1 dnl Process this file with autoconf to produce a configure script.
5 AC_INIT(pspp, 0.3.2,bug-gnu-pspp@gnu.org)
6 AC_CONFIG_HEADERS([config.h])
9 dnl Checks for programs.
14 AM_CONDITIONAL(cc_is_gcc, test x"$GCC" = x"yes" )
16 AC_PATH_PROG([PERL], perl, no)
18 if test "$PERL" = no; then
19 AC_MSG_ERROR([perl is not found])
21 $PERL -e 'require 5.005_03;' || {
22 AC_MSG_ERROR([Perl 5.005_03 or better is required])
25 dnl Internationalization macros.
27 AM_GNU_GETTEXT_VERSION dnl Prevents autoreconf complaint.
29 dnl Checks for libraries.
33 AC_ARG_WITH(libplot, [ --without-libplot don't compile in support of charts (using libplot)])
35 if test x"$with_libplot" != x"no" ; then
36 AC_CHECK_LIB(plot, pl_newpl_r,,
37 AC_MSG_ERROR([You must install libplot (or use --without-libplot)])
40 AM_CONDITIONAL(WITHCHARTS, test x"$with_libplot" != x"no")
43 AC_CHECK_LIB(gmp, mpf_get_str,,
44 AC_CHECK_LIB(gmp, __gmpf_get_str,,
45 AC_MSG_ERROR([You must install libgmp])
49 AC_CHECK_LIB(gslcblas,main,,AC_MSG_ERROR([You must install libgslcblas]))
50 AC_CHECK_LIB(gsl, gsl_cdf_chisq_Q,,
51 AC_MSG_ERROR([You must install libgsl version 1.4 or later]))
53 AC_CHECK_LIB(gnugetopt,getopt_long)
54 AC_CHECK_FUNC(getopt_long,,
55 AC_MSG_ERROR(`This application depends upon getopt_long'))
58 [ --without-ncurses don't compile in ncurses command line editing])
61 if test "x$with_ncurses" = x"yes"; then
62 AC_CHECK_LIB(ncurses, tgetent, LIBS="-lncurses $LIBS" termcap=yes,
63 AC_CHECK_LIB(termcap, tgetent, LIBS="-ltermcap $LIBS" termcap=yes,
68 if test "$termcap" = yes; then
69 AC_CHECK_HEADERS(termcap.h)
70 AC_DEFINE(HAVE_LIBTERMCAP, 1,
71 [Define if you have the termcap library (-ltermcap).])
74 AC_CHECK_LIB(readline, readline)
75 if test "$ac_cv_lib_readline_readline" = yes; then
76 AC_CHECK_HEADERS(readline/readline.h)
77 AC_CHECK_LIB(readline, add_history, history=yes,
78 AC_CHECK_LIB(history, add_history, LIBS="-lhistory" history=yes,
80 if test "$history" = yes; then
81 AC_CHECK_HEADERS(readline/history.h)
82 AC_DEFINE(HAVE_LIBHISTORY, 1,
83 [Define if you have the history library (-lhistory).])
87 dnl Checks for header files.
88 AC_ARG_WITH(valgrind, [ --without-valgrind don't compile in valgrind])
89 if test "x$with_valgrind" != x"no"; then
90 AC_CHECK_HEADERS([valgrind/valgrind.h])
92 AC_CHECK_HEADERS([limits.h memory.h sys/stat.h sys/time.h sys/types.h \
93 fpu_control.h sys/mman.h sys/wait.h ieeefp.h fenv.h] )
102 dnl Dont use AC_TYPE_OFF_T --- it doesnt generate the HAVE_TYPE macro
103 AC_CHECK_TYPES(off_t)
107 AC_CHECK_SIZEOF(short, 2)
108 AC_CHECK_SIZEOF(int, 4)
109 AC_CHECK_SIZEOF(long, 4)
110 AC_CHECK_SIZEOF(long long, 0)
111 AC_CHECK_SIZEOF(float, 0)
112 AC_CHECK_SIZEOF(double, 8)
113 AC_CHECK_SIZEOF(long double, 0)
115 AC_DEFINE(FPREP_IEEE754, 1,
116 [Define for machines that have IEEE 754 floating point arithmetic,
117 the most common format today.])
128 AC_REPLACE_FUNCS([memmove memset stpcpy strpbrk strerror strtol strtoul \
129 memchr getline getdelim strcasecmp strncasecmp memmem \
131 AC_CHECK_FUNCS([gethostname strstr strtod __setfpucw isinf isnan finite \
132 getpid feholdexcept mkdtemp])
137 AH_BOTTOM([#include <pref.h>])
140 AM_CONDITIONAL(unix, test x"$host_os" != x"msdos" )
141 AM_CONDITIONAL(msdos, test x"$host_os" == x"msdos" )
143 dnl This is needed otherwise --with-included-gettext fails
144 AH_BOTTOM([#include <locale.h>])
146 AC_ARG_ENABLE(debug, [ --enable-debug Turn on diagnostic features in the program])
147 if test x"$enable_debug" = x"yes" ; then
148 AC_DEFINE(DEBUGGING, 1, [Define to 1 if debugging is enabled.])
151 AC_CONFIG_FILES([Makefile po/Makefile.in m4/Makefile
152 lib/Makefile lib/misc/Makefile lib/gsl-extras/Makefile
154 src/Makefile src/expressions/Makefile
157 AC_CONFIG_COMMANDS([pref.h],[
158 # Copy pref.h from pref.h.orig if prudent
159 if test ! -f pref.h; then
160 echo "creating pref.h"
161 cp $ac_given_srcdir/pref.h.orig pref.h
162 elif test "`ls -t pref.h.orig pref.h 2>/dev/null | sed 1q`" = pref.h.orig; then
163 echo "replacing pref.h with newer pref.h.orig"
164 cp $ac_given_srcdir/pref.h.orig pref.h
168 if test -f pref.h; then touch pref.h; fi
170 AC_OUTPUT(intl/Makefile)
172 dnl configure.ac ends here