blob: 8b47ea506cbfd270dc3e5c69b9be81e5a96ff481 [file] [log] [blame]
Daniel Veillard01791d51998-07-24 19:24:09 +00001#!/bin/sh
2# Run this to generate all the initial makefiles, etc.
3
Elliot Lee8f8b4c81998-12-23 00:37:26 +00004srcdir=`dirname $0`
5test -z "$srcdir" && srcdir=.
6
7THEDIR=`pwd`
8cd $srcdir
Daniel Veillard01791d51998-07-24 19:24:09 +00009DIE=0
10
11(autoconf --version) < /dev/null > /dev/null 2>&1 || {
12 echo
Daniel Veillard361d8452000-04-03 19:48:13 +000013 echo "You must have autoconf installed to compile libxml."
Daniel Veillard01791d51998-07-24 19:24:09 +000014 echo "Download the appropriate package for your distribution,"
William M. Brack476cd962003-08-13 11:09:42 +000015 echo "or see http://www.gnu.org/software/autoconf"
Daniel Veillard01791d51998-07-24 19:24:09 +000016 DIE=1
17}
18
Colin Waltersca03efc2012-01-27 06:56:23 -050019(libtoolize --version) < /dev/null > /dev/null 2>&1 || {
Daniel Veillard01791d51998-07-24 19:24:09 +000020 echo
Daniel Veillard361d8452000-04-03 19:48:13 +000021 echo "You must have libtool installed to compile libxml."
William M. Brack476cd962003-08-13 11:09:42 +000022 echo "Download the appropriate package for your distribution,"
23 echo "or see http://www.gnu.org/software/libtool"
Daniel Veillard01791d51998-07-24 19:24:09 +000024 DIE=1
25}
26
William M. Brack476cd962003-08-13 11:09:42 +000027(automake --version) < /dev/null > /dev/null 2>&1 || {
Daniel Veillard01791d51998-07-24 19:24:09 +000028 echo
Daniel Veillard01791d51998-07-24 19:24:09 +000029 DIE=1
William M. Brack476cd962003-08-13 11:09:42 +000030 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"
Daniel Veillard01791d51998-07-24 19:24:09 +000033}
34
35if test "$DIE" -eq 1; then
36 exit 1
37fi
38
Daniel Veillardcd1d9442001-06-23 18:53:44 +000039test -f entities.c || {
Daniel Veillard361d8452000-04-03 19:48:13 +000040 echo "You must run this script in the top-level libxml directory"
Daniel Veillard01791d51998-07-24 19:24:09 +000041 exit 1
42}
43
Daniel Veillard16d3a612012-02-29 09:34:32 +080044EXTRA_ARGS=
45if 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 $@"
56else
57 if test -z "$NOCONFIGURE" && test -z "$*"; then
58 echo "I am going to run ./configure with no arguments - if you wish "
Daniel Veillard01791d51998-07-24 19:24:09 +000059 echo "to pass any to it, please specify them on the $0 command line."
Daniel Veillard16d3a612012-02-29 09:34:32 +080060 fi
Daniel Veillard01791d51998-07-24 19:24:09 +000061fi
62
Rob Richardsbdf24b92010-04-26 16:09:34 -040063if [ ! -d $srcdir/m4 ]; then
64 mkdir $srcdir/m4
65fi
66
Daniel Veillard743311b2010-03-10 10:35:56 +010067# Replaced by autoreconf below
Daniel Richard Gec4fc522012-08-17 10:04:30 +080068autoreconf -if -Wall
Elliot Lee8f8b4c81998-12-23 00:37:26 +000069
70cd $THEDIR
Arturo Espinosacd69df91998-12-28 23:49:02 +000071
72if test x$OBJ_DIR != x; then
73 mkdir -p "$OBJ_DIR"
74 cd "$OBJ_DIR"
75fi
76
Colin Walters81809d52012-01-05 10:08:03 -050077if test -z "$NOCONFIGURE"; then
Daniel Veillard16d3a612012-02-29 09:34:32 +080078 $srcdir/configure $EXTRA_ARGS "$@"
79 echo
Javier Jardón05fd0282012-04-02 17:39:26 +010080 echo "Now type 'make' to compile libxml2."
Colin Walters81809d52012-01-05 10:08:03 -050081fi