source: indexers/trunk/mg/configure.in@ 15560

Last change on this file since 15560 was 15560, checked in by davidb, 16 years ago

Addition of COMPAT32BITFLAGS so mg and mgpp can compile on a 64-bit machine

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