[7708] | 1 | dnl Process this file with autoconf to produce a configure script.
|
---|
| 2 | AC_INIT(src/java/org/greenstone/gsdl3/Library1.java)
|
---|
| 3 | AC_CONFIG_HEADER(config.h)
|
---|
| 4 |
|
---|
| 5 | PACKAGE=gsdl3
|
---|
| 6 | VERSION=0.1
|
---|
[7714] | 7 | AC_DEFINE_UNQUOTED(PACKAGE, "$PACKAGE", Define to the name of the distribution.)
|
---|
| 8 | AC_DEFINE_UNQUOTED(VERSION, "$VERSION", Define to the version of the distribution.)
|
---|
[7708] | 9 | AC_SUBST(PACKAGE)
|
---|
| 10 | AC_SUBST(VERSION)
|
---|
| 11 |
|
---|
[7715] | 12 | AC_DEFINE(PROTOTYPES, 1, Define to 1 if ANSI function prototypes are usable.)
|
---|
[7708] | 13 |
|
---|
| 14 | dnl Checks for programs.
|
---|
| 15 | LDFLAGS=
|
---|
| 16 | dnl only set CFLAGS if not already set in environment
|
---|
| 17 | if test -z "$CFLAGS"; then
|
---|
| 18 | CFLAGS=-O2
|
---|
| 19 | fi
|
---|
| 20 | AC_SUBST(CFLAGS)
|
---|
| 21 |
|
---|
| 22 | AC_PROG_CC
|
---|
| 23 | AC_PROG_CXX
|
---|
| 24 | AC_PROG_AWK
|
---|
| 25 | AC_PROG_YACC
|
---|
| 26 | dnl get $target_cpu, $target_vendor, and $target_os
|
---|
| 27 | dnl (as well as host_*)
|
---|
| 28 | AC_CANONICAL_SYSTEM
|
---|
| 29 | dnl do we actually want this? It adds a prefix based on host, system etc
|
---|
| 30 | dnl AC_ARG_PROGRAM
|
---|
| 31 | AC_PROG_INSTALL
|
---|
| 32 | AC_PROG_LN_S
|
---|
| 33 | AC_PROG_MAKE_SET
|
---|
| 34 | AC_PROG_RANLIB
|
---|
| 35 |
|
---|
| 36 | dnl Checks for typedefs, structures, and compiler characteristics.
|
---|
| 37 | AC_AIX
|
---|
| 38 | AC_ISC_POSIX
|
---|
| 39 | AC_MINIX
|
---|
| 40 | fp_C_PROTOTYPES
|
---|
| 41 | AC_C_CONST
|
---|
| 42 | AC_TYPE_OFF_T
|
---|
| 43 | AC_TYPE_SIZE_T
|
---|
| 44 | AC_HEADER_TIME
|
---|
| 45 | AC_STRUCT_TM
|
---|
| 46 |
|
---|
| 47 | dnl --- This should be in the stdc checking -----------------
|
---|
| 48 | if test "$ac_cv_prog_cc_stdc" = '-Xc'; then
|
---|
| 49 | dnl The Pyramids running SMP_DC.OSx on MIPS r3000 chips with
|
---|
| 50 | dnl /usr/opt/cc3.11/bin/cc treat -Xc as full ANSI mode - no POSIX or
|
---|
| 51 | dnl XOPEN extensions (like popen).
|
---|
| 52 | dnl Unfortunately -D_{XOPEN,POSIX}_SOURCE can't provide all that mg
|
---|
| 53 | dnl needs. So drop back to -Xa
|
---|
| 54 | AC_TRY_COMPILE(
|
---|
| 55 | [#include <stdio.h>
|
---|
| 56 | ], [ FILE *rubbish = popen("yes", "r"); ],,
|
---|
| 57 | [CC="`echo $CC | sed 's/-Xc/-Xa/'`" ac_cv_prog_cc_stdc='-Xa'])
|
---|
| 58 | fi
|
---|
| 59 | dnl ----------------------
|
---|
| 60 |
|
---|
| 61 |
|
---|
| 62 | dnl Checks for libraries.
|
---|
| 63 | dnl Replace `main' with a function in -lg:
|
---|
| 64 | AC_CHECK_LIB(g, main)
|
---|
| 65 | dnl Replace `main' with a function in -lm:
|
---|
| 66 | AC_CHECK_LIB(m, main)
|
---|
| 67 | dnl Replace `main' with a function in -lstdc++:
|
---|
| 68 | AC_CHECK_LIB(stdc++, main)
|
---|
| 69 | dnl Replace `main' with a function in -lcrypt:
|
---|
| 70 | AC_CHECK_LIB(crypt, main)
|
---|
| 71 |
|
---|
| 72 | dnl Checks for header files.
|
---|
| 73 | AC_HEADER_DIRENT
|
---|
| 74 | AC_HEADER_STDC
|
---|
| 75 | AC_CHECK_HEADERS(fcntl.h limits.h sys/time.h unistd.h crypt.h string.h memory.h sys/procfs.h)
|
---|
[7715] | 76 | AC_EGREP_HEADER(fread, stdio.h, AC_DEFINE(HAVE_FREAD_DECL, 1, Some braindead header files do not have the requ'd function declarations))
|
---|
| 77 | AC_EGREP_HEADER(fgetc, stdio.h, AC_DEFINE(HAVE_FGETC_DECL, 1, Some braindead header files do not have the requ'd function declarations))
|
---|
| 78 | AC_EGREP_HEADER(pr_brksize, sys/procfs.h, AC_DEFINE(HAVE_PR_BRKSIZE, 1, See if have this field in the prstatus_t structure. It stores the size of the process heap))
|
---|
[7708] | 79 |
|
---|
| 80 | dnl Checks for library functions.
|
---|
| 81 | AC_FUNC_ALLOCA
|
---|
| 82 | AC_PROG_GCC_TRADITIONAL
|
---|
| 83 | AC_TYPE_SIGNAL
|
---|
| 84 | AC_FUNC_VPRINTF
|
---|
| 85 | AC_CHECK_FUNCS(ftime select strftime strtol getrusage times mallinfo setbuffer getpagesize strerror)
|
---|
| 86 | AC_REPLACE_FUNCS(ftruncate strstr strcasecmp)
|
---|
| 87 |
|
---|
| 88 | dnl see if gettext is in libc. (try the textdomain() function).
|
---|
| 89 |
|
---|
[7714] | 90 | AC_CHECK_FUNC( textdomain, AC_DEFINE(ENABLE_NLS,1, Define if you have gettext (eg glibc)) )
|
---|
| 91 |
|
---|
[7708] | 92 | dnl
|
---|
| 93 | dnl Switch into C++
|
---|
| 94 | dnl
|
---|
| 95 | AC_LANG_CPLUSPLUS
|
---|
| 96 |
|
---|
| 97 | dnl
|
---|
| 98 | dnl Check if the STL library has any known faults;
|
---|
| 99 | dnl In GCC 2.7.2.x series, some STL library headers are missing
|
---|
| 100 | dnl a file called "new" which is referred to by other headers
|
---|
| 101 | dnl (eg. vector/vector.h); if this applies, then all use of the
|
---|
| 102 | dnl STL will cause a compile fail, so we'd better let the user
|
---|
| 103 | dnl know now, before things really go wrong!
|
---|
| 104 | dnl
|
---|
| 105 | success=no
|
---|
| 106 | AC_MSG_CHECKING("whether STL library has known faults")
|
---|
| 107 |
|
---|
| 108 | dnl - first shot, try simple good old vector on its own
|
---|
| 109 | AC_TRY_COMPILE(
|
---|
| 110 | [#include <vector>
|
---|
| 111 | ],
|
---|
| 112 | [],
|
---|
| 113 | success=yes,
|
---|
| 114 | )
|
---|
| 115 |
|
---|
| 116 | dnl - try using the .h equivalent
|
---|
| 117 | if test $success = "no"; then
|
---|
| 118 | AC_TRY_COMPILE(
|
---|
| 119 | [#include <vector.h>
|
---|
| 120 | ],
|
---|
| 121 | [],
|
---|
| 122 | success="yes",
|
---|
| 123 | )
|
---|
| 124 | fi
|
---|
| 125 |
|
---|
| 126 | dnl - now try for the objectspace headers
|
---|
| 127 | if test $success = "no"; then
|
---|
| 128 | AC_TRY_COMPILE(
|
---|
| 129 | [#include <ospace\\std\\vector>
|
---|
| 130 | ],
|
---|
| 131 | [],
|
---|
| 132 | success="yes",
|
---|
| 133 | )
|
---|
| 134 | fi
|
---|
| 135 |
|
---|
| 136 | if test $success = yes; then
|
---|
| 137 | AC_MSG_RESULT("no")
|
---|
| 138 | else
|
---|
| 139 | AC_MSG_RESULT("yes")
|
---|
| 140 | AC_MSG_ERROR("STL Broken - Obtain newer version of GNU C Compiler")
|
---|
| 141 | fi
|
---|
| 142 |
|
---|
| 143 | gsdlos=`uname | tr ABCDEFGHIJKLMNOPQRSTUVWXYZ abcdefghijklmnopqrstuvwxyz`
|
---|
| 144 | # check for running bash under cygwin
|
---|
| 145 | if test "`echo $gsdlos | sed 's/cygwin//'`" != "$gsdlos" ;
|
---|
| 146 | then
|
---|
| 147 | gsdlos=windows
|
---|
| 148 | fi
|
---|
| 149 | AC_SUBST(gsdlos)
|
---|
| 150 |
|
---|
| 151 | # ---------------------------------------------------------------------------
|
---|
| 152 | dnl for Darwin, as our packages don't (yet) correctly guess our system type.
|
---|
| 153 | ac_configure_args="$ac_configure_args --host=$host --target=$target"
|
---|
| 154 | AC_CONFIG_SUBDIRS(packages)
|
---|
| 155 |
|
---|
[7722] | 156 | AC_OUTPUT(packages/Makefile docs/Makefile src/java/Makefile Makefile)
|
---|
[7708] | 157 |
|
---|
| 158 | echo "-------------------------------------"
|
---|
| 159 | echo "Greenstone 3 successfully configured."
|
---|
| 160 | echo ""
|
---|