1 dnl Process this file with autoconf to produce a configure script.
6 AC_CONFIG_HEADERS([config.h])
9 dnl Checks for programs.
13 dnl Internationalization macros.
15 AM_GNU_GETTEXT_VERSION dnl Prevents autoreconf complaint.
17 dnl Checks for libraries.
19 AC_CHECK_LIB(gmp, mpf_get_str, [LIBS="-lgmp $LIBS"],
20 [AC_CHECK_LIB(gmp, __gmpf_get_str, [LIBS="-lgmp $LIBS"])])
22 AC_CHECK_LIB(ncurses, tgetent, LIBS="-lncurses $LIBS" termcap=yes,
23 AC_CHECK_LIB(termcap, tgetent, LIBS="-ltermcap $LIBS" termcap=yes,
25 if test "$termcap" = yes; then
26 AC_CHECK_HEADERS(termcap.h)
27 AC_DEFINE(HAVE_LIBTERMCAP, 1,
28 [Define if you have the termcap library (-ltermcap).])
31 AC_CHECK_LIB(readline, readline)
32 if test "$ac_cv_lib_readline_readline" = yes; then
33 AC_CHECK_HEADERS(readline/readline.h)
34 AC_CHECK_LIB(readline, add_history, history=yes,
35 AC_CHECK_LIB(history, add_history, LIBS="-lhistory" history=yes,
37 if test "$history" = yes; then
38 AC_CHECK_HEADERS(readline/history.h)
39 AC_DEFINE(HAVE_LIBHISTORY, 1,
40 [Define if you have the history library (-lhistory).])
44 dnl Checks for header files.
45 AC_CHECK_HEADERS([limits.h memory.h sys/stat.h sys/time.h sys/types.h \
46 fpu_control.h sys/mman.h sys/wait.h ieeefp.h fenv.h])
56 AC_CHECK_SIZEOF(short, 2)
57 AC_CHECK_SIZEOF(int, 4)
58 AC_CHECK_SIZEOF(long, 4)
59 AC_CHECK_SIZEOF(long long, 0)
60 AC_CHECK_SIZEOF(float, 0)
61 AC_CHECK_SIZEOF(double, 8)
62 AC_CHECK_SIZEOF(long double, 0)
64 AC_DEFINE(FPREP_IEEE754, 1,
65 [Define for machines that have IEEE 754 floating point arithmetic,
66 the most common format today.])
77 AC_REPLACE_FUNCS([memmove memset stpcpy strpbrk strerror strtol strtoul \
78 memchr getline getdelim strcasecmp strncasecmp memmem \
80 AC_CHECK_FUNCS([gethostname strstr strtod __setfpucw isinf isnan finite \
85 dnl This must be after other tests so warnings don't provoke errors above.
86 if test "$ac_cv_c_compiler_gnu" = yes; then
87 CFLAGS="-g -Wall -W -Wno-uninitialized -Wwrite-strings \
88 -Wstrict-prototypes -Wpointer-arith -Wno-sign-compare"
89 if test "$CC_OPTIONS" != ""; then
90 CFLAGS="$CFLAGS $CC_OPTIONS"
95 AH_BOTTOM([#include <pref.h>])
97 AC_CONFIG_FILES([Makefile po/Makefile.in m4/Makefile intl/Makefile
98 lib/Makefile lib/julcal/Makefile lib/misc/Makefile
99 lib/dcdflib/Makefile doc/Makefile src/Makefile
100 config/Makefile tests/Makefile])
101 AC_CONFIG_COMMANDS([pref.h],[
102 # Copy pref.h from pref.h.orig if prudent
103 if test ! -f pref.h; then
104 echo "creating pref.h"
105 cp $ac_given_srcdir/pref.h.orig pref.h
106 elif test "`ls -t pref.h.orig pref.h 2>/dev/null | sed 1q`" = pref.h.orig; then
107 echo "replacing pref.h with newer pref.h.orig"
108 cp $ac_given_srcdir/pref.h.orig pref.h
112 if test -f pref.h; then touch pref.h; fi
116 dnl configure.in ends here