blob: 3778be719789f5e0143974ce66233f2fe67f33c3 [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
Elliott Hughesecdab2a2022-02-23 14:33:50 -080019(libtoolize --version) < /dev/null > /dev/null 2>&1 ||
20(glibtoolize --version) < /dev/null > /dev/null 2>&1 || {
Daniel Veillard01791d51998-07-24 19:24:09 +000021 echo
Daniel Veillard361d8452000-04-03 19:48:13 +000022 echo "You must have libtool installed to compile libxml."
William M. Brack476cd962003-08-13 11:09:42 +000023 echo "Download the appropriate package for your distribution,"
24 echo "or see http://www.gnu.org/software/libtool"
Daniel Veillard01791d51998-07-24 19:24:09 +000025 DIE=1
26}
27
William M. Brack476cd962003-08-13 11:09:42 +000028(automake --version) < /dev/null > /dev/null 2>&1 || {
Daniel Veillard01791d51998-07-24 19:24:09 +000029 echo
Daniel Veillard01791d51998-07-24 19:24:09 +000030 DIE=1
William M. Brack476cd962003-08-13 11:09:42 +000031 echo "You must have automake installed to compile libxml."
32 echo "Download the appropriate package for your distribution,"
33 echo "or see http://www.gnu.org/software/automake"
Daniel Veillard01791d51998-07-24 19:24:09 +000034}
35
36if test "$DIE" -eq 1; then
37 exit 1
38fi
39
Daniel Veillardcd1d9442001-06-23 18:53:44 +000040test -f entities.c || {
Daniel Veillard361d8452000-04-03 19:48:13 +000041 echo "You must run this script in the top-level libxml directory"
Daniel Veillard01791d51998-07-24 19:24:09 +000042 exit 1
43}
44
Daniel Veillard16d3a612012-02-29 09:34:32 +080045EXTRA_ARGS=
46if test "x$1" = "x--system"; then
47 shift
48 prefix=/usr
49 libdir=$prefix/lib
50 sysconfdir=/etc
51 localstatedir=/var
52 if [ -d /usr/lib64 ]; then
53 libdir=$prefix/lib64
54 fi
55 EXTRA_ARGS="--prefix=$prefix --sysconfdir=$sysconfdir --localstatedir=$localstatedir --libdir=$libdir"
56 echo "Running ./configure with $EXTRA_ARGS $@"
57else
58 if test -z "$NOCONFIGURE" && test -z "$*"; then
59 echo "I am going to run ./configure with no arguments - if you wish "
Daniel Veillard01791d51998-07-24 19:24:09 +000060 echo "to pass any to it, please specify them on the $0 command line."
Daniel Veillard16d3a612012-02-29 09:34:32 +080061 fi
Daniel Veillard01791d51998-07-24 19:24:09 +000062fi
63
Rob Richardsbdf24b92010-04-26 16:09:34 -040064if [ ! -d $srcdir/m4 ]; then
65 mkdir $srcdir/m4
66fi
67
Daniel Veillard743311b2010-03-10 10:35:56 +010068# Replaced by autoreconf below
Daniel Richard Gec4fc522012-08-17 10:04:30 +080069autoreconf -if -Wall
Elliot Lee8f8b4c81998-12-23 00:37:26 +000070
Elliott Hughes7fbecab2019-01-10 16:42:03 -080071if ! grep -q pkg.m4 aclocal.m4; then
72 cat <<EOF
73
74Couldn't find pkg.m4 from pkg-config. Install the appropriate package for
75your distribution or set ACLOCAL_PATH to the directory containing pkg.m4.
76EOF
77 exit 1
78fi
79
Elliot Lee8f8b4c81998-12-23 00:37:26 +000080cd $THEDIR
Arturo Espinosacd69df91998-12-28 23:49:02 +000081
82if test x$OBJ_DIR != x; then
83 mkdir -p "$OBJ_DIR"
84 cd "$OBJ_DIR"
85fi
86
Colin Walters81809d52012-01-05 10:08:03 -050087if test -z "$NOCONFIGURE"; then
Daniel Veillard16d3a612012-02-29 09:34:32 +080088 $srcdir/configure $EXTRA_ARGS "$@"
Elliott Hughes7fbecab2019-01-10 16:42:03 -080089 if test "$?" -ne 0; then
90 echo
91 echo "Configure script failed, check config.log for more info."
92 else
93 echo
94 echo "Now type 'make' to compile libxml2."
95 fi
Colin Walters81809d52012-01-05 10:08:03 -050096fi