1 | ###########################################################################
|
---|
2 | #
|
---|
3 | # configure -- Configure script for common-src
|
---|
4 | #
|
---|
5 | # A component of the Greenstone digital library software
|
---|
6 | # from the New Zealand Digital Library Project at the
|
---|
7 | # University of Waikato, New Zealand.
|
---|
8 | #
|
---|
9 | # Copyright (C) 1999-2010 The New Zealand Digital Library Project
|
---|
10 | #
|
---|
11 | # This program is free software; you can redistribute it and/or modify
|
---|
12 | # it under the terms of the GNU General Public License as published by
|
---|
13 | # the Free Software Foundation; either version 2 of the License, or
|
---|
14 | # (at your option) any later version.
|
---|
15 | #
|
---|
16 | # This program is distributed in the hope that it will be useful,
|
---|
17 | # but WITHOUT ANY WARRANTY; without even the implied warranty of
|
---|
18 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
---|
19 | # GNU General Public License for more details.
|
---|
20 | #
|
---|
21 | # You should have received a copy of the GNU General Public License
|
---|
22 | # along with this program; if not, write to the Free Software
|
---|
23 | # Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
|
---|
24 | #
|
---|
25 | ###########################################################################
|
---|
26 |
|
---|
27 |
|
---|
28 | AC_INIT([greenstone2-common-src], [2.84], [[email protected]])
|
---|
29 | AC_CONFIG_AUX_DIR([.])
|
---|
30 | AM_CONFIG_HEADER([config.h])
|
---|
31 | AM_INIT_AUTOMAKE([-Wall -Werror foreign no-define])
|
---|
32 |
|
---|
33 | # This package requires C++ compilation and library creation
|
---|
34 | AC_PROG_CXX
|
---|
35 | AC_PROG_INSTALL
|
---|
36 | AC_PROG_RANLIB
|
---|
37 |
|
---|
38 | # Check for 64-bit machines
|
---|
39 | AC_CANONICAL_HOST
|
---|
40 | AC_MSG_CHECKING(if architecture is 64-bit)
|
---|
41 | arch_64bit=no
|
---|
42 | case "$host_cpu" in
|
---|
43 | x86_64) arch_64bit=yes ;;
|
---|
44 | esac
|
---|
45 | if test "$arch_64bit" = yes; then
|
---|
46 | AC_MSG_RESULT(yes)
|
---|
47 | if test -z "$COMPAT32BITFLAGS" ; then
|
---|
48 | COMPAT32BITFLAGS="-m32"
|
---|
49 | fi
|
---|
50 | else
|
---|
51 | AC_MSG_RESULT(no)
|
---|
52 | fi
|
---|
53 | AC_SUBST(COMPAT32BITFLAGS)
|
---|
54 |
|
---|
55 | # Option: Lucene support (enabled by default)
|
---|
56 | AC_ARG_ENABLE([lucene], [AS_HELP_STRING([--disable-lucene], [Disable Lucene support])], [], [enable_lucene=yes])
|
---|
57 | if test "x$enable_lucene" != xno; then
|
---|
58 | AC_DEFINE(ENABLE_LUCENE, 1, [Lucene support])
|
---|
59 |
|
---|
60 | # Unpack Expat (if it hasn't already been done)
|
---|
61 | if test ! -d "packages/expat/expat-1.95.8"; then
|
---|
62 | cd packages/expat
|
---|
63 | gzip -dc expat-1.95.8.tar.gz | tar -xf -
|
---|
64 | cd ../..
|
---|
65 | fi
|
---|
66 |
|
---|
67 | # Configure Expat manually
|
---|
68 | cd packages/expat/expat-1.95.8
|
---|
69 | ./configure --prefix=`pwd`/..
|
---|
70 | cd ../../..
|
---|
71 | fi
|
---|
72 | AM_CONDITIONAL(ENABLE_LUCENE, test "x$enable_lucene" != xno)
|
---|
73 |
|
---|
74 | # Option: SQLite support (enabled by default)
|
---|
75 | AC_ARG_ENABLE([sqlite], [AS_HELP_STRING([--disable-sqlite], [Disable SQLite support])], [], [enable_sqlite=yes])
|
---|
76 | if test "x$enable_sqlite" != xno; then
|
---|
77 | AC_DEFINE(USE_SQLITE, 1, [SQLite support])
|
---|
78 |
|
---|
79 | # Unpack SQLite (if it hasn't already been done)
|
---|
80 | if test ! -d "packages/sqlite/sqlite-amalgamation-3.5.9"; then
|
---|
81 | cd packages/sqlite
|
---|
82 | gzip -dc sqlite-amalgamation-3.5.9.tar.gz | tar -xf -
|
---|
83 | cd ../..
|
---|
84 | fi
|
---|
85 |
|
---|
86 | # Configure SQLite manually
|
---|
87 | cd packages/sqlite/sqlite-amalgamation-3.5.9
|
---|
88 | ./configure --prefix=`pwd`/..
|
---|
89 | cd ../../..
|
---|
90 | fi
|
---|
91 | AM_CONDITIONAL(USE_SQLITE, test "x$enable_sqlite" != xno)
|
---|
92 |
|
---|
93 | # Generate the Makefiles for this package
|
---|
94 | AC_OUTPUT(Makefile src/lib/Makefile)
|
---|