Use fseeko module from gnulib instead of our home-grown solution.
[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.3,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
19 AM_CONDITIONAL(cc_is_gcc, test x"$GCC" = x"yes" )
20
21 PSPP_CC_FOR_BUILD
22 PSPP_PERL
23
24 dnl Internationalization macros.
25 AM_GNU_GETTEXT([external], [need-ngettext])
26 AM_GNU_GETTEXT_VERSION([0.16.1])
27
28 dnl Checks for libraries.
29 AC_SYS_LARGEFILE
30 AC_CHECK_LIB(m, sin)
31 PSPP_LIBPLOT
32 PSPP_LC_PAPER
33 AM_CONDITIONAL(WITHCHARTS, test x"$with_libplot" != x"no")
34
35
36 AC_ARG_WITH(
37   gui, 
38   [AS_HELP_STRING([--without-gui], [don't build the PSPPIRE gui])])
39
40 if test x"$with_gui" != x"no" ; then 
41   PKG_CHECK_MODULES(GTK, gtk+-2.0 >= 2.8.0,,
42     [PSPP_REQUIRED_PREREQ([gtk+ 2.0 v2.8.0 or later (or use --without-gui)])])
43   PKG_CHECK_MODULES(GLADE, libglade-2.0 >= 2.6.0,,
44     [PSPP_REQUIRED_PREREQ([libglade 2.0 (or use --without-gui)])])
45 fi
46 AM_CONDITIONAL(WITHGUI, test x"$with_gui" != x"no")
47
48 AC_ARG_WITH(
49   gui_tools,
50   [AS_HELP_STRING([--with-gui-tools], [build the gui developer tools])])
51 if test x"$with_gui_tools" = x"yes" ; then 
52         PKG_CHECK_MODULES(GLADE_UI, gladeui-1.0)
53 fi
54 AM_CONDITIONAL(WITH_GUI_TOOLS, test x"$with_gui_tools" = x"yes")
55
56 AC_CHECK_LIB(gslcblas,main,,[PSPP_REQUIRED_PREREQ([libgslcblas])])
57 AC_CHECK_LIB(gsl, gsl_cdf_chisq_Q,,[PSPP_REQUIRED_PREREQ([libgsl (version 1.4 or later)])])
58
59 AC_CHECK_LIB(ncurses, tgetent)
60 AC_CHECK_HEADERS(termcap.h)
61
62 PSPP_READLINE
63
64 dnl Checks for header files.
65 AC_CHECK_HEADERS([sys/wait.h fpu_control.h ieeefp.h fenv.h])
66
67 # For gnulib.
68 gl_INIT
69
70 AC_C_INLINE
71
72 dnl  Dont use AC_TYPE_OFF_T --- it doesnt generate the HAVE_TYPE macro
73 AC_CHECK_TYPES(off_t) 
74 AC_CHECK_SIZEOF(float)
75 AC_CHECK_SIZEOF(double)
76 AC_CHECK_SIZEOF(long double)
77
78 AC_C_BIGENDIAN
79
80 AC_CHECK_FUNCS([__setfpucw fork execl execlp isinf isnan finite getpid feholdexcept fpsetmask popen round trunc])
81
82 AC_PROG_LN_S
83
84 dnl This is needed otherwise --with-included-gettext fails
85 AH_BOTTOM([#include <locale.h>])
86
87 AC_ARG_ENABLE(
88   debug, 
89   [AS_HELP_STRING([--enable-debug], 
90                   [Turn on diagnostic features in the program])])
91 if test x"$enable_debug" = x"yes"  ; then
92   AC_DEFINE(DEBUGGING, 1, [Define to 1 if debugging is enabled.])
93 fi
94
95 # iconv is required
96 if test "$am_cv_func_iconv" != "yes"; then
97    PSPP_REQUIRED_PREREQ([iconv (see http://www.gnu.org/software/libiconv/)])
98 fi
99
100 PSPP_CHECK_PREREQS
101
102 AC_CONFIG_FILES([Makefile gl/Makefile po/Makefile.in])
103
104 AC_OUTPUT
105 echo "PSPP configured successfully."
106
107 dnl configure.ac ends here