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