Commit 89647e8a by Loren J. Rittle Committed by Bruce Korb

fix freebsd version check of GCC

Co-Authored-By: Bruce Korb <bkorb@gnu.org>

From-SVN: r39961
parent e889f41a
2001-02-21 Loren J. Rittle <ljrittle@acm.org>
Bruce Korb <bkorb@gnu.org>
* fixinc/inclhack.def (freebsd_gcc3_breakage): new fix
* fixinc/README: Document how to convert sed substitutions
to format style c_fix-es.
* fixinc/fixincl.x: regen
2001-02-21 Jeffrey D. Oldham <oldham@codesourcery.com> 2001-02-21 Jeffrey D. Oldham <oldham@codesourcery.com>
* gcc.c: Add comment explaining how to add a command-line option. * gcc.c: Add comment explaining how to add a command-line option.
......
...@@ -181,6 +181,25 @@ Here are the rules for making fixes in the inclhack.def file: ...@@ -181,6 +181,25 @@ Here are the rules for making fixes in the inclhack.def file:
replaced. You may delete text by supplying an empty string for replaced. You may delete text by supplying an empty string for
the format (the first "c_fix_arg"). the format (the first "c_fix_arg").
Note: In general, a format c_fix may be used in place of one
sed expression. However, it will need to be rewritten by
hand. For example:
sed = 's@^#if __GNUC__ == 2 && __GNUC_MINOR__ >= 7$'
'@& || __GNUC__ >= 3@';
may be rewritten using a format c_fix as:
c_fix = format;
c_fix_arg = '%0 || __GNUC__ >= 3';
c_fix_arg = '^#if __GNUC__ == 2 && __GNUC_MINOR__ >= 7$';
Multiple sed substitution expressions probably ought to remain sed
expressions in order to maintain clarity. Also note that if the
second sed expression is the same as the first select expression,
then you may omit the second c_fix_arg. The select expression will
be picked up and used in its absence.
EXAMPLES OF FIXES: EXAMPLES OF FIXES:
================== ==================
......
...@@ -1031,6 +1031,23 @@ fix = { ...@@ -1031,6 +1031,23 @@ fix = {
/* /*
* Between 8/24/1998 and 2/17/2001, FreeBSD system headers presume
* neither the existence of GCC 3 nor its exact feature set yet break
* (by design?) when __GNUC__ is set beyond 2.
*/
fix = {
hackname = freebsd_gcc3_breakage;
mach = *-*-freebsd*;
files = sys/cdefs.h;
select = '^#if __GNUC__ == 2 && __GNUC_MINOR__ >= 7$';
bypass = '__GNUC__[ \t]*([>=]=[ \t]*[3-9]|>[ \t]*2)';
c_fix = format;
c_fix_arg = '%0 || __GNUC__ >= 3';
test_text = '#if __GNUC__ == 2 && __GNUC_MINOR__ >= 7';
};
/*
* Fix HP & Sony's use of "../machine/xxx.h" * Fix HP & Sony's use of "../machine/xxx.h"
* to refer to: <machine/xxx.h> * to refer to: <machine/xxx.h>
*/ */
...@@ -1904,29 +1921,11 @@ fix = { ...@@ -1904,29 +1921,11 @@ fix = {
/* /*
* "!__STDC__" is "!defined( __STRICT_ANSI__ )"
*/
fix = {
hackname = sco_strict_ansi;
mach = "i?86-*-sco3.2*";
select = "^[ \t]*#[ \t]*if.*!__STDC__";
c_fix = format;
c_fix_arg = "%1defined(__STRICT_ANSI__)%2";
c_fix_arg = "^([ \t]*#[ \t]*if[ \t].*!)__STDC__(.*)";
test_text = "#if !__STDC__ /* not standard C */\nint foo;\n#endif";
};
/*
* "!__STDC__" or "__STDC__==0" or "__STDC__!=1" or "__STDC__-0==0" * "!__STDC__" or "__STDC__==0" or "__STDC__!=1" or "__STDC__-0==0"
* is "!defined( __STRICT_ANSI__ )" * is "!defined( __STRICT_ANSI__ )"
*/ */
fix = { fix = {
hackname = strict_ansi_not; hackname = strict_ansi_not;
mach="*-*-sysv4*";
mach="i[34567]86-*-sysv5*";
mach="i[34567]86-*-udk*";
select = "^([ \t]*#[ \t]*if.*)" select = "^([ \t]*#[ \t]*if.*)"
"(!__STDC__" "(!__STDC__"
"|__STDC__[ \t]*==[ \t]*0" "|__STDC__[ \t]*==[ \t]*0"
...@@ -1937,8 +1936,10 @@ fix = { ...@@ -1937,8 +1936,10 @@ fix = {
c_fix = format; c_fix = format;
c_fix_arg = "%1 !defined(__STRICT_ANSI__)%3"; c_fix_arg = "%1 !defined(__STRICT_ANSI__)%3";
test_text = "#if !__STDC__ || __STDC__ == 0 || __STDC__ != 1" test_text = "#if !__STDC__ \n"
"|| __STDC__ - 0 == 0" "#if __STDC__ == 0\n"
"#if __STDC__ != 1\n"
"#if __STDC__ - 0 == 0"
"/* not std C */\nint foo;\n#endif"; "/* not std C */\nint foo;\n#endif";
}; };
...@@ -1954,7 +1955,6 @@ fix = { ...@@ -1954,7 +1955,6 @@ fix = {
files="signal.h"; files="signal.h";
files="stdlib.h"; files="stdlib.h";
files="time.h"; files="time.h";
mach="i[34567]86-*-sysv5*";
select = "^([ \t]*[|&][|&][ \t(]*)" select = "^([ \t]*[|&][|&][ \t(]*)"
"(__STDC__[ \t]*-[ \t]*0[ \t]*==[ \t]*0" "(__STDC__[ \t]*-[ \t]*0[ \t]*==[ \t]*0"
")(.*)"; ")(.*)";
...@@ -1972,9 +1972,6 @@ fix = { ...@@ -1972,9 +1972,6 @@ fix = {
*/ */
fix = { fix = {
hackname = strict_ansi_only; hackname = strict_ansi_only;
mach="*-*-sysv4*";
mach="i[34567]86-*-sysv5*";
mach="i[34567]86-*-udk";
select = "^([ \t]*#[ \t]*if.*)" select = "^([ \t]*#[ \t]*if.*)"
"(__STDC__[ \t]*!=[ \t]*0" "(__STDC__[ \t]*!=[ \t]*0"
"|__STDC__[ \t]*==[ \t]*1" "|__STDC__[ \t]*==[ \t]*1"
...@@ -2121,21 +2118,6 @@ fix = { ...@@ -2121,21 +2118,6 @@ fix = {
/* /*
* Check for strict ansi compliance
*/
#ifdef STRICT_ANSI
fix = {
hackname = strict_ansi;
select = "__STDC__[ \t]*[=!]=[ \t]*[01]";
sed = "s/__STDC__[ \t]*==[ \t]*0/!defined (__STRICT_ANSI__)/g";
sed = "s/__STDC__[ \t]*!=[ \t]*0/defined (__STRICT_ANSI__)/g";
sed = "s/__STDC__[ \t]*==[ \t]*1/defined (__STRICT_ANSI__)/g";
sed = "s/__STDC__[ \t]*!=[ \t]*1/!defined (__STRICT_ANSI__)/g";
};
#endif
/*
* IRIX 4.0.5 <rpc/xdr.h> uses struct __file_s * IRIX 4.0.5 <rpc/xdr.h> uses struct __file_s
* in prototype without previous definition. * in prototype without previous definition.
*/ */
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment