autogen.sh 1.9 KB
Newer Older
1 2 3
#!/bin/sh
# Run this to generate all the initial makefiles, etc.

4 5 6 7 8
srcdir=`dirname $0`
test -z "$srcdir" && srcdir=. 

THEDIR=`pwd`
cd $srcdir
9 10 11 12
DIE=0

(autoconf --version) < /dev/null > /dev/null 2>&1 || {
	echo
13
	echo "You must have autoconf installed to compile libxml."
14
	echo "Download the appropriate package for your distribution,"
15
	echo "or see http://www.gnu.org/software/autoconf"
16 17 18
	DIE=1
}

19
(libtoolize --version) < /dev/null > /dev/null 2>&1 || {
20
	echo
21
	echo "You must have libtool installed to compile libxml."
22 23
	echo "Download the appropriate package for your distribution,"
	echo "or see http://www.gnu.org/software/libtool"
24 25 26
	DIE=1
}

27
(automake --version) < /dev/null > /dev/null 2>&1 || {
28 29
	echo
	DIE=1
30 31 32
	echo "You must have automake installed to compile libxml."
	echo "Download the appropriate package for your distribution,"
	echo "or see http://www.gnu.org/software/automake"
33 34 35 36 37 38
}

if test "$DIE" -eq 1; then
	exit 1
fi

39
test -f entities.c || {
40
	echo "You must run this script in the top-level libxml directory"
41 42 43
	exit 1
}

44 45 46 47 48 49 50 51 52 53 54 55 56 57 58
EXTRA_ARGS=
if test "x$1" = "x--system"; then
    shift
    prefix=/usr
    libdir=$prefix/lib
    sysconfdir=/etc
    localstatedir=/var
    if [ -d /usr/lib64 ]; then
      libdir=$prefix/lib64
    fi
    EXTRA_ARGS="--prefix=$prefix --sysconfdir=$sysconfdir --localstatedir=$localstatedir --libdir=$libdir"
    echo "Running ./configure with $EXTRA_ARGS $@"
else
    if test -z "$NOCONFIGURE" && test -z "$*"; then
        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 62
fi

63 64 65 66
if [ ! -d $srcdir/m4 ]; then
        mkdir $srcdir/m4
fi

67
# Replaced by autoreconf below
68
autoreconf -if -Wall
69 70

cd $THEDIR
71 72 73 74 75 76

if test x$OBJ_DIR != x; then
    mkdir -p "$OBJ_DIR"
    cd "$OBJ_DIR"
fi

77
if test -z "$NOCONFIGURE"; then
78 79
    $srcdir/configure $EXTRA_ARGS "$@"
    echo
Javier Jardón's avatar
Javier Jardón committed
80
    echo "Now type 'make' to compile libxml2."
81
fi