summaryrefslogtreecommitdiff
path: root/autogen.sh
diff options
context:
space:
mode:
authorJohn Bowler <jbowler@acm.org>2012-01-25 08:30:24 -0600
committerGlenn Randers-Pehrson <glennrp at users.sourceforge.net>2012-01-25 08:30:24 -0600
commitda2194c0d5f57a259ec630a7353c040f49a9d3be (patch)
tree91a5ed225dfba1c769698c57bbf925848babc6e0 /autogen.sh
parent1eb2c48458edf825cd38f6fc335a85ddae51f2df (diff)
downloadlibpng-da2194c0d5f57a259ec630a7353c040f49a9d3be.tar.gz
[libpng16] Rewrote autogen.sh to run autoreconf
instead of running tools one-by-one.
Diffstat (limited to 'autogen.sh')
-rwxr-xr-xautogen.sh80
1 files changed, 50 insertions, 30 deletions
diff --git a/autogen.sh b/autogen.sh
index 5be104eb1..c17dd3fd9 100755
--- a/autogen.sh
+++ b/autogen.sh
@@ -1,34 +1,54 @@
#! /bin/sh
-# a quick hack script to generate necessary files from
-# auto* tools.
#
-# WARNING: if you run this you will change the versions
-# of the tools which are used and, maybe, required!
+# Run 'autoreconf' to build 'configure', 'Makefile.in' and other configure
+# control files.
+args=
+force=
+init=
+while test $# -gt 0
+do
+ case "$1" in
+ -f|--force)
+ force=1
+ args="$args $1";;
-# You can define your own replacements in your environment.
-# $AUTOCONF, $AUTOMAKE, $AUTOHEADER, $AUTOPOINT, $ACLOCAL and $LIBTOOLIZE
+ -V|--version)
+ sed -n -e \
+ '/PNG_HEADER_VERSION_STRING/,+1s/^[^"]*" \([^"]*\).."[^"]*$/\1/p' \
+ png.h
+ exit 0;;
-touch Makefile.am configure.ac
-{
- LT=${LIBTOOLIZE-libtoolize}
- echo "running $LT" >&2
- $LT --force --copy --automake
-} && {
- AL=${ACLOCAL-aclocal}
- echo "running $AL" >&2
- $AL
-} && {
- AH=${AUTOHEADER-autoheader}
- echo "running $AH [ignore the warnings]" >&2
- $AH
-} && {
- AM=${AUTOMAKE-automake}
- echo "running $AM" >&2
- $AM --force-missing --foreign -a -c
-} && {
- AC=${AUTOCONF-autoconf}
- echo "running $AC" >&2
- $AC
-} &&
- echo "autogen complete" >&2 ||
- echo "ERROR: autogen.sh failed, autogen is incomplete" >&2
+ --init)
+ init=1;;
+
+ -h|--help)
+ echo "$0: run autoreconf to update configure files" >&2
+ echo " options:" >&2
+ echo " --version: print the version of this libpng" >&2
+ echo " --force: ignore date stamps and make all files" >&2
+ echo " --init: do a complete re-initialization" >&2
+ echo " others: passed to autoreconf, use autoreconf --help" >&2
+ exit 1;;
+
+ *)
+ args="$args $1";;
+ esac
+
+ shift
+done
+
+if test -r configure -a -z "$init"
+then
+ # Configure exists, either an update or a tarball distribution
+ if test ! -d .git -a -z "$force"
+ then
+ echo "autogen: running with --force to update a non-GIT distribution" >&2
+ args="--force $args"
+ fi
+ autoreconf --warnings=all $args
+else
+ # No configure: assume this is a clean tree and everything needs to be
+ # generated
+ # autoupdate
+ autoreconf --warnings=all --force --install $args
+fi