source: main/trunk/greenstone2/common-src/indexers/mg/configure.in@ 22058

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

Changes to makefiles to 1. incorporate USE_GDBM and USE_JDBM flags (and USE_SQLITE) in most places so that the DEFINES variable is set at all times. This is necessary to ensure that all classes that contain objects with gdbm and jdbm members are of a consistent size. Else we've had experience with Greenstone crashing with memory errors (to do with the similar ENABLE_indexer flags). 2. ENABLE_JDBM is now USE_JDBM. 3. Not everything works now. It still compiles the default way, but the disable-gdbm flag is causing trouble when compiling argdb in recpt since it uses that.

  • Property svn:executable set to *
  • Property svn:keywords set to Author Date Id Revision
File size: 4.5 KB
Line 
1dnl Process this file with autoconf to produce a configure script.
2AC_INIT(src/text/mgquery.c)
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=mg
12VERSION=1.2
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
39
40dnl
41dnl Set use of JDBM (enabled by default)
42dnl
43AC_ARG_ENABLE(jdbm, [ --disable-jdbm Disable JDBM compilation], USE_JDBM=$enableval, USE_JDBM=yes)
44if test $USE_JDBM = "yes" -o $USE_JDBM = "1" ; then
45 USE_JDBM=1
46 AC_DEFINE(USE_JDBM,[])
47else
48 USE_JDBM=0
49fi
50AC_SUBST(USE_JDBM)
51
52dnl
53dnl Set use of GDBM (enabled by default)
54dnl
55AC_ARG_ENABLE(gdbm, [ --disable-gdbm Disable GDBM compilation], USE_GDBM=$enableval, USE_GDBM=yes)
56if test $USE_GDBM = "yes" -o $USE_GDBM = "1" ; then
57 USE_GDBM=1
58 AC_DEFINE(USE_GDBM,[])
59else
60 USE_GDBM=0
61fi
62AC_SUBST(USE_GDBM)
63
64
65dnl Checks for programs.
66AC_PROG_CXX
67AC_PROG_AWK
68AC_PROG_YACC
69AC_PROG_CC
70AC_PROG_INSTALL
71AC_PROG_LN_S
72AC_PROG_MAKE_SET
73AC_PROG_RANLIB
74
75dnl Checks for typedefs, structures, and compiler characteristics.
76AC_AIX
77AC_ISC_POSIX
78AC_MINIX
79fp_C_PROTOTYPES
80AC_C_CONST
81AC_TYPE_OFF_T
82AC_TYPE_SIZE_T
83AC_HEADER_TIME
84AC_STRUCT_TM
85
86dnl --- This should be in the stdc checking -----------------
87if test "$ac_cv_prog_cc_stdc" = '-Xc'; then
88dnl The Pyramids running SMP_DC.OSx on MIPS r3000 chips with
89dnl /usr/opt/cc3.11/bin/cc treat -Xc as full ANSI mode - no POSIX or
90dnl XOPEN extensions (like popen).
91dnl Unfortunately -D_{XOPEN,POSIX}_SOURCE can't provide all that mg
92dnl needs. So drop back to -Xa
93AC_TRY_COMPILE(
94[#include <stdio.h>
95], [ FILE *rubbish = popen("yes", "r"); ],,
96[CC="`echo $CC | sed 's/-Xc/-Xa/'`" ac_cv_prog_cc_stdc='-Xa'])
97fi
98dnl ----------------------
99
100
101dnl Checks for libraries.
102dnl Replace `main' with a function in -lm:
103AC_CHECK_LIB(m, main)
104
105dnl Checks for header files.
106AC_HEADER_DIRENT
107AC_HEADER_STDC
108AC_CHECK_HEADERS(fcntl.h limits.h sys/time.h unistd.h string.h memory.h sys/procfs.h)
109AC_EGREP_HEADER(fread, stdio.h, AC_DEFINE(HAVE_FREAD_DECL))
110AC_EGREP_HEADER(fgetc, stdio.h, AC_DEFINE(HAVE_FGETC_DECL))
111AC_EGREP_HEADER(pr_brksize, sys/procfs.h, AC_DEFINE(HAVE_PR_BRKSIZE))
112
113dnl Checks for library functions.
114AC_FUNC_ALLOCA
115AC_PROG_GCC_TRADITIONAL
116AC_TYPE_SIGNAL
117AC_FUNC_VPRINTF
118AC_CHECK_FUNCS(ftime select strftime strtol getrusage times mallinfo setbuffer getpagesize)
119AC_REPLACE_FUNCS(ftruncate strstr strcasecmp)
120
121
122# *** Custom checking (based on GNU tar configure.in) ***
123# ---------------------------------------------------------------------------
124AC_MSG_CHECKING(for HP-UX needing gmalloc)
125if test "`(uname -s) 2> /dev/null`" = 'HP-UX'; then
126 AC_MSG_RESULT(yes)
127 AC_LIBOBJ(gmalloc)
128 AC_DEFINE(HAVE_VALLOC)
129else
130 AC_MSG_RESULT(no)
131 AC_CHECK_FUNCS(valloc)
132fi
133
134# we need to set an extended JNI path for Mac OS/Darwin, as jni.h is on
135# a non-standard Path
136# is there a better way to do this??
137AC_MSG_CHECKING(for OS to set JNI options)
138# set defaults
139JNIINC=""
140JNISUFFIX="so"
141JNIFLAGS="-shared"
142
143if test "`(uname -s) 2> /dev/null`" = 'Darwin'; then
144 AC_MSG_RESULT(Darwin)
145 JNIINC="-I/System/Library/Frameworks/JavaVM.framework/Headers/ "
146 JNISUFFIX="jnilib"
147 JNIFLAGS="-dynamiclib -fno-common -single_module -framework JavaVM"
148fi
149if test "`(uname -s) 2> /dev/null`" = 'SunOS'; then
150 AC_MSG_RESULT(Solaris)
151 JNIINC="-I\$(JAVA_HOME)/include/solaris "
152fi
153if test "`(uname -s) 2> /dev/null`" = 'Linux'; then
154 AC_MSG_RESULT(Linux)
155 JNIINC="-I\$(JAVA_HOME)/include/linux -I\$(JAVA_HOME)/include "
156fi
157
158AC_SUBST(JNIINC)
159AC_SUBST(JNISUFFIX)
160AC_SUBST(JNIFLAGS)
161
162fp_WITH_DMALLOC
163fp_WITH_REGEX
164
165# text for endianness
166AC_C_BIGENDIAN
167
168# ---------------------------------------------------------------------------
169if test "$ac_cv_func_alloca" = 'no'; then
170dnl support functions for alloca.c
171 AC_LIBOBJ(xmalloc)
172 AC_LIBOBJ(error)
173fi
174
175
176# ---------------------------------------------------------------------------
177
178AC_OUTPUT([Makefile src/text/Makefile lib/Makefile
179 jni/Makefile java/org/greenstone/mg/Makefile ],
180[test -z "$CONFIG_HEADERS" || echo timestamp > stamp-h])
181
182# To prevent timestamp problems causing bool_parser.c to be generated from bool_parser.y
183touch src/text/bool_parser.c
Note: See TracBrowser for help on using the repository browser.