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"])],
21 AC_MSG_ERROR(`You must install libgmp'))
23 AC_CHECK_LIB(ncurses, tgetent, LIBS="-lncurses $LIBS" termcap=yes,
24 AC_CHECK_LIB(termcap, tgetent, LIBS="-ltermcap $LIBS" termcap=yes,
26 if test "$termcap" = yes; then
27 AC_CHECK_HEADERS(termcap.h)
28 AC_DEFINE(HAVE_LIBTERMCAP, 1,
29 [Define if you have the termcap library (-ltermcap).])
32 AC_CHECK_LIB(readline, readline)
33 if test "$ac_cv_lib_readline_readline" = yes; then
34 AC_CHECK_HEADERS(readline/readline.h)
35 AC_CHECK_LIB(readline, add_history, history=yes,
36 AC_CHECK_LIB(history, add_history, LIBS="-lhistory" history=yes,
38 if test "$history" = yes; then
39 AC_CHECK_HEADERS(readline/history.h)
40 AC_DEFINE(HAVE_LIBHISTORY, 1,
41 [Define if you have the history library (-lhistory).])
45 dnl Checks for header files.
46 AC_CHECK_HEADERS([limits.h memory.h sys/stat.h sys/time.h sys/types.h \
47 fpu_control.h sys/mman.h sys/wait.h ieeefp.h fenv.h])
57 AC_CHECK_SIZEOF(short, 2)
58 AC_CHECK_SIZEOF(int, 4)
59 AC_CHECK_SIZEOF(long, 4)
60 AC_CHECK_SIZEOF(long long, 0)
61 AC_CHECK_SIZEOF(float, 0)
62 AC_CHECK_SIZEOF(double, 8)
63 AC_CHECK_SIZEOF(long double, 0)
65 AC_DEFINE(FPREP_IEEE754, 1,
66 [Define for machines that have IEEE 754 floating point arithmetic,
67 the most common format today.])
78 AC_REPLACE_FUNCS([memmove memset stpcpy strpbrk strerror strtol strtoul \
79 memchr getline getdelim strcasecmp strncasecmp memmem \
81 AC_CHECK_FUNCS([gethostname strstr strtod __setfpucw isinf isnan finite \
86 dnl This must be after other tests so warnings don't provoke errors above.
87 if test "$ac_cv_c_compiler_gnu" = yes; then
88 CFLAGS="-g -Wall -W -Wno-uninitialized -Wwrite-strings \
89 -Wstrict-prototypes -Wpointer-arith -Wno-sign-compare"
90 if test "$CC_OPTIONS" != ""; then
91 CFLAGS="$CFLAGS $CC_OPTIONS"
96 AH_BOTTOM([#include <pref.h>])
98 AC_CONFIG_FILES([Makefile po/Makefile.in m4/Makefile intl/Makefile
99 lib/Makefile lib/julcal/Makefile lib/misc/Makefile
100 lib/dcdflib/Makefile doc/Makefile src/Makefile
101 config/Makefile tests/Makefile])
102 AC_CONFIG_COMMANDS([pref.h],[
103 # Copy pref.h from pref.h.orig if prudent
104 if test ! -f pref.h; then
105 echo "creating pref.h"
106 cp $ac_given_srcdir/pref.h.orig pref.h
107 elif test "`ls -t pref.h.orig pref.h 2>/dev/null | sed 1q`" = pref.h.orig; then
108 echo "replacing pref.h with newer pref.h.orig"
109 cp $ac_given_srcdir/pref.h.orig pref.h
113 if test -f pref.h; then touch pref.h; fi
117 dnl configure.ac ends here