Fixed the calculation of percentiles and added --syntax and --algorithm options
[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.57)
5 AC_INIT(pspp, 0.3.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
13 AM_CONDITIONAL(cc_is_gcc, test x"$GCC" = x"yes" )
14
15
16
17 dnl Internationalization macros.
18 AM_GNU_GETTEXT
19 AM_GNU_GETTEXT_VERSION  dnl Prevents autoreconf complaint.
20
21 dnl Checks for libraries.
22 AC_CHECK_LIB(m, sin)
23 AC_CHECK_LIB(gmp, mpf_get_str,,
24         AC_CHECK_LIB(gmp, __gmpf_get_str,,
25           AC_MSG_ERROR([You must install libgmp])
26         )
27 )
28
29 AC_CHECK_LIB(gslcblas,main,,AC_MSG_ERROR([You must install libgslcblas]))
30 AC_CHECK_LIB(gsl,gsl_set_error_handler,,AC_MSG_ERROR([You must install libgsl]))
31
32 AC_CHECK_FUNC(getopt_long,,
33         AC_MSG_ERROR(`This application depends upon getopt_long'))
34
35 AC_CHECK_LIB(ncurses, tgetent, LIBS="-lncurses $LIBS" termcap=yes,
36   AC_CHECK_LIB(termcap, tgetent, LIBS="-ltermcap $LIBS" termcap=yes,
37                termcap=no))
38 if test "$termcap" = yes; then
39   AC_CHECK_HEADERS(termcap.h)
40   AC_DEFINE(HAVE_LIBTERMCAP, 1, 
41         [Define if you have the termcap library (-ltermcap).])
42 fi
43
44 AC_CHECK_LIB(readline, readline)
45 if test "$ac_cv_lib_readline_readline" = yes; then
46   AC_CHECK_HEADERS(readline/readline.h)
47   AC_CHECK_LIB(readline, add_history, history=yes,
48     AC_CHECK_LIB(history, add_history, LIBS="-lhistory" history=yes,
49                  history=no))
50   if test "$history" = yes; then
51     AC_CHECK_HEADERS(readline/history.h)
52     AC_DEFINE(HAVE_LIBHISTORY, 1,
53         [Define if you have the history library (-lhistory).])
54   fi
55 fi
56
57 dnl Checks for header files.
58 AC_CHECK_HEADERS([limits.h memory.h sys/stat.h sys/time.h sys/types.h \
59                   fpu_control.h sys/mman.h sys/wait.h ieeefp.h fenv.h])
60 AC_HEADER_STAT
61 AC_HEADER_STDC
62 AC_HEADER_TIME
63
64 AC_C_CONST
65 AC_C_INLINE
66 AC_TYPE_SIZE_T
67 AC_STRUCT_TM
68
69 AC_CHECK_SIZEOF(short, 2)
70 AC_CHECK_SIZEOF(int, 4)
71 AC_CHECK_SIZEOF(long, 4)
72 AC_CHECK_SIZEOF(long long, 0)
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 BLP_IS_SPRINTF_GOOD
84 BLP_INT_DIGITS
85 BLP_RANDOM
86
87 AC_FUNC_ALLOCA
88 AC_FUNC_MEMCMP
89 AC_FUNC_VPRINTF
90 AC_REPLACE_FUNCS([memmove memset stpcpy strpbrk strerror strtol strtoul \
91                   memchr getline getdelim strcasecmp strncasecmp memmem \
92                   strtok_r])
93 AC_CHECK_FUNCS([gethostname strstr strtod __setfpucw isinf isnan finite \
94                 getpid feholdexcept mkdtemp posix_fadvise])
95
96 AC_PROG_LN_S
97
98
99 AH_BOTTOM([#include <pref.h>])
100
101
102 AM_CONDITIONAL(unix, test x"$host_os" != x"msdos" )
103 AM_CONDITIONAL(msdos, test x"$host_os" == x"msdos" )
104
105 dnl This is needed otherwise --with-included-gettext fails
106 AH_BOTTOM([#include <locale.h>])
107
108 AC_ARG_ENABLE(debug, [  --enable-debug          Turn on diagnostic features in the program])
109 if test x"$enable_debug" = x"yes"  ; then
110   AC_DEFINE(DEBUGGING, 1, [Define to 1 if debugging is enabled.])
111 fi
112
113 AC_CONFIG_FILES([Makefile po/Makefile.in m4/Makefile 
114                  lib/Makefile lib/julcal/Makefile lib/misc/Makefile 
115                  doc/Makefile src/Makefile 
116                  config/Makefile tests/Makefile])
117 AC_CONFIG_COMMANDS([pref.h],[
118            # Copy pref.h from pref.h.orig if prudent
119            if test ! -f pref.h; then
120              echo "creating pref.h"
121              cp $ac_given_srcdir/pref.h.orig pref.h
122            elif test "`ls -t pref.h.orig pref.h 2>/dev/null | sed 1q`" = pref.h.orig; then
123              echo "replacing pref.h with newer pref.h.orig"
124              cp $ac_given_srcdir/pref.h.orig pref.h
125            else
126              echo "pref.h exists"
127            fi
128            if test -f pref.h; then touch pref.h; fi
129           ])
130 AC_OUTPUT(intl/Makefile)
131
132 dnl configure.ac ends here