source: main/trunk/greenstone2/common-src/indexers/mgpp/configure.in@ 23356

Last change on this file since 23356 was 23356, checked in by sjm84, 13 years ago

Updated several configure scripts and Makefiles to make use of the JAVA, JAVAC and JAVACFLAGS environment variables, also added a --disable-java option to several of the configure scripts

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