dnl Process this file with autoconf to produce a configure script. AC_INIT(src/q2c.c) AC_PREREQ(2.12) AM_CONFIG_HEADER(config.h) CPPFLAGS="$CPPFLAGS -D_GNU_SOURCE=1" AC_ISC_POSIX AC_PROG_CC AM_PROG_CC_STDC AC_CANONICAL_SYSTEM AM_INIT_AUTOMAKE(pspp, [0.3.0]) #AC_DEFINE_UNQUOTED(PACKAGE, "$PACKAGE") AC_DEFINE_UNQUOTED(VERSION, "$VERSION") #GNU_PACKAGE="GNU $PACKAGE" #AC_DEFINE_UNQUOTED(GNU_PACKAGE, "$GNU_PACKAGE") ALL_LINGUAS="" AC_ARG_PROGRAM AC_PROG_INSTALL AC_PROG_RANLIB dnl internationalization macros AM_GNU_GETTEXT AC_LINK_FILES($nls_cv_header_libgt, $nls_cv_header_intl) AC_ARG_WITH(checker, [ --with-checker compile with Checker (for debugging)], CC="checkergcc" LOCAL_CC="gcc" CC_OPTIONS="-Werror") AC_ARG_ENABLE(debugging, [ --enable-debugging turn on debugging options], CC_OPTIONS="-DDEBUGGING=1") # LOCAL_CC runs on the build system, targets the build system. # CC runs on the build system, targets the host system. if test -z "$LOCAL_CC"; then LOCAL_CC="$CC" fi AC_SUBST(LOCAL_CC) AC_CHECK_LIB(m, sin) AC_CHECK_LIB(gmp, mpf_get_str, LIBS="-lgmp $LIBS" GMP_SUBDIRS= GMP_LIBS=, GMP_SUBDIRS=gmp GMP_LIBS='$(GMP_LIBS)') AC_SUBST(GMP_SUBDIRS) AC_SUBST(GMP_LIBS) AC_CHECK_LIB(ncurses, tgetent, LIBS="-lncurses $LIBS" termcap=yes, AC_CHECK_LIB(termcap, tgetent, LIBS="-ltermcap $LIBS" termcap=yes, termcap=no)) if test "$termcap" = yes; then AC_CHECK_HEADERS(termcap.h) AC_DEFINE(HAVE_LIBTERMCAP) fi AC_CHECK_LIB(readline, readline) if test "$ac_cv_lib_readline_readline" = yes; then AC_CHECK_HEADERS(readline/readline.h) AC_CHECK_LIB(readline, add_history, history=yes, AC_CHECK_LIB(history, add_history, LIBS="-lhistory" history=yes, history=no)) if test "$history" = yes; then AC_CHECK_HEADERS(readline/history.h) AC_DEFINE(HAVE_LIBHISTORY) fi fi AC_CHECK_HEADERS(limits.h memory.h sys/stat.h sys/time.h sys/types.h \ fpu_control.h sys/mman.h sys/wait.h ieeefp.h fenv.h) AC_HEADER_STAT AC_HEADER_STDC AC_HEADER_TIME dnl This test must precede tests of compiler characteristics like dnl that for the inline keyword, since it may change the degree to dnl which the compiler supports such features. AM_C_PROTOTYPES AC_C_CONST AC_C_INLINE AC_TYPE_SIZE_T AC_STRUCT_TM AC_CHECK_SIZEOF(short, 2) AC_CHECK_SIZEOF(int, 4) AC_CHECK_SIZEOF(long, 4) AC_CHECK_SIZEOF(long long, 0) AC_CHECK_SIZEOF(float, 0) AC_CHECK_SIZEOF(double, 8) AC_CHECK_SIZEOF(long double, 0) dnl There used to be a check for floating-point representation here, but dnl for some reason it didn't work on certain m68k GNU/Linux machines, and dnl I was unable to determine why. So, since every modern computer uses dnl ieee754 format anyway, I've hard-coded it to ieee754. Anyone who uses dnl something else can enumerate the exceptions. AC_DEFINE(FPREP, FPREP_IEEE754) dnl if test "$cross_compiling" = yes; then dnl AC_MSG_WARN([Edit config.h to set proper values for SIZEOF_SHORT, \ dnl SIZEOF_INT,]) dnl AC_MSG_WARN([SIZEOF_LONG, and SIZEOF_LONG_LONG (if available), if the \ dnl values]) dnl AC_MSG_WARN([are not 2, 4, 4, and 8, respectively.]) dnl AC_MSG_WARN([Also set the floating point representation (IEEE754, etc.).]) dnl else dnl AC_CACHE_CHECK( dnl floating point representation, ac_cv_sys_fprep, dnl dnl AC_TRY_RUN( dnl [changequote(<<, >>)dnl dnl << dnl main () { dnl /* Test for IEEE754 floating point representation. */ dnl union { unsigned char c[8]; double d; } dnl l = {{0x1c, 0xbc, 0x6e, 0xf2, 0x54, 0x8b, 0x11, 0x43}}, dnl b = {{0x43, 0x11, 0x8b, 0x54, 0xf2, 0x6e, 0xbc, 0x1c}}; dnl return l.d!=1234567891234567.0 && b.d!=1234567891234567.0; dnl } dnl >> dnl changequote([, ])dnl dnl ], ac_cv_sys_fprep=ieee754, ac_cv_sys_fprep=unknown, dnl AC_MSG_WARN([This error cannot occur.]))) dnl if test "$ac_cv_sys_fprep" = ieee754; then dnl AC_DEFINE(FPREP, FPREP_IEEE754) dnl else dnl AC_MSG_WARN([Unknown floating-point representation. This is a serious \ dnl error.]) dnl AC_MSG_WARN([Please contact the author for porting information.]) dnl AC_MSG_WARN([(It should be a fairly simple port, by the way.)]) dnl AC_DEFINE(FPREP, FPREP_UNKNOWN) dnl fi dnl fi if test "$cross_compiling" = no; then dnl This code was taken from acspecific.m4 and modified. dnl It began life as AC_C_BIGENDIAN. AC_CACHE_CHECK( whether byte ordering is bigendian, ac_cv_c_bigendian, [ac_cv_c_bigendian=unknown # See if sys/param.h defines the BYTE_ORDER macro. AC_TRY_COMPILE( [#include #include ], [#if !BYTE_ORDER || !BIG_ENDIAN || !LITTLE_ENDIAN bogus endian macros #endif], [# It does; now see whether it defined to BIG_ENDIAN or not. AC_TRY_COMPILE( [#include #include ], [#if BYTE_ORDER != BIG_ENDIAN not big endian #endif], ac_cv_c_bigendian=yes, ac_cv_c_bigendian=no)]) if test $ac_cv_c_bigendian = unknown; then AC_TRY_RUN( [main () { /* Are we little or big endian? From Harbison&Steele. */ union { long l; char c[sizeof (long)]; } u; u.l = 1; exit (u.c[sizeof (long) - 1] == 1); }], ac_cv_c_bigendian=no, ac_cv_c_bigendian=yes, AC_MSG_ERROR([Internal error determining endianness.])) fi]) if test "$ac_cv_c_bigendian" = yes; then AC_DEFINE(ENDIAN, BIG) elif test "$ac_cv_c_bigendian" = no; then AC_DEFINE(ENDIAN, LITTLE) else AC_MSG_ERROR([Machine's endianness is unknown.]) fi else AC_DEFINE(ENDIAN, UNKNOWN) AC_MSG_WARN([Optionally set value for endianness for best performance.]) fi BLP_IS_SPRINTF_GOOD BLP_INT_DIGITS BLP_RANDOM AC_FUNC_ALLOCA AC_FUNC_MEMCMP AC_FUNC_VPRINTF AC_REPLACE_FUNCS(memmove memset stpcpy strpbrk strerror strtol strtoul memchr \ getline getdelim strcasecmp strncasecmp memmem strtok_r) AC_CHECK_FUNCS(gethostname strstr strtod __setfpucw isinf isnan finite getpid \ feholdexcept) AC_PROG_LN_S dnl This must be after other tests so warnings don't provoke errors above. if test "$ac_cv_prog_gcc" = yes; then CFLAGS="-g -Wall -W -Wno-uninitialized -Wwrite-strings \ -Wstrict-prototypes -Wpointer-arith" if test "$CC_OPTIONS" != ""; then CFLAGS="$CFLAGS $CC_OPTIONS" fi fi AC_SUBST(CFLAGS) AC_OUTPUT(Makefile \ intl/Makefile \ po/Makefile.in \ lib/Makefile \ lib/gmp/Makefile \ lib/gmp/mpn/Makefile \ lib/gmp/mpf/Makefile \ lib/julcal/Makefile \ lib/misc/Makefile \ lib/dcdflib/Makefile \ doc/Makefile \ src/Makefile \ config/Makefile \ tests/Makefile, [sed -e "/POTFILES =/r po/POTFILES" po/Makefile.in > po/Makefile # Copy pref.h from pref.h.orig if prudent if test ! -f pref.h; then echo "creating pref.h" cp $ac_given_srcdir/pref.h.orig pref.h elif test "`ls -t pref.h.orig pref.h 2>/dev/null | sed 1q`" = pref.h.orig; then echo "replacing pref.h with newer pref.h.orig" cp $ac_given_srcdir/pref.h.orig pref.h else echo "pref.h exists" fi if test -f pref.h; then touch pref.h; fi ]) dnl configure.in ends here