root/indexers/trunk/mgpp/configure.in @ 18598

Revision 18598, 5.1 KB (checked in by oranfry, 11 years ago)

changing jni include path to work on newer linux distros

  • 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
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
75
76dnl --- This should be in the stdc checking -----------------
77if test "$ac_cv_prog_cc_stdc" = '-Xc'; then
78dnl The Pyramids running SMP_DC.OSx on MIPS r3000 chips with
79dnl /usr/opt/cc3.11/bin/cc treat -Xc as full ANSI mode - no POSIX or
80dnl XOPEN extensions (like popen).
81dnl Unfortunately -D_{XOPEN,POSIX}_SOURCE can't provide all that mg
82dnl needs. So drop back to -Xa
83AC_TRY_COMPILE(
84[#include <stdio.h>
85], [ FILE *rubbish = popen("yes", "r"); ],,
86[CC="`echo $CC | sed 's/-Xc/-Xa/'`"    ac_cv_prog_cc_stdc='-Xa'])
87fi
88dnl ----------------------
89
90
91dnl Checks for libraries.
92dnl Replace `main' with a function in -lg:
93AC_CHECK_LIB(g, main)
94dnl Replace `main' with a function in -lm:
95AC_CHECK_LIB(m, main)
96dnl Replace `main' with a function in -lstdc++:
97AC_CHECK_LIB(stdc++, main)
98dnl Replace `main' with a function in -lcrypt:
99AC_CHECK_LIB(crypt, main)
100if test $ENABLE_ACCENTFOLD = 1; then
101AC_HAVE_LIBRARY(iconv)
102fi
103
104
105dnl Checks for header files.
106AC_HEADER_DIRENT
107AC_HEADER_STDC
108AC_CHECK_HEADERS(fcntl.h limits.h sys/time.h unistd.h crypt.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 strerror)
119AC_REPLACE_FUNCS(ftruncate strstr strcasecmp)
120
121
122dnl see if gettext is in libc. (try the textdomain() function).
123AC_CHECK_FUNC(textdomain, AC_DEFINE(ENABLE_NLS ,1) )
124
125# we need to set an extended JNI path for Mac OS/Darwin, as jni.h is on
126# a non-standard Path
127# is there a better way to do this??
128AC_MSG_CHECKING(for OS to set JNI options)
129# set defaults
130JNIINC=""
131JNISUFFIX="so"
132JNIFLAGS="-shared"
133
134if test "`(uname -s) 2> /dev/null`" = 'Darwin'; then
135  AC_MSG_RESULT(Darwin)
136  JNIINC="-I/System/Library/Frameworks/JavaVM.framework/Headers/ "
137  JNISUFFIX="jnilib"
138  JNIFLAGS="-dynamiclib -fno-common -single_module -framework JavaVM"
139fi
140if test "`(uname -s) 2> /dev/null`" = 'SunOS'; then
141  AC_MSG_RESULT(Solaris)
142  JNIINC="-I\$(JAVA_HOME)/include/solaris "
143fi
144if test "`(uname -s) 2> /dev/null`" = 'Linux'; then
145  AC_MSG_RESULT(Linux)
146  JNIINC="-I\$(JAVA_HOME)/include/linux -I\$(JAVA_HOME)/include "
147fi
148
149AC_SUBST(JNIINC)
150AC_SUBST(JNISUFFIX)
151AC_SUBST(JNIFLAGS)
152
153# *** Custom checking (based on GNU tar configure.in) ***
154# ---------------------------------------------------------------------------
155AC_MSG_CHECKING(for HP-UX needing gmalloc)
156if test "`(uname -s) 2> /dev/null`" = 'HP-UX'; then
157  AC_MSG_RESULT(yes)
158  AC_LIBOBJ(gmalloc)
159  AC_DEFINE(HAVE_VALLOC)
160else
161  AC_MSG_RESULT(no)
162  AC_CHECK_FUNCS(valloc)
163fi
164
165fp_WITH_DMALLOC
166fp_WITH_REGEX
167fp_WITH_GNU_READLINE
168
169# text for endianness
170AC_C_BIGENDIAN
171
172# ---------------------------------------------------------------------------
173if test "$ac_cv_func_alloca" = 'no'; then
174dnl    support functions for alloca.c
175  AC_LIBOBJ(xmalloc)
176  AC_LIBOBJ(error)
177fi
178
179
180# ---------------------------------------------------------------------------
181# see if the user wants to override use of long long
182AC_ARG_ENABLE(override-longlong,
183[  --enable-override-longlong
184                          overide use of long long with GCC],
185  AC_DEFINE(DISABLE_LONG_LONG))
186
187
188# ---------------------------------------------------------------------------
189
190AC_OUTPUT([Makefile text/Makefile lib/Makefile
191   jni/Makefile java/org/greenstone/mgpp/Makefile],
192[test -z "$CONFIG_HEADERS" || echo timestamp > stamp-h])
Note: See TracBrowser for help on using the browser.