reed@android.com | 5469607 | 2010-04-08 18:48:12 +0000 | [diff] [blame] | 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 | ORIGDIR=`pwd` |
| 10 | cd $srcdir |
| 11 | PROJECT=harfbuzz |
| 12 | TEST_TYPE=-f |
| 13 | FILE=src/harfbuzz.h |
| 14 | ACLOCAL=${ACLOCAL-aclocal} |
| 15 | LIBTOOLIZE=${LIBTOOLIZE-libtoolize} |
| 16 | AUTOMAKE=${AUTOMAKE-automake} |
| 17 | AUTOHEADER=${AUTOHEADER-autoheader} |
| 18 | AUTOCONF=${AUTOCONF-autoconf} |
| 19 | LIBTOOLIZE_FLAGS="--copy --force" |
| 20 | |
| 21 | DIE=0 |
| 22 | |
| 23 | have_libtool=false |
| 24 | if $LIBTOOLIZE --version < /dev/null > /dev/null 2>&1 ; then |
| 25 | libtool_version=`$LIBTOOLIZE --version | sed 's/^[^0-9]*\([0-9].[0-9.]*\).*/\1/'` |
| 26 | case $libtool_version in |
| 27 | 1.4*|1.5*|1.6*|1.7*|2*) |
| 28 | have_libtool=true |
| 29 | ;; |
| 30 | esac |
| 31 | fi |
| 32 | if $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 |
| 38 | fi |
| 39 | |
| 40 | ($AUTOCONF --version) < /dev/null > /dev/null 2>&1 || { |
| 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 | |
| 48 | have_automake=false |
| 49 | need_libtoolize=true |
| 50 | if $AUTOMAKE --version < /dev/null > /dev/null 2>&1 ; then |
| 51 | automake_version=`$AUTOMAKE --version | grep 'automake (GNU automake)' | sed 's/^[^0-9]*\(.*\)/\1/'` |
| 52 | case $automake_version in |
| 53 | 1.2*|1.3*|1.4) |
| 54 | ;; |
| 55 | 1.4*) |
| 56 | have_automake=true |
| 57 | need_libtoolize=false |
| 58 | ;; |
| 59 | *) |
| 60 | have_automake=true |
| 61 | ;; |
| 62 | esac |
| 63 | fi |
| 64 | if $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 |
| 70 | fi |
| 71 | |
| 72 | if test "$DIE" -eq 1; then |
| 73 | exit 1 |
| 74 | fi |
| 75 | |
| 76 | test $TEST_TYPE $FILE || { |
| 77 | echo "You must run this script in the top-level $PROJECT directory" |
| 78 | exit 1 |
| 79 | } |
| 80 | |
| 81 | if 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 |
| 86 | fi |
| 87 | |
| 88 | echo Running $ACLOCAL $ACLOCAL_FLAGS |
| 89 | $ACLOCAL $ACLOCAL_FLAGS |
| 90 | |
| 91 | # optionally run autoheader |
| 92 | if $AUTOHEADER --version < /dev/null > /dev/null 2>&1; then |
| 93 | echo Running $AUTOHEADER |
| 94 | $AUTOHEADER |
| 95 | fi |
| 96 | |
| 97 | case $need_libtoolize in |
| 98 | true) |
| 99 | echo Running $LIBTOOLIZE $LIBTOOLIZE_FLAGS |
| 100 | $LIBTOOLIZE $LIBTOOLIZE_FLAGS |
| 101 | ;; |
| 102 | esac |
| 103 | |
| 104 | echo Running $AUTOMAKE -a $am_opt |
| 105 | $AUTOMAKE -a $am_opt |
| 106 | echo Running $AUTOCONF |
| 107 | $AUTOCONF |
| 108 | cd $ORIGDIR |
| 109 | |
| 110 | if test -z "$AUTOGEN_SUBDIR_MODE"; then |
| 111 | echo Running $srcdir/configure "$@" |
| 112 | $srcdir/configure "$@" |
| 113 | |
| 114 | echo |
| 115 | echo "Now type 'make' to compile $PROJECT." |
| 116 | fi |