[xiph-commits] SF.net SVN: libspiff:[510] trunk/autogen.sh

hartwork at users.sourceforge.net hartwork at users.sourceforge.net
Sat Dec 13 10:35:42 PST 2008


Revision: 510
          http://libspiff.svn.sourceforge.net/libspiff/?rev=510&view=rev
Author:   hartwork
Date:     2008-12-13 18:35:42 +0000 (Sat, 13 Dec 2008)

Log Message:
-----------
Update autogen.sh

Modified Paths:
--------------
    trunk/autogen.sh

Modified: trunk/autogen.sh
===================================================================
--- trunk/autogen.sh	2008-12-03 21:56:50 UTC (rev 509)
+++ trunk/autogen.sh	2008-12-13 18:35:42 UTC (rev 510)
@@ -1,7 +1,7 @@
 #!/bin/sh
 #                        a u t o g e n . s h
 #
-# Copyright (c) 2005-2007 United States Government as represented by
+# Copyright (c) 2005-2008 United States Government as represented by
 # the U.S. Army Research Laboratory.
 #
 # Redistribution and use in source and binary forms, with or without
@@ -102,7 +102,7 @@
     fi
 
     # extract version from CVS Id string
-    __id="$Id: autogen.sh,v 14.97 2007/06/18 22:25:02 brlcad Exp $"
+    __id="$Id$"
     __version="`echo $__id | sed 's/.*\([0-9][0-9][0-9][0-9]\)[-\/]\([0-9][0-9]\)[-\/]\([0-9][0-9]\).*/\1\2\3/'`"
     if [ "x$__version" = "x" ] ; then
 	__version=""
@@ -119,11 +119,12 @@
 # USAGE FUNCTION #
 ##################
 usage ( ) {
-    echo "Usage: $AUTOGEN_SH [-h|--help] [-v|--verbose] [-q|--quiet] [--version]"
-    echo "    --help     Help on $NAME_OF_AUTOGEN usage"
-    echo "    --verbose  Verbose progress output"
-    echo "    --quiet    Quiet suppressed progress output"
-    echo "    --version  Only perform GNU Build System version checks"
+    echo "Usage: $AUTOGEN_SH [-h|--help] [-v|--verbose] [-q|--quiet] [-d|--download] [--version]"
+    echo "    --help      Help on $NAME_OF_AUTOGEN usage"
+    echo "    --verbose   Verbose progress output"
+    echo "    --quiet     Quiet suppressed progress output"
+    echo "    --download  Download the latest config.guess from gnulib"
+    echo "    --version   Only perform GNU Build System version checks"
     echo
     echo "Description: This script will validate that minimum versions of the"
     echo "GNU Build System tools are installed and then run autoreconf for you."
@@ -273,6 +274,9 @@
 if [ "x$VERSION_ONLY" = "x" ] ; then
     VERSION_ONLY=no
 fi
+if [ "x$DOWNLOAD" = "x" ] ; then
+    DOWNLOAD=no
+fi
 if [ "x$AUTORECONF_OPTIONS" = "x" ] ; then
     AUTORECONF_OPTIONS="-i -f"
 fi
@@ -293,6 +297,9 @@
 if [ "x$AUTOHEADER_OPTIONS" = "x" ] ; then
     AUTOHEADER_OPTIONS=""
 fi
+if [ "x$CONFIG_GUESS_URL" = "x" ] ; then
+    CONFIG_GUESS_URL="http://git.savannah.gnu.org/gitweb/?p=gnulib.git;a=blob_plain;f=build-aux/config.guess;hb=HEAD"
+fi
 for arg in $ARGS ; do
     case "x$arg" in
 	x--help) HELP=yes ;;
@@ -300,6 +307,8 @@
 	x--quiet) QUIET=yes ;;
 	x-[qQ]) QUIET=yes ;;
 	x--verbose) VERBOSE=yes ;;
+	x-[dD]) DOWNLOAD=yes ;;
+	x--download) DOWNLOAD=yes ;;
 	x-[vV]) VERBOSE=yes ;;
 	x--version) VERSION_ONLY=yes ;;
 	*)
@@ -589,7 +598,7 @@
 	_version="0.0.0"
     fi
     $ECHO "Found GNU Automake version $_version"
-    version_check "$AUTOMAKE_VERSION" "$_version" 
+    version_check "$AUTOMAKE_VERSION" "$_version"
     if [ $? -ne 0 ] ; then
 	_report_error=yes
     fi
@@ -691,7 +700,7 @@
 	_version="0.0.0"
     fi
     $ECHO "Found GNU Libtool version $_version"
-    version_check "$LIBTOOL_VERSION" "$_version" 
+    version_check "$LIBTOOL_VERSION" "$_version"
     if [ $? -ne 0 ] ; then
 	_report_error=yes
     fi
@@ -1049,10 +1058,12 @@
 # DOWNLOAD_GNULIB_CONFIG_GUESS FUNCTION #
 #########################################
 
