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

Last change on this file since 22070 was 22070, checked in by ak19, 14 years ago

Undoing the commits of 22058 to the indexer folder: USE_GDBM, USE_JDBM are not relevant here (or USE_SQLITE).

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