1 dnl Process this file with autoconf to produce a configure script.
5 AC_INIT(pspp, 0.4.0,bug-gnu-pspp@gnu.org)
6 AC_CONFIG_HEADERS([config.h])
9 dnl Checks for programs.
15 AM_CONDITIONAL(cc_is_gcc, test x"$GCC" = x"yes" )
17 dnl Check that Perl is available.
18 AC_PATH_PROG([PERL], perl, no)
20 if test "$PERL" = no; then
21 AC_MSG_ERROR([perl is not found])
23 $PERL -e 'require 5.005_03;' || {
24 AC_MSG_ERROR([Perl 5.005_03 or better is required])
27 dnl Internationalization macros.
29 AM_GNU_GETTEXT_VERSION([0.14.5])
31 dnl Checks for libraries.
35 AC_ARG_WITH(libplot, [ --without-libplot don't compile in support of charts (using libplot)])
37 if test x"$with_libplot" != x"no" ; then
38 AC_CHECK_LIB(plot, pl_newpl_r,,
39 AC_MSG_ERROR([You must install libplot (or use --without-libplot)])
42 AM_CONDITIONAL(WITHCHARTS, test x"$with_libplot" != x"no")
44 dnl Check that off_t is defined as an integer type.
45 dnl Solaris sometimes declares it as a struct, if it
46 dnl thinks that the compiler does not support `long long'.
47 AC_COMPILE_IFELSE([#include <sys/types.h>
54 }], [], [AC_MSG_ERROR(
55 [Your system's definition of off_t is broken. You are probably
56 using Solaris. You can probably fix the problem with
57 `--disable-largefile' or `CFLAGS=-ansi'.])])
59 AC_CHECK_LIB(gslcblas,main,,AC_MSG_ERROR([You must install libgslcblas]))
60 AC_CHECK_LIB(gsl, gsl_cdf_chisq_Q,,
61 AC_MSG_ERROR([You must install libgsl version 1.4 or later]))
64 [ --without-ncurses don't compile in ncurses command line editing])
66 if test "x$with_ncurses" = x"yes"; then
67 AC_CHECK_LIB(ncurses, tgetent, LIBS="-lncurses $LIBS" termcap=yes,
68 AC_CHECK_LIB(termcap, tgetent, LIBS="-ltermcap $LIBS" termcap=yes,
72 if test "$termcap" = yes; then
73 AC_CHECK_HEADERS(termcap.h)
74 AC_DEFINE(HAVE_LIBTERMCAP, 1,
75 [Define if you have the termcap library (-ltermcap).])
78 AC_CHECK_LIB(readline, readline)
79 if test "$ac_cv_lib_readline_readline" = yes; then
80 AC_CHECK_HEADERS(readline/readline.h)
81 AC_CHECK_LIB(readline, add_history, history=yes,
82 AC_CHECK_LIB(history, add_history, LIBS="-lhistory" history=yes,
84 if test "$history" = yes; then
85 AC_CHECK_HEADERS(readline/history.h)
86 AC_DEFINE(HAVE_LIBHISTORY, 1,
87 [Define if you have the history library (-lhistory).])
91 dnl Checks for header files.
92 AC_ARG_WITH(valgrind, [ --without-valgrind don't compile in valgrind])
93 if test "x$with_valgrind" != x"no"; then
94 AC_CHECK_HEADERS([valgrind/valgrind.h])
96 AC_CHECK_HEADERS([limits.h memory.h sys/stat.h sys/time.h sys/types.h \
97 fpu_control.h sys/mman.h sys/wait.h ieeefp.h fenv.h] )
105 dnl Dont use AC_TYPE_OFF_T --- it doesnt generate the HAVE_TYPE macro
106 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.])
126 AC_CHECK_FUNCS([strchr strrchr __setfpucw isinf isnan finite getpid feholdexcept])
131 AH_BOTTOM([#include <pref.h>])
134 AM_CONDITIONAL(unix, test x"$host_os" != x"msdos" )
135 AM_CONDITIONAL(msdos, test x"$host_os" = x"msdos" )
137 dnl This is needed otherwise --with-included-gettext fails
138 AH_BOTTOM([#include <locale.h>])
140 AC_ARG_ENABLE(debug, [ --enable-debug Turn on diagnostic features in the program])
141 if test x"$enable_debug" = x"yes" ; then
142 AC_DEFINE(DEBUGGING, 1, [Define to 1 if debugging is enabled.])
145 AC_CONFIG_FILES([Makefile m4/Makefile gl/Makefile intl/Makefile po/Makefile.in
146 lib/Makefile lib/gsl-extras/Makefile lib/linreg/Makefile
148 src/Makefile src/expressions/Makefile
152 AC_CONFIG_COMMANDS([pref.h],[
153 # Copy pref.h from pref.h.orig if prudent
154 if test ! -f pref.h; then
155 echo "creating pref.h"
156 cp $ac_given_srcdir/pref.h.orig pref.h
157 elif test "`ls -t pref.h.orig pref.h 2>/dev/null | sed 1q`" = pref.h.orig; then
158 echo "replacing pref.h with newer pref.h.orig"
159 cp $ac_given_srcdir/pref.h.orig pref.h
163 if test -f pref.h; then touch pref.h; fi
167 dnl configure.ac ends here