]> andersk Git - splint.git/blame - configure.ac
noexpand always false.
[splint.git] / configure.ac
CommitLineData
8fe44445 1dnl Process with autoconf to create a configure script -*- Autoconf -*-
2AC_PREREQ(2.50)
fc97bef4 3
a9ec3280 4AC_INIT([Splint], [3.1.2], [splint-bug@splint.org], [splint])
8fe44445 5
6dnl This MUST precede any other macro
7AC_CONFIG_AUX_DIR([config])
8
9dnl Set up the source directory
10AC_CONFIG_SRCDIR([src/lclinit.c])
11
12dnl Deduce host
f7bbce9e 13AC_CANONICAL_SYSTEM
8fe44445 14
15dnl Set up automake & the configuration header
16AM_INIT_AUTOMAKE(AC_PACKAGE_TARNAME, AC_PACKAGE_VERSION, AC_PACKAGE_BUGREPORT)
17AM_CONFIG_HEADER([config.h:config.hin])
18
11db3170 19dnl Prepare for Splint processing of config.h
210066f9 20AH_TOP([/*@ -macroconstdecl@*/])
21AH_BOTTOM([/*@ =macroconstdecl@*/])
8fe44445 22
23dnl Checks for programs.
11db3170 24#drl 12-19-2001 commented out so Splint won't depend on C++
c1dda563 25#AC_PROG_CXX
8fe44445 26AC_PROG_CC
27AC_PROG_CPP
55c181ed 28dnl This produces a warning. See http://mail.gnu.org/pipermail/bug-automake/2001-August/000213.html
8fe44445 29AM_PROG_LEX
30AC_PROG_INSTALL
31AC_PROG_MAKE_SET
32AC_PROG_LN_S
33AC_CHECK_PROG(BISON, bison, bison, no)
34AC_CHECK_PROG(GREP, grep, grep, grep-is-missing)
35AC_CHECK_PROG(DIFF, diff, diff, diff-is-missing)
36AC_CHECK_PROG(CAT, cat, cat, cat-is-missing)
37AC_CHECK_PROG(RM, rm, rm, rm-is-missing)
38AC_CHECK_PROG(MV, mv, mv, mv-is-missing)
39AC_CHECK_PROG(CP, cp, cp, cp-is-missing)
6fcd0b1e 40AC_CHECK_PROG(SED, sed, sed, sed-is-missing)
8fe44445 41
42dnl Checks for header files.
43dnl Currently all disable, as the source files don't care about the results
44dnl AC_HEADER_DIRENT
45dnl AC_HEADER_STDC
46dnl 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])
47
48dnl Checks for typedefs, structures, and compiler characteristics.
49dnl Currently all disable, as the source files don't care about the results
50dnl AC_C_CONST
51dnl AC_TYPE_UID_T
52dnl AC_TYPE_MODE_T
53dnl AC_TYPE_OFF_T
54dnl AC_TYPE_PID_T
55dnl AC_TYPE_SIZE_T
56dnl AC_STRUCT_ST_BLOCKS
57dnl AC_CHECK_MEMBERS([struct stat.st_rdev])
58dnl AC_DECL_SYS_SIGLIST
59dnl AC_HEADER_TIME
60dnl AC_STRUCT_TM
61dnl AC_CHECK_TYPES([ptrdiff_t])
62
63dnl Checks for library functions.
64dnl Currently all disable, as the source files don't care about the results
65dnl AC_FUNC_ALLOCA
66dnl AC_FUNC_CHOWN
67dnl AC_FUNC_GETPGRP
68dnl AC_PROG_GCC_TRADITIONAL
69dnl AC_FUNC_LSTAT
70dnl AC_FUNC_MALLOC
71dnl AC_FUNC_MEMCMP
72dnl AC_FUNC_MKTIME
73dnl AC_FUNC_MMAP
74dnl AC_FUNC_SETVBUF_REVERSED
75dnl AC_TYPE_SIGNAL
76dnl AC_FUNC_STAT
77dnl AC_FUNC_STRCOLL
78dnl AC_FUNC_STRERROR_R
79dnl AC_FUNC_VFORK
80dnl AC_FUNC_VPRINTF
81dnl AC_FUNC_WAIT3
82dnl 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])
83
55c181ed 84dnl This was provided by Nelson Beebe for dealing with problems on IBM
85dnl AIX 4.3 with defining mode_t.
86
87dnl Checks for _ALL_SOURCE (IBM RS/6000 c89 needs this)
88AC_MSG_CHECKING(whether we need _ALL_SOURCE to expose mode_t)
89all=no
90AC_TRY_COMPILE([
91#include <stdio.h>
92mode_t x;
93], , , all=maybe)
94if test $all = maybe ; then
95AC_TRY_COMPILE([
96#define _ALL_SOURCE
97#include <stdio.h>
98mode_t x;
99], , AC_DEFINE(_ALL_SOURCE) all=yes)
100fi
101if test $all = maybe ; then all=no ; fi
102AC_MSG_RESULT($all)
36ba812d 103AH_TEMPLATE([_ALL_SOURCE], [needed to expose mode_t on some machines])
55c181ed 104
8fe44445 105LCLOBJ='$(lcl_OBJECTS)'
106AC_ARG_WITH([lcl],
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))
112if test x$ac_cv_use_lcl != xyes; then
113 LCLOBJ=
114 AC_DEFINE(NOLCL, 1, [Define to disable support LCL files])
115fi
116AC_SUBST(LCLOBJ)
117
118# Make sure we have an actual value for $prefix
119myprefix=$prefix
120test x$myprefix = xNONE && myprefix=$ac_default_prefix
121
b87215ab 122
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.
125
8fe44445 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.
b87215ab 128
129if test x$GCC = xyes; then
8fe44445 130 dnl Make sure to override NLS; this assumes gcc prints only
131 dnl Reading specs from blah
132 dnl gcc version blah
e5f31c00 133
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/'`
f2b6724f 136GCC_INCLUDE_DIR=/usr/include
137# was /usr/lib/gcc-lib/i386-linux/2.7.2.1/include
e5f31c00 138# GCC_INCLUDE_DIR=`LANGUAGE= LANG= $CC -v 2>&1 | sed -n -e '/^gcc/ d' -e 's/.* \(.*\)specs/\1include/p'`
8fe44445 139 AC_DEFINE_UNQUOTED(GCC_INCLUDE_DIR, "$GCC_INCLUDE_DIR",
f2b6724f 140 [system include directory])
b87215ab 141else
6fcd0b1e 142GCC_INCLUDE_DIR=/usr/include
143AC_DEFINE_UNQUOTED(GCC_INCLUDE_DIR, "$GCC_INCLUDE_DIR", [system include directory])
8fe44445 144fi
6fcd0b1e 145
8fe44445 146AC_DEFINE_UNQUOTED(GCC_INCLUDE_DIR2, "$myprefix/include",
f2b6724f 147 [alternate include directory])
8fe44445 148
149# These used to be in local_constants.h
150AC_DEFINE_UNQUOTED(SYSTEM_LIBDIR, "$myprefix/include",
151 [The system's main include directory])
152AC_DEFINE_UNQUOTED(DEFAULT_LARCHPATH,
11db3170 153 ".$PATH_SEPARATOR$myprefix/share/splint/lib$PATH_SEPARATOR`pwd`/lib$PATH_SEPARATOR",
154 [The directory where Splint's library files live])
155AC_DEFINE_UNQUOTED(DEFAULT_LCLIMPORTDIR, ".$PATH_SEPARATOR$myprefix/share/splint/imports$PATH_SEPARATOR`pwd`/imports",
156 [Splint's imports directory])
8fe44445 157
158# These used to be in herald.h
159LCL_PARSE_VERSION="AC_PACKAGE_NAME AC_PACKAGE_VERSION"
f2b6724f 160AC_DEFINE_UNQUOTED(SPLINT_VERSION,
146e25eb 161 "$LCL_PARSE_VERSION --- `date +"%d %b %Y"`",
162 [Splint's version number and configure/build date])
8fe44445 163AC_DEFINE_UNQUOTED(LCL_PARSE_VERSION, "$LCL_PARSE_VERSION",
11db3170 164 [Splint's version number])
8fe44445 165AC_DEFINE_UNQUOTED(LCL_COMPILE,
166 "Compiled using $CC $CFLAGS on `uname -a` by `whoami`",
167 [String describing who compiled this binary and how])
168
f7bbce9e 169dnl TODO: Use result AC_CANONICAL_SYSTEM to figure out what to define
170
8fe44445 171AC_DEFINE(UNIX, 1, [Define if you're on a Unixy system])
172
f7bbce9e 173#just define some Header constants for now...
174
9882c722 175UNAME=`uname`
36ba812d 176AC_DEFINE_UNQUOTED(UNAME, "${UNAME}", uname output)
9882c722 177
36ba812d 178AC_DEFINE_UNQUOTED(BUILD, "${build}", build)
179AC_DEFINE_UNQUOTED(HOST, "${host}", host)
180AC_DEFINE_UNQUOTED(TARGET, "${target}", target)
f7bbce9e 181
36ba812d 182AC_DEFINE_UNQUOTED(BUILD_ALIAS, "${build_alias}", build_alias)
183AC_DEFINE_UNQUOTED(HOST_ALIAS, "${host_alias}", host_alias)
184AC_DEFINE_UNQUOTED(TARGET_ALIAS, "${TARGET_ALIAS}", target_alias)
f7bbce9e 185
36ba812d 186AC_DEFINE_UNQUOTED(BUILD_CPU, "${build_cpu}", build_cpu)
187AC_DEFINE_UNQUOTED(HOST_CPU, "$host_cpu", host_cpu)
188AC_DEFINE_UNQUOTED(TARGET_CPU, "${target_cpu}", target_cpu)
f7bbce9e 189
36ba812d 190AC_DEFINE_UNQUOTED(BUILD_VENDOR, "${build_vendor}", build_vendor)
191AC_DEFINE_UNQUOTED(HOST_VENDOR, "${host_vendor}", host_vendor)
192AC_DEFINE_UNQUOTED(TARGET_VENDOR, "${target_vendor}", target_vendor)
f7bbce9e 193
36ba812d 194AC_DEFINE_UNQUOTED(BUILD_OS, "${build_os}", build_os)
195AC_DEFINE_UNQUOTED(HOST_OS, "${host_os}", host_os)
196AC_DEFINE_UNQUOTED(TARGET_OS,"${target_os}", target_os)
f7bbce9e 197
198
199
8fe44445 200dnl AC_CONFIG_FILES([test/Makefile
201dnl test/ensuresclauses/Makefile
202dnl test/conditions/Makefile
203dnl test/db2/Makefile
204dnl test/warnuse/Makefile
205dnl test/tainted/Makefile
206dnl test/fileio/Makefile
207dnl test/tests2.4/Makefile
208dnl test/db3/Makefile
209dnl test/metastate/Makefile
210dnl test/mergestate/Makefile
211dnl test/tests2.5/Makefile
212dnl test/tests2.2/Makefile
213dnl test/db1/Makefile])
214
215AC_CONFIG_FILES([Makefile imports/Makefile lib/Makefile src/Makefile
fc97bef4 216 test/Makefile doc/Makefile bin/Makefile])
363a5c93 217AC_OUTPUT
8fe44445 218
219
220
221
222
223
224
225
226
This page took 0.118859 seconds and 5 git commands to generate.