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

Revision 10917, 4.0 KB (checked in by kjdon, 14 years ago)

removed java_home/include/linux from include path in makefile, made the configure script include this in JNIINC for linux, and use JAVA_HOME/include/solaris for solaris machines

  • 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)
4AC_ARG_PROGRAM
5
6dnl
7PACKAGE=mgpp
8VERSION=1.3
9
10LDFLAGS=
11
12AC_DEFINE_UNQUOTED(PACKAGE, "$PACKAGE")
13AC_DEFINE_UNQUOTED(VERSION, "$VERSION")
14AC_SUBST(PACKAGE)
15AC_SUBST(VERSION)
16
17dnl Checks for programs.
18AC_PROG_CXX
19AC_PROG_AWK
20AC_PROG_YACC
21AC_PROG_CC
22AC_PROG_INSTALL
23AC_PROG_LN_S
24AC_PROG_MAKE_SET
25AC_PROG_RANLIB
26
27dnl Checks for typedefs, structures, and compiler characteristics.
28AC_AIX
29AC_ISC_POSIX
30AC_MINIX
31fp_C_PROTOTYPES
32AC_C_CONST
33AC_TYPE_OFF_T
34AC_TYPE_SIZE_T
35AC_HEADER_TIME
36AC_STRUCT_TM
37
38dnl --- This should be in the stdc checking -----------------
39if test "$ac_cv_prog_cc_stdc" = '-Xc'; then
40dnl The Pyramids running SMP_DC.OSx on MIPS r3000 chips with
41dnl /usr/opt/cc3.11/bin/cc treat -Xc as full ANSI mode - no POSIX or
42dnl XOPEN extensions (like popen).
43dnl Unfortunately -D_{XOPEN,POSIX}_SOURCE can't provide all that mg
44dnl needs. So drop back to -Xa
45AC_TRY_COMPILE(
46[#include <stdio.h>
47], [ FILE *rubbish = popen("yes", "r"); ],,
48[CC="`echo $CC | sed 's/-Xc/-Xa/'`"    ac_cv_prog_cc_stdc='-Xa'])
49fi
50dnl ----------------------
51
52
53dnl Checks for libraries.
54dnl Replace `main' with a function in -lg:
55AC_CHECK_LIB(g, main)
56dnl Replace `main' with a function in -lm:
57AC_CHECK_LIB(m, main)
58dnl Replace `main' with a function in -lstdc++:
59AC_CHECK_LIB(stdc++, main)
60dnl Replace `main' with a function in -lcrypt:
61AC_CHECK_LIB(crypt, main)
62
63dnl Checks for header files.
64AC_HEADER_DIRENT
65AC_HEADER_STDC
66AC_CHECK_HEADERS(fcntl.h limits.h sys/time.h unistd.h crypt.h string.h memory.h sys/procfs.h)
67AC_EGREP_HEADER(fread, stdio.h, AC_DEFINE(HAVE_FREAD_DECL))
68AC_EGREP_HEADER(fgetc, stdio.h, AC_DEFINE(HAVE_FGETC_DECL))
69AC_EGREP_HEADER(pr_brksize, sys/procfs.h, AC_DEFINE(HAVE_PR_BRKSIZE))
70
71dnl Checks for library functions.
72AC_FUNC_ALLOCA
73AC_PROG_GCC_TRADITIONAL
74AC_TYPE_SIGNAL
75AC_FUNC_VPRINTF
76AC_CHECK_FUNCS(ftime select strftime strtol getrusage times mallinfo setbuffer getpagesize strerror)
77AC_REPLACE_FUNCS(ftruncate strstr strcasecmp)
78
79
80dnl see if gettext is in libc. (try the textdomain() function).
81AC_CHECK_FUNC(textdomain, AC_DEFINE(ENABLE_NLS ,1) )
82
83# we need to set an extended JNI path for Mac OS/Darwin, as jni.h is on
84# a non-standard Path
85# is there a better way to do this??
86AC_MSG_CHECKING(for OS to set JNI options)
87# set defaults
88JNIINC=""
89JNISUFFIX="so"
90JNIFLAGS="-shared"
91
92if test "`(uname -s) 2> /dev/null`" = 'Darwin'; then
93  AC_MSG_RESULT(Darwin)
94  JNIINC="-I/System/Library/Frameworks/JavaVM.framework/Headers/ "
95  JNISUFFIX="jnilib"
96  JNIFLAGS="-dynamiclib -fno-common -single_module -framework JavaVM"
97fi
98if test "`(uname -s) 2> /dev/null`" = 'SunOS'; then
99  AC_MSG_RESULT(Solaris)
100  JNIINC="-I\$(JAVA_HOME)/include/solaris "
101fi
102if test "`(uname -s) 2> /dev/null`" = 'Linux'; then
103  AC_MSG_RESULT(Linux)
104  JNIINC="-I\$(JAVA_HOME)/include/linux "
105fi
106
107AC_SUBST(JNIINC)
108AC_SUBST(JNISUFFIX)
109AC_SUBST(JNIFLAGS)
110
111# *** Custom checking (based on GNU tar configure.in) ***
112# ---------------------------------------------------------------------------
113AC_MSG_CHECKING(for HP-UX needing gmalloc)
114if test "`(uname -s) 2> /dev/null`" = 'HP-UX'; then
115  AC_MSG_RESULT(yes)
116  AC_LIBOBJ(gmalloc)
117  AC_DEFINE(HAVE_VALLOC)
118else
119  AC_MSG_RESULT(no)
120  AC_CHECK_FUNCS(valloc)
121fi
122
123fp_WITH_DMALLOC
124fp_WITH_REGEX
125fp_WITH_GNU_READLINE
126
127# text for endianness
128AC_C_BIGENDIAN
129
130# ---------------------------------------------------------------------------
131if test "$ac_cv_func_alloca" = 'no'; then
132dnl    support functions for alloca.c
133  AC_LIBOBJ(xmalloc)
134  AC_LIBOBJ(error)
135fi
136
137
138# ---------------------------------------------------------------------------
139# see if the user wants to override use of long long
140AC_ARG_ENABLE(override-longlong,
141[  --enable-override-longlong
142                          overide use of long long with GCC],
143  AC_DEFINE(DISABLE_LONG_LONG))
144
145
146# ---------------------------------------------------------------------------
147
148AC_OUTPUT([Makefile text/Makefile lib/Makefile
149   jni/Makefile java/org/greenstone/mgpp/Makefile],
150[test -z "$CONFIG_HEADERS" || echo timestamp > stamp-h])
Note: See TracBrowser for help on using the browser.