Upgrade to AutoGen 5 Template

From-SVN: r42235
This commit is contained in:
Bruce Korb 2001-05-18 02:54:25 +00:00 committed by Bruce Korb
parent b3eddceefe
commit 98c197fe39
3 changed files with 126 additions and 115 deletions

View File

@ -1,3 +1,8 @@
2001-05-17 Bruce Korb <bkorb@gnu.org>
* fixinc/fixincl.tpl: rewritten as an AutoGen version 5 template
* fixinc/genfixes: emit a warning if AutoGen is out of date
2001-05-17 Brendan Conoboy <blc@cygnus.com>
Bruce Korb <bkorb@gnu.org>

View File

@ -1,4 +1,4 @@
[= autogen template -*- Mode: C -*-
[= AutoGen5 Template -*- Mode: C -*-
x=fixincl.x =]
/*
* DO NOT EDIT THIS FILE - it has been generated
@ -7,171 +7,167 @@ x=fixincl.x =]
* files which are fixed to work correctly with ANSI C and placed in a
* directory that GNU C will search.
*
* This file contains [=_eval fix _count =] fixup descriptions.
* This file contains [=(count "fix")=] fixup descriptions.
*
* See README for more information.
*
* inclhack copyright (c) 1998, 1999, 2000, 2001
* The Free Software Foundation, Inc.
*
[=_eval inclhack "# * " _gpl=]
[=(define re-ct 0) (define max-mach 0) (define ct 0)
(define HACK "") (define Hack "") (define tmp "")
(gpl "inclhack" " * ")=]
*/
[= _SETENV re_ct 0 =][= _SETENV max_mach 0 =][=
[=
_FOR fix =]
FOR fix =]
/* * * * * * * * * * * * * * * * * * * * * * * * * *
*
* Description of [=hackname _cap=] fix
* Description of [=
(set! Hack (string-capitalize! (get "hackname")))
(set! HACK (string-upcase! (get "hackname")))
(. Hack)=] fix
*/[=
# Note that this is not just for debugging purposes, but in case
some C fix wishes to refer to the regexps it is paired with.
See commentary at the top of fixfixes.c.
=]
#define [=hackname _up #_FIXIDX + #%-32s _printf=] [=_eval _index=]
tSCC z[=hackname _cap=]Name[] =
[=hackname _krstr=];
#define [=(sprintf "%-32s" (string-append HACK "_FIXIDX"))=] [=(for-index)=]
tSCC z[=(. Hack)=]Name[] =
"[=hackname=]";
/*
* File name selection pattern
*/[=
_IF files _exist=]
tSCC z[=hackname _cap=]List[] =
"[=_FOR files =]|[=files=][=/files=]|";[=
IF (exist? "files")=]
tSCC z[=(. Hack)=]List[] =
"[=FOR files =]|[=files=][=ENDFOR=]|";[=
_ELSE =]
#define z[=hackname _cap=]List (char*)NULL[=
_ENDIF "files _exist" =]
ELSE =]
#define z[=(. Hack)=]List (char*)NULL[=
ENDIF (exist? "files") =]
/*
* Machine/OS name selection pattern
*/[=
_IF mach _exist=]
tSCC* apz[=hackname _cap=]Machs[] = {[=
_SETENV this_mach 0 =][=
IF (exist? "mach")=]
tSCC* apz[=(. Hack)=]Machs[] = {[=
(set! ct 0) =][=
_FOR mach =]
[=mach _krstr=],[=
_SETENV this_mach mach _len this_mach _env _val 5 + +
=][= /mach=]
FOR mach =]
[=
(set! tmp (get "mach"))
(set! ct (+ ct (string-length tmp) 5))
(kr-string tmp)=],[=
ENDFOR=]
(const char*)NULL };[=
_SETENV max_mach _mark this_mach _env _val max_mach _env _val _max =][=
(if (> ct max-mach) (set! max-mach ct)) =][=
_ELSE =]
#define apz[=hackname _cap=]Machs (const char**)NULL[=
_ENDIF "files _exist" =][=
ELSE =]
#define apz[=(. Hack)=]Machs (const char**)NULL[=
ENDIF (exist? "files") =][=
_IF select _exist=]
IF (exist? "select")=]
/*
* content selection pattern - do fix if pattern found
*/[=
_FOR select =]
tSCC z[=hackname _cap=]Select[=_eval _index=][] =
[=select _krstr=];[=
/select =][=
_ENDIF =][=
FOR select =]
tSCC z[=(. Hack)=]Select[=(for-index)=][] =
[=(kr-string (get "select"))=];[=
ENDFOR select =][=
ENDIF =][=
_IF bypass _exist=]
IF (exist? "bypass")=]
/*
* content bypass pattern - skip fix if pattern found
*/[=
_FOR bypass =]
tSCC z[=hackname _cap=]Bypass[=_eval _index=][] =
[=bypass _krstr=];[=
/bypass =][=
_ENDIF =][=
FOR bypass =]
tSCC z[=(. Hack)=]Bypass[=(for-index)=][] =
[=(kr-string (get "bypass"))=];[=
ENDFOR bypass =][=
ENDIF =][=
_IF test _exist=]
IF (exist? "test")=]
/*
* perform the 'test' shell command - do fix on success
*/[=
_FOR test =]
tSCC z[=hackname _cap=]Test[=_eval _index=][] =
[=test _krstr=];[=
/test =][=
_ENDIF =][=
FOR test =]
tSCC z[=(. Hack)=]Test[=(for-index)=][] =
[=(kr-string (get "test"))=];[=
ENDFOR =][=
ENDIF =][=
_IF c_test _exist=]
IF (exist? "c_test")=]
/*
* perform the C function call test
*/[=
_FOR c_test =]
tSCC z[=hackname _cap=]FTst[=_eval _index=][] = "[=c_test=]";[=
/c_test =][=
_ENDIF =][=
FOR c_test =]
tSCC z[=(. Hack)=]FTst[=(for-index)=][] = "[=c_test=]";[=
ENDFOR c_test =][=
ENDIF =][=
IF (set! ct (+ (count "select") (count "bypass")
(count "test") (count "c_test")))
# Build the array of test descriptions for this fix: =][=
_IF select _exist
bypass _exist |
test _exist |
c_test _exist |
(= ct 0)
=]
#define [=(. HACK)=]_TEST_CT 0
#define a[=(. Hack)=]Tests (tTestDesc*)NULL[=
ELSE =]
#define [=hackname _up =]_TEST_CT [=
_eval select _count
bypass _count +
test _count +
c_test _count + =][=
_SETENV re_ct
re_ct _env _val
select _count +
bypass _count + =]
static tTestDesc a[=hackname _cap=]Tests[] = {[=
#define [=(. HACK)=]_TEST_CT [=(. ct)=][=
(set! re-ct (+ re-ct (count "select") (count "bypass"))) =]
static tTestDesc a[=(. Hack)=]Tests[] = {[=
_FOR test =]
{ TT_TEST, z[=hackname _cap=]Test[=_eval _index=], 0 /* unused */ },[=
/test =][=
FOR test =]
{ TT_TEST, z[=(. Hack)=]Test[=(for-index)=], 0 /* unused */ },[=
ENDFOR test =][=
_FOR c_test =]
{ TT_FUNCTION, z[=hackname _cap=]FTst[=_eval _index=], 0 /* unused */ },[=
/c_test =][=
FOR c_test =]
{ TT_FUNCTION, z[=(. Hack)=]FTst[=(for-index)=], 0 /* unused */ },[=
ENDFOR c_test =][=
_FOR bypass =]
{ TT_NEGREP, z[=hackname _cap=]Bypass[=_eval _index=], (regex_t*)NULL },[=
/bypass =][=
FOR bypass =]
{ TT_NEGREP, z[=(. Hack)=]Bypass[=(for-index)=], (regex_t*)NULL },[=
ENDFOR bypass =][=
_FOR select =]
{ TT_EGREP, z[=hackname _cap=]Select[=_eval _index=], (regex_t*)NULL },[=
/select =] };[=
_ELSE =]
#define [=hackname _up=]_TEST_CT 0
#define a[=hackname _cap=]Tests (tTestDesc*)NULL[=
_ENDIF =]
FOR select =]
{ TT_EGREP, z[=(. Hack)=]Select[=(for-index)=], (regex_t*)NULL },[=
ENDFOR select =] };[=
ENDIF =]
/*
* Fix Command Arguments for [=hackname _cap=]
* Fix Command Arguments for [=(. Hack)=]
*/
static const char* apz[=hackname _cap=]Patch[] = {[=
_IF sed _exist =] "sed"[=
_FOR sed=],
"-e", [=sed _krstr=][=
/sed=],[=
static const char* apz[=(. Hack)=]Patch[] = {[=
IF (exist? "sed")=] "sed"[=
FOR sed=],
"-e", [=(kr-string (get "sed"))=][=
ENDFOR sed=],[=
_ELIF shell _exist =] "sh", "-c",
[=shell _krstr=],[=
ELIF (exist? "shell")=] "sh", "-c",
[=(kr-string (get "shell"))=],[=
_ELIF c_fix _exist =]
[=
c_fix _krstr=],[=
ELIF (exist? "c_fix")=]
[=(kr-string (get "c_fix"))=],[=
_FOR c_fix_arg =]
[=c_fix_arg _krstr=],[=
/c_fix_arg =][=
FOR c_fix_arg =]
[=(kr-string (get "c_fix_arg"))=],[=
ENDFOR c_fix_arg =][=
_ELIF replace _len =]
[=replace _krstr=],[=
ELIF (> (len "replace") 0) =]
[=(kr-string (get "replace"))=],[=
_ENDIF=]
ENDIF=]
(char*)NULL };
[=/fix=]
[=ENDFOR fix=]
/* * * * * * * * * * * * * * * * * * * * * * * * * *
*
@ -181,25 +177,27 @@ static const char* apz[=hackname _cap=]Patch[] = {[=
We also must allow for the size of the target machine machine name.
This allows for a 79 byte machine name. Better be enough.
=]
#define REGEX_COUNT [= _eval re_ct _env =]
#define MACH_LIST_SIZE_LIMIT [= _eval max_mach _env _val 128 + =]
#define FIX_COUNT [= _eval fix _count =]
#define REGEX_COUNT [= (. re-ct) =]
#define MACH_LIST_SIZE_LIMIT [= (+ 128 max-mach) =]
#define FIX_COUNT [= (count "fix") =]
tFixDesc fixDescList[ FIX_COUNT ] = {[=
_FOR fix ",\n" =]
{ z[=hackname _cap=]Name, z[=hackname _cap=]List,
apz[=hackname _cap=]Machs,
[=hackname _up=]_TEST_CT, [=
_IF not_machine _exist =]FD_MACH_IFNOT[=
_ELSE =]FD_MACH_ONLY[=
_ENDIF =][=
_IF shell _exist =] | FD_SHELL_SCRIPT[=
_ELIF c_fix _exist =] | FD_SUBROUTINE[=
_ELIF replace _exist =] | FD_REPLACEMENT[=
_ENDIF =],
a[=hackname _cap=]Tests, apz[=hackname _cap=]Patch, 0 }[=
FOR fix ",\n" =][=
(set! Hack (string-capitalize! (get "hackname")))
(set! HACK (string-upcase! (get "hackname"))) =]
{ z[=(. Hack)=]Name, z[=(. Hack)=]List,
apz[=(. Hack)=]Machs,
[=(. HACK)=]_TEST_CT, [=
IF (exist? "not_machine") =]FD_MACH_IFNOT[=
ELSE =]FD_MACH_ONLY[=
ENDIF =][=
IF (exist? "shell") =] | FD_SHELL_SCRIPT[=
ELIF (exist? "c_fix") =] | FD_SUBROUTINE[=
ELIF (exist? "replace") =] | FD_REPLACEMENT[=
ENDIF =],
a[=(. Hack)=]Tests, apz[=(. Hack)=]Patch, 0 }[=
/fix=]
ENDFOR =]
};

View File

@ -66,6 +66,14 @@ fi
AG="autogen $AG"
set -e
if [ -z "`${AG} -v | fgrep 'Ver. 5.'`" ]
then
echo "Your AutoGen is either out of date or not available" >&2
echo "Please get AutoGen5 from ftp.gnu.org/gnu/autogen" >&2
touch $@
exit 0
fi
case "$1" in
fixincl.x | */fixincl.x )
if (${AG} --help > /dev/null 2>&1)