From b7d3054f6b313d9f9f5f9253b9772cc4f3e75085 Mon Sep 17 00:00:00 2001 From: Bart van Strien Date: Wed, 8 Jun 2011 21:55:23 +0200 Subject: [PATCH] Make platform/unix/automagic nicer --- platform/unix/automagic | 31 +++++++++++++++++++++++-------- 1 file changed, 23 insertions(+), 8 deletions(-) diff --git a/platform/unix/automagic b/platform/unix/automagic index b2de67e12..d885ea03b 100755 --- a/platform/unix/automagic +++ b/platform/unix/automagic @@ -1,10 +1,25 @@ #!/bin/bash -if ! sh platform/unix/gen-makefile; then - echo "You should be doing this from the root directory of the project." - exit 1 + +automagic() { + if ! sh platform/unix/gen-makefile; then + echo "You should be doing this from the root directory of the project." + exit 1 + fi + autoheader 2>&1 || return 1 # Gimmie config.h.in + libtoolize --force 2>&1 || return 1 + aclocal 2>&1 || return 1 + autoconf 2>&1 || return 1 + automake -a 2>&1 || return 1 +} + +if [[ $1 == "-d" ]]; then + automagic +else + automagic > /dev/null +fi +if [ $? -eq 1 ]; then + echo "Failed, please contact the developers." + exit 1 +else + echo "Success, carry on configuring." fi -autoheader # Gimmie config.h.in -libtoolize --force -aclocal -autoconf -automake -a