1 dnl Process this file with autoconf to produce a configure script.
3 AC_REVISION($Revision: 1.1.1.1 $)dnl
4 dnl $Log: configure.in,v $
5 dnl Revision 1.1.1.1 2001/05/18 23:14:04 mb
6 dnl Move from private repository to open source repository
8 dnl Revision 1.3 2000/12/21 23:58:39 dmitch
9 dnl Misc. updates for clean build on Cheetah 1D7.
11 dnl Revision 1.2 2000/06/08 19:57:33 dmitch
14 dnl Revision 1.1.1.1 1999/03/16 18:05:49 aram
15 dnl Originals from SMIME Free Library.
17 dnl Revision 1.13 1997/09/04 13:54:04 wan
18 dnl A little more portability
20 dnl Revision 1.12 1997/02/28 13:39:35 wan
21 dnl Modifications collected for new version 1.3: Bug fixes, tk4.2.
23 dnl Revision 1.11 1997/02/16 16:50:27 rj
24 dnl made return *this after calling abort()'' a compile time option.
26 dnl Revision 1.10 1997/02/15 20:06:27 rj
27 dnl adjust to changed AC_TRY_COMPILE macro
29 dnl Revision 1.9 1997/02/15 20:01:38 rj
30 dnl check whether the compiler supports volatile functions (and whether abort() is volatile).
32 dnl Revision 1.8 1997/01/01 19:57:01 rj
33 dnl changes for autoconf version 2.12
35 dnl Revision 1.7 1995/09/07 18:36:47 rj
36 dnl psbook and psnup are looked for (used by .../doc/makefile)
38 dnl Revision 1.6 1995/07/24 14:44:47 rj
39 dnl don't use gcc/g++ with -pipe, compiling some files may exceed virtual memory.
41 dnl look for tclsh(1). tcl-lib uses it to construct the tclIndex file. don't look for Tcl/Tk if the tclsh is absent.
43 dnl look for patch(1). the c-lib uses it to patch tbl.h.
45 dnl search for tree-3.6's libtktree.a and set TREELIBS in .../makehead accordingly.
47 dnl check for memset(3), memcpy(3) and memcmp(3). .../snacc.h reverts to bzero(3), bcopy(3) and bcmp(3) if necessary.
49 dnl Revision 1.5 1995/02/20 11:18:41 rj
50 dnl cpp switch HAVE_VARIABLE_SIZED_AUTOMATIC_ARRAYS added.
51 dnl check for isinf(3) and finite(3) added.
53 dnl Revision 1.4 1995/02/17 15:15:44 rj
54 dnl hack to let makedepend find .h files the way gcc does.
56 dnl Revision 1.3 1995/02/17 14:26:40 rj
57 dnl adjustments for autoconf 2.x
59 dnl Revision 1.2 1994/10/08 04:29:37 rj
62 dnl Revision 1.1 1994/09/01 00:51:22 rj
63 dnl first check-in (new file).
65 AC_INIT( compiler/core/snacc.c)
66 AC_CONFIG_HEADER( config.h)
67 dnl --- alternative programs:
71 if test -n "$GCC"; then
74 dnl AC_MSG_CHECKING( whether $saveCC takes -pipe)
75 dnl AC_TRY_LINK( , , [AC_MSG_RESULT( yes)], [AC_MSG_RESULT( no); CC="$saveCC"])
77 # hack to let X11 makedepend find .h file a little more the way gcc does:
78 AC_MSG_CHECKING( for $CC's include path)
79 gcclibdir=`$CC -v 2>&1 | sed -n -e 's:Reading specs from \(.*\)/specs:\1:p'`
80 gxxincdir=`which gcc | sed "s/bin\/gcc//"`
81 #MKDEP_CCINC="-I$gxxincdir/lib/g++-include -I/usr/local/include -I$gcclibdir/include"
82 MKDEP_CCINC="-I/usr/local/include -I$gcclibdir/include -F/System/Library/PrivateFrameworks"
83 AC_MSG_RESULT( $MKDEP_CCINC)
84 AC_SUBST( MKDEP_CCINC)
86 AC_PROG_GCC_TRADITIONAL
88 if eval "test \"`echo '$ac_cv_prog_cc_'${ac_cc}_c_o`\" = no"; then
89 AC_MSG_WARN( since -c and -o don't seem to work together, the makefiles probably won't work!)
91 AC_MSG_CHECKING( whether ANSI or K&R style C)
92 AC_TRY_RUN( [main (int argc, char **argv) { void *p; return 0; }], [AC_MSG_RESULT( ANSI); AC_DEFINE( __USE_ANSI_C__)], AC_MSG_RESULT( K&R), AC_MSG_RESULT( K&R))
95 dnl if test -n "$GCC"; then
98 dnl AC_MSG_CHECKING( whether $saveCXX takes -pipe)
99 dnl AC_TRY_LINK( , , [AC_MSG_RESULT( yes)], [AC_MSG_RESULT( no);CC="$saveCC"])
101 AC_MSG_CHECKING( for bool built-in)
102 AC_TRY_COMPILE( , bool b = false;, [AC_DEFINE( BOOL_BUILTIN) AC_MSG_RESULT( yes)], AC_MSG_RESULT( no))
103 AC_MSG_CHECKING( for variable sized automatic arrays)
104 AC_TRY_COMPILE( , changequote(<,>)int i = 42; char a[++i]; *a = i;changequote([,]), [AC_DEFINE( HAVE_VARIABLE_SIZED_AUTOMATIC_ARRAYS) AC_MSG_RESULT( yes)], AC_MSG_RESULT( no))
105 AC_MSG_CHECKING( for volatile functions)
106 AC_TRY_COMPILE( , changequote(<,>)abort();changequote([,]), [AC_MSG_RESULT( yes)], [AC_DEFINE( COMPILER_WITHOUT_VOLATILE_FUNCTIONS) SNACC_NOVOLAT=-novolat; AC_SUBST( SNACC_NOVOLAT) AC_MSG_RESULT( no)])
115 CFLAGS="$CFLAGS -DFLEX_IN_USE"
119 # the boot strapping code in .../c-lib/ needs patch:
120 AC_CHECK_PROGS( PATCH, patch, false)
122 AC_CHECK_PROGS( MKDEP, makedepend mkdep mkdep.sh, $CC)
123 AC_CHECK_PROGS( AR, ar, ar)
126 dnl --- header files:
132 AC_CHECK_HEADERS( unistd.h memory.h string.h malloc.h fcntl.h)
134 dnl --- system and compiler characteristics:
137 AC_CHECK_SIZEOF( short)
138 AC_CHECK_SIZEOF( int)
139 AC_CHECK_SIZEOF( long)
140 AC_CHECK_SIZEOF( double)
141 AC_CHECK_LIB( m, sin)
142 AC_CHECK_FUNCS( isinf finite)
143 AC_CHECK_FUNCS( memset memcpy memcmp)
147 AC_CHECK_PROGS( TCLSH, tclsh, false)
148 if test "$TCLSH" != false; then
151 [AC_CHECK_LIB( ld, ldopen, TCLOTHERLIBS=-lld)
155 [saveCFLAGS="$CFLAGS"
156 CFLAGS="$CFLAGS $X_CFLAGS"
160 [AC_DEFINE( HAVE_TCL)
161 TCLLIBS="-ltk -ltcl $TCLOTHERLIBS"
166 [TREELIBS="-lTkTree"],
167 [AC_MSG_RESULT( [tcl/tk libs found, but tree widget is missing])],
168 -lTkTree -ltk -ltcl $TCLOTHERLIBS $X_LIBS $X_PRE_LIBS -lX11 $X_EXTRA_LIBS)
170 [AC_MSG_RESULT( [tcl lib found, but tk lib is missing])],
171 -ltcl $TCLOTHERLIBS $X_LIBS $X_PRE_LIBS -lX11 $X_EXTRA_LIBS)
172 CFLAGS="$saveCFLAGS"],
173 [AC_MSG_RESULT( [tcl library not found])],
179 AC_CHECK_PROGS( LATEX, latex, false)
180 AC_CHECK_PROGS( BIBTEX, bibtex, false)
181 AC_CHECK_PROGS( DVIPS, dvips, false)
182 AC_CHECK_PROGS( DETEX, detex2 detex, false)
183 AC_CHECK_PROGS( PSPREVIEW, ghostview gs, true)
184 AC_CHECK_PROGS( PSBOOK, psbook, false)
185 AC_CHECK_PROGS( PSNUP, psnup, false)
186 AC_CHECK_PROGS( SPELL, ispell spell, spell)
188 AC_OUTPUT( makehead, date > stamp-h)