From dc994a6d4839382766097f5df1d6f68f10639ef8 Mon Sep 17 00:00:00 2001 From: Bruce Korb Date: Mon, 25 Oct 1999 16:05:08 +0000 Subject: [PATCH] Provide a means for specifying -D options to AutoGen From-SVN: r30165 --- gcc/ChangeLog | 4 +++ gcc/fixinc/genfixes | 74 ++++++++++++++++++++++++++++++++++----------- 2 files changed, 60 insertions(+), 18 deletions(-) diff --git a/gcc/ChangeLog b/gcc/ChangeLog index d72d913bb40..d3dec30183c 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,7 @@ +1999-10-25 Bruce Korb + + * fixinc/genfixes: Provide a means for specifying -D options to AutoGen + Mon Oct 25 00:42:35 1999 Jeffrey A Law (law@cygnus.com) * loop.c (note_set_pseudo_multiple_uses_retval): New variable. diff --git a/gcc/fixinc/genfixes b/gcc/fixinc/genfixes index 25964a0ea03..cfa8a4b27ba 100755 --- a/gcc/fixinc/genfixes +++ b/gcc/fixinc/genfixes @@ -1,20 +1,5 @@ #! /bin/sh -SHELL=/bin/sh -export SHELL - -if [ $# -eq 0 ] ; then - echo AutoGen-ing inclhack.sh - autogen inclhack.def - - echo AutoGen-ing fixincl.x - autogen -T fixincl.tpl -b fixincl inclhack.def - - echo AutoGen-ing fixincl.sh - autogen -DPROGRAM=1 -b fixincl inclhack.def - exit 0 -fi - if (autogen --help > /dev/null 2>&1) ; then : ; else echo "AutoGen does not appear to be correctly installed." echo "Please download and install:" @@ -22,22 +7,75 @@ if (autogen --help > /dev/null 2>&1) ; then : ; else exit 1 fi +SHELL=/bin/sh +export SHELL +AG="" +if [ $# -eq 0 ] ; then + not_done=false +else + not_done=true +fi + +while $not_done +do + case "$1" in + -D ) + shift + if [ $# -eq 0 ] ; then + not_done=false + else + AG="$AG -D$1" + shift + fi + ;; + + -D* ) + AG="$AG $1" + shift + ;; + + '-?' ) + echo "USAGE: gendefs [ -D ... ] [ ]" + echo "WHERE: '' specifies a #define test name from inclhack.def" + echo " and '' is one of: inclhack.sh fixincl.x fixincl.sh" + echo "The default is to produce all three outputs." + exit 0 + ;; + + * ) + not_done=false + ;; + esac +done + +if [ $# -eq 0 ] ; then + echo AutoGen-ing inclhack.sh + $AG inclhack.def + + echo AutoGen-ing fixincl.x + $AG -T fixincl.tpl -b fixincl inclhack.def + + echo AutoGen-ing fixincl.sh + $AG -DPROGRAM=1 -b fixincl inclhack.def + exit 0 +fi + set -e case "$1" in inclhack.def ) echo AutoGen-ing inclhack.sh - autogen inclhack.sh + $AG inclhack.sh ;; fixincl.x ) echo AutoGen-ing fixincl.x - autogen -T fixincl.tpl -b fixincl inclhack.def + $AG -T fixincl.tpl -b fixincl inclhack.def ;; fixincl.sh ) echo AutoGen-ing fixincl.sh - autogen -DPROGRAM=1 -b fixincl inclhack.def + $AG -DPROGRAM=1 -b fixincl inclhack.def ;; * )