From 30a4312c4913b956df15351e48a48b781c2cd1f5 Mon Sep 17 00:00:00 2001 From: Mark Wooding Date: Tue, 7 Feb 2006 19:44:18 +0000 Subject: [PATCH] Change in project setups. Replace lots of little `setup' scripts with a single `mdw-setup' script here which works out what it needs to do. Also, don't explicitly call `mkinstalldirs' from the Makefile.am, because it doesn't exist any more. --- Makefile.am | 4 ++-- mdw-setup | 58 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ setup | 7 ------- 3 files changed, 60 insertions(+), 9 deletions(-) create mode 100755 mdw-setup delete mode 100755 setup diff --git a/Makefile.am b/Makefile.am index 460bc27..3e021de 100644 --- a/Makefile.am +++ b/Makefile.am @@ -32,7 +32,7 @@ AUTOMAKE_OPTIONS = foreign ## --- What needs building --- -bin_SCRIPTS = mklinks findlinks txtlib mkaclocal +bin_SCRIPTS = mklinks findlinks txtlib mkaclocal mdw-setup ## --- Files to install in the repository --- @@ -51,7 +51,7 @@ pkgdata_SCRIPTS = \ install-ac maninst install-data-hook: - $(srcdir)/mkinstalldirs $(DESTDIR)$(aclocaldir) + $(mkinstalldirs) $(DESTDIR)$(aclocaldir) $(srcdir)/install-ac install \ $(srcdir)/aclocal.glob $(DESTDIR)$(aclocaldir) uninstall-hook: diff --git a/mdw-setup b/mdw-setup new file mode 100755 index 0000000..d18a49a --- /dev/null +++ b/mdw-setup @@ -0,0 +1,58 @@ +#! /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 + +### 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 + am=$(echo $m4 | sed 's:.m4:.am:') + m4 $m4 >$am.new + mv $am.new $am + done + mkaclocal + autoconf + grep >/dev/null AM_CONFIG_HEADER $configure && autoheader + [ -f Makefile.am ] && automake -a +fi + +### Maybe make a build directory +[ $debian = no ] && [ ! -e build ] && mkdir build diff --git a/setup b/setup deleted file mode 100755 index 5c7f1e0..0000000 --- a/setup +++ /dev/null @@ -1,7 +0,0 @@ -#! /bin/sh - -set -e -mkaclocal || cp aclocal.glob aclocal.m4 -autoconf -automake -a -mkdir -p build -- 2.11.0