source: trunk/mgpp/configure.in@ 10192

Last change on this file since 10192 was 10192, checked in by kjdon, 19 years ago

modified so that jni stuff works on Mac OS. in configure.in changed the names of some of the vars that george had added.

  • Property svn:executable set to *
  • Property svn:keywords set to Author Date Id Revision
File size: 3.7 KB
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
84# we need to set an extended JNI path for Mac OS/Darwin, as jni.h is on
85# a non-standard Path
86AC_MSG_CHECKING(for Apple MacOS X/Darwin)
87if test "`(uname -s) 2> /dev/null`" = 'Darwin'; then
88 AC_MSG_RESULT(yes)
89 JNIINC="-I/System/Library/Frameworks/JavaVM.framework/Headers/ "
90 JNISUFFIX="jnilib"
91 JNIFLAGS="-dynamiclib -fno-common"
92 LDFLAGS="-framework JavaVM"
93else
94 AC_MSG_RESULT(no)
95 JNIINC=""
96 JNISUFFIX="so"
97 JNIFLAGS="-shared"
98fi
99AC_SUBST(JNIINC)
100AC_SUBST(JNISUFFIX)
101AC_SUBST(JNIFLAGS)
102
103# *** Custom checking (based on GNU tar configure.in) ***
104# ---------------------------------------------------------------------------
105AC_MSG_CHECKING(for HP-UX needing gmalloc)
106if test "`(uname -s) 2> /dev/null`" = 'HP-UX'; then
107 AC_MSG_RESULT(yes)
108 AC_LIBOBJ(gmalloc)
109 AC_DEFINE(HAVE_VALLOC)
110else
111 AC_MSG_RESULT(no)
112 AC_CHECK_FUNCS(valloc)
113fi
114
115fp_WITH_DMALLOC
116fp_WITH_REGEX
117fp_WITH_GNU_READLINE
118
119# ---------------------------------------------------------------------------
120if test "$ac_cv_func_alloca" = 'no'; then
121dnl support functions for alloca.c
122 AC_LIBOBJ(xmalloc)
123 AC_LIBOBJ(error)
124fi
125
126
127# ---------------------------------------------------------------------------
128# see if the user wants to override use of long long
129AC_ARG_ENABLE(override-longlong,
130[ --enable-override-longlong
131 overide use of long long with GCC],
132 AC_DEFINE(DISABLE_LONG_LONG))
133
134# ---------------------------------------------------------------------------
135
136AC_OUTPUT([Makefile text/Makefile lib/Makefile
137 jni/Makefile java/org/greenstone/mgpp/Makefile],
138[test -z "$CONFIG_HEADERS" || echo timestamp > stamp-h])
Note: See TracBrowser for help on using the repository browser.