]> git.wh0rd.org - fontconfig.git/blob - autogen.sh
Fix autogen.sh to work with newer automakes
[fontconfig.git] / autogen.sh
1 #!/bin/sh
2 # Run this to generate all the initial makefiles, etc.
3
4 srcdir=`dirname $0`
5 test -z "$srcdir" && srcdir=.
6
7 ORIGDIR=`pwd`
8 cd $srcdir
9 PROJECT=Fontconfig
10 TEST_TYPE=-f
11 FILE=fontconfig/fontconfig.h
12 ACLOCAL=${ACLOCAL-aclocal}
13 LIBTOOLIZE=${LIBTOOLIZE-libtoolize}
14 AUTOMAKE=${AUTOMAKE-automake}
15 AUTOHEADER=${AUTOHEADER-autoheader}
16 AUTOCONF=${AUTOCONF-autoconf}
17 LIBTOOLIZE_FLAGS="--copy --force"
18
19 DIE=0
20
21 have_libtool=false
22 if $LIBTOOLIZE --version < /dev/null > /dev/null 2>&1 ; then
23 libtool_version=`$LIBTOOLIZE --version | sed 's/^[^0-9]*\([0-9].[0-9.]*\).*/\1/'`
24 case $libtool_version in
25 1.4*|1.5*|1.6*|1.7*|2*)
26 have_libtool=true
27 ;;
28 esac
29 fi
30 if $have_libtool ; then : ; else
31 echo
32 echo "You must have libtool 1.4 installed to compile $PROJECT."
33 echo "Install the appropriate package for your distribution,"
34 echo "or get the source tarball at ftp://ftp.gnu.org/pub/gnu/"
35 DIE=1
36 fi
37
38 ($AUTOCONF --version) < /dev/null > /dev/null 2>&1 || {
39 echo
40 echo "You must have autoconf installed to compile $PROJECT."
41 echo "libtool the appropriate package for your distribution,"
42 echo "or get the source tarball at ftp://ftp.gnu.org/pub/gnu/"
43 DIE=1
44 }
45
46 have_automake=false
47 need_libtoolize=true
48 if $AUTOMAKE --version < /dev/null > /dev/null 2>&1 ; then
49 automake_version=`$AUTOMAKE --version | grep 'automake (GNU automake)' | sed 's/^[^0-9]*\(.*\)/\1/'`
50 case $automake_version in
51 1.2*|1.3*|1.4)
52 ;;
53 1.4*)
54 have_automake=true
55 need_libtoolize=false
56 ;;
57 *)
58 have_automake=true
59 ;;
60 esac
61 fi
62 if $have_automake ; then : ; else
63 echo
64 echo "You must have automake 1.4-p1 installed to compile $PROJECT."
65 echo "Get ftp://ftp.gnu.org/pub/gnu/automake/automake-1.4-p1.tar.gz"
66 echo "(or a newer version if it is available)"
67 DIE=1
68 fi
69
70 if test "$DIE" -eq 1; then
71 exit 1
72 fi
73
74 test $TEST_TYPE $FILE || {
75 echo "You must run this script in the top-level $PROJECT directory"
76 exit 1
77 }
78
79 if test -z "$AUTOGEN_SUBDIR_MODE"; then
80 if test -z "$*"; then
81 echo "I am going to run ./configure with no arguments - if you wish "
82 echo "to pass any to it, please specify them on the $0 command line."
83 fi
84 fi
85
86 echo Running $ACLOCAL $ACLOCAL_FLAGS
87 $ACLOCAL $ACLOCAL_FLAGS
88
89 # optionally run autoheader
90 if $AUTOHEADER --version < /dev/null > /dev/null 2>&1; then
91 echo Running $AUTOHEADER
92 $AUTOHEADER
93 fi
94
95 case $need_libtoolize in
96 true)
97 echo Running $LIBTOOLIZE $LIBTOOLIZE_FLAGS
98 $LIBTOOLIZE $LIBTOOLIZE_FLAGS
99 ;;
100 esac
101
102 echo Running $AUTOMAKE -a $am_opt
103 $AUTOMAKE -a $am_opt
104 echo Running $AUTOCONF
105 $AUTOCONF
106 cd $ORIGDIR
107
108 if test -z "$AUTOGEN_SUBDIR_MODE"; then
109 echo Running $srcdir/configure
110 $srcdir/configure --enable-maintainer-mode "$@"
111
112 echo
113 echo "Now type 'make' to compile $PROJECT."
114 fi