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