* Makefile.am (AUTOMAKE_OPTIONS): Require Automake 1.10 (or
[pspp-builds.git] / configure.ac
1 dnl Process this file with autoconf to produce a configure script.
2
3 dnl Initialize.
4 AX_PREREQ(2.60)
5 AC_INIT(pspp, 0.4.2,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 gl_EARLY
13 AM_PROG_CC_C_O
14 AC_LIBTOOL_DLOPEN
15 AC_PROG_LIBTOOL
16
17 PSPP_ENABLE_OPTION(-Wdeclaration-after-statement)
18 PSPP_ENABLE_OPTION(-mieee)
19
20 AM_CONDITIONAL(cc_is_gcc, test x"$GCC" = x"yes" )
21
22 PSPP_CC_FOR_BUILD
23 PSPP_PERL
24
25 dnl Internationalization macros.
26 AM_GNU_GETTEXT([external], [need-ngettext])
27 AM_GNU_GETTEXT_VERSION([0.16.1])
28
29 dnl Checks for libraries.
30 AC_SYS_LARGEFILE
31 AC_FUNC_FSEEKO
32 AC_CHECK_LIB(m, sin)
33 PSPP_LIBPLOT
34 AM_CONDITIONAL(WITHCHARTS, test x"$with_libplot" != x"no")
35
36
37 AC_ARG_WITH(gui, [  --without-gui         don't build the PSPPIRE gui])
38
39 if test x"$with_gui" != x"no" ; then 
40         PKG_CHECK_MODULES(GTK, gtk+-2.0 >= 2.6.0)
41         PKG_CHECK_MODULES(GLADE, libglade-2.0)
42 fi
43 AM_CONDITIONAL(WITHGUI, test x"$with_gui" != x"no")
44
45 AC_ARG_WITH(gui_tools, [  --with-gui-tools          build the gui developer tools])
46 if test x"$with_gui_tools" = x"yes" ; then 
47         PKG_CHECK_MODULES(GLADE_UI, libgladeui-1.0)
48 fi
49 AM_CONDITIONAL(WITH_GUI_TOOLS, test x"$with_gui_tools" = x"yes")
50
51 PSPP_OFF_T
52
53 AC_CHECK_LIB(gslcblas,main,,[PSPP_REQUIRED_PREREQ([libgslcblas])])
54 AC_CHECK_LIB(gsl, gsl_cdf_chisq_Q,,[PSPP_REQUIRED_PREREQ([libgsl (version 1.4 or later)])])
55
56 AC_CHECK_LIB(ncurses, tgetent)
57 AC_CHECK_HEADERS(termcap.h)
58
59 PSPP_READLINE
60
61 dnl Checks for header files.
62 AC_CHECK_HEADERS([limits.h memory.h sys/stat.h sys/time.h sys/types.h \
63                   fpu_control.h sys/mman.h sys/wait.h ieeefp.h fenv.h] )
64
65 # For gnulib.
66 gl_INIT
67
68 AC_C_CONST
69 AC_C_INLINE
70
71 dnl  Dont use AC_TYPE_OFF_T --- it doesnt generate the HAVE_TYPE macro
72 AC_CHECK_TYPES(off_t) 
73 AC_CHECK_SIZEOF(float, 0)
74 AC_CHECK_SIZEOF(double, 8)
75 AC_CHECK_SIZEOF(long double, 0)
76
77 AC_DEFINE(FPREP_IEEE754, 1,
78         [Define for machines that have IEEE 754 floating point arithmetic,
79          the most common format today.])
80
81 AC_C_BIGENDIAN
82
83 AC_FUNC_VPRINTF
84 AC_CHECK_FUNCS([__setfpucw execl fork isinf isnan finite getpid feholdexcept fpsetmask popen round trunc])
85
86 AC_PROG_LN_S
87
88 dnl This is needed otherwise --with-included-gettext fails
89 AH_BOTTOM([#include <locale.h>])
90
91 AC_ARG_ENABLE(debug, [  --enable-debug          Turn on diagnostic features in the program])
92 if test x"$enable_debug" = x"yes"  ; then
93   AC_DEFINE(DEBUGGING, 1, [Define to 1 if debugging is enabled.])
94 fi
95
96 # iconv is required
97 if test "$am_cv_func_iconv" != "yes"; then
98    PSPP_REQUIRED_PREREQ([iconv (see http://www.gnu.org/software/libiconv/)])
99 fi
100
101 PSPP_CHECK_PREREQS
102
103 AC_CONFIG_FILES([Makefile gl/Makefile po/Makefile.in])
104
105 AC_OUTPUT
106
107 dnl configure.ac ends here