1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234
|
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.2.2])
#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(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/time.h sys/types.h \
fpu_control.h sys/mman.h sys/wait.h ieeefp.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 <sys/types.h>
#include <sys/param.h>],
[#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 <sys/types.h>
#include <sys/param.h>],
[#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)
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
|