X-Git-Url: https://git.distorted.org.uk/~mdw/cfd/blobdiff_plain/996a7fd061af73f7b8d69fcf91d8f5c0393b9a01..282625e1b87743236f1cb8c70c2762edd413c6b0:/mdw-setup diff --git a/mdw-setup b/mdw-setup index 57dbd90..e4513e0 100755 --- a/mdw-setup +++ b/mdw-setup @@ -1,7 +1,7 @@ #! /bin/sh ### -*-sh-*- ### -### Create links to the repository +### Set up a new project ### ### (c) 1997 Mark Wooding ### @@ -29,7 +29,7 @@ set -e ###-------------------------------------------------------------------------- ### Basic setup stuff. -ego=$(echo "$0" | sed 's:^.*[/\\]::; s:\.*$::') +ego=${0##*[/\\]}; ego=${ego%%.*} usage="Usage: $ego" ###-------------------------------------------------------------------------- @@ -66,7 +66,7 @@ fi ###-------------------------------------------------------------------------- ### Do any initial local stuff. -[ -x build-setup ] && ./build-setup start +if [ -x build-setup ]; then ./build-setup start; fi ###-------------------------------------------------------------------------- ### Grind through the Autoconf machinery. @@ -76,9 +76,9 @@ for i in configure.ac configure.in; do [ -f $i ] && configure=$i done if [ "$configure" ]; then - grep >/dev/null AM_PROG_LIBTOOL $configure && libtoolize + grep >/dev/null AM_PROG_LIBTOOL $configure && libtoolize -f find . -name Makefile.m4 -print | while read m4; do - dir=$(echo $m4 | sed 's:/[^/]*$::') + dir=${m4%/*} (cd $dir && m4 Makefile.m4 >Makefile.am.new && mv Makefile.am.new Makefile.am) @@ -89,7 +89,7 @@ if [ "$configure" ]; then autoconf --force if grep >/dev/null 'AC_CONFIG_AUX_DIR' $configure; then auxdir=$( - sed -n 's:^.*AC_CONFIG_AUX_DIR(\[\?\([^])]*\)\]\?).*$:\1:p' $configure) + sed -n 's:^.*AC_CONFIG_AUX_DIR(\[\{0,1\}\([^])]*\)\]\{0,1\}).*$:\1:p' $configure) mkdir -p $auxdir fi grep >/dev/null 'A[MC]_CONFIG_HEADER' $configure && autoheader @@ -99,6 +99,6 @@ fi ###-------------------------------------------------------------------------- ### Do any final local stuff. -[ -x build-setup ] && ./build-setup end +if [ -x build-setup ]; then ./build-setup end; fi ###------ That's all, folks -------------------------------------------------