1 dnl Process this file with autoconf to produce a configure script.
4 AM_CONFIG_HEADER(config.h)
5 CPPFLAGS="$CPPFLAGS -D_GNU_SOURCE=1"
10 AM_INIT_AUTOMAKE(pspp, [0.3.0])
12 #AC_DEFINE_UNQUOTED(PACKAGE, "$PACKAGE")
13 AC_DEFINE_UNQUOTED(VERSION, "$VERSION")
15 #GNU_PACKAGE="GNU $PACKAGE"
16 #AC_DEFINE_UNQUOTED(GNU_PACKAGE, "$GNU_PACKAGE")
24 dnl internationalization macros
27 AC_LINK_FILES($nls_cv_header_libgt, $nls_cv_header_intl)
30 [ --with-checker compile with Checker (for debugging)],
31 CC="checkergcc" LOCAL_CC="gcc" CC_OPTIONS="-Werror")
32 AC_ARG_ENABLE(debugging,
33 [ --enable-debugging turn on debugging options],
34 CC_OPTIONS="-DDEBUGGING=1")
36 # LOCAL_CC runs on the build system, targets the build system.
37 # CC runs on the build system, targets the host system.
38 if test -z "$LOCAL_CC"; then
44 AC_CHECK_LIB(gmp, mpf_get_str,
45 LIBS="-lgmp $LIBS" GMP_SUBDIRS= GMP_LIBS=,
46 GMP_SUBDIRS=gmp GMP_LIBS='$(GMP_LIBS)')
50 AC_CHECK_LIB(ncurses, tgetent, LIBS="-lncurses $LIBS" termcap=yes,
51 AC_CHECK_LIB(termcap, tgetent, LIBS="-ltermcap $LIBS" termcap=yes,
53 if test "$termcap" = yes; then
54 AC_CHECK_HEADERS(termcap.h)
55 AC_DEFINE(HAVE_LIBTERMCAP)
58 AC_CHECK_LIB(readline, readline)
59 if test "$ac_cv_lib_readline_readline" = yes; then
60 AC_CHECK_HEADERS(readline/readline.h)
61 AC_CHECK_LIB(readline, add_history, history=yes,
62 AC_CHECK_LIB(history, add_history, LIBS="-lhistory" history=yes,
64 if test "$history" = yes; then
65 AC_CHECK_HEADERS(readline/history.h)
66 AC_DEFINE(HAVE_LIBHISTORY)
70 AC_CHECK_HEADERS(limits.h memory.h sys/stat.h sys/time.h sys/types.h \
71 fpu_control.h sys/mman.h sys/wait.h ieeefp.h fenv.h)
76 dnl This test must precede tests of compiler characteristics like
77 dnl that for the inline keyword, since it may change the degree to
78 dnl which the compiler supports such features.
86 AC_CHECK_SIZEOF(short, 2)
87 AC_CHECK_SIZEOF(int, 4)
88 AC_CHECK_SIZEOF(long, 4)
89 AC_CHECK_SIZEOF(long long, 0)
90 AC_CHECK_SIZEOF(float, 0)
91 AC_CHECK_SIZEOF(double, 8)
92 AC_CHECK_SIZEOF(long double, 0)
94 dnl There used to be a check for floating-point representation here, but
95 dnl for some reason it didn't work on certain m68k GNU/Linux machines, and
96 dnl I was unable to determine why. So, since every modern computer uses
97 dnl ieee754 format anyway, I've hard-coded it to ieee754. Anyone who uses
98 dnl something else can enumerate the exceptions.
100 AC_DEFINE(FPREP, FPREP_IEEE754)
102 dnl if test "$cross_compiling" = yes; then
103 dnl AC_MSG_WARN([Edit config.h to set proper values for SIZEOF_SHORT, \
105 dnl AC_MSG_WARN([SIZEOF_LONG, and SIZEOF_LONG_LONG (if available), if the \
107 dnl AC_MSG_WARN([are not 2, 4, 4, and 8, respectively.])
108 dnl AC_MSG_WARN([Also set the floating point representation (IEEE754, etc.).])
111 dnl floating point representation, ac_cv_sys_fprep,
114 dnl [changequote(<<, >>)dnl
117 dnl /* Test for IEEE754 floating point representation. */
118 dnl union { unsigned char c[8]; double d; }
119 dnl l = {{0x1c, 0xbc, 0x6e, 0xf2, 0x54, 0x8b, 0x11, 0x43}},
120 dnl b = {{0x43, 0x11, 0x8b, 0x54, 0xf2, 0x6e, 0xbc, 0x1c}};
121 dnl return l.d!=1234567891234567.0 && b.d!=1234567891234567.0;
124 dnl changequote([, ])dnl
125 dnl ], ac_cv_sys_fprep=ieee754, ac_cv_sys_fprep=unknown,
126 dnl AC_MSG_WARN([This error cannot occur.])))
127 dnl if test "$ac_cv_sys_fprep" = ieee754; then
128 dnl AC_DEFINE(FPREP, FPREP_IEEE754)
130 dnl AC_MSG_WARN([Unknown floating-point representation. This is a serious \
132 dnl AC_MSG_WARN([Please contact the author for porting information.])
133 dnl AC_MSG_WARN([(It should be a fairly simple port, by the way.)])
134 dnl AC_DEFINE(FPREP, FPREP_UNKNOWN)
138 if test "$cross_compiling" = no; then
139 dnl This code was taken from acspecific.m4 and modified.
140 dnl It began life as AC_C_BIGENDIAN.
142 whether byte ordering is bigendian, ac_cv_c_bigendian,
143 [ac_cv_c_bigendian=unknown
144 # See if sys/param.h defines the BYTE_ORDER macro.
146 [#include <sys/types.h>
147 #include <sys/param.h>],
148 [#if !BYTE_ORDER || !BIG_ENDIAN || !LITTLE_ENDIAN
151 [# It does; now see whether it defined to BIG_ENDIAN or not.
153 [#include <sys/types.h>
154 #include <sys/param.h>],
155 [#if BYTE_ORDER != BIG_ENDIAN
158 ac_cv_c_bigendian=yes, ac_cv_c_bigendian=no)])
159 if test $ac_cv_c_bigendian = unknown; then
162 /* Are we little or big endian? From Harbison&Steele. */
166 char c[sizeof (long)];
169 exit (u.c[sizeof (long) - 1] == 1);
171 ac_cv_c_bigendian=no, ac_cv_c_bigendian=yes,
172 AC_MSG_ERROR([Internal error determining endianness.]))
175 if test "$ac_cv_c_bigendian" = yes; then
176 AC_DEFINE(ENDIAN, BIG)
177 elif test "$ac_cv_c_bigendian" = no; then
178 AC_DEFINE(ENDIAN, LITTLE)
180 AC_MSG_ERROR([Machine's endianness is unknown.])
183 AC_DEFINE(ENDIAN, UNKNOWN)
185 AC_MSG_WARN([Optionally set value for endianness for best performance.])
195 AC_REPLACE_FUNCS(memmove memset stpcpy strpbrk strerror strtol strtoul memchr \
196 getline getdelim strcasecmp strncasecmp memmem strtok_r)
197 AC_CHECK_FUNCS(gethostname strstr strtod __setfpucw isinf isnan finite getpid \
202 dnl This must be after other tests so warnings don't provoke errors above.
203 if test "$ac_cv_prog_gcc" = yes; then
204 CFLAGS="-g -Wall -W -Wno-uninitialized -Wwrite-strings \
205 -Wstrict-prototypes -Wpointer-arith"
206 if test "$CC_OPTIONS" != ""; then
207 CFLAGS="$CFLAGS $CC_OPTIONS"
217 lib/gmp/mpn/Makefile \
218 lib/gmp/mpf/Makefile \
219 lib/julcal/Makefile \
221 lib/dcdflib/Makefile \
226 [sed -e "/POTFILES =/r po/POTFILES" po/Makefile.in > po/Makefile
228 # Copy pref.h from pref.h.orig if prudent
229 if test ! -f pref.h; then
230 echo "creating pref.h"
231 cp $ac_given_srcdir/pref.h.orig pref.h
232 elif test "`ls -t pref.h.orig pref.h 2>/dev/null | sed 1q`" = pref.h.orig; then
233 echo "replacing pref.h with newer pref.h.orig"
234 cp $ac_given_srcdir/pref.h.orig pref.h
238 if test -f pref.h; then touch pref.h; fi
241 dnl configure.in ends here