changeset 2:3297aa761bc2

Added autogen.sh
author jcid
date Sun, 07 Oct 2007 00:43:20 +0200
parents 6ee11bf9e3ea
children 05a33a2ac9ba
files autogen.sh
diffstat 1 files changed, 59 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/autogen.sh	Sun Oct 07 00:43:20 2007 +0200
@@ -0,0 +1,59 @@
+#!/bin/sh
+#
+# Script to generate configure&make stuff
+#
+
+#-----------------------------------------------------
+# If defined, get these programs from the environment
+#
+: ${ACLOCAL:=aclocal}
+: ${AUTOHEADER:=autoheader}
+: ${AUTOCONF:=autoconf}
+: ${AUTOMAKE:=automake}
+
+#-------------------------
+# Required binaries check
+#          
+check_bin_file(){
+   which $1 > /dev/null 2>&1
+   if [ $? = 0 ]; then
+      return 0
+   else
+      return 1
+   fi
+}
+
+#------
+# Main
+#
+
+#clear
+ERR="no"
+for cmd in "$ACLOCAL" "$AUTOHEADER" "$AUTOCONF" "$AUTOMAKE"
+do
+   if check_bin_file "$cmd"
+   then
+      echo -e "$cmd   \tfound"
+   else
+      echo -e "$cmd   \tNOT found"
+      ERR="yes"
+   fi
+done
+
+if test $ERR = "yes"
+then
+   echo
+   echo "ERROR: to run this program you need the following installed"
+   echo "       $ACLOCAL $AUTOHEADER $AUTOCONF $AUTOMAKE"
+   echo
+   exit 1
+fi
+
+echo "[Checks passed]"
+echo "Generating..."
+
+"$ACLOCAL"
+"$AUTOHEADER"
+"$AUTOCONF"
+"$AUTOMAKE" -a
+