+# TODO - should make sure wget/curl exist and/or work before trying to
+# use them.
+
 download_gnulib_config_guess () {
     # abuse gitweb to download gnulib's latest config.guess via HTTP
-    config_guess_url='http://git.savannah.gnu.org/gitweb/?p=gnulib.git;a=blob_plain;f=build-aux/config.guess;hb=HEAD'
-    config_guess_temp=`mktemp`
+    config_guess_temp="config.guess.$$.download"
     ret=1
     for __cmd in wget curl fetch ; do
 	$VERBOSE_ECHO "Checking for command ${__cmd}"
@@ -1065,30 +1076,30 @@
 	__cmd_version=`${__cmd} --version | head -n 1 | sed -e 's/^[^0-9]\+//' -e 's/ .*//'`
 	$VERBOSE_ECHO "Found ${__cmd} ${__cmd_version}"
 
-	$VERBOSE_ECHO "Downloading gnulib's latest config.guess"
+	opts=""
 	case ${__cmd} in
 	    wget)
-		wget "${config_guess_url}" -O "${config_guess_temp}" &>/dev/null
-		ret=$?
+		opts="-O" 
 		;;
 	    curl)
-		curl "${config_guess_url}" -o "${config_guess_temp}" &>/dev/null
-		ret=$?
+		opts="-o"
 		;;
 	    fetch)
-		fetch "${config_guess_url}" -t 5 -f "${config_guess_temp}" &>/dev/null
-		ret=$?
+		opts="-t 5 -f"
 		;;
 	esac
 
-	if [ $ret = 0 ] ; then
+	$VERBOSE_ECHO "Running $__cmd \"${CONFIG_GUESS_URL}\" $opts \"${config_guess_temp}\""
+	eval "$__cmd \"${CONFIG_GUESS_URL}\" $opts \"${config_guess_temp}\"" > /dev/null 2>&1
+	if [ $? = 0 ] ; then
 	    mv -f "${config_guess_temp}" ${_aux_dir}/config.guess
+	    ret=0
 	    break
 	fi
     done
 
     if [ ! $ret = 0 ] ; then
-	$ECHO "Warning: config.guess download failed"
+	$ECHO "Warning: config.guess download failed from: $CONFIG_GUESS_URL"
 	rm -f "${config_guess_temp}"
     fi
 }
@@ -1098,12 +1109,12 @@
 # LIBTOOLIZE_NEEDED FUNCTION #
 ##############################
 libtoolize_needed () {
-    ret=1 # means no
+    ret=1 # means no, don't need libtoolize
     for feature in AC_PROG_LIBTOOL LT_INIT ; do
 	$VERBOSE_ECHO "Searching for $feature in $CONFIGURE"
 	found="`grep \"^$feature.*\" $CONFIGURE`"
 	if [ ! "x$found" = "x" ] ; then
-	    ret=0 # means yes
+	    ret=0 # means yes, need to run libtoolize
 	    break
 	fi
     done
@@ -1156,8 +1167,10 @@
 	$ECHO "Attempting to run the preparation steps individually"
 	reconfigure_manually=yes
     else
-	if libtoolize_needed ; then
-	    download_gnulib_config_guess
+	if [ "x$DOWNLOAD" = "xyes" ] ; then
+	    if libtoolize_needed ; then
+		download_gnulib_config_guess
+	    fi
 	fi
     fi
 else
@@ -1243,7 +1256,7 @@
 	    libtoolize_output="`$LIBTOOLIZE $LIBTOOLIZE_OPTIONS 2>&1`"
 	    ret=$?
 	    $VERBOSE_ECHO "$libtoolize_output"
-	    
+
 	    if [ ! $ret = 0 ] ; then $ECHO "ERROR: $LIBTOOLIZE failed" && exit 2 ; fi
 	else
 	    if [ "x$HAVE_ALT_LIBTOOLIZE" = "xyes" ] ; then
@@ -1251,7 +1264,7 @@
 		libtoolize_output="`$LIBTOOLIZE $ALT_LIBTOOLIZE_OPTIONS 2>&1`"
 		ret=$?
 		$VERBOSE_ECHO "$libtoolize_output"
-		
+
 		if [ ! $ret = 0 ] ; then $ECHO "ERROR: $LIBTOOLIZE failed" && exit 2 ; fi
 	    fi
 	fi
@@ -1280,7 +1293,9 @@
 	    fi
 	fi # ltmain.sh
 
-	download_gnulib_config_guess
+	if [ "x$DOWNLOAD" = "xyes" ] ; then
+	    download_gnulib_config_guess
+	fi
     fi # libtoolize_needed
 
     ############
@@ -1301,7 +1316,7 @@
 	macros_to_search=""
 	ac_major="`echo ${AUTOCONF_VERSION}. | cut -d. -f1 | sed 's/[^0-9]//g'`"
 	ac_minor="`echo ${AUTOCONF_VERSION}. | cut -d. -f2 | sed 's/[^0-9]//g'`"
-	
+
 	if [ $ac_major -lt 2 ] ; then
 	    macros_to_search="$ac2_59_macros $ac2_55_macros $ac2_54_macros"
 	else
@@ -1419,7 +1434,7 @@
 	automake_output="`$AUTOMAKE $AUTOMAKE_OPTIONS 2>&1`"
 	ret=$?
 	$VERBOSE_ECHO "$automake_output"
-	
+
 	if [ ! $ret = 0 ] ; then
 
 	    ###################
@@ -1431,7 +1446,7 @@
 	    automake_output="`$AUTOMAKE $ALT_AUTOMAKE_OPTIONS 2>&1`"
 	    ret=$?
 	    $VERBOSE_ECHO "$automake_output"
-	    
+
 	    if [ ! $ret = 0 ] ; then
 	 	# test if libtool is busted
 		libtool_failure "$automake_output"


This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.


More information about the commits mailing list