Changeset 989
- Timestamp:
- May 26, 2006, 9:02:29 AM (17 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
ttyvaders/trunk/bootstrap
r74 r989 1 1 #! /bin/sh 2 2 3 ## bootstrap file for ttyvaders -- Sam Hocevar <sam@zoy.org> 4 ## $Id$ 3 # bootstrap: the ultimate bootstrap/autogen.sh script for autotools projects 4 # Copyright (c) 2002, 2003, 2004, 2005, 2006 Sam Hocevar <sam@zoy.org> 5 # 6 # This program is free software; you can redistribute it and/or 7 # modify it under the terms of the Do What The Fuck You Want To 8 # Public License, Version 2, as published by Sam Hocevar. See 9 # http://sam.zoy.org/wtfpl/COPYING for more details. 10 # 11 # The latest version of this script can be found at the following place: 12 # http://sam.zoy.org/autotools/ 5 13 6 set -x 14 # Die if an error occurs 7 15 set -e 8 16 9 # Get a sane environment, just in case 10 LANG=C 11 export LANG 12 CYGWIN=binmode 13 export CYGWIN 17 # Guess whether we are using configure.ac or configure.in 18 if test -f configure.ac; then 19 conffile="configure.ac" 20 elif test -f configure.in; then 21 conffile="configure.in" 22 else 23 echo "$0: could not find configure.ac or configure.in" 24 exit 1 25 fi 26 27 # Check for needed features 28 auxdir="`sed -ne 's/^[ \t]*A._CONFIG_AUX_DIR *( *\([^ )]*\).*/\1/p' $conffile`" 29 libtool="`grep -q '^[ \t]*A._PROG_LIBTOOL' $conffile && echo yes || echo no`" 30 header="`grep -q '^[ \t]*A._CONFIG_HEADER' $conffile && echo yes || echo no`" 31 aclocalflags="`sed -ne 's/^[ \t]*ACLOCAL_AMFLAGS[ \t]*=//p' Makefile.am`" 14 32 15 33 # Check for automake 16 34 amvers="no" 17 if automake-1.7 --version >/dev/null 2>&1; then 18 amvers="-1.7" 19 elif automake-1.6 --version >/dev/null 2>&1; then 20 amvers="-1.6" 21 elif automake-1.5 --version >/dev/null 2>&1; then 22 amvers="-1.5" 23 elif automake --version > /dev/null 2>&1; then 35 for v in "-1.9" "19" "-1.8" "18" "-1.7" "17" "-1.6" "16" "-1.5" "15"; do 36 if automake${v} --version >/dev/null 2>&1; then 37 amvers="${v}" 38 break 39 fi 40 done 41 42 if test "${amvers}" = "no" && automake --version > /dev/null 2>&1; then 24 43 amvers="`automake --version | sed -e '1s/[^0-9]*//' -e q`" 25 44 if expr "$amvers" "<" "1.5" > /dev/null 2>&1; then … … 31 50 32 51 if test "$amvers" = "no"; then 33 set +x34 52 echo "$0: you need automake version 1.5 or later" 35 53 exit 1 36 54 fi 37 55 56 # Check for autoconf 57 acvers="no" 58 for v in "" "259" "253"; do 59 if autoconf${v} --version >/dev/null 2>&1; then 60 acvers="${v}" 61 break 62 fi 63 done 64 65 if test "$acvers" = "no"; then 66 echo "$0: you need autoconf" 67 exit 1 68 fi 69 70 # Check for libtool 71 if test "$libtool" = "yes"; then 72 libtoolize="no" 73 if glibtoolize --version >/dev/null 2>&1; then 74 libtoolize="glibtoolize" 75 else 76 for v in "16" "15" "" "14"; do 77 if libtoolize${v} --version >/dev/null 2>&1; then 78 libtoolize="libtoolize${v}" 79 break 80 fi 81 done 82 fi 83 84 if test "$libtoolize" = "no"; then 85 echo "$0: you need libtool" 86 exit 1 87 fi 88 fi 89 38 90 # Remove old cruft 39 rm -f aclocal.m4 configure config.guess config.log config.sub config.cache config.h.in config.h compile ltmain.sh libtool ltconfig missing mkinstalldirs depcomp install-sh INSTALL 91 for x in aclocal.m4 configure config.guess config.log config.sub config.cache config.h.in config.h compile libtool.m4 ltoptions.m4 ltsugar.m4 ltversion.m4 ltmain.sh libtool ltconfig missing mkinstalldirs depcomp install-sh; do rm -f $x autotools/$x; if test -n "$auxdir"; then rm -f "$auxdir/$x"; fi; done 40 92 rm -Rf autom4te.cache 41 (cd autotools && rm -f config.guess config.sub missing mkinstalldirs compile ltmain.sh depcomp install-sh) 93 if test -n "$auxdir" -a ! -d "$auxdir"; then mkdir "$auxdir"; fi 42 94 43 aclocal${amvers} 44 autoconf 45 autoheader 46 automake${amvers} --add-missing --copy 95 # Explain what we are doing from now 96 set -x 47 97 98 # Bootstrap package 99 if test "$libtool" = "yes"; then 100 ${libtoolize} --copy --force 101 if test -n "$auxdir" -a -f "ltmain.sh"; then 102 echo "$0: working around a minor libtool issue" 103 mv ltmain.sh "$auxdir/" 104 fi 105 fi 106 107 if test -n "$auxdir"; then 108 aclocal${amvers} -I autotools ${aclocalflags} 109 else 110 aclocal${amvers} ${aclocalflags} 111 fi 112 autoconf${acvers} 113 if test "$header" = "yes"; then 114 autoheader${acvers} 115 fi 116 #add --include-deps if you want to bootstrap with any other compiler than gcc 117 #automake${amvers} --add-missing --copy --include-deps 118 automake${amvers} --foreign --add-missing --copy 119 120 # Remove cruft that we no longer want 121 rm -Rf autom4te.cache 122
Note: See TracChangeset
for help on using the changeset viewer.