Upgrade to AutoGen 5 Template
From-SVN: r42235
This commit is contained in:
parent
b3eddceefe
commit
98c197fe39
@ -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>
|
2001-05-17 Brendan Conoboy <blc@cygnus.com>
|
||||||
Bruce Korb <bkorb@gnu.org>
|
Bruce Korb <bkorb@gnu.org>
|
||||||
|
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
[= autogen template -*- Mode: C -*-
|
[= AutoGen5 Template -*- Mode: C -*-
|
||||||
x=fixincl.x =]
|
x=fixincl.x =]
|
||||||
/*
|
/*
|
||||||
* DO NOT EDIT THIS FILE - it has been generated
|
* 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
|
* files which are fixed to work correctly with ANSI C and placed in a
|
||||||
* directory that GNU C will search.
|
* 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.
|
* See README for more information.
|
||||||
*
|
*
|
||||||
* inclhack copyright (c) 1998, 1999, 2000, 2001
|
* inclhack copyright (c) 1998, 1999, 2000, 2001
|
||||||
* The Free Software Foundation, Inc.
|
* 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
|
# 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.
|
some C fix wishes to refer to the regexps it is paired with.
|
||||||
See commentary at the top of fixfixes.c.
|
See commentary at the top of fixfixes.c.
|
||||||
=]
|
=]
|
||||||
#define [=hackname _up #_FIXIDX + #%-32s _printf=] [=_eval _index=]
|
#define [=(sprintf "%-32s" (string-append HACK "_FIXIDX"))=] [=(for-index)=]
|
||||||
tSCC z[=hackname _cap=]Name[] =
|
tSCC z[=(. Hack)=]Name[] =
|
||||||
[=hackname _krstr=];
|
"[=hackname=]";
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* File name selection pattern
|
* File name selection pattern
|
||||||
*/[=
|
*/[=
|
||||||
|
|
||||||
_IF files _exist=]
|
IF (exist? "files")=]
|
||||||
tSCC z[=hackname _cap=]List[] =
|
tSCC z[=(. Hack)=]List[] =
|
||||||
"[=_FOR files =]|[=files=][=/files=]|";[=
|
"[=FOR files =]|[=files=][=ENDFOR=]|";[=
|
||||||
|
|
||||||
_ELSE =]
|
ELSE =]
|
||||||
#define z[=hackname _cap=]List (char*)NULL[=
|
#define z[=(. Hack)=]List (char*)NULL[=
|
||||||
_ENDIF "files _exist" =]
|
ENDIF (exist? "files") =]
|
||||||
/*
|
/*
|
||||||
* Machine/OS name selection pattern
|
* Machine/OS name selection pattern
|
||||||
*/[=
|
*/[=
|
||||||
|
|
||||||
_IF mach _exist=]
|
IF (exist? "mach")=]
|
||||||
tSCC* apz[=hackname _cap=]Machs[] = {[=
|
tSCC* apz[=(. Hack)=]Machs[] = {[=
|
||||||
_SETENV this_mach 0 =][=
|
(set! ct 0) =][=
|
||||||
|
|
||||||
_FOR mach =]
|
FOR mach =]
|
||||||
[=mach _krstr=],[=
|
[=
|
||||||
_SETENV this_mach mach _len this_mach _env _val 5 + +
|
(set! tmp (get "mach"))
|
||||||
=][= /mach=]
|
(set! ct (+ ct (string-length tmp) 5))
|
||||||
|
(kr-string tmp)=],[=
|
||||||
|
ENDFOR=]
|
||||||
(const char*)NULL };[=
|
(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 =]
|
ELSE =]
|
||||||
#define apz[=hackname _cap=]Machs (const char**)NULL[=
|
#define apz[=(. Hack)=]Machs (const char**)NULL[=
|
||||||
_ENDIF "files _exist" =][=
|
ENDIF (exist? "files") =][=
|
||||||
|
|
||||||
_IF select _exist=]
|
IF (exist? "select")=]
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* content selection pattern - do fix if pattern found
|
* content selection pattern - do fix if pattern found
|
||||||
*/[=
|
*/[=
|
||||||
_FOR select =]
|
FOR select =]
|
||||||
tSCC z[=hackname _cap=]Select[=_eval _index=][] =
|
tSCC z[=(. Hack)=]Select[=(for-index)=][] =
|
||||||
[=select _krstr=];[=
|
[=(kr-string (get "select"))=];[=
|
||||||
/select =][=
|
ENDFOR select =][=
|
||||||
_ENDIF =][=
|
ENDIF =][=
|
||||||
|
|
||||||
_IF bypass _exist=]
|
IF (exist? "bypass")=]
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* content bypass pattern - skip fix if pattern found
|
* content bypass pattern - skip fix if pattern found
|
||||||
*/[=
|
*/[=
|
||||||
_FOR bypass =]
|
FOR bypass =]
|
||||||
tSCC z[=hackname _cap=]Bypass[=_eval _index=][] =
|
tSCC z[=(. Hack)=]Bypass[=(for-index)=][] =
|
||||||
[=bypass _krstr=];[=
|
[=(kr-string (get "bypass"))=];[=
|
||||||
/bypass =][=
|
ENDFOR bypass =][=
|
||||||
_ENDIF =][=
|
ENDIF =][=
|
||||||
|
|
||||||
_IF test _exist=]
|
IF (exist? "test")=]
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* perform the 'test' shell command - do fix on success
|
* perform the 'test' shell command - do fix on success
|
||||||
*/[=
|
*/[=
|
||||||
_FOR test =]
|
FOR test =]
|
||||||
tSCC z[=hackname _cap=]Test[=_eval _index=][] =
|
tSCC z[=(. Hack)=]Test[=(for-index)=][] =
|
||||||
[=test _krstr=];[=
|
[=(kr-string (get "test"))=];[=
|
||||||
/test =][=
|
ENDFOR =][=
|
||||||
_ENDIF =][=
|
ENDIF =][=
|
||||||
|
|
||||||
_IF c_test _exist=]
|
IF (exist? "c_test")=]
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* perform the C function call test
|
* perform the C function call test
|
||||||
*/[=
|
*/[=
|
||||||
_FOR c_test =]
|
FOR c_test =]
|
||||||
tSCC z[=hackname _cap=]FTst[=_eval _index=][] = "[=c_test=]";[=
|
tSCC z[=(. Hack)=]FTst[=(for-index)=][] = "[=c_test=]";[=
|
||||||
/c_test =][=
|
ENDFOR c_test =][=
|
||||||
_ENDIF =][=
|
ENDIF =][=
|
||||||
|
|
||||||
|
IF (set! ct (+ (count "select") (count "bypass")
|
||||||
|
(count "test") (count "c_test")))
|
||||||
|
|
||||||
# Build the array of test descriptions for this fix: =][=
|
(= ct 0)
|
||||||
|
|
||||||
_IF select _exist
|
|
||||||
bypass _exist |
|
|
||||||
test _exist |
|
|
||||||
c_test _exist |
|
|
||||||
=]
|
=]
|
||||||
|
#define [=(. HACK)=]_TEST_CT 0
|
||||||
|
#define a[=(. Hack)=]Tests (tTestDesc*)NULL[=
|
||||||
|
ELSE =]
|
||||||
|
|
||||||
#define [=hackname _up =]_TEST_CT [=
|
#define [=(. HACK)=]_TEST_CT [=(. ct)=][=
|
||||||
_eval select _count
|
(set! re-ct (+ re-ct (count "select") (count "bypass"))) =]
|
||||||
bypass _count +
|
static tTestDesc a[=(. Hack)=]Tests[] = {[=
|
||||||
test _count +
|
|
||||||
c_test _count + =][=
|
|
||||||
_SETENV re_ct
|
|
||||||
re_ct _env _val
|
|
||||||
select _count +
|
|
||||||
bypass _count + =]
|
|
||||||
static tTestDesc a[=hackname _cap=]Tests[] = {[=
|
|
||||||
|
|
||||||
_FOR test =]
|
FOR test =]
|
||||||
{ TT_TEST, z[=hackname _cap=]Test[=_eval _index=], 0 /* unused */ },[=
|
{ TT_TEST, z[=(. Hack)=]Test[=(for-index)=], 0 /* unused */ },[=
|
||||||
/test =][=
|
ENDFOR test =][=
|
||||||
|
|
||||||
_FOR c_test =]
|
FOR c_test =]
|
||||||
{ TT_FUNCTION, z[=hackname _cap=]FTst[=_eval _index=], 0 /* unused */ },[=
|
{ TT_FUNCTION, z[=(. Hack)=]FTst[=(for-index)=], 0 /* unused */ },[=
|
||||||
/c_test =][=
|
ENDFOR c_test =][=
|
||||||
|
|
||||||
_FOR bypass =]
|
FOR bypass =]
|
||||||
{ TT_NEGREP, z[=hackname _cap=]Bypass[=_eval _index=], (regex_t*)NULL },[=
|
{ TT_NEGREP, z[=(. Hack)=]Bypass[=(for-index)=], (regex_t*)NULL },[=
|
||||||
/bypass =][=
|
ENDFOR bypass =][=
|
||||||
|
|
||||||
_FOR select =]
|
FOR select =]
|
||||||
{ TT_EGREP, z[=hackname _cap=]Select[=_eval _index=], (regex_t*)NULL },[=
|
{ TT_EGREP, z[=(. Hack)=]Select[=(for-index)=], (regex_t*)NULL },[=
|
||||||
/select =] };[=
|
ENDFOR select =] };[=
|
||||||
_ELSE =]
|
ENDIF =]
|
||||||
#define [=hackname _up=]_TEST_CT 0
|
|
||||||
#define a[=hackname _cap=]Tests (tTestDesc*)NULL[=
|
|
||||||
_ENDIF =]
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Fix Command Arguments for [=hackname _cap=]
|
* Fix Command Arguments for [=(. Hack)=]
|
||||||
*/
|
*/
|
||||||
static const char* apz[=hackname _cap=]Patch[] = {[=
|
static const char* apz[=(. Hack)=]Patch[] = {[=
|
||||||
_IF sed _exist =] "sed"[=
|
IF (exist? "sed")=] "sed"[=
|
||||||
_FOR sed=],
|
FOR sed=],
|
||||||
"-e", [=sed _krstr=][=
|
"-e", [=(kr-string (get "sed"))=][=
|
||||||
/sed=],[=
|
ENDFOR sed=],[=
|
||||||
|
|
||||||
_ELIF shell _exist =] "sh", "-c",
|
ELIF (exist? "shell")=] "sh", "-c",
|
||||||
[=shell _krstr=],[=
|
[=(kr-string (get "shell"))=],[=
|
||||||
|
|
||||||
_ELIF c_fix _exist =]
|
ELIF (exist? "c_fix")=]
|
||||||
[=
|
[=(kr-string (get "c_fix"))=],[=
|
||||||
c_fix _krstr=],[=
|
|
||||||
|
|
||||||
_FOR c_fix_arg =]
|
FOR c_fix_arg =]
|
||||||
[=c_fix_arg _krstr=],[=
|
[=(kr-string (get "c_fix_arg"))=],[=
|
||||||
/c_fix_arg =][=
|
ENDFOR c_fix_arg =][=
|
||||||
|
|
||||||
_ELIF replace _len =]
|
ELIF (> (len "replace") 0) =]
|
||||||
[=replace _krstr=],[=
|
[=(kr-string (get "replace"))=],[=
|
||||||
|
|
||||||
_ENDIF=]
|
ENDIF=]
|
||||||
(char*)NULL };
|
(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.
|
We also must allow for the size of the target machine machine name.
|
||||||
This allows for a 79 byte machine name. Better be enough.
|
This allows for a 79 byte machine name. Better be enough.
|
||||||
=]
|
=]
|
||||||
#define REGEX_COUNT [= _eval re_ct _env =]
|
#define REGEX_COUNT [= (. re-ct) =]
|
||||||
#define MACH_LIST_SIZE_LIMIT [= _eval max_mach _env _val 128 + =]
|
#define MACH_LIST_SIZE_LIMIT [= (+ 128 max-mach) =]
|
||||||
#define FIX_COUNT [= _eval fix _count =]
|
#define FIX_COUNT [= (count "fix") =]
|
||||||
|
|
||||||
tFixDesc fixDescList[ FIX_COUNT ] = {[=
|
tFixDesc fixDescList[ FIX_COUNT ] = {[=
|
||||||
|
|
||||||
|
|
||||||
_FOR fix ",\n" =]
|
FOR fix ",\n" =][=
|
||||||
{ z[=hackname _cap=]Name, z[=hackname _cap=]List,
|
(set! Hack (string-capitalize! (get "hackname")))
|
||||||
apz[=hackname _cap=]Machs,
|
(set! HACK (string-upcase! (get "hackname"))) =]
|
||||||
[=hackname _up=]_TEST_CT, [=
|
{ z[=(. Hack)=]Name, z[=(. Hack)=]List,
|
||||||
_IF not_machine _exist =]FD_MACH_IFNOT[=
|
apz[=(. Hack)=]Machs,
|
||||||
_ELSE =]FD_MACH_ONLY[=
|
[=(. HACK)=]_TEST_CT, [=
|
||||||
_ENDIF =][=
|
IF (exist? "not_machine") =]FD_MACH_IFNOT[=
|
||||||
_IF shell _exist =] | FD_SHELL_SCRIPT[=
|
ELSE =]FD_MACH_ONLY[=
|
||||||
_ELIF c_fix _exist =] | FD_SUBROUTINE[=
|
ENDIF =][=
|
||||||
_ELIF replace _exist =] | FD_REPLACEMENT[=
|
IF (exist? "shell") =] | FD_SHELL_SCRIPT[=
|
||||||
_ENDIF =],
|
ELIF (exist? "c_fix") =] | FD_SUBROUTINE[=
|
||||||
a[=hackname _cap=]Tests, apz[=hackname _cap=]Patch, 0 }[=
|
ELIF (exist? "replace") =] | FD_REPLACEMENT[=
|
||||||
|
ENDIF =],
|
||||||
|
a[=(. Hack)=]Tests, apz[=(. Hack)=]Patch, 0 }[=
|
||||||
|
|
||||||
/fix=]
|
ENDFOR =]
|
||||||
};
|
};
|
||||||
|
@ -66,6 +66,14 @@ fi
|
|||||||
AG="autogen $AG"
|
AG="autogen $AG"
|
||||||
set -e
|
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
|
case "$1" in
|
||||||
fixincl.x | */fixincl.x )
|
fixincl.x | */fixincl.x )
|
||||||
if (${AG} --help > /dev/null 2>&1)
|
if (${AG} --help > /dev/null 2>&1)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user