Removed auto generated files from the repository
[pspp-builds.git] / configure.ac
1 dnl Process this file with autoconf to produce a configure script.
2
3 dnl Initialize.
4 AC_PREREQ(2.58)
5 AC_INIT(pspp, 0.3.1)
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 dnl Internationalization macros.
14 AM_GNU_GETTEXT
15 AM_GNU_GETTEXT_VERSION  dnl Prevents autoreconf complaint.
16
17 dnl Checks for libraries.
18 AC_CHECK_LIB(m, sin)
19 AC_CHECK_LIB(gmp, mpf_get_str, [LIBS="-lgmp $LIBS"],
20              [AC_CHECK_LIB(gmp, __gmpf_get_str, [LIBS="-lgmp $LIBS"])],
21              AC_MSG_ERROR(`You must install libgmp'))
22   
23 AC_CHECK_LIB(ncurses, tgetent, LIBS="-lncurses $LIBS" termcap=yes,
24   AC_CHECK_LIB(termcap, tgetent, LIBS="-ltermcap $LIBS" termcap=yes,
25                termcap=no))
26 if test "$termcap" = yes; then
27   AC_CHECK_HEADERS(termcap.h)
28   AC_DEFINE(HAVE_LIBTERMCAP, 1, 
29         [Define if you have the termcap library (-ltermcap).])
30 fi
31
32 AC_CHECK_LIB(readline, readline)
33 if test "$ac_cv_lib_readline_readline" = yes; then
34   AC_CHECK_HEADERS(readline/readline.h)
35   AC_CHECK_LIB(readline, add_history, history=yes,
36     AC_CHECK_LIB(history, add_history, LIBS="-lhistory" history=yes,
37                  history=no))
38   if test "$history" = yes; then
39     AC_CHECK_HEADERS(readline/history.h)
40     AC_DEFINE(HAVE_LIBHISTORY, 1,
41         [Define if you have the history library (-lhistory).])
42   fi
43 fi
44
45 dnl Checks for header files.
46 AC_CHECK_HEADERS([limits.h memory.h sys/stat.h sys/time.h sys/types.h \
47                   fpu_control.h sys/mman.h sys/wait.h ieeefp.h fenv.h])
48 AC_HEADER_STAT
49 AC_HEADER_STDC
50 AC_HEADER_TIME
51
52 AC_C_CONST
53 AC_C_INLINE
54 AC_TYPE_SIZE_T
55 AC_STRUCT_TM
56
57 AC_CHECK_SIZEOF(short, 2)
58 AC_CHECK_SIZEOF(int, 4)
59 AC_CHECK_SIZEOF(long, 4)
60 AC_CHECK_SIZEOF(long long, 0)
61 AC_CHECK_SIZEOF(float, 0)
62 AC_CHECK_SIZEOF(double, 8)
63 AC_CHECK_SIZEOF(long double, 0)
64
65 AC_DEFINE(FPREP_IEEE754, 1,
66         [Define for machines that have IEEE 754 floating point arithmetic,
67          the most common format today.])
68
69 AC_C_BIGENDIAN
70
71 BLP_IS_SPRINTF_GOOD
72 BLP_INT_DIGITS
73 BLP_RANDOM
74
75 AC_FUNC_ALLOCA
76 AC_FUNC_MEMCMP
77 AC_FUNC_VPRINTF
78 AC_REPLACE_FUNCS([memmove memset stpcpy strpbrk strerror strtol strtoul \
79                   memchr getline getdelim strcasecmp strncasecmp memmem \
80                   strtok_r])
81 AC_CHECK_FUNCS([gethostname strstr strtod __setfpucw isinf isnan finite \
82                 getpid feholdexcept])
83
84 AC_PROG_LN_S
85
86 dnl This must be after other tests so warnings don't provoke errors above.
87 if test "$ac_cv_c_compiler_gnu" = yes; then
88         CFLAGS="-g -Wall -W -Wno-uninitialized -Wwrite-strings \
89 -Wstrict-prototypes -Wpointer-arith -Wno-sign-compare"
90         if test "$CC_OPTIONS" != ""; then
91                 CFLAGS="$CFLAGS $CC_OPTIONS"
92         fi
93 fi
94 AC_SUBST(CFLAGS)
95
96 AH_BOTTOM([#include <pref.h>])
97
98 AC_CONFIG_FILES([Makefile po/Makefile.in m4/Makefile intl/Makefile
99                  lib/Makefile lib/julcal/Makefile lib/misc/Makefile 
100                  lib/dcdflib/Makefile doc/Makefile src/Makefile 
101                  config/Makefile tests/Makefile])
102 AC_CONFIG_COMMANDS([pref.h],[
103            # Copy pref.h from pref.h.orig if prudent
104            if test ! -f pref.h; then
105              echo "creating pref.h"
106              cp $ac_given_srcdir/pref.h.orig pref.h
107            elif test "`ls -t pref.h.orig pref.h 2>/dev/null | sed 1q`" = pref.h.orig; then
108              echo "replacing pref.h with newer pref.h.orig"
109              cp $ac_given_srcdir/pref.h.orig pref.h
110            else
111              echo "pref.h exists"
112            fi
113            if test -f pref.h; then touch pref.h; fi
114           ])
115 AC_OUTPUT
116
117 dnl configure.ac ends here