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

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

merged 64_bit_Greenstone branch into trunk, rev 25139

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