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