dnl Process with autoconf to create a configure script -*- Autoconf -*-
AC_PREREQ(2.50)
-AC_INIT([LCLint], [3.0.0.19], [lclint-bug@cs.virginia.edu], [lclint])
+
+AC_INIT([Splint], [3.0.1.8], [splint-bug@splint.org], [splint])
dnl This MUST precede any other macro
AC_CONFIG_AUX_DIR([config])
AC_CONFIG_SRCDIR([src/lclinit.c])
dnl Deduce host
-AC_CANONICAL_HOST
+AC_CANONICAL_SYSTEM
dnl Set up automake & the configuration header
AM_INIT_AUTOMAKE(AC_PACKAGE_TARNAME, AC_PACKAGE_VERSION, AC_PACKAGE_BUGREPORT)
AM_CONFIG_HEADER([config.h:config.hin])
-dnl Prepare for LCLint processing of config.h
+dnl Prepare for Splint processing of config.h
AH_TOP([/*@-constmacros@*/])
AH_BOTTOM([/*@=constmacros@*/])
dnl Checks for programs.
-#drl 12-19-2001 commented out so LCLint won't depend on C++
+#drl 12-19-2001 commented out so Splint won't depend on C++
#AC_PROG_CXX
AC_PROG_CC
AC_PROG_CPP
+dnl This produces a warning. See http://mail.gnu.org/pipermail/bug-automake/2001-August/000213.html
AM_PROG_LEX
AC_PROG_INSTALL
AC_PROG_MAKE_SET
AC_CHECK_PROG(RM, rm, rm, rm-is-missing)
AC_CHECK_PROG(MV, mv, mv, mv-is-missing)
AC_CHECK_PROG(CP, cp, cp, cp-is-missing)
+AC_CHECK_PROG(SED, sed, sed, sed-is-missing)
dnl Checks for header files.
dnl Currently all disable, as the source files don't care about the results
dnl AC_FUNC_WAIT3
dnl AC_CHECK_FUNCS([alarm atexit btowc bzero dup2 endgrent endpwent fchdir floor ftruncate getcwd getgroups gethostname gettimeofday isascii iswprint lchown localeconv mblen mbrlen mbrtowc memchr memmove memset mkdir mkfifo modf munmap pathconf pow putenv realpath regcomp rint rmdir rpmatch select setenv socket sqrt strcasecmp strchr strcspn strdup strerror strftime strncasecmp strpbrk strrchr strspn strstr strtod strtol strtoul strtoull tzset uname utime vprintf])
+dnl This was provided by Nelson Beebe for dealing with problems on IBM
+dnl AIX 4.3 with defining mode_t.
+
+dnl Checks for _ALL_SOURCE (IBM RS/6000 c89 needs this)
+AC_MSG_CHECKING(whether we need _ALL_SOURCE to expose mode_t)
+all=no
+AC_TRY_COMPILE([
+#include <stdio.h>
+mode_t x;
+], , , all=maybe)
+if test $all = maybe ; then
+AC_TRY_COMPILE([
+#define _ALL_SOURCE
+#include <stdio.h>
+mode_t x;
+], , AC_DEFINE(_ALL_SOURCE) all=yes)
+fi
+if test $all = maybe ; then all=no ; fi
+AC_MSG_RESULT($all)
+
LCLOBJ='$(lcl_OBJECTS)'
AC_ARG_WITH([lcl],
AC_HELP_STRING([--without-lcl],
myprefix=$prefix
test x$myprefix = xNONE && myprefix=$ac_default_prefix
+
+### Yuck! This is really kludgey, but I don't understand autoconf well
+### enough to do something simple that always works. Hopefully this does.
+
# cpplib.h defines 2 include dirs; one is $includedir, the other is gcc's
# include dir. Not the most portable setup, but let's do our best.
-if test x$ac_cv_c_compiler_gnu = xyes; then
+
+if test x$GCC = xyes; then
dnl Make sure to override NLS; this assumes gcc prints only
dnl Reading specs from blah
dnl gcc version blah
# This breaks on gcc-3.0 on redhat fixing drl 11-15-2001
# GCC_INCLUDE_DIR=`LANGUAGE= LANG= $CC -v 2>&1 | sed -e '/^gcc/ d' -e 's/.* \(.*\)specs/\1include/'`
- GCC_INCLUDE_DIR=/usr/lib/gcc-lib/i386-linux/2.7.2.1/include
+GCC_INCLUDE_DIR=/usr/include
+# was /usr/lib/gcc-lib/i386-linux/2.7.2.1/include
# GCC_INCLUDE_DIR=`LANGUAGE= LANG= $CC -v 2>&1 | sed -n -e '/^gcc/ d' -e 's/.* \(.*\)specs/\1include/p'`
AC_DEFINE_UNQUOTED(GCC_INCLUDE_DIR, "$GCC_INCLUDE_DIR",
- [gcc's private include directory])
+ [system include directory])
+else
+GCC_INCLUDE_DIR=/usr/include
+AC_DEFINE_UNQUOTED(GCC_INCLUDE_DIR, "$GCC_INCLUDE_DIR", [system include directory])
fi
+
AC_DEFINE_UNQUOTED(GCC_INCLUDE_DIR2, "$myprefix/include",
- [the system's main include directory])
+ [alternate include directory])
# These used to be in local_constants.h
AC_DEFINE_UNQUOTED(SYSTEM_LIBDIR, "$myprefix/include",
[The system's main include directory])
AC_DEFINE_UNQUOTED(DEFAULT_LARCHPATH,
- ".$PATH_SEPARATOR$myprefix/share/lclint/lib$PATH_SEPARATOR`pwd`/lib$PATH_SEPARATOR",
- [The directory where LCLint's library files live])
-AC_DEFINE_UNQUOTED(DEFAULT_LCLIMPORTDIR, ".$PATH_SEPARATOR$myprefix/share/lclint/imports$PATH_SEPARATOR`pwd`/imports",
- [LCLint's imports directory])
+ ".$PATH_SEPARATOR$myprefix/share/splint/lib$PATH_SEPARATOR`pwd`/lib$PATH_SEPARATOR",
+ [The directory where Splint's library files live])
+AC_DEFINE_UNQUOTED(DEFAULT_LCLIMPORTDIR, ".$PATH_SEPARATOR$myprefix/share/splint/imports$PATH_SEPARATOR`pwd`/imports",
+ [Splint's imports directory])
# These used to be in herald.h
LCL_PARSE_VERSION="AC_PACKAGE_NAME AC_PACKAGE_VERSION"
-AC_DEFINE_UNQUOTED(LCL_VERSION,
- "$LCL_PARSE_VERSION --- `cat $srcdir/src/DATE`",
- [LCLint's version number and release date])
+AC_DEFINE_UNQUOTED(SPLINT_VERSION,
+ "$LCL_PARSE_VERSION --- `date +"%d %b %Y"`",
+ [Splint's version number and configure/build date])
AC_DEFINE_UNQUOTED(LCL_PARSE_VERSION, "$LCL_PARSE_VERSION",
- [LCLint's version number])
+ [Splint's version number])
AC_DEFINE_UNQUOTED(LCL_COMPILE,
"Compiled using $CC $CFLAGS on `uname -a` by `whoami`",
[String describing who compiled this binary and how])
+dnl TODO: Use result AC_CANONICAL_SYSTEM to figure out what to define
-dnl TODO: Use result AC_CANONICAL_HOST to figure out what to define
AC_DEFINE(UNIX, 1, [Define if you're on a Unixy system])
+#just define some Header constants for now...
+
+UNAME=`uname`
+AC_DEFINE_UNQUOTED(UNAME, "${UNAME}")
+
+AC_DEFINE_UNQUOTED(BUILD, "${build}")
+AC_DEFINE_UNQUOTED(HOST, "${host}")
+AC_DEFINE_UNQUOTED(TARGET, "${target}")
+
+AC_DEFINE_UNQUOTED(BUILD_ALIAS, "${build_alias}")
+AC_DEFINE_UNQUOTED(HOST_ALIAS, "${host_alias}")
+AC_DEFINE_UNQUOTED(TARGET_ALIAS, "${TARGET_ALIAS}")
+
+AC_DEFINE_UNQUOTED(BUILD_CPU, "${build_cpu}")
+AC_DEFINE_UNQUOTED(HOST_CPU, "$host_cpu")
+AC_DEFINE_UNQUOTED(TARGET_CPU, "${target_cpu}")
+
+AC_DEFINE_UNQUOTED(BUILD_VENDOR, "${build_vendor}")
+AC_DEFINE_UNQUOTED(HOST_VENDOR, "${host_vendor}")
+AC_DEFINE_UNQUOTED(TARGET_VENDOR, "${target_vendor}")
+
+AC_DEFINE_UNQUOTED(BUILD_OS, "${build_os}")
+AC_DEFINE_UNQUOTED(HOST_OS, "${host_os}")
+AC_DEFINE_UNQUOTED(TARGET_OS,"${target_os}")
+
+
+
dnl AC_CONFIG_FILES([test/Makefile
dnl test/ensuresclauses/Makefile
dnl test/conditions/Makefile
dnl test/db1/Makefile])
AC_CONFIG_FILES([Makefile imports/Makefile lib/Makefile src/Makefile
- test/Makefile])
-AC_OUTPUT
+ test/Makefile doc/Makefile bin/Makefile])
+AC_OUTPUT