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_FUNC(getopt_long,,
24 AC_MSG_ERROR(`This application depends upon getopt_long'))
27 AC_CHECK_LIB(ncurses, tgetent, LIBS="-lncurses $LIBS" termcap=yes,
28 AC_CHECK_LIB(termcap, tgetent, LIBS="-ltermcap $LIBS" termcap=yes,
30 if test "$termcap" = yes; then
31 AC_CHECK_HEADERS(termcap.h)
32 AC_DEFINE(HAVE_LIBTERMCAP, 1,
33 [Define if you have the termcap library (-ltermcap).])
36 AC_CHECK_LIB(readline, readline)
37 if test "$ac_cv_lib_readline_readline" = yes; then
38 AC_CHECK_HEADERS(readline/readline.h)
39 AC_CHECK_LIB(readline, add_history, history=yes,
40 AC_CHECK_LIB(history, add_history, LIBS="-lhistory" history=yes,
42 if test "$history" = yes; then
43 AC_CHECK_HEADERS(readline/history.h)
44 AC_DEFINE(HAVE_LIBHISTORY, 1,
45 [Define if you have the history library (-lhistory).])
49 dnl Checks for header files.
50 AC_CHECK_HEADERS([limits.h memory.h sys/stat.h sys/time.h sys/types.h \
51 fpu_control.h sys/mman.h sys/wait.h ieeefp.h fenv.h])
61 AC_CHECK_SIZEOF(short, 2)
62 AC_CHECK_SIZEOF(int, 4)
63 AC_CHECK_SIZEOF(long, 4)
64 AC_CHECK_SIZEOF(long long, 0)
65 AC_CHECK_SIZEOF(float, 0)
66 AC_CHECK_SIZEOF(double, 8)
67 AC_CHECK_SIZEOF(long double, 0)
69 AC_DEFINE(FPREP_IEEE754, 1,
70 [Define for machines that have IEEE 754 floating point arithmetic,
71 the most common format today.])
82 AC_REPLACE_FUNCS([memmove memset stpcpy strpbrk strerror strtol strtoul \
83 memchr getline getdelim strcasecmp strncasecmp memmem \
85 AC_CHECK_FUNCS([gethostname strstr strtod __setfpucw isinf isnan finite \
90 dnl This must be after other tests so warnings don't provoke errors above.
91 if test "$ac_cv_c_compiler_gnu" = yes; then
92 CFLAGS="-g -Wall -W -Wno-uninitialized -Wwrite-strings \
93 -Wstrict-prototypes -Wpointer-arith -Wno-sign-compare"
94 if test "$CC_OPTIONS" != ""; then
95 CFLAGS="$CFLAGS $CC_OPTIONS"
100 AH_BOTTOM([#include <pref.h>])
102 AC_CONFIG_FILES([Makefile po/Makefile.in m4/Makefile intl/Makefile
103 lib/Makefile lib/julcal/Makefile lib/misc/Makefile
104 lib/dcdflib/Makefile doc/Makefile src/Makefile
105 config/Makefile tests/Makefile])
106 AC_CONFIG_COMMANDS([pref.h],[
107 # Copy pref.h from pref.h.orig if prudent
108 if test ! -f pref.h; then
109 echo "creating pref.h"
110 cp $ac_given_srcdir/pref.h.orig pref.h
111 elif test "`ls -t pref.h.orig pref.h 2>/dev/null | sed 1q`" = pref.h.orig; then
112 echo "replacing pref.h with newer pref.h.orig"
113 cp $ac_given_srcdir/pref.h.orig pref.h
117 if test -f pref.h; then touch pref.h; fi
121 dnl configure.ac ends here