1 | dnl Process this file with autoconf to produce a configure script.
|
---|
2 | AC_INIT(text/MGQuery.cpp)
|
---|
3 | AC_CONFIG_HEADER(config.h)
|
---|
4 |
|
---|
5 | dnl get $target_cpu, $target_vendor, and $target_os
|
---|
6 | dnl (as well as host_*)
|
---|
7 | AC_CANONICAL_SYSTEM
|
---|
8 | AC_ARG_PROGRAM
|
---|
9 |
|
---|
10 | dnl
|
---|
11 | PACKAGE=mgpp
|
---|
12 | VERSION=1.3
|
---|
13 |
|
---|
14 | AC_DEFINE_UNQUOTED(PACKAGE, "$PACKAGE")
|
---|
15 | AC_DEFINE_UNQUOTED(VERSION, "$VERSION")
|
---|
16 | AC_SUBST(PACKAGE)
|
---|
17 | AC_SUBST(VERSION)
|
---|
18 |
|
---|
19 | dnl
|
---|
20 | dnl Disable all Java compilation
|
---|
21 | dnl
|
---|
22 | AC_ARG_ENABLE(java, [ --disable-java Disable Java compilation], ENABLE_JAVA=$enableval, ENABLE_JAVA=yes)
|
---|
23 | if test $ENABLE_JAVA = "yes" -o $ENABLE_JAVA = "1" ; then
|
---|
24 | ENABLE_JAVA=1
|
---|
25 | if test "x$JAVA_HOME" != "x" ; then
|
---|
26 | echo "Detected JAVA_HOME is set, however this will not be used during compilation"
|
---|
27 | echo "To control the version of 'javac' and 'java' set environment variables JAVAC"
|
---|
28 | echo "and JAVA respectively"
|
---|
29 | export JAVA_HOME=
|
---|
30 | fi
|
---|
31 | else
|
---|
32 | ENABLE_JAVA=0
|
---|
33 | fi
|
---|
34 | AC_SUBST(ENABLE_JAVA)
|
---|
35 |
|
---|
36 | dnl AC_MSG_CHECKING(to see if architecture is 64-bit)
|
---|
37 | dnl arch_64bit=no
|
---|
38 | dnl case "$host_cpu" in
|
---|
39 | dnl x86_64) arch_64bit=yes ;;
|
---|
40 | dnl esac
|
---|
41 | if test -z "$ARCH_DEP_FLAGS" ; then
|
---|
42 | ARCH_DEP_FLAGS=
|
---|
43 | fi
|
---|
44 | AC_SUBST(ARCH_DEP_FLAGS)
|
---|
45 |
|
---|
46 | dnl
|
---|
47 | dnl disable compilation of accent folding stuff for mgpp (and one day mg)
|
---|
48 | dnl
|
---|
49 | AC_ARG_ENABLE(accentfold, [ --disable-accentfold Disable Accent Folding for MGPP], ENABLE_ACCENTFOLD=$enableval, ENABLE_ACCENTFOLD=yes)
|
---|
50 | if test $ENABLE_ACCENTFOLD = "yes" -o $ENABLE_ACCENTFOLD = "1" ; then
|
---|
51 | ENABLE_ACCENTFOLD=1
|
---|
52 | AC_DEFINE(ENABLE_ACCENTFOLD,[])
|
---|
53 | else
|
---|
54 | ENABLE_ACCENTFOLD=0
|
---|
55 | fi
|
---|
56 | AC_SUBST(ENABLE_ACCENTFOLD)
|
---|
57 |
|
---|
58 |
|
---|
59 | dnl Checks for programs.
|
---|
60 | AC_PROG_CXX
|
---|
61 | AC_PROG_AWK
|
---|
62 | AC_PROG_YACC
|
---|
63 | AC_PROG_CC
|
---|
64 | AC_PROG_INSTALL
|
---|
65 | AC_PROG_LN_S
|
---|
66 | AC_PROG_MAKE_SET
|
---|
67 | AC_PROG_RANLIB
|
---|
68 | if test $ENABLE_JAVA = "1" ; then
|
---|
69 | AC_PROG_JAVA
|
---|
70 | AC_PROG_JAVAC
|
---|
71 | fi
|
---|
72 |
|
---|
73 | dnl Checks for typedefs, structures, and compiler characteristics.
|
---|
74 | AC_AIX
|
---|
75 | AC_ISC_POSIX
|
---|
76 | AC_MINIX
|
---|
77 | fp_C_PROTOTYPES
|
---|
78 | AC_C_CONST
|
---|
79 | AC_TYPE_OFF_T
|
---|
80 | AC_TYPE_SIZE_T
|
---|
81 | AC_HEADER_TIME
|
---|
82 | AC_STRUCT_TM
|
---|
83 |
|
---|
84 | dnl
|
---|
85 | dnl look for unac package if not in standard location
|
---|
86 | dnl
|
---|
87 | dnl is it ok to use `pwd` like this??
|
---|
88 | AC_ARG_WITH(unac, [ --with-unac=dir Use local unac library and headers], UNAC_DIR=$withval, UNAC_DIR="`pwd`/../packages/unac")
|
---|
89 | AC_DEFINE_UNQUOTED(UNAC_DIR, "$UNAC_DIR")
|
---|
90 | AC_SUBST(UNAC_DIR)
|
---|
91 |
|
---|
92 | dnl
|
---|
93 | dnl look for libiconv package if not in standard location
|
---|
94 | dnl
|
---|
95 | #AC_ARG_WITH(unac, [ --with-libiconv-prefix=dir Use local libiconv library], LIBICONV_DIR=$withval)
|
---|
96 | #AC_DEFINE_UNQUOTED(LIBICONV_DIR, "$LIBICONV_DIR")
|
---|
97 | #AC_SUBST(LIBICONV_DIR)
|
---|
98 |
|
---|
99 |
|
---|
100 | dnl --- This should be in the stdc checking -----------------
|
---|
101 | if test "$ac_cv_prog_cc_stdc" = '-Xc'; then
|
---|
102 | dnl The Pyramids running SMP_DC.OSx on MIPS r3000 chips with
|
---|
103 | dnl /usr/opt/cc3.11/bin/cc treat -Xc as full ANSI mode - no POSIX or
|
---|
104 | dnl XOPEN extensions (like popen).
|
---|
105 | dnl Unfortunately -D_{XOPEN,POSIX}_SOURCE can't provide all that mg
|
---|
106 | dnl needs. So drop back to -Xa
|
---|
107 | AC_TRY_COMPILE(
|
---|
108 | [#include <stdio.h>
|
---|
109 | ], [ FILE *rubbish = popen("yes", "r"); ],,
|
---|
110 | [CC="`echo $CC | sed 's/-Xc/-Xa/'`" ac_cv_prog_cc_stdc='-Xa'])
|
---|
111 | fi
|
---|
112 | dnl ----------------------
|
---|
113 |
|
---|
114 |
|
---|
115 | dnl Checks for libraries.
|
---|
116 | dnl Replace `main' with a function in -lg:
|
---|
117 | AC_CHECK_LIB(g, main)
|
---|
118 | dnl Replace `main' with a function in -lm:
|
---|
119 | AC_CHECK_LIB(m, main)
|
---|
120 | dnl Replace `main' with a function in -lstdc++:
|
---|
121 | AC_CHECK_LIB(stdc++, main)
|
---|
122 | dnl Replace `main' with a function in -lcrypt:
|
---|
123 | AC_CHECK_LIB(crypt, main)
|
---|
124 | #if test $ENABLE_ACCENTFOLD = 1; then
|
---|
125 | #AC_HAVE_LIBRARY(iconv)
|
---|
126 | #fi
|
---|
127 |
|
---|
128 |
|
---|
129 | dnl Checks for header files.
|
---|
130 | AC_HEADER_DIRENT
|
---|
131 | AC_HEADER_STDC
|
---|
132 | AC_CHECK_HEADERS(fcntl.h limits.h sys/time.h unistd.h crypt.h string.h memory.h sys/procfs.h)
|
---|
133 | AC_EGREP_HEADER(fread, stdio.h, AC_DEFINE(HAVE_FREAD_DECL))
|
---|
134 | AC_EGREP_HEADER(fgetc, stdio.h, AC_DEFINE(HAVE_FGETC_DECL))
|
---|
135 | AC_EGREP_HEADER(pr_brksize, sys/procfs.h, AC_DEFINE(HAVE_PR_BRKSIZE))
|
---|
136 |
|
---|
137 | dnl Checks for library functions.
|
---|
138 | AC_FUNC_ALLOCA
|
---|
139 | AC_PROG_GCC_TRADITIONAL
|
---|
140 | AC_TYPE_SIGNAL
|
---|
141 | AC_FUNC_VPRINTF
|
---|
142 | AC_CHECK_FUNCS(ftime select strftime strtol getrusage times mallinfo setbuffer getpagesize strerror)
|
---|
143 | AC_REPLACE_FUNCS(ftruncate strstr strcasecmp)
|
---|
144 |
|
---|
145 |
|
---|
146 | dnl see if gettext is in libc. (try the textdomain() function).
|
---|
147 | AC_CHECK_FUNC(textdomain, AC_DEFINE(ENABLE_NLS ,1) )
|
---|
148 |
|
---|
149 | # we need to set an extended JNI path for Mac OS/Darwin, as jni.h is on
|
---|
150 | # a non-standard Path
|
---|
151 | # is there a better way to do this??
|
---|
152 | AC_MSG_CHECKING(for OS to set JNI options)
|
---|
153 | # set defaults
|
---|
154 | JNIINC=""
|
---|
155 | JNISUFFIX="so"
|
---|
156 | JNIFLAGS="-shared"
|
---|
157 |
|
---|
158 | if test "`(uname -s) 2> /dev/null`" = 'Darwin'; then
|
---|
159 | AC_MSG_RESULT(Darwin)
|
---|
160 | JNIINC="-I/System/Library/Frameworks/JavaVM.framework/Headers/ "
|
---|
161 | JNISUFFIX="jnilib"
|
---|
162 | JNIFLAGS="-dynamiclib -fno-common -single_module -framework JavaVM"
|
---|
163 | fi
|
---|
164 | if test "`(uname -s) 2> /dev/null`" = 'SunOS'; then
|
---|
165 | AC_MSG_RESULT(Solaris)
|
---|
166 | JNIINC="-I\$(JAVA_HOME)/include/solaris "
|
---|
167 | fi
|
---|
168 | if test "`(uname -s) 2> /dev/null`" = 'Linux'; then
|
---|
169 | AC_MSG_RESULT(Linux)
|
---|
170 | JNIINC="-I\$(JAVA_HOME)/include/linux -I\$(JAVA_HOME)/include "
|
---|
171 | fi
|
---|
172 |
|
---|
173 | AC_SUBST(JNIINC)
|
---|
174 | AC_SUBST(JNISUFFIX)
|
---|
175 | AC_SUBST(JNIFLAGS)
|
---|
176 |
|
---|
177 | # *** Custom checking (based on GNU tar configure.in) ***
|
---|
178 | # ---------------------------------------------------------------------------
|
---|
179 | AC_MSG_CHECKING(for HP-UX needing gmalloc)
|
---|
180 | if test "`(uname -s) 2> /dev/null`" = 'HP-UX'; then
|
---|
181 | AC_MSG_RESULT(yes)
|
---|
182 | AC_LIBOBJ(gmalloc)
|
---|
183 | AC_DEFINE(HAVE_VALLOC)
|
---|
184 | else
|
---|
185 | AC_MSG_RESULT(no)
|
---|
186 | AC_CHECK_FUNCS(valloc)
|
---|
187 | fi
|
---|
188 |
|
---|
189 | fp_WITH_DMALLOC
|
---|
190 | fp_WITH_REGEX
|
---|
191 | fp_WITH_GNU_READLINE
|
---|
192 |
|
---|
193 | # text for endianness
|
---|
194 | AC_C_BIGENDIAN
|
---|
195 |
|
---|
196 | # ---------------------------------------------------------------------------
|
---|
197 | if test "$ac_cv_func_alloca" = 'no'; then
|
---|
198 | dnl support functions for alloca.c
|
---|
199 | AC_LIBOBJ(xmalloc)
|
---|
200 | AC_LIBOBJ(error)
|
---|
201 | fi
|
---|
202 |
|
---|
203 |
|
---|
204 | # ---------------------------------------------------------------------------
|
---|
205 | # see if the user wants to override use of long long
|
---|
206 | AC_ARG_ENABLE(override-longlong,
|
---|
207 | [ --enable-override-longlong
|
---|
208 | overide use of long long with GCC],
|
---|
209 | AC_DEFINE(DISABLE_LONG_LONG))
|
---|
210 |
|
---|
211 |
|
---|
212 | # ---------------------------------------------------------------------------
|
---|
213 |
|
---|
214 | AC_OUTPUT([Makefile text/Makefile lib/Makefile
|
---|
215 | jni/Makefile java/org/greenstone/mgpp/Makefile],
|
---|
216 | [test -z "$CONFIG_HEADERS" || echo timestamp > stamp-h])
|
---|