source: indexers/trunk/mgpp/configure.in@ 20832

Last change on this file since 20832 was 20832, checked in by ak19, 15 years ago

Libiconv and libexpat are now compiled up during configure time rather than during Make. Committing files affected with adjustments related to this change, of which setup.bash adds the lib folder in common-src packages (generated by compiling libiconv) to the LD_LIBRARY_PATH for now. The last is probably not necessary since libiconv is generated as a static library (not shared).

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