1 dnl Process this file with autoconf to produce a configure script.
5 AC_INIT(pspp, 0.3.1,bug-gnu-pspp@gnu.org)
6 AC_CONFIG_HEADERS([config.h])
9 dnl Checks for programs.
13 AM_CONDITIONAL(cc_is_gcc, test x"$GCC" = x"yes" )
17 dnl Internationalization macros.
19 AM_GNU_GETTEXT_VERSION dnl Prevents autoreconf complaint.
21 dnl Checks for libraries.
25 AC_CHECK_LIB(gmp, mpf_get_str,,
26 AC_CHECK_LIB(gmp, __gmpf_get_str,,
27 AC_MSG_ERROR([You must install libgmp])
31 AC_CHECK_LIB(gslcblas,main,,AC_MSG_ERROR([You must install libgslcblas]))
32 AC_CHECK_LIB(gsl, gsl_cdf_chisq_Q,,
33 AC_MSG_ERROR([You must install libgsl version 1.4 or later]))
35 AC_CHECK_LIB(gnugetopt,getopt_long)
36 AC_CHECK_FUNC(getopt_long,,
37 AC_MSG_ERROR(`This application depends upon getopt_long'))
39 AC_CHECK_LIB(ncurses, tgetent, LIBS="-lncurses $LIBS" termcap=yes,
40 AC_CHECK_LIB(termcap, tgetent, LIBS="-ltermcap $LIBS" termcap=yes,
42 if test "$termcap" = yes; then
43 AC_CHECK_HEADERS(termcap.h)
44 AC_DEFINE(HAVE_LIBTERMCAP, 1,
45 [Define if you have the termcap library (-ltermcap).])
48 AC_CHECK_LIB(readline, readline)
49 if test "$ac_cv_lib_readline_readline" = yes; then
50 AC_CHECK_HEADERS(readline/readline.h)
51 AC_CHECK_LIB(readline, add_history, history=yes,
52 AC_CHECK_LIB(history, add_history, LIBS="-lhistory" history=yes,
54 if test "$history" = yes; then
55 AC_CHECK_HEADERS(readline/history.h)
56 AC_DEFINE(HAVE_LIBHISTORY, 1,
57 [Define if you have the history library (-lhistory).])
61 dnl Checks for header files.
62 AC_CHECK_HEADERS([limits.h memory.h sys/stat.h sys/time.h sys/types.h \
63 fpu_control.h sys/mman.h sys/wait.h ieeefp.h fenv.h \
74 AC_CHECK_SIZEOF(short, 2)
75 AC_CHECK_SIZEOF(int, 4)
76 AC_CHECK_SIZEOF(long, 4)
77 AC_CHECK_SIZEOF(long long, 0)
78 AC_CHECK_SIZEOF(float, 0)
79 AC_CHECK_SIZEOF(double, 8)
80 AC_CHECK_SIZEOF(long double, 0)
82 AC_DEFINE(FPREP_IEEE754, 1,
83 [Define for machines that have IEEE 754 floating point arithmetic,
84 the most common format today.])
95 AC_REPLACE_FUNCS([memmove memset stpcpy strpbrk strerror strtol strtoul \
96 memchr getline getdelim strcasecmp strncasecmp memmem \
98 AC_CHECK_FUNCS([gethostname strstr strtod __setfpucw isinf isnan finite \
99 getpid feholdexcept mkdtemp])
104 AH_BOTTOM([#include <pref.h>])
107 AM_CONDITIONAL(unix, test x"$host_os" != x"msdos" )
108 AM_CONDITIONAL(msdos, test x"$host_os" == x"msdos" )
110 dnl This is needed otherwise --with-included-gettext fails
111 AH_BOTTOM([#include <locale.h>])
113 AC_ARG_ENABLE(debug, [ --enable-debug Turn on diagnostic features in the program])
114 if test x"$enable_debug" = x"yes" ; then
115 AC_DEFINE(DEBUGGING, 1, [Define to 1 if debugging is enabled.])
118 AC_CONFIG_FILES([Makefile po/Makefile.in m4/Makefile
119 lib/Makefile lib/julcal/Makefile lib/misc/Makefile
120 doc/Makefile src/Makefile
121 config/Makefile tests/Makefile])
122 AC_CONFIG_COMMANDS([pref.h],[
123 # Copy pref.h from pref.h.orig if prudent
124 if test ! -f pref.h; then
125 echo "creating pref.h"
126 cp $ac_given_srcdir/pref.h.orig pref.h
127 elif test "`ls -t pref.h.orig pref.h 2>/dev/null | sed 1q`" = pref.h.orig; then
128 echo "replacing pref.h with newer pref.h.orig"
129 cp $ac_given_srcdir/pref.h.orig pref.h
133 if test -f pref.h; then touch pref.h; fi
135 AC_OUTPUT(intl/Makefile)
137 dnl configure.ac ends here