source: main/branches/64_bit_Greenstone/greenstone2/common-src/indexers/mg/configure.in@ 23508

Last change on this file since 23508 was 23508, checked in by sjm84, 13 years ago

Committing 64 bit changes into the branch

  • Property svn:executable set to *
  • Property svn:keywords set to Author Date Id Revision
File size: 4.3 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
19dnl
20dnl Disable all Java compilation
21dnl
22AC_ARG_ENABLE(java, [ --disable-java Disable Java compilation], ENABLE_JAVA=$enableval, ENABLE_JAVA=yes)
23if test $ENABLE_JAVA = "yes" -o $ENABLE_JAVA = "1" ; then
24 ENABLE_JAVA=1
25 if test "x$JAVA_HOME" != "x" ; then
26 echo "Detected JAVA_HOME is set, however this will not be used during compilation"
27 echo "To control the version of 'javac' and 'java' set environment variables JAVAC"
28 echo "and JAVA respectively"
29 export JAVA_HOME=
30 fi
31else
32 ENABLE_JAVA=0
33fi
34AC_SUBST(ENABLE_JAVA)
35
36dnl AC_MSG_CHECKING(to see if architecture is 64-bit)
37dnl arch_64bit=no
38dnl case "$host_cpu" in
39dnl x86_64) arch_64bit=yes ;;
40dnl esac
41
42dnl Checks for programs.
43AC_PROG_CXX
44AC_PROG_AWK
45AC_PROG_YACC
46AC_PROG_CC
47AC_PROG_INSTALL
48AC_PROG_LN_S
49AC_PROG_MAKE_SET
50AC_PROG_RANLIB
51if test $ENABLE_JAVA = "1" ; then
52 AC_PROG_JAVA
53 AC_PROG_JAVAC
54fi
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 --- This should be in the stdc checking -----------------
68if test "$ac_cv_prog_cc_stdc" = '-Xc'; then
69dnl The Pyramids running SMP_DC.OSx on MIPS r3000 chips with
70dnl /usr/opt/cc3.11/bin/cc treat -Xc as full ANSI mode - no POSIX or
71dnl XOPEN extensions (like popen).
72dnl Unfortunately -D_{XOPEN,POSIX}_SOURCE can't provide all that mg
73dnl needs. So drop back to -Xa
74AC_TRY_COMPILE(
75[#include <stdio.h>
76], [ FILE *rubbish = popen("yes", "r"); ],,
77[CC="`echo $CC | sed 's/-Xc/-Xa/'`" ac_cv_prog_cc_stdc='-Xa'])
78fi
79dnl ----------------------
80
81
82dnl Checks for libraries.
83dnl Replace `main' with a function in -lm:
84AC_CHECK_LIB(m, main)
85
86dnl Checks for header files.
87AC_HEADER_DIRENT
88AC_HEADER_STDC
89AC_CHECK_HEADERS(fcntl.h limits.h sys/time.h unistd.h string.h memory.h sys/procfs.h)
90AC_EGREP_HEADER(fread, stdio.h, AC_DEFINE(HAVE_FREAD_DECL))
91AC_EGREP_HEADER(fgetc, stdio.h, AC_DEFINE(HAVE_FGETC_DECL))
92AC_EGREP_HEADER(pr_brksize, sys/procfs.h, AC_DEFINE(HAVE_PR_BRKSIZE))
93
94dnl Checks for library functions.
95AC_FUNC_ALLOCA
96AC_PROG_GCC_TRADITIONAL
97AC_TYPE_SIGNAL
98AC_FUNC_VPRINTF
99AC_CHECK_FUNCS(ftime select strftime strtol getrusage times mallinfo setbuffer getpagesize)
100AC_REPLACE_FUNCS(ftruncate strstr strcasecmp)
101
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
115# we need to set an extended JNI path for Mac OS/Darwin, as jni.h is on
116# a non-standard Path
117# is there a better way to do this??
118AC_MSG_CHECKING(for OS to set JNI options)
119# set defaults
120JNIINC=""
121JNISUFFIX="so"
122JNIFLAGS="-shared"
123
124if test "`(uname -s) 2> /dev/null`" = 'Darwin'; then
125 AC_MSG_RESULT(Darwin)
126 JNIINC="-I/System/Library/Frameworks/JavaVM.framework/Headers/ "
127 JNISUFFIX="jnilib"
128 JNIFLAGS="-dynamiclib -fno-common -single_module -framework JavaVM"
129fi
130if test "`(uname -s) 2> /dev/null`" = 'SunOS'; then
131 AC_MSG_RESULT(Solaris)
132 JNIINC="-I\$(JAVA_HOME)/include/solaris "
133fi
134if test "`(uname -s) 2> /dev/null`" = 'Linux'; then
135 AC_MSG_RESULT(Linux)
136 JNIINC="-I\$(JAVA_HOME)/include/linux -I\$(JAVA_HOME)/include "
137fi
138
139AC_SUBST(JNIINC)
140AC_SUBST(JNISUFFIX)
141AC_SUBST(JNIFLAGS)
142
143fp_WITH_DMALLOC
144fp_WITH_REGEX
145
146# text for endianness
147AC_C_BIGENDIAN
148
149# ---------------------------------------------------------------------------
150if test "$ac_cv_func_alloca" = 'no'; then
151dnl support functions for alloca.c
152 AC_LIBOBJ(xmalloc)
153 AC_LIBOBJ(error)
154fi
155
156
157# ---------------------------------------------------------------------------
158
159AC_OUTPUT([Makefile src/text/Makefile lib/Makefile
160 jni/Makefile java/org/greenstone/mg/Makefile ],
161[test -z "$CONFIG_HEADERS" || echo timestamp > stamp-h])
162
163# To prevent timestamp problems causing bool_parser.c to be generated from bool_parser.y
164touch src/text/bool_parser.c
Note: See TracBrowser for help on using the repository browser.