1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232
|
dnl Process with autoconf to create a configure script -*- Autoconf -*-
AC_PREREQ(2.50)
AC_INIT([Splint], [3.1.2], [submit@bugs.debian.org (via reportbug)], [splint])
dnl This MUST precede any other macro
AC_CONFIG_AUX_DIR([config])
dnl Set up the source directory
AC_CONFIG_SRCDIR([src/lclinit.c])
dnl Deduce 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 Splint processing of config.h
AH_TOP([/*@ -macroconstdecl@*/])
AH_BOTTOM([/*@ =macroconstdecl@*/])
dnl Checks for programs.
#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_PROG_LN_S
AC_CHECK_PROG(BISON, bison, bison, no)
AC_CHECK_PROG(GREP, grep, grep, grep-is-missing)
AC_CHECK_PROG(DIFF, diff, diff, diff-is-missing)
AC_CHECK_PROG(CAT, cat, cat, cat-is-missing)
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_HEADER_DIRENT
dnl AC_HEADER_STDC
dnl AC_CHECK_HEADERS([alloca.h errno.h fcntl.h float.h limits.h locale.h malloc.h stddef.h stdlib.h string.h strings.h sys/time.h unistd.h])
dnl Checks for typedefs, structures, and compiler characteristics.
dnl Currently all disable, as the source files don't care about the results
dnl AC_C_CONST
dnl AC_TYPE_UID_T
dnl AC_TYPE_MODE_T
dnl AC_TYPE_OFF_T
dnl AC_TYPE_PID_T
dnl AC_TYPE_SIZE_T
dnl AC_STRUCT_ST_BLOCKS
dnl AC_CHECK_MEMBERS([struct stat.st_rdev])
dnl AC_DECL_SYS_SIGLIST
dnl AC_HEADER_TIME
dnl AC_STRUCT_TM
dnl AC_CHECK_TYPES([ptrdiff_t])
dnl Checks for library functions.
dnl Currently all disable, as the source files don't care about the results
dnl AC_FUNC_ALLOCA
dnl AC_FUNC_CHOWN
dnl AC_FUNC_GETPGRP
dnl AC_PROG_GCC_TRADITIONAL
dnl AC_FUNC_LSTAT
dnl AC_FUNC_MALLOC
dnl AC_FUNC_MEMCMP
dnl AC_FUNC_MKTIME
dnl AC_FUNC_MMAP
dnl AC_FUNC_SETVBUF_REVERSED
dnl AC_TYPE_SIGNAL
dnl AC_FUNC_STAT
dnl AC_FUNC_STRCOLL
dnl AC_FUNC_STRERROR_R
dnl AC_FUNC_VFORK
dnl AC_FUNC_VPRINTF
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)
AH_TEMPLATE([_ALL_SOURCE], [needed to expose mode_t on some machines])
LCLOBJ='$(lcl_OBJECTS)'
AC_ARG_WITH([lcl],
AC_HELP_STRING([--without-lcl],
[don't include support for LCL files]),
ac_cv_use_lcl=$withval,
AC_CACHE_CHECK([whether to include support for LCL files],
ac_cv_use_lcl, ac_cv_use_lcl=yes))
if test x$ac_cv_use_lcl != xyes; then
LCLOBJ=
AC_DEFINE(NOLCL, 1, [Define to disable support LCL files])
fi
AC_SUBST(LCLOBJ)
# Make sure we have an actual value for $prefix
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$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/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",
[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",
[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/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"
if [ -n "${SOURCE_DATE_EPOCH}" ]; then
AC_DEFINE_UNQUOTED(SPLINT_VERSION,
"$LCL_PARSE_VERSION --- `LC_ALL=C date --utc --date="@${SOURCE_DATE_EPOCH}" +"%d %b %Y"`",
[Splint's version number and configure/build date])
else
AC_DEFINE_UNQUOTED(SPLINT_VERSION,
"$LCL_PARSE_VERSION --- `date +"%d %b %Y"`",
[Splint's version number and configure/build date])
fi
AC_DEFINE_UNQUOTED(LCL_PARSE_VERSION, "$LCL_PARSE_VERSION",
[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
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}", uname output)
AC_DEFINE_UNQUOTED(BUILD, "${build}", build)
AC_DEFINE_UNQUOTED(HOST, "${host}", host)
AC_DEFINE_UNQUOTED(TARGET, "${target}", target)
AC_DEFINE_UNQUOTED(BUILD_ALIAS, "${build_alias}", build_alias)
AC_DEFINE_UNQUOTED(HOST_ALIAS, "${host_alias}", host_alias)
AC_DEFINE_UNQUOTED(TARGET_ALIAS, "${TARGET_ALIAS}", target_alias)
AC_DEFINE_UNQUOTED(BUILD_CPU, "${build_cpu}", build_cpu)
AC_DEFINE_UNQUOTED(HOST_CPU, "$host_cpu", host_cpu)
AC_DEFINE_UNQUOTED(TARGET_CPU, "${target_cpu}", target_cpu)
AC_DEFINE_UNQUOTED(BUILD_VENDOR, "${build_vendor}", build_vendor)
AC_DEFINE_UNQUOTED(HOST_VENDOR, "${host_vendor}", host_vendor)
AC_DEFINE_UNQUOTED(TARGET_VENDOR, "${target_vendor}", target_vendor)
AC_DEFINE_UNQUOTED(BUILD_OS, "${build_os}", build_os)
AC_DEFINE_UNQUOTED(HOST_OS, "${host_os}", host_os)
AC_DEFINE_UNQUOTED(TARGET_OS,"${target_os}", target_os)
dnl AC_CONFIG_FILES([test/Makefile
dnl test/ensuresclauses/Makefile
dnl test/conditions/Makefile
dnl test/db2/Makefile
dnl test/warnuse/Makefile
dnl test/tainted/Makefile
dnl test/fileio/Makefile
dnl test/tests2.4/Makefile
dnl test/db3/Makefile
dnl test/metastate/Makefile
dnl test/mergestate/Makefile
dnl test/tests2.5/Makefile
dnl test/tests2.2/Makefile
dnl test/db1/Makefile])
AC_CONFIG_FILES([Makefile imports/Makefile lib/Makefile src/Makefile
test/Makefile doc/Makefile bin/Makefile])
AC_OUTPUT
|