From 8576118c37c8fd0b03f18ba1e56cedbcd5bd658d Mon Sep 17 00:00:00 2001 From: Khaled Hosny Date: Sun, 11 Feb 2018 00:49:13 +0200 Subject: [PATCH] Replace bootstrap with simpler autogen.sh MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit Copied from HarfBuzz but removed the parts we don’t need. Fixes the rest of https://github.com/fribidi/fribidi/issues/35 --- .travis.yml | 5 +- Makefile.am | 2 +- README.md | 2 +- autogen.sh | 35 ++++++++++++ bootstrap | 154 ---------------------------------------------------- 5 files changed, 38 insertions(+), 160 deletions(-) create mode 100755 autogen.sh delete mode 100755 bootstrap diff --git a/.travis.yml b/.travis.yml index c022cb4..787d5f4 100644 --- a/.travis.yml +++ b/.travis.yml @@ -11,11 +11,8 @@ matrix: - os: osx compiler: clang -install: - - ./bootstrap - script: - - ./configure + - ./autogen.sh - make - make check || (cat */test-suite.log && false) - make distcheck || (cat */test-suite.log && false) diff --git a/Makefile.am b/Makefile.am index 8828c69..4767d69 100644 --- a/Makefile.am +++ b/Makefile.am @@ -6,7 +6,7 @@ ACLOCAL_AMFLAGS = -I m4 ## The order of subdirs is important, don't change without a reason. SUBDIRS = gen.tab charset lib bin doc test -EXTRA_DIST = bootstrap ChangeLog.old +EXTRA_DIST = autogen.sh ChangeLog.old pkgconfigdir = $(libdir)/pkgconfig pkgconfig_DATA = @PACKAGE@.pc diff --git a/README.md b/README.md index 8937f15..33c1a5d 100644 --- a/README.md +++ b/README.md @@ -41,7 +41,7 @@ The latest version of GNU FriBidi may be found at: ## Building -Start with running the [`bootstrap`](./bootstrap) script and follow the +Start with running the [`autogen.sh`](./autogen.sh) script and follow the instructions. diff --git a/autogen.sh b/autogen.sh new file mode 100755 index 0000000..2530b37 --- /dev/null +++ b/autogen.sh @@ -0,0 +1,35 @@ +#!/bin/sh +# Run this to generate all the initial makefiles, etc. + +test -n "$srcdir" || srcdir=`dirname "$0"` +test -n "$srcdir" || srcdir=. + +olddir=`pwd` +cd $srcdir + +echo -n "checking for pkg-config... " +which pkg-config || { + echo "*** No pkg-config found, please install it ***" + exit 1 +} + +echo -n "checking for libtoolize... " +which glibtoolize || which libtoolize || { + echo "*** No libtoolize (libtool) found, please install it ***" + exit 1 +} + +echo -n "checking for autoreconf... " +which autoreconf || { + echo "*** No autoreconf (autoconf) found, please install it ***" + exit 1 +} + +echo "running autoreconf --force --install --verbose" +autoreconf --force --install --verbose || exit $? + +cd $olddir +test -n "$NOCONFIGURE" || { + echo "running configure $@" + "$srcdir/configure" "$@" +} diff --git a/bootstrap b/bootstrap deleted file mode 100755 index 8fc5fec..0000000 --- a/bootstrap +++ /dev/null @@ -1,154 +0,0 @@ -#! /bin/sh -# -*- Bootstrap -*- -# Run this file to produce a configure script. - -DEFAULT_BOOTSTRAPFLAGS="--force --install --autoreconf=auto" -DEFAULT_CONFIGUREFLAGS="--enable-maintainer-mode --enable-compile-warnings" - -OLDDIR=`pwd` - -# move to source dir -DIR=`echo $0 | sed 's,[^/]*$,,'` -test -n "$DIR" && cd "$DIR" - -if test "$1" = --write-configure; then - test -f configure && \ - ((echo '#! /bin/sh - DIR=`echo $0 | sed "s,[^/]*\$,,"` - exec ${DIR}bootstrap --configure -- "$@"' > configure \ - && chmod a+x configure) || \ - echo Failed writing to configure >&2) - - exit $? -fi - -# check if we are invoked as configure, or bootstrap -BASE=`echo $0 | sed 's,.*/,,'` -if test "$BASE" = "configure"; then - CONFIG=--config - EXTRA_CONFIGUREFLAGS=$@ -else # bootstrap - EXTRA_BOOTSTRAPFLAGS=$* -fi - -for arg in $DEFAULT_BOOTSTRAPFLAGS $BOOTSTRAPFLAGS $EXTRA_BOOTSTRAPFLAGS -do -if test -n "$DASHDASHFLAGS"; then - DASHDASHFLAGS="$DASHDASHFLAGS $arg" -else - case $arg in - -h|--h|--he|--hel|--help) - HELP=--help ;; - -V|--vers|--versi|--versio|--version) - VERSION=--version ;; - -v|--verb|--verbo|--verbos|--verbose) - VERBOSE=--verbose ;; - -d|--de|--deb|--debu|--debug) - DEBUG=--debug ;; - -W|--w|--wa|--war|--warn|--warni|--warnin|--warning|--warnings|--warnings=yes|--warnings=all) - WARNS=--warnings=all ;; - --no-w|--no-wa|--no-war|--no-warn|--no-warni|--no-warnin|--no-warning|--no-warnings|--warn=no|--warning=no|--warnings=no) - WARNS=--warnings=none ;; - --w=*|--wa=*|--war=*|--warn=*|--warni=*|--warnin=*|--warning=*|--warnings=*) - WARNS=$arg ;; - -f|--f|--fo|--for|--forc|--force|--forced|--force=yes|--force-missing) - FORCE=--force ;; - --no-f|--no-fo|--no-for|--no-forc|--no-force|--no-forced|--force=no) - FORCE=--no-force ;; - -i|--i|--in|--ins|--inst|--insta|--instal|--install|--install=yes|-a|--add-missing) - INSTALL=--install ;; - --no-i|--no-in|--no-ins|--no-inst|--no-insta|--no-instal|--no-install|--install=no) - INSTALL= ;; - -s|--s|--sy|--sym|--syml|--symli|--symlin|--symlink|--symlink=yes|--no-copy|--copy=no) - SYMLINK=--symlink ;; - --no-s|--no-sy|--no-sym|--no-syml|--no-symli|--no-symlin|--no-symlink|--symlink=no|--copy|--copy=yes) - SYMLINK= ;; - -m|--m|--ma|--mak|--make|--make=yes) - MAKE=--make - CONFIG=--configure ;; - --no-m|--no-ma|--no-mak|--no-make|--make=no) - MAKE= ;; - -c|--c|--co|--con|--conf|--confi|--config|--configu|--configur|--configure|--configure=yes) - CONFIG=--configure ;; - --no-c|--no-co|--no-con|--no-conf|--no-confi|--no-config|--no-configu|--no-configur|--no-configure|--configure=no) - CONFIG= ;; - -n|--dr|--dry|--dry-|--dry-r|--dry-ru|--dry-run) - DRYRUN=echo ;; - --auto|--autoreconf=auto) - AUTORECONF=auto ;; - --autoreconf|--autoreconf=yes) - AUTORECONF=yes ;; - --no-autoreconf|--autoreconf=no) - AUTORECONF= ;; - --) - DASHDASHFLAGS=" " ;; - *) - echo Ignoring unknown parameter $arg - esac -fi -done - -test -z "$SYMLINK" && COPY=--copy -test -n "$INSTALL" && ADDMISSING=--add-missing - -# use autoreconf if possible, just check for version 2+ -if test "$AUTORECONF" = auto; then - case `autoreconf --version 2>/dev/null` in - *"autoreconf (GNU Autoconf) 2."* ) - echo Usable autoreconf found, running - ;; - *) - AUTORECONF= - ;; - esac -fi - -if test -n "$AUTORECONF"; then - $DRYRUN autoreconf $HELP $VERSION $VERBOSE $DEBUG $FORCE $INSTALL $SYMLINK $MAKE $WARNS $AUTORECONFFLAGS || exit $? -else - -# add files 'config.guess', 'config.sub', 'ltconfig', 'ltmain.sh' -test -f Makefile.am && MY_LIBTOOLIZEFLAGS=--automake - -if grep -q '^ *AC_PROG_LIBTOOL' configure.ac configure.in 2>/dev/null; then - $DRYRUN libtoolize $HELP $VERSION $COPY $DEBUG $FORCE $MY_LIBTOOLIZEFLAGS $LIBTOOLIZEFLAGS || exit $? -fi - -# generate 'aclocal.m4' -if test -f configure.ac -o configure.in; then - $DRYRUN aclocal $HELP $VERSION $VERBOSE $FORCE $ACLOCALFLAGS || exit $? -fi - -# generate 'config.h.in' -if test -f configure.ac -o configure.in; then - $DRYRUN autoheader $HELP $VERSION $VERBOSE $DEBUG $FORCE $WARNS $AUTOHEADERFLAGS || exit $? -fi - -# generate Makefile.in's from Makefile.am's -if test -f Makefile.am; then - $DRYRUN automake $HELP $VERSION $VERBOSE $ADDMISSING $COPY $FORCE $WARNS $AUTOMAKEFLAGS || exit $? -fi - -# generate configure from configure.ac -if test -f configure.ac -o -f configure.in; then - $DRYRUN autoconf $HELP $VERSION $VERBOSE $DEBUG $FORCE $WARNS $AUTOCONFFLAGS || exit $? -fi - -fi # !AUTOCONF - -# move to build dir -cd $OLDDIR - -# configure -if test -n "$CONFIG"; then - if test -f ${DIR}configure; then - $DRYRUN ${DIR}configure $HELP $VERSION $DEFAULT_CONFIGUREFLAGS $CONFIGUREFLAGS $DASHDASHFLAGS $EXTRA_CONFIGUREFLAGS || exit $? - fi -fi - -# make -if test -n "$MAKE"; then - if test -f Makefile; then - $DRYRUN make $MAKEFLAGS || exit $? - fi -fi -- 2.40.0