root/main/trunk/greenstone2/common-src/indexers/mgpp/configure.in @ 25170

Revision 25170, 6.0 KB (checked in by jmt12, 7 years ago)

Propagating ARCH_DEP_FLAGS. It appears that you need to at least reissue the AC_SUBST command even for variables that have been exported in 'higher' configures

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