1 | #!/bin/sh
|
---|
2 | # Run this to generate all the initial makefiles, etc.
|
---|
3 |
|
---|
4 | THEDIR=`pwd`
|
---|
5 | cd `dirname $0`
|
---|
6 | srcdir=`pwd`
|
---|
7 |
|
---|
8 | DIE=0
|
---|
9 |
|
---|
10 | (autoconf --version) < /dev/null > /dev/null 2>&1 || {
|
---|
11 | echo
|
---|
12 | echo "You must have autoconf installed to compile libxml."
|
---|
13 | echo "Download the appropriate package for your distribution,"
|
---|
14 | echo "or see http://www.gnu.org/software/autoconf"
|
---|
15 | DIE=1
|
---|
16 | }
|
---|
17 |
|
---|
18 | (libtoolize --version) < /dev/null > /dev/null 2>&1 ||
|
---|
19 | (glibtoolize --version) < /dev/null > /dev/null 2>&1 || {
|
---|
20 | echo
|
---|
21 | echo "You must have libtool installed to compile libxml."
|
---|
22 | echo "Download the appropriate package for your distribution,"
|
---|
23 | echo "or see http://www.gnu.org/software/libtool"
|
---|
24 | DIE=1
|
---|
25 | }
|
---|
26 |
|
---|
27 | (automake --version) < /dev/null > /dev/null 2>&1 || {
|
---|
28 | echo
|
---|
29 | DIE=1
|
---|
30 | echo "You must have automake installed to compile libxml."
|
---|
31 | echo "Download the appropriate package for your distribution,"
|
---|
32 | echo "or see http://www.gnu.org/software/automake"
|
---|
33 | }
|
---|
34 |
|
---|
35 | if test "$DIE" -eq 1; then
|
---|
36 | exit 1
|
---|
37 | fi
|
---|
38 |
|
---|
39 | test -f entities.c || {
|
---|
40 | echo "You must run this script in the top-level libxml directory"
|
---|
41 | exit 1
|
---|
42 | }
|
---|
43 |
|
---|
44 | EXTRA_ARGS=
|
---|
45 | if test "x$1" = "x--system"; then
|
---|
46 | shift
|
---|
47 | prefix=/usr
|
---|
48 | libdir=$prefix/lib
|
---|
49 | sysconfdir=/etc
|
---|
50 | localstatedir=/var
|
---|
51 | if [ -d /usr/lib64 ]; then
|
---|
52 | libdir=$prefix/lib64
|
---|
53 | fi
|
---|
54 | EXTRA_ARGS="--prefix=$prefix --sysconfdir=$sysconfdir --localstatedir=$localstatedir --libdir=$libdir"
|
---|
55 | echo "Running ./configure with $EXTRA_ARGS $@"
|
---|
56 | else
|
---|
57 | if test -z "$NOCONFIGURE" && test -z "$*"; then
|
---|
58 | echo "I am going to run ./configure with no arguments - if you wish "
|
---|
59 | echo "to pass any to it, please specify them on the $0 command line."
|
---|
60 | fi
|
---|
61 | fi
|
---|
62 |
|
---|
63 | if [ ! -d $srcdir/m4 ]; then
|
---|
64 | mkdir $srcdir/m4
|
---|
65 | fi
|
---|
66 |
|
---|
67 | # Replaced by autoreconf below
|
---|
68 | autoreconf -if -Wall || exit 1
|
---|
69 |
|
---|
70 | if ! grep -q pkg.m4 aclocal.m4; then
|
---|
71 | cat <<EOF
|
---|
72 |
|
---|
73 | Couldn't find pkg.m4 from pkg-config. Install the appropriate package for
|
---|
74 | your distribution or set ACLOCAL_PATH to the directory containing pkg.m4.
|
---|
75 | EOF
|
---|
76 | exit 1
|
---|
77 | fi
|
---|
78 |
|
---|
79 | cd $THEDIR
|
---|
80 |
|
---|
81 | if test x$OBJ_DIR != x; then
|
---|
82 | mkdir -p "$OBJ_DIR"
|
---|
83 | cd "$OBJ_DIR"
|
---|
84 | fi
|
---|
85 |
|
---|
86 | if test -z "$NOCONFIGURE"; then
|
---|
87 | $srcdir/configure $EXTRA_ARGS "$@"
|
---|
88 | if test "$?" -ne 0; then
|
---|
89 | echo
|
---|
90 | echo "Configure script failed, check config.log for more info."
|
---|
91 | exit 1
|
---|
92 | else
|
---|
93 | echo
|
---|
94 | echo "Now type 'make' to compile libxml2."
|
---|
95 | fi
|
---|
96 | fi
|
---|