1 | ###########################################################################
|
---|
2 | #
|
---|
3 | # configure -- Configure script for common-src
|
---|
4 | #
|
---|
5 | # By Michael Dewsnip
|
---|
6 | #
|
---|
7 | # Copyright (C) 2010 DL Consulting Ltd.
|
---|
8 | #
|
---|
9 | ###########################################################################
|
---|
10 |
|
---|
11 |
|
---|
12 | AC_INIT([greenstone2-common-src], [2.84], [[email protected]])
|
---|
13 | AC_CONFIG_AUX_DIR([.])
|
---|
14 | AC_CONFIG_HEADERS([config.h])
|
---|
15 | AM_INIT_AUTOMAKE([-Wall -Werror foreign no-define])
|
---|
16 |
|
---|
17 | # This package requires C++ compilation and library creation
|
---|
18 | AC_PROG_CXX
|
---|
19 | AC_PROG_INSTALL
|
---|
20 | AC_PROG_RANLIB
|
---|
21 |
|
---|
22 | # Check for 64-bit machines
|
---|
23 | AC_CANONICAL_HOST
|
---|
24 | AC_MSG_CHECKING(if architecture is 64-bit)
|
---|
25 | arch_64bit=no
|
---|
26 | case "$host_cpu" in
|
---|
27 | x86_64) arch_64bit=yes ;;
|
---|
28 | esac
|
---|
29 | if test "$arch_64bit" = yes; then
|
---|
30 | AC_MSG_RESULT(yes)
|
---|
31 | if test -z "$COMPAT32BITFLAGS" ; then
|
---|
32 | COMPAT32BITFLAGS="-m32"
|
---|
33 | fi
|
---|
34 | else
|
---|
35 | AC_MSG_RESULT(no)
|
---|
36 | fi
|
---|
37 | AC_SUBST(COMPAT32BITFLAGS)
|
---|
38 |
|
---|
39 | # Option: Lucene support (enabled by default)
|
---|
40 | AC_ARG_ENABLE([lucene], [AS_HELP_STRING([--disable-lucene], [Disable Lucene support])], [], [enable_lucene=yes])
|
---|
41 | if test "x$enable_lucene" != xno; then
|
---|
42 | AC_DEFINE(ENABLE_LUCENE, 1, [Lucene support])
|
---|
43 |
|
---|
44 | # Unpack Expat (if it hasn't already been done)
|
---|
45 | if test ! -d "packages/expat/expat-1.95.8"; then
|
---|
46 | cd packages/expat
|
---|
47 | gzip -dc expat-1.95.8.tar.gz | tar -xf -
|
---|
48 | cd ../..
|
---|
49 | fi
|
---|
50 |
|
---|
51 | # Configure Expat manually
|
---|
52 | cd packages/expat/expat-1.95.8
|
---|
53 | ./configure --prefix=`pwd`/..
|
---|
54 | cd ../../..
|
---|
55 | fi
|
---|
56 | AM_CONDITIONAL(ENABLE_LUCENE, test "x$enable_lucene" != xno)
|
---|
57 |
|
---|
58 | # Option: SQLite support (enabled by default)
|
---|
59 | AC_ARG_ENABLE([sqlite], [AS_HELP_STRING([--disable-sqlite], [Disable SQLite support])], [], [enable_sqlite=yes])
|
---|
60 | if test "x$enable_sqlite" != xno; then
|
---|
61 | AC_DEFINE(USE_SQLITE, 1, [SQLite support])
|
---|
62 |
|
---|
63 | # Unpack SQLite (if it hasn't already been done)
|
---|
64 | if test ! -d "packages/sqlite/sqlite-amalgamation-3.5.9"; then
|
---|
65 | cd packages/sqlite
|
---|
66 | gzip -dc sqlite-amalgamation-3.5.9.tar.gz | tar -xf -
|
---|
67 | cd ../..
|
---|
68 | fi
|
---|
69 |
|
---|
70 | # Configure SQLite manually
|
---|
71 | cd packages/sqlite/sqlite-amalgamation-3.5.9
|
---|
72 | ./configure --prefix=`pwd`/.. --bindir="$bindir"
|
---|
73 | cd ../../..
|
---|
74 | fi
|
---|
75 | AM_CONDITIONAL(USE_SQLITE, test "x$enable_sqlite" != xno)
|
---|
76 |
|
---|
77 | # Generate the Makefiles for this package
|
---|
78 | AC_OUTPUT(Makefile src/lib/Makefile)
|
---|