#! /bin/sh set -e ### Basic setup stuff ego=$(echo "$0" | sed 's:^.*[/\\]::; s:\.*$::') usage="Usage: $ego [--debian]" ### Parse options debian=no while [ $# -gt 0 ]; do case "$1" in --help | -h | --usage | -u) echo "$usage" exit ;; --debian) debian=yes ;; --) shift break ;; -*) echo >&2 "$ego: unknown option \`$1'" exit 1 ;; esac shift done if [ $# -ne 0 ]; then echo >&2 "$usage" exit 1 fi ### Link any strange common files we need [ -f .links ] && mklinks ### Do any local stuff [ -x build-setup ] && ./build-setup start ### Grind through the Autoconf machinery configure= for i in configure.ac configure.in; do [ -f $i ] && configure=$i done if [ "$configure" ]; then grep >/dev/null AM_PROG_LIBTOOL $configure && libtoolize find . -name Makefile.m4 -print | while read m4; do dir=$(echo $m4 | sed 's:/[^/]*$::') (cd $dir && m4 Makefile.m4 >Makefile.am.new && mv Makefile.am.new Makefile.am) done aclocalargs= for i in config m4; do [ -d $i ] && aclocalargs="$aclocalargs -I $i"; done aclocal $aclocalargs autoconf grep >/dev/null AM_CONFIG_HEADER $configure && autoheader [ -f Makefile.am ] && automake -a fi ### Do any local stuff [ -x build-setup ] && ./build-setup end