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

Last change on this file since 25148 was 25148, checked in by kjdon, 12 years ago

getting greenstone to work properly on 64 bit machines. COMPAT32BITFLAGS is no more. Don't need -m32 option. Instead, have ARCH_DEP_FLAGS, which gets -fPIC on 64 bit machines.

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