Skip to content
Snippets Groups Projects
autogen.sh 2.01 KiB
Newer Older
  • Learn to ignore specific revisions
  • usage () {
        echo "Usage: ./autogen.sh [options]"
    
        echo "  --ac=, --acversion=VERSION   use a specific VERSION of autoconf"
        echo "  --am=, --amversion=VERSION   use a specific VERSION of automake"
        echo "  -h,    --help                you already found this :-)"
    
    for OPT in "$@"; do
    
        set +e
        # stolen from configure...
        # when no option is set, this returns an error code
        arg=`expr "x$OPT" : 'x[^=]*=\(.*\)'`
        set -e
    
        case "$OPT" in
    
    	--ac=*|--acversion=*)
    
    Christian Engwer's avatar
    Christian Engwer committed
    			if test "x$arg" = "x"; then
    
    Christian Engwer's avatar
    Christian Engwer committed
    				usage; 
    				exit 1;
    			fi
    
    			ACVERSION=$arg
    			;;
    	--am=*|--amversion=*)
    
    Christian Engwer's avatar
    Christian Engwer committed
    			if test "x$arg" = "x"; then
    
    Christian Engwer's avatar
    Christian Engwer committed
    				usage; 
    				exit 1;
    			fi
    
    	*)
                if test -d "$OPT/m4"; then
                  ACLOCAL_FLAGS="$ACLOCAL_FLAGS -I $OPT/m4"
                fi
                if test -d "$OPT/am"; then
                  am_dir="$OPT/am"
                fi
                ;;
    
    ## report parameters
    if test "x$ACVERSION" != "x"; then
    
    Christian Engwer's avatar
    Christian Engwer committed
    	echo "Forcing autoconf version $ACVERSION"
    
    	if ! which autoconf$ACVERSION > /dev/null; then
    		echo
    		echo "Error: Could not find autoconf$ACVERSION"
    		echo "       Did you specify a wrong version?"
    		exit 1
    	fi
    
    if test "x$AMVERSION" != "x"; then
    
    Christian Engwer's avatar
    Christian Engwer committed
    	echo "Forcing automake version $AMVERSION"
    
    	if ! which automake$AMVERSION > /dev/null; then
    		echo
    		echo "Error: Could not find automake$AMVERSION"
    		echo "       Did you specify a wrong version?"
    		exit 1
    	fi
    
    Thimo Neubauer's avatar
    Thimo Neubauer committed
    echo "--> libtoolize..."
    # this script won't rewrite the files if they already exist. This is a
    # PITA when you want to upgrade libtool, thus I'm setting --force
    
    Thimo Neubauer's avatar
    Thimo Neubauer committed
    
    
    # prepare everything
    echo "--> aclocal..."
    
    aclocal$AMVERSION -I m4
    
    
    # applications should provide a config.h for now
    
    Christian Engwer's avatar
    Christian Engwer committed
    echo "--> autoheader..."
    
    autoheader$ACVERSION
    
    automake$AMVERSION --add-missing
    
    ## tell the user what to do next
    
    echo "Now run ./configure to setup dune-common"