root/trunk/indexers/mg/configure.in @ 10917

Revision 10917, 3.4 KB (checked in by kjdon, 14 years ago)

removed java_home/include/linux from include path in makefile, made the configure script include this in JNIINC for linux, and use JAVA_HOME/include/solaris for solaris machines

  • Property svn:executable set to *
  • Property svn:keywords set to Author Date Id Revision
Line 
1dnl Process this file with autoconf to produce a configure script.
2AC_INIT(src/text/mgquery.c)
3AC_CONFIG_HEADER(config.h)
4AC_ARG_PROGRAM
5
6dnl
7PACKAGE=mg
8VERSION=1.2
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 -lm:
55AC_CHECK_LIB(m, main)
56
57dnl Checks for header files.
58AC_HEADER_DIRENT
59AC_HEADER_STDC
60AC_CHECK_HEADERS(fcntl.h limits.h sys/time.h unistd.h string.h memory.h sys/procfs.h)
61AC_EGREP_HEADER(fread, stdio.h, AC_DEFINE(HAVE_FREAD_DECL))
62AC_EGREP_HEADER(fgetc, stdio.h, AC_DEFINE(HAVE_FGETC_DECL))
63AC_EGREP_HEADER(pr_brksize, sys/procfs.h, AC_DEFINE(HAVE_PR_BRKSIZE))
64
65dnl Checks for library functions.
66AC_FUNC_ALLOCA
67AC_PROG_GCC_TRADITIONAL
68AC_TYPE_SIGNAL
69AC_FUNC_VPRINTF
70AC_CHECK_FUNCS(ftime select strftime strtol getrusage times mallinfo setbuffer getpagesize)
71AC_REPLACE_FUNCS(ftruncate strstr strcasecmp)
72
73
74# *** Custom checking (based on GNU tar configure.in) ***
75# ---------------------------------------------------------------------------
76AC_MSG_CHECKING(for HP-UX needing gmalloc)
77if test "`(uname -s) 2> /dev/null`" = 'HP-UX'; then
78  AC_MSG_RESULT(yes)
79  AC_LIBOBJ(gmalloc)
80  AC_DEFINE(HAVE_VALLOC)
81else
82  AC_MSG_RESULT(no)
83  AC_CHECK_FUNCS(valloc)
84fi
85
86# we need to set an extended JNI path for Mac OS/Darwin, as jni.h is on
87# a non-standard Path
88# is there a better way to do this??
89AC_MSG_CHECKING(for OS to set JNI options)
90# set defaults
91JNIINC=""
92JNISUFFIX="so"
93JNIFLAGS="-shared"
94
95if test "`(uname -s) 2> /dev/null`" = 'Darwin'; then
96  AC_MSG_RESULT(Darwin)
97  JNIINC="-I/System/Library/Frameworks/JavaVM.framework/Headers/ "
98  JNISUFFIX="jnilib"
99  JNIFLAGS="-dynamiclib -fno-common -single_module -framework JavaVM"
100fi
101if test "`(uname -s) 2> /dev/null`" = 'SunOS'; then
102  AC_MSG_RESULT(Solaris)
103  JNIINC="-I\$(JAVA_HOME)/include/solaris "
104fi
105if test "`(uname -s) 2> /dev/null`" = 'Linux'; then
106  AC_MSG_RESULT(Linux)
107  JNIINC="-I\$(JAVA_HOME)/include/linux "
108fi
109
110AC_SUBST(JNIINC)
111AC_SUBST(JNISUFFIX)
112AC_SUBST(JNIFLAGS)
113
114fp_WITH_DMALLOC
115fp_WITH_REGEX
116
117# text for endianness
118AC_C_BIGENDIAN
119
120# ---------------------------------------------------------------------------
121if test "$ac_cv_func_alloca" = 'no'; then
122dnl    support functions for alloca.c
123  AC_LIBOBJ(xmalloc)
124  AC_LIBOBJ(error)
125fi
126
127
128# ---------------------------------------------------------------------------
129
130AC_OUTPUT([Makefile src/text/Makefile src/images/Makefile
131          src/scripts/Makefile lib/Makefile
132      jni/Makefile java/org/greenstone/mg/Makefile ],
133[test -z "$CONFIG_HEADERS" || echo timestamp > stamp-h])
Note: See TracBrowser for help on using the browser.