Daniel Veillard | 01791d5 | 1998-07-24 19:24:09 +0000 | [diff] [blame] | 1 | #!/bin/sh |
| 2 | # Run this to generate all the initial makefiles, etc. |
| 3 | |
Elliot Lee | 8f8b4c8 | 1998-12-23 00:37:26 +0000 | [diff] [blame] | 4 | srcdir=`dirname $0` |
| 5 | test -z "$srcdir" && srcdir=. |
| 6 | |
| 7 | THEDIR=`pwd` |
| 8 | cd $srcdir |
Daniel Veillard | 01791d5 | 1998-07-24 19:24:09 +0000 | [diff] [blame] | 9 | DIE=0 |
| 10 | |
| 11 | (autoconf --version) < /dev/null > /dev/null 2>&1 || { |
| 12 | echo |
Daniel Veillard | 361d845 | 2000-04-03 19:48:13 +0000 | [diff] [blame] | 13 | echo "You must have autoconf installed to compile libxml." |
Daniel Veillard | 01791d5 | 1998-07-24 19:24:09 +0000 | [diff] [blame] | 14 | echo "Download the appropriate package for your distribution," |
William M. Brack | 476cd96 | 2003-08-13 11:09:42 +0000 | [diff] [blame] | 15 | echo "or see http://www.gnu.org/software/autoconf" |
Daniel Veillard | 01791d5 | 1998-07-24 19:24:09 +0000 | [diff] [blame] | 16 | DIE=1 |
| 17 | } |
| 18 | |
Elliott Hughes | ecdab2a | 2022-02-23 14:33:50 -0800 | [diff] [blame] | 19 | (libtoolize --version) < /dev/null > /dev/null 2>&1 || |
| 20 | (glibtoolize --version) < /dev/null > /dev/null 2>&1 || { |
Daniel Veillard | 01791d5 | 1998-07-24 19:24:09 +0000 | [diff] [blame] | 21 | echo |
Daniel Veillard | 361d845 | 2000-04-03 19:48:13 +0000 | [diff] [blame] | 22 | echo "You must have libtool installed to compile libxml." |
William M. Brack | 476cd96 | 2003-08-13 11:09:42 +0000 | [diff] [blame] | 23 | echo "Download the appropriate package for your distribution," |
| 24 | echo "or see http://www.gnu.org/software/libtool" |
Daniel Veillard | 01791d5 | 1998-07-24 19:24:09 +0000 | [diff] [blame] | 25 | DIE=1 |
| 26 | } |
| 27 | |
William M. Brack | 476cd96 | 2003-08-13 11:09:42 +0000 | [diff] [blame] | 28 | (automake --version) < /dev/null > /dev/null 2>&1 || { |
Daniel Veillard | 01791d5 | 1998-07-24 19:24:09 +0000 | [diff] [blame] | 29 | echo |
Daniel Veillard | 01791d5 | 1998-07-24 19:24:09 +0000 | [diff] [blame] | 30 | DIE=1 |
William M. Brack | 476cd96 | 2003-08-13 11:09:42 +0000 | [diff] [blame] | 31 | 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 Veillard | 01791d5 | 1998-07-24 19:24:09 +0000 | [diff] [blame] | 34 | } |
| 35 | |
| 36 | if test "$DIE" -eq 1; then |
| 37 | exit 1 |
| 38 | fi |
| 39 | |
Daniel Veillard | cd1d944 | 2001-06-23 18:53:44 +0000 | [diff] [blame] | 40 | test -f entities.c || { |
Daniel Veillard | 361d845 | 2000-04-03 19:48:13 +0000 | [diff] [blame] | 41 | echo "You must run this script in the top-level libxml directory" |
Daniel Veillard | 01791d5 | 1998-07-24 19:24:09 +0000 | [diff] [blame] | 42 | exit 1 |
| 43 | } |
| 44 | |
Daniel Veillard | 16d3a61 | 2012-02-29 09:34:32 +0800 | [diff] [blame] | 45 | EXTRA_ARGS= |
| 46 | if 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 $@" |
| 57 | else |
| 58 | if test -z "$NOCONFIGURE" && test -z "$*"; then |
| 59 | echo "I am going to run ./configure with no arguments - if you wish " |
Daniel Veillard | 01791d5 | 1998-07-24 19:24:09 +0000 | [diff] [blame] | 60 | echo "to pass any to it, please specify them on the $0 command line." |
Daniel Veillard | 16d3a61 | 2012-02-29 09:34:32 +0800 | [diff] [blame] | 61 | fi |
Daniel Veillard | 01791d5 | 1998-07-24 19:24:09 +0000 | [diff] [blame] | 62 | fi |
| 63 | |
Rob Richards | bdf24b9 | 2010-04-26 16:09:34 -0400 | [diff] [blame] | 64 | if [ ! -d $srcdir/m4 ]; then |
| 65 | mkdir $srcdir/m4 |
| 66 | fi |
| 67 | |
Daniel Veillard | 743311b | 2010-03-10 10:35:56 +0100 | [diff] [blame] | 68 | # Replaced by autoreconf below |
Daniel Richard G | ec4fc52 | 2012-08-17 10:04:30 +0800 | [diff] [blame] | 69 | autoreconf -if -Wall |
Elliot Lee | 8f8b4c8 | 1998-12-23 00:37:26 +0000 | [diff] [blame] | 70 | |
Elliott Hughes | 7fbecab | 2019-01-10 16:42:03 -0800 | [diff] [blame] | 71 | if ! grep -q pkg.m4 aclocal.m4; then |
| 72 | cat <<EOF |
| 73 | |
| 74 | Couldn't find pkg.m4 from pkg-config. Install the appropriate package for |
| 75 | your distribution or set ACLOCAL_PATH to the directory containing pkg.m4. |
| 76 | EOF |
| 77 | exit 1 |
| 78 | fi |
| 79 | |
Elliot Lee | 8f8b4c8 | 1998-12-23 00:37:26 +0000 | [diff] [blame] | 80 | cd $THEDIR |
Arturo Espinosa | cd69df9 | 1998-12-28 23:49:02 +0000 | [diff] [blame] | 81 | |
| 82 | if test x$OBJ_DIR != x; then |
| 83 | mkdir -p "$OBJ_DIR" |
| 84 | cd "$OBJ_DIR" |
| 85 | fi |
| 86 | |
Colin Walters | 81809d5 | 2012-01-05 10:08:03 -0500 | [diff] [blame] | 87 | if test -z "$NOCONFIGURE"; then |
Daniel Veillard | 16d3a61 | 2012-02-29 09:34:32 +0800 | [diff] [blame] | 88 | $srcdir/configure $EXTRA_ARGS "$@" |
Elliott Hughes | 7fbecab | 2019-01-10 16:42:03 -0800 | [diff] [blame] | 89 | 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 Walters | 81809d5 | 2012-01-05 10:08:03 -0500 | [diff] [blame] | 96 | fi |