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

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

Configure files updated to correctly set all the variables that can be ENABLED/DISABLED.

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