1 0dnl Process this file with autoconf to produce a configure script.
5 AC_INIT(pspp, 0.4.1,bug-gnu-pspp@gnu.org)
6 AC_CONFIG_HEADERS([config.h])
9 dnl Checks for programs.
16 AM_CONDITIONAL(cc_is_gcc, test x"$GCC" = x"yes" )
19 dnl Check that Perl is available.
20 AC_PATH_PROG([PERL], perl, no)
22 if test "$PERL" = no; then
23 AC_MSG_ERROR([perl is not found])
25 $PERL -e 'require 5.005_03;' || {
26 AC_MSG_ERROR([Perl 5.005_03 or better is required])
29 dnl Internationalization macros.
31 AM_GNU_GETTEXT_VERSION([0.14.5])
33 dnl Checks for libraries.
37 AC_ARG_WITH(libplot, [ --without-libplot don't compile in support of charts (using libplot)])
39 if test x"$with_libplot" != x"no" ; then
40 AC_CHECK_LIB(plot, pl_newpl_r,,
41 AC_MSG_ERROR([You must install libplot development libraries (or use --without-libplot)])
44 AM_CONDITIONAL(WITHCHARTS, test x"$with_libplot" != x"no")
47 AC_ARG_WITH(gui, [ --without-gui don't build the PSPPIRE gui])
49 if test x"$with_gui" != x"no" ; then
50 PKG_CHECK_MODULES(GTK, gtk+-2.0 >= 2.6.0)
51 PKG_CHECK_MODULES(GLADE, libglade-2.0)
53 AM_CONDITIONAL(WITHGUI, test x"$with_gui" != x"no")
56 dnl Check that off_t is defined as an integer type.
57 dnl Solaris sometimes declares it as a struct, if it
58 dnl thinks that the compiler does not support `long long'.
59 AC_COMPILE_IFELSE([#include <sys/types.h>
66 }], [], [AC_MSG_ERROR(
67 [Your system's definition of off_t is broken. You are probably
68 using Solaris. You can probably fix the problem with
69 `--disable-largefile' or `CFLAGS=-ansi'.])])
71 AC_CHECK_LIB(gslcblas,main,,AC_MSG_ERROR([You must install libgslcblas development libraries]))
72 AC_CHECK_LIB(gsl, gsl_cdf_chisq_Q,,
73 AC_MSG_ERROR([You must install development libraries for libgsl version 1.4 or later]))
75 AC_CHECK_LIB(ncurses, tgetent)
76 AC_CHECK_HEADERS(termcap.h)
80 dnl Checks for header files.
81 AC_CHECK_HEADERS([limits.h memory.h sys/stat.h sys/time.h sys/types.h \
82 fpu_control.h sys/mman.h sys/wait.h ieeefp.h fenv.h] )
90 dnl Dont use AC_TYPE_OFF_T --- it doesnt generate the HAVE_TYPE macro
92 AC_CHECK_SIZEOF(short, 2)
93 AC_CHECK_SIZEOF(int, 4)
94 AC_CHECK_SIZEOF(long, 4)
95 AC_CHECK_SIZEOF(long long, 0)
96 AC_CHECK_SIZEOF(float, 0)
97 AC_CHECK_SIZEOF(double, 8)
98 AC_CHECK_SIZEOF(long double, 0)
100 AC_DEFINE(FPREP_IEEE754, 1,
101 [Define for machines that have IEEE 754 floating point arithmetic,
102 the most common format today.])
114 AC_CHECK_FUNCS([strchr strrchr __setfpucw isinf isnan finite getpid feholdexcept])
119 AH_BOTTOM([#include <pref.h>])
122 AM_CONDITIONAL(unix, test x"$host_os" != x"msdos" )
123 AM_CONDITIONAL(msdos, test x"$host_os" = x"msdos" )
125 dnl This is needed otherwise --with-included-gettext fails
126 AH_BOTTOM([#include <locale.h>])
128 AC_ARG_ENABLE(debug, [ --enable-debug Turn on diagnostic features in the program])
129 if test x"$enable_debug" = x"yes" ; then
130 AC_DEFINE(DEBUGGING, 1, [Define to 1 if debugging is enabled.])
133 AC_CONFIG_FILES([Makefile gl/Makefile intl/Makefile po/Makefile.in])
135 AC_CONFIG_COMMANDS([pref.h],[
136 # Copy pref.h from pref.h.orig if prudent
137 if test ! -f pref.h; then
138 echo "creating pref.h"
139 cp $ac_top_srcdir/pref.h.orig pref.h
140 elif test "`ls -t pref.h.orig pref.h 2>/dev/null | sed 1q`" = pref.h.orig; then
141 echo "replacing pref.h with newer pref.h.orig"
142 cp $ac_top_srcdir/pref.h.orig pref.h
146 if test -f pref.h; then touch pref.h; fi
150 dnl configure.ac ends here