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

Last change on this file since 23356 was 23356, checked in by sjm84, 13 years ago

Updated several configure scripts and Makefiles to make use of the JAVA, JAVAC and JAVACFLAGS environment variables, also added a --disable-java option to several of the configure scripts

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