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

Last change on this file since 30866 was 30866, checked in by ak19, 8 years ago

GSDLOS variable wasn't being set in configure.in and hence wasn't propagating into mgpp/jni and mgpp/text, and the jni/Makefile.in wasn;t making reference to it either.

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