1 dnl Process with autoconf to create a configure script -*- Autoconf -*-
4 AC_INIT([Splint], [3.1.1.1], [splint-bug@splint.org], [splint])
6 dnl This MUST precede any other macro
7 AC_CONFIG_AUX_DIR([config])
9 dnl Set up the source directory
10 AC_CONFIG_SRCDIR([src/lclinit.c])
15 dnl Set up automake & the configuration header
16 AM_INIT_AUTOMAKE(AC_PACKAGE_TARNAME, AC_PACKAGE_VERSION, AC_PACKAGE_BUGREPORT)
17 AM_CONFIG_HEADER([config.h:config.hin])
19 dnl Prepare for Splint processing of config.h
20 AH_TOP([/*@ -constmacros@*/])
21 AH_BOTTOM([/*@ =constmacros@*/])
23 dnl Checks for programs.
24 #drl 12-19-2001 commented out so Splint won't depend on C++
28 dnl This produces a warning. See http://mail.gnu.org/pipermail/bug-automake/2001-August/000213.html
33 AC_CHECK_PROG(BISON, bison, bison, no)
34 AC_CHECK_PROG(GREP, grep, grep, grep-is-missing)
35 AC_CHECK_PROG(DIFF, diff, diff, diff-is-missing)
36 AC_CHECK_PROG(CAT, cat, cat, cat-is-missing)
37 AC_CHECK_PROG(RM, rm, rm, rm-is-missing)
38 AC_CHECK_PROG(MV, mv, mv, mv-is-missing)
39 AC_CHECK_PROG(CP, cp, cp, cp-is-missing)
40 AC_CHECK_PROG(SED, sed, sed, sed-is-missing)
42 dnl Checks for header files.
43 dnl Currently all disable, as the source files don't care about the results
46 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])
48 dnl Checks for typedefs, structures, and compiler characteristics.
49 dnl Currently all disable, as the source files don't care about the results
56 dnl AC_STRUCT_ST_BLOCKS
57 dnl AC_CHECK_MEMBERS([struct stat.st_rdev])
58 dnl AC_DECL_SYS_SIGLIST
61 dnl AC_CHECK_TYPES([ptrdiff_t])
63 dnl Checks for library functions.
64 dnl Currently all disable, as the source files don't care about the results
68 dnl AC_PROG_GCC_TRADITIONAL
74 dnl AC_FUNC_SETVBUF_REVERSED
78 dnl AC_FUNC_STRERROR_R
82 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])
84 dnl This was provided by Nelson Beebe for dealing with problems on IBM
85 dnl AIX 4.3 with defining mode_t.
87 dnl Checks for _ALL_SOURCE (IBM RS/6000 c89 needs this)
88 AC_MSG_CHECKING(whether we need _ALL_SOURCE to expose mode_t)
94 if test $all = maybe ; then
99 ], , AC_DEFINE(_ALL_SOURCE) all=yes)
101 if test $all = maybe ; then all=no ; fi
103 AH_TEMPLATE([_ALL_SOURCE], [needed to expose mode_t on some machines])
105 LCLOBJ='$(lcl_OBJECTS)'
107 AC_HELP_STRING([--without-lcl],
108 [don't include support for LCL files]),
109 ac_cv_use_lcl=$withval,
110 AC_CACHE_CHECK([whether to include support for LCL files],
111 ac_cv_use_lcl, ac_cv_use_lcl=yes))
112 if test x$ac_cv_use_lcl != xyes; then
114 AC_DEFINE(NOLCL, 1, [Define to disable support LCL files])
118 # Make sure we have an actual value for $prefix
120 test x$myprefix = xNONE && myprefix=$ac_default_prefix
123 ### Yuck! This is really kludgey, but I don't understand autoconf well
124 ### enough to do something simple that always works. Hopefully this does.
126 # cpplib.h defines 2 include dirs; one is $includedir, the other is gcc's
127 # include dir. Not the most portable setup, but let's do our best.
129 if test x$GCC = xyes; then
130 dnl Make sure to override NLS; this assumes gcc prints only
131 dnl Reading specs from blah
134 # This breaks on gcc-3.0 on redhat fixing drl 11-15-2001
135 # GCC_INCLUDE_DIR=`LANGUAGE= LANG= $CC -v 2>&1 | sed -e '/^gcc/ d' -e 's/.* \(.*\)specs/\1include/'`
136 GCC_INCLUDE_DIR=/usr/include
137 # was /usr/lib/gcc-lib/i386-linux/2.7.2.1/include
138 # GCC_INCLUDE_DIR=`LANGUAGE= LANG= $CC -v 2>&1 | sed -n -e '/^gcc/ d' -e 's/.* \(.*\)specs/\1include/p'`
139 AC_DEFINE_UNQUOTED(GCC_INCLUDE_DIR, "$GCC_INCLUDE_DIR",
140 [system include directory])
142 GCC_INCLUDE_DIR=/usr/include
143 AC_DEFINE_UNQUOTED(GCC_INCLUDE_DIR, "$GCC_INCLUDE_DIR", [system include directory])
146 AC_DEFINE_UNQUOTED(GCC_INCLUDE_DIR2, "$myprefix/include",
147 [alternate include directory])
149 # These used to be in local_constants.h
150 AC_DEFINE_UNQUOTED(SYSTEM_LIBDIR, "$myprefix/include",
151 [The system's main include directory])
152 AC_DEFINE_UNQUOTED(DEFAULT_LARCHPATH,
153 ".$PATH_SEPARATOR$myprefix/share/splint/lib$PATH_SEPARATOR`pwd`/lib$PATH_SEPARATOR",
154 [The directory where Splint's library files live])
155 AC_DEFINE_UNQUOTED(DEFAULT_LCLIMPORTDIR, ".$PATH_SEPARATOR$myprefix/share/splint/imports$PATH_SEPARATOR`pwd`/imports",
156 [Splint's imports directory])
158 # These used to be in herald.h
159 LCL_PARSE_VERSION="AC_PACKAGE_NAME AC_PACKAGE_VERSION"
160 AC_DEFINE_UNQUOTED(SPLINT_VERSION,
161 "$LCL_PARSE_VERSION --- `date +"%d %b %Y"`",
162 [Splint's version number and configure/build date])
163 AC_DEFINE_UNQUOTED(LCL_PARSE_VERSION, "$LCL_PARSE_VERSION",
164 [Splint's version number])
165 AC_DEFINE_UNQUOTED(LCL_COMPILE,
166 "Compiled using $CC $CFLAGS on `uname -a` by `whoami`",
167 [String describing who compiled this binary and how])
169 dnl TODO: Use result AC_CANONICAL_SYSTEM to figure out what to define
171 AC_DEFINE(UNIX, 1, [Define if you're on a Unixy system])
173 #just define some Header constants for now...
176 AC_DEFINE_UNQUOTED(UNAME, "${UNAME}", uname output)
178 AC_DEFINE_UNQUOTED(BUILD, "${build}", build)
179 AC_DEFINE_UNQUOTED(HOST, "${host}", host)
180 AC_DEFINE_UNQUOTED(TARGET, "${target}", target)
182 AC_DEFINE_UNQUOTED(BUILD_ALIAS, "${build_alias}", build_alias)
183 AC_DEFINE_UNQUOTED(HOST_ALIAS, "${host_alias}", host_alias)
184 AC_DEFINE_UNQUOTED(TARGET_ALIAS, "${TARGET_ALIAS}", target_alias)
186 AC_DEFINE_UNQUOTED(BUILD_CPU, "${build_cpu}", build_cpu)
187 AC_DEFINE_UNQUOTED(HOST_CPU, "$host_cpu", host_cpu)
188 AC_DEFINE_UNQUOTED(TARGET_CPU, "${target_cpu}", target_cpu)
190 AC_DEFINE_UNQUOTED(BUILD_VENDOR, "${build_vendor}", build_vendor)
191 AC_DEFINE_UNQUOTED(HOST_VENDOR, "${host_vendor}", host_vendor)
192 AC_DEFINE_UNQUOTED(TARGET_VENDOR, "${target_vendor}", target_vendor)
194 AC_DEFINE_UNQUOTED(BUILD_OS, "${build_os}", build_os)
195 AC_DEFINE_UNQUOTED(HOST_OS, "${host_os}", host_os)
196 AC_DEFINE_UNQUOTED(TARGET_OS,"${target_os}", target_os)
200 dnl AC_CONFIG_FILES([test/Makefile
201 dnl test/ensuresclauses/Makefile
202 dnl test/conditions/Makefile
203 dnl test/db2/Makefile
204 dnl test/warnuse/Makefile
205 dnl test/tainted/Makefile
206 dnl test/fileio/Makefile
207 dnl test/tests2.4/Makefile
208 dnl test/db3/Makefile
209 dnl test/metastate/Makefile
210 dnl test/mergestate/Makefile
211 dnl test/tests2.5/Makefile
212 dnl test/tests2.2/Makefile
213 dnl test/db1/Makefile])
215 AC_CONFIG_FILES([Makefile imports/Makefile lib/Makefile src/Makefile
216 test/Makefile doc/Makefile bin/Makefile])