source: trunk/gsdl3/configure.ac@ 10762

Last change on this file since 10762 was 7722, checked in by kjdon, 20 years ago

added a couple more Makefiles to the list

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