1 dnl Process this file with autoconf to produce a configure script.
5 AC_INIT([pspp],[0.4.3],[bug-gnu-pspp@gnu.org])
6 AC_CONFIG_HEADERS([config.h])
9 dnl Checks for programs.
18 PSPP_ENABLE_OPTION(-Wdeclaration-after-statement)
20 AM_CONDITIONAL(cc_is_gcc, test x"$GCC" = x"yes" )
25 dnl Internationalization macros.
26 AM_GNU_GETTEXT([external], [need-ngettext])
27 AM_GNU_GETTEXT_VERSION([0.16.1])
29 dnl Checks for libraries.
34 AM_CONDITIONAL(WITHCHARTS, test x"$with_libplot" != x"no")
39 [AS_HELP_STRING([--without-gui], [don't build the PSPPIRE gui])])
41 if test x"$with_gui" != x"no" ; then
42 PKG_CHECK_MODULES(GTK, gtk+-2.0 >= 2.12.0,,
43 [PSPP_REQUIRED_PREREQ([gtk+ 2.0 v2.12.0 or later (or use --without-gui)])])
44 PKG_CHECK_MODULES(GLADE, libglade-2.0 >= 2.6.0,,
45 [PSPP_REQUIRED_PREREQ([libglade 2.0 (or use --without-gui)])])
47 AM_CONDITIONAL(WITHGUI, test x"$with_gui" != x"no")
50 dnl Checks needed for psql reader
52 dnl The 8.x series postgres tarballs installs with a default prefix of
53 dnl /usr/local/pgsql whereas, OSes (such as debian) install into /usr .
55 dnl If the libpq.so file is in a non standard path, (one which the linker
56 dnl doesn't search) then we must set the PG_LDFLAGS to -R/usr/wherever/
57 dnl However, if the system happens to have more than one version of other
58 dnl dependent libraries (eg. libgtk) in different standard paths. (eg:
59 dnl /usr and /usr/local) then the wrong one may get linked.
61 dnl To overcome this, we first check for libpq in the standard places, and
62 dnl only set PG_LDFLAGS if it's not found.
65 AC_CHECK_LIB([pq], [PQexec], [libpq_in_std_lib_path=yes])
67 AC_ARG_VAR([PG_CONFIG], [Full pathname of the pg_config program shipped with Postgresql])
68 AC_PATH_PROG([PG_CONFIG], [pg_config], [], [$PATH:/usr/local/pgsql/bin:/usr/pgsql/bin])
69 if test -n "$PG_CONFIG" ; then
71 AC_DEFINE([PSQL_SUPPORT], 1,
72 [Define to 1 if building in support for reading from postgres databases.])
73 PG_CFLAGS=-I`$PG_CONFIG --includedir`
76 if test "x$libpq_in_std_lib_path" != x"yes" ; then
77 PG_LDFLAGS="-L`$PG_CONFIG --libdir` -R`$PG_CONFIG --libdir`"
83 PKG_CHECK_EXISTS(libssl,
84 AC_DEFINE([USE_SSL],1,
85 [Define to 1 if the openssl library is present.])
88 AM_CONDITIONAL(PSQL_SUPPORT, test -n "$PG_CONFIG")
90 dnl Checks needed for gnumeric reader
92 PKG_CHECK_MODULES(LIBXML2, libxml-2.0,,
93 [PSPP_OPTIONAL_PREREQ([libxml2]); gnm_support=no;]);
94 AC_SEARCH_LIBS(gzopen,z,,[PSPP_OPTIONAL_PREREQ([zlib]); gnm_support=no;])
95 AC_CHECK_HEADERS(zlib.h,,[PSPP_OPTIONAL_PREREQ([zlib]); gnm_support=no;])
97 if test x"$gnm_support" = x"yes" ; then
98 AC_DEFINE([GNM_SUPPORT], 1,
99 [Define to 1 if building in support for reading Gnumeric files.])
101 AM_CONDITIONAL(GNM_SUPPORT, test x"$gnm_support" = x"yes")
105 [AS_HELP_STRING([--with-gui-tools], [build the gui developer tools])])
106 if test x"$with_gui_tools" = x"yes" ; then
107 PKG_CHECK_MODULES(GLADE_UI, gladeui-1.0)
109 AM_CONDITIONAL(WITH_GUI_TOOLS, test x"$with_gui_tools" = x"yes")
111 AC_CHECK_LIB(gslcblas,main,,[PSPP_REQUIRED_PREREQ([libgslcblas])])
112 AC_CHECK_LIB(gsl, gsl_cdf_chisq_Q,,[PSPP_REQUIRED_PREREQ([libgsl (version 1.4 or later)])])
114 AC_CHECK_LIB(ncurses, tgetent)
115 AC_CHECK_HEADERS(termcap.h)
119 dnl Checks for header files.
120 AC_CHECK_HEADERS([sys/wait.h fpu_control.h ieeefp.h fenv.h])
127 AC_CHECK_SIZEOF(double)
131 AC_CHECK_FUNCS([__setfpucw fork execl execlp isinf isnan finite getpid feholdexcept fpsetmask popen round])
137 [AS_HELP_STRING([--enable-debug],
138 [Turn on diagnostic features in the program])])
139 if test x"$enable_debug" = x"yes" ; then
140 AC_DEFINE(DEBUGGING, 1, [Define to 1 if debugging is enabled.])
144 if test "$am_cv_func_iconv" != "yes"; then
145 PSPP_REQUIRED_PREREQ([iconv (see http://www.gnu.org/software/libiconv/)])
150 AC_CONFIG_FILES([Makefile gl/Makefile po/Makefile.in])
153 echo "PSPP configured successfully."
155 dnl configure.ac ends here