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

Last change on this file since 10014 was 10014, checked in by cs025, 19 years ago

Changes to support Darwin/Mac OS X

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