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