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_ARG_WITH(libplot, [ --without-libplot don't compile in support of charts (using libplot)])
27 if test x"$with_libplot" != x"no" ; then
28 AC_CHECK_LIB(plot, pl_newpl_r,,
29 AC_MSG_ERROR([You must install libplot (or use --without-libplot)])
32 AM_CONDITIONAL(WITHCHARTS, test x"$with_libplot" != x"no")
35 AC_CHECK_LIB(gmp, mpf_get_str,,
36 AC_CHECK_LIB(gmp, __gmpf_get_str,,
37 AC_MSG_ERROR([You must install libgmp])
41 AC_CHECK_LIB(gslcblas,main,,AC_MSG_ERROR([You must install libgslcblas]))
42 AC_CHECK_LIB(gsl, gsl_cdf_chisq_Q,,
43 AC_MSG_ERROR([You must install libgsl version 1.4 or later]))
45 AC_CHECK_LIB(gnugetopt,getopt_long)
46 AC_CHECK_FUNC(getopt_long,,
47 AC_MSG_ERROR(`This application depends upon getopt_long'))
50 [ --without-ncurses don't compile in ncurses command line editing])
53 if test "x$with_ncurses" = x"yes"; then
54 AC_CHECK_LIB(ncurses, tgetent, LIBS="-lncurses $LIBS" termcap=yes,
55 AC_CHECK_LIB(termcap, tgetent, LIBS="-ltermcap $LIBS" termcap=yes,
60 if test "$termcap" = yes; then
61 AC_CHECK_HEADERS(termcap.h)
62 AC_DEFINE(HAVE_LIBTERMCAP, 1,
63 [Define if you have the termcap library (-ltermcap).])
66 AC_CHECK_LIB(readline, readline)
67 if test "$ac_cv_lib_readline_readline" = yes; then
68 AC_CHECK_HEADERS(readline/readline.h)
69 AC_CHECK_LIB(readline, add_history, history=yes,
70 AC_CHECK_LIB(history, add_history, LIBS="-lhistory" history=yes,
72 if test "$history" = yes; then
73 AC_CHECK_HEADERS(readline/history.h)
74 AC_DEFINE(HAVE_LIBHISTORY, 1,
75 [Define if you have the history library (-lhistory).])
79 dnl Checks for header files.
80 AC_ARG_WITH(valgrind, [ --without-valgrind don't compile in valgrind])
81 if test "x$with_valgrind" != x"no"; then
82 AC_CHECK_HEADERS([valgrind/valgrind.h])
84 AC_CHECK_HEADERS([limits.h memory.h sys/stat.h sys/time.h sys/types.h \
85 fpu_control.h sys/mman.h sys/wait.h ieeefp.h fenv.h] )
93 dnl Dont use AC_TYPE_OFF_T --- it doesnt generate the HAVE_TYPE macro
98 AC_CHECK_SIZEOF(short, 2)
99 AC_CHECK_SIZEOF(int, 4)
100 AC_CHECK_SIZEOF(long, 4)
101 AC_CHECK_SIZEOF(long long, 0)
102 AC_CHECK_SIZEOF(float, 0)
103 AC_CHECK_SIZEOF(double, 8)
104 AC_CHECK_SIZEOF(long double, 0)
106 AC_DEFINE(FPREP_IEEE754, 1,
107 [Define for machines that have IEEE 754 floating point arithmetic,
108 the most common format today.])
119 AC_REPLACE_FUNCS([memmove memset stpcpy strpbrk strerror strtol strtoul \
120 memchr getline getdelim strcasecmp strncasecmp memmem \
122 AC_CHECK_FUNCS([gethostname strstr strtod __setfpucw isinf isnan finite \
123 getpid feholdexcept mkdtemp])
128 AH_BOTTOM([#include <pref.h>])
131 AM_CONDITIONAL(unix, test x"$host_os" != x"msdos" )
132 AM_CONDITIONAL(msdos, test x"$host_os" == x"msdos" )
134 dnl This is needed otherwise --with-included-gettext fails
135 AH_BOTTOM([#include <locale.h>])
137 AC_ARG_ENABLE(debug, [ --enable-debug Turn on diagnostic features in the program])
138 if test x"$enable_debug" = x"yes" ; then
139 AC_DEFINE(DEBUGGING, 1, [Define to 1 if debugging is enabled.])
142 AC_CONFIG_FILES([Makefile po/Makefile.in m4/Makefile
143 lib/Makefile lib/julcal/Makefile lib/misc/Makefile
144 doc/Makefile src/Makefile
145 config/Makefile tests/Makefile])
146 AC_CONFIG_COMMANDS([pref.h],[
147 # Copy pref.h from pref.h.orig if prudent
148 if test ! -f pref.h; then
149 echo "creating pref.h"
150 cp $ac_given_srcdir/pref.h.orig pref.h
151 elif test "`ls -t pref.h.orig pref.h 2>/dev/null | sed 1q`" = pref.h.orig; then
152 echo "replacing pref.h with newer pref.h.orig"
153 cp $ac_given_srcdir/pref.h.orig pref.h
157 if test -f pref.h; then touch pref.h; fi
159 AC_OUTPUT(intl/Makefile)
161 dnl configure.ac ends here