source: main/trunk/greenstone2/common-src/indexers/mg/configure.in@ 22070

Last change on this file since 22070 was 22070, checked in by ak19, 14 years ago

Undoing the commits of 22058 to the indexer folder: USE_GDBM, USE_JDBM are not relevant here (or USE_SQLITE).

  • Property svn:executable set to *
  • Property svn:keywords set to Author Date Id Revision
File size: 4.0 KB
Line 
1dnl Process this file with autoconf to produce a configure script.
2AC_INIT(src/text/mgquery.c)
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=mg
12VERSION=1.2
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
39
40dnl Checks for programs.
41AC_PROG_CXX
42AC_PROG_AWK
43AC_PROG_YACC
44AC_PROG_CC
45AC_PROG_INSTALL
46AC_PROG_LN_S
47AC_PROG_MAKE_SET
48AC_PROG_RANLIB
49
50dnl Checks for typedefs, structures, and compiler characteristics.
51AC_AIX
52AC_ISC_POSIX
53AC_MINIX
54fp_C_PROTOTYPES
55AC_C_CONST
56AC_TYPE_OFF_T
57AC_TYPE_SIZE_T
58AC_HEADER_TIME
59AC_STRUCT_TM
60
61dnl --- This should be in the stdc checking -----------------
62if test "$ac_cv_prog_cc_stdc" = '-Xc'; then
63dnl The Pyramids running SMP_DC.OSx on MIPS r3000 chips with
64dnl /usr/opt/cc3.11/bin/cc treat -Xc as full ANSI mode - no POSIX or
65dnl XOPEN extensions (like popen).
66dnl Unfortunately -D_{XOPEN,POSIX}_SOURCE can't provide all that mg
67dnl needs. So drop back to -Xa
68AC_TRY_COMPILE(
69[#include <stdio.h>
70], [ FILE *rubbish = popen("yes", "r"); ],,
71[CC="`echo $CC | sed 's/-Xc/-Xa/'`" ac_cv_prog_cc_stdc='-Xa'])
72fi
73dnl ----------------------
74
75
76dnl Checks for libraries.
77dnl Replace `main' with a function in -lm:
78AC_CHECK_LIB(m, main)
79
80dnl Checks for header files.
81AC_HEADER_DIRENT
82AC_HEADER_STDC
83AC_CHECK_HEADERS(fcntl.h limits.h sys/time.h unistd.h string.h memory.h sys/procfs.h)
84AC_EGREP_HEADER(fread, stdio.h, AC_DEFINE(HAVE_FREAD_DECL))
85AC_EGREP_HEADER(fgetc, stdio.h, AC_DEFINE(HAVE_FGETC_DECL))
86AC_EGREP_HEADER(pr_brksize, sys/procfs.h, AC_DEFINE(HAVE_PR_BRKSIZE))
87
88dnl Checks for library functions.
89AC_FUNC_ALLOCA
90AC_PROG_GCC_TRADITIONAL
91AC_TYPE_SIGNAL
92AC_FUNC_VPRINTF
93AC_CHECK_FUNCS(ftime select strftime strtol getrusage times mallinfo setbuffer getpagesize)
94AC_REPLACE_FUNCS(ftruncate strstr strcasecmp)
95
96
97# *** Custom checking (based on GNU tar configure.in) ***
98# ---------------------------------------------------------------------------
99AC_MSG_CHECKING(for HP-UX needing gmalloc)
100if test "`(uname -s) 2> /dev/null`" = 'HP-UX'; then
101 AC_MSG_RESULT(yes)
102 AC_LIBOBJ(gmalloc)
103 AC_DEFINE(HAVE_VALLOC)
104else
105 AC_MSG_RESULT(no)
106 AC_CHECK_FUNCS(valloc)
107fi
108
109# we need to set an extended JNI path for Mac OS/Darwin, as jni.h is on
110# a non-standard Path
111# is there a better way to do this??
112AC_MSG_CHECKING(for OS to set JNI options)
113# set defaults
114JNIINC=""
115JNISUFFIX="so"
116JNIFLAGS="-shared"
117
118if test "`(uname -s) 2> /dev/null`" = 'Darwin'; then
119 AC_MSG_RESULT(Darwin)
120 JNIINC="-I/System/Library/Frameworks/JavaVM.framework/Headers/ "
121 JNISUFFIX="jnilib"
122 JNIFLAGS="-dynamiclib -fno-common -single_module -framework JavaVM"
123fi
124if test "`(uname -s) 2> /dev/null`" = 'SunOS'; then
125 AC_MSG_RESULT(Solaris)
126 JNIINC="-I\$(JAVA_HOME)/include/solaris "
127fi
128if test "`(uname -s) 2> /dev/null`" = 'Linux'; then
129 AC_MSG_RESULT(Linux)
130 JNIINC="-I\$(JAVA_HOME)/include/linux -I\$(JAVA_HOME)/include "
131fi
132
133AC_SUBST(JNIINC)
134AC_SUBST(JNISUFFIX)
135AC_SUBST(JNIFLAGS)
136
137fp_WITH_DMALLOC
138fp_WITH_REGEX
139
140# text for endianness
141AC_C_BIGENDIAN
142
143# ---------------------------------------------------------------------------
144if test "$ac_cv_func_alloca" = 'no'; then
145dnl support functions for alloca.c
146 AC_LIBOBJ(xmalloc)
147 AC_LIBOBJ(error)
148fi
149
150
151# ---------------------------------------------------------------------------
152
153AC_OUTPUT([Makefile src/text/Makefile lib/Makefile
154 jni/Makefile java/org/greenstone/mg/Makefile ],
155[test -z "$CONFIG_HEADERS" || echo timestamp > stamp-h])
156
157# To prevent timestamp problems causing bool_parser.c to be generated from bool_parser.y
158touch src/text/bool_parser.c
Note: See TracBrowser for help on using the repository browser.