Remove BLP_INT_DIGITS. Now we use the intprops.h header file instead.
[pspp-builds.git] / configure.ac
1 0dnl Process this file with autoconf to produce a configure script.
2
3 dnl Initialize.
4 AX_PREREQ(2.57)
5 AC_INIT(pspp, 0.4.1,bug-gnu-pspp@gnu.org)
6 AC_CONFIG_HEADERS([config.h])
7 AM_INIT_AUTOMAKE
8
9 dnl Checks for programs.
10 AC_GNU_SOURCE
11 AC_PROG_CC
12 AM_PROG_CC_C_O
13 AC_PROG_RANLIB
14 gl_EARLY
15
16 AM_CONDITIONAL(cc_is_gcc, test x"$GCC" = x"yes" )
17
18
19 dnl Check that Perl is available.
20 AC_PATH_PROG([PERL], perl, no)
21 AC_SUBST([PERL])dnl
22 if test "$PERL" = no; then
23   AC_MSG_ERROR([perl is not found])
24 fi
25 $PERL -e 'require 5.005_03;' || {
26    AC_MSG_ERROR([Perl 5.005_03 or better is required])
27 }
28
29 dnl Internationalization macros.
30 AM_GNU_GETTEXT
31 AM_GNU_GETTEXT_VERSION([0.14.5])
32
33 dnl Checks for libraries.
34 AC_SYS_LARGEFILE
35 AC_FUNC_FSEEKO
36 AC_CHECK_LIB(m, sin)
37 AC_ARG_WITH(libplot, [  --without-libplot         don't compile in support of charts (using libplot)])
38
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)])
42         )
43 fi
44 AM_CONDITIONAL(WITHCHARTS, test x"$with_libplot" != x"no")
45
46
47 AC_ARG_WITH(gui, [  --without-gui         don't build the PSPPIRE gui])
48
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)
52 fi
53 AM_CONDITIONAL(WITHGUI, test x"$with_gui" != x"no")
54
55
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>
60 #include <unistd.h>
61 off_t x = 0;
62 int main (void) 
63
64   lseek (0, 1, 2);
65   return 0;
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'.])])
70
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]))
74
75 AC_CHECK_LIB(ncurses, tgetent)
76 AC_CHECK_HEADERS(termcap.h)
77
78 PSPP_READLINE
79
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] )
83
84 # For gnulib.
85 gl_INIT
86
87 AC_C_CONST
88 AC_C_INLINE
89
90 dnl  Dont use AC_TYPE_OFF_T --- it doesnt generate the HAVE_TYPE macro
91 AC_CHECK_TYPES(off_t) 
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)
99
100 AC_DEFINE(FPREP_IEEE754, 1,
101         [Define for machines that have IEEE 754 floating point arithmetic,
102          the most common format today.])
103
104 AC_C_BIGENDIAN
105
106 AC_FUNC_VPRINTF
107 AC_CHECK_FUNCS([strchr strrchr __setfpucw isinf isnan finite getpid feholdexcept])
108
109 AC_PROG_LN_S
110
111
112 AH_BOTTOM([#include <pref.h>])
113
114
115 AM_CONDITIONAL(unix, test x"$host_os" != x"msdos" )
116 AM_CONDITIONAL(msdos, test x"$host_os" = x"msdos" )
117
118 dnl This is needed otherwise --with-included-gettext fails
119 AH_BOTTOM([#include <locale.h>])
120
121 AC_ARG_ENABLE(debug, [  --enable-debug          Turn on diagnostic features in the program])
122 if test x"$enable_debug" = x"yes"  ; then
123   AC_DEFINE(DEBUGGING, 1, [Define to 1 if debugging is enabled.])
124 fi
125
126 AC_CONFIG_FILES([Makefile gl/Makefile intl/Makefile po/Makefile.in])
127
128 AC_CONFIG_COMMANDS([pref.h],[
129            # Copy pref.h from pref.h.orig if prudent
130            if test ! -f pref.h; then
131              echo "creating pref.h"
132              cp $ac_top_srcdir/pref.h.orig pref.h
133            elif test "`ls -t pref.h.orig pref.h 2>/dev/null | sed 1q`" = pref.h.orig; then
134              echo "replacing pref.h with newer pref.h.orig"
135              cp $ac_top_srcdir/pref.h.orig pref.h
136            else
137              echo "pref.h exists"
138            fi
139            if test -f pref.h; then touch pref.h; fi
140           ])
141 AC_OUTPUT
142
143 dnl configure.ac ends here