2 ##############################################################################
3 # $Id: bootstrap,v 1.4 2005-08-27 10:21:51 behdad Exp $
5 # $Date: 2005-08-27 10:21:51 $
7 # $Source: /home/behdad/src/fdo/fribidi/togit/git/../fribidi/fribidi2/bootstrap,v $
8 ##############################################################################
10 # Run this file to produce a configure script.
12 DEFAULT_BOOTSTRAPFLAGS="--force --install --autoreconf=auto"
13 DEFAULT_CONFIGUREFLAGS="--enable-maintainer-mode --enable-compile-warnings"
18 DIR=`echo $0 | sed 's,[^/]*$,,'`
19 test -n "$DIR" && cd "$DIR"
21 if test "$1" = --write-configure; then
22 test -f configure && \
24 DIR=`echo $0 | sed "s,[^/]*\$,,"`
25 exec ${DIR}bootstrap --configure -- "$@"' > configure \
26 && chmod a+x configure) || \
27 echo Failed writing to configure >&2)
32 # check if we are invoked as configure, or bootstrap
33 BASE=`echo $0 | sed 's,.*/,,'`
34 if test "$BASE" = "configure"; then
36 EXTRA_CONFIGUREFLAGS=$@
38 EXTRA_BOOTSTRAPFLAGS=$*
41 for arg in $DEFAULT_BOOTSTRAPFLAGS $BOOTSTRAPFLAGS $EXTRA_BOOTSTRAPFLAGS
43 if test -n "$DASHDASHFLAGS"; then
44 DASHDASHFLAGS="$DASHDASHFLAGS $arg"
47 -h|--h|--he|--hel|--help)
49 -V|--vers|--versi|--versio|--version)
51 -v|--verb|--verbo|--verbos|--verbose)
53 -d|--de|--deb|--debu|--debug)
55 -W|--w|--wa|--war|--warn|--warni|--warnin|--warning|--warnings|--warnings=yes|--warnings=all)
56 WARNS=--warnings=all ;;
57 --no-w|--no-wa|--no-war|--no-warn|--no-warni|--no-warnin|--no-warning|--no-warnings|--warn=no|--warning=no|--warnings=no)
58 WARNS=--warnings=none ;;
59 --w=*|--wa=*|--war=*|--warn=*|--warni=*|--warnin=*|--warning=*|--warnings=*)
61 -f|--f|--fo|--for|--forc|--force|--forced|--force=yes|--force-missing)
63 --no-f|--no-fo|--no-for|--no-forc|--no-force|--no-forced|--force=no)
65 -i|--i|--in|--ins|--inst|--insta|--instal|--install|--install=yes|-a|--add-missing)
67 --no-i|--no-in|--no-ins|--no-inst|--no-insta|--no-instal|--no-install|--install=no)
69 -s|--s|--sy|--sym|--syml|--symli|--symlin|--symlink|--symlink=yes|--no-copy|--copy=no)
71 --no-s|--no-sy|--no-sym|--no-syml|--no-symli|--no-symlin|--no-symlink|--symlink=no|--copy|--copy=yes)
73 -m|--m|--ma|--mak|--make|--make=yes)
76 --no-m|--no-ma|--no-mak|--no-make|--make=no)
78 -c|--c|--co|--con|--conf|--confi|--config|--configu|--configur|--configure|--configure=yes)
80 --no-c|--no-co|--no-con|--no-conf|--no-confi|--no-config|--no-configu|--no-configur|--no-configure|--configure=no)
82 -n|--dr|--dry|--dry-|--dry-r|--dry-ru|--dry-run)
84 --auto|--autoreconf=auto)
86 --autoreconf|--autoreconf=yes)
88 --no-autoreconf|--autoreconf=no)
93 echo Ignoring unknown parameter $arg
98 test -z "$SYMLINK" && COPY=--copy
99 test -n "$INSTALL" && ADDMISSING=--add-missing
101 # use autoreconf if possible, just check for version 2+
102 if test "$AUTORECONF" = auto; then
103 case `autoreconf --version 2>/dev/null` in
104 *"autoreconf (GNU Autoconf) 2."* )
105 echo Usable autoreconf found, running
113 if test -n "$AUTORECONF"; then
114 $DRYRUN autoreconf $HELP $VERSION $VERBOSE $DEBUG $FORCE $INSTALL $SYMLINK $MAKE $WARNS $AUTORECONFFLAGS || exit $?
117 # add files 'config.guess', 'config.sub', 'ltconfig', 'ltmain.sh'
118 test -f Makefile.am && MY_LIBTOOLIZEFLAGS=--automake
120 if grep -q '^ *AC_PROG_LIBTOOL' configure.ac configure.in 2>/dev/null; then
121 $DRYRUN libtoolize $HELP $VERSION $COPY $DEBUG $FORCE $MY_LIBTOOLIZEFLAGS $LIBTOOLIZEFLAGS || exit $?
124 # generate 'aclocal.m4'
125 if test -f configure.ac -o configure.in; then
126 $DRYRUN aclocal $HELP $VERSION $VERBOSE $FORCE $ACLOCALFLAGS || exit $?
129 # generate 'config.h.in'
130 if test -f configure.ac -o configure.in; then
131 $DRYRUN autoheader $HELP $VERSION $VERBOSE $DEBUG $FORCE $WARNS $AUTOHEADERFLAGS || exit $?
134 # generate Makefile.in's from Makefile.am's
135 if test -f Makefile.am; then
136 $DRYRUN automake $HELP $VERSION $VERBOSE $ADDMISSING $COPY $FORCE $WARNS $AUTOMAKEFLAGS || exit $?
139 # generate configure from configure.ac
140 if test -f configure.ac -o -f configure.in; then
141 $DRYRUN autoconf $HELP $VERSION $VERBOSE $DEBUG $FORCE $WARNS $AUTOCONFFLAGS || exit $?
150 if test -n "$CONFIG"; then
151 if test -f ${DIR}configure; then
152 $DRYRUN ${DIR}configure $HELP $VERSION $DEFAULT_CONFIGUREFLAGS $CONFIGUREFLAGS $DASHDASHFLAGS $EXTRA_CONFIGUREFLAGS || exit $?
157 if test -n "$MAKE"; then
158 if test -f Makefile; then
159 $DRYRUN make $MAKEFLAGS || exit $?