Browse Source

Make platform/unix/automagic nicer

Bart van Strien 14 years ago
parent
commit
b7d3054f6b
1 changed files with 22 additions and 7 deletions
  1. 22 7
      platform/unix/automagic

+ 22 - 7
platform/unix/automagic

@@ -1,10 +1,25 @@
 #!/bin/bash
 #!/bin/bash
-if ! sh platform/unix/gen-makefile; then
-	echo "You should be doing this from the root directory of the project."
+
+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
 	exit 1
+else
+	echo "Success, carry on configuring."
 fi
 fi
-autoheader # Gimmie config.h.in
-libtoolize --force
-aclocal
-autoconf
-automake -a