Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
R
riscv-gcc-1
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
lvzhengyang
riscv-gcc-1
Commits
84e0c5a8
Commit
84e0c5a8
authored
May 29, 1998
by
Bruce Korb
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fixes from six months of fixincludes hacking
From-SVN: r20140
parent
e23afa25
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
131 additions
and
20 deletions
+131
-20
contrib/fixinc/inclhack.def
+115
-10
contrib/fixinc/mkfixinc.sh
+16
-10
No files found.
contrib/fixinc/inclhack.def
View file @
84e0c5a8
...
@@ -171,15 +171,43 @@ fix = {
...
@@ -171,15 +171,43 @@ fix = {
fix = {
fix = {
hackname = badquote;
hackname = badquote;
files = sundev/vuid_event.h;
files = sundev/vuid_event.h;
/*
* The following uglitude is to allow an apostrophe inside
* of a single quote quoted string in a shell command line.
*/
sed = "s/doesn't/does not/";
sed = "s/doesn't/does not/";
};
};
/*
/*
* Fix #defines under Alpha OSF/1:
* The following files contain '#pragma extern_prefix "_FOO"' followed by
* a '#define something(x,y,z) _FOOsomething(x,y,z)'. The intent of these
* statements is to reduce namespace pollution. While these macros work
* properly in most cases, they don't allow you to take a pointer to the
* "something" being modified. To get around this limitation, change these
* statements to be of the form '#define something _FOOsomething'.
*/
fix = {
hackname = bad_lval;
select = "^[ \t]*#[ \t]*pragma[ \t]extern_prefix";
files = libgen.h;
files = dirent.h;
files = ftw.h;
files = grp.h;
files = ndbm.h;
files = pthread.h;
files = pwd.h;
files = signal.h;
files = standards.h;
files = stdlib.h;
files = string.h;
files = stropts.h;
files = time.h;
files = unistd.h;
sed =
"s/^[ \t]*#[ \t]*define[ \t]*\\([^(]*\\)\\(([^)]*)\\)[ \t]*"
"\\(_.\\)\\1\\2[ \t]*$/#define \\1 \\3\\1/";
};
/*
* check for broken assert.h that needs stdio.h
* check for broken assert.h that needs stdio.h
*/
*/
fix = {
fix = {
...
@@ -223,7 +251,7 @@ fix = {
...
@@ -223,7 +251,7 @@ fix = {
/*
/*
* And also with the HP-UX 10 sys/pci.h file
* And also with the HP-UX 10
and HP-UX 11
sys/pci.h file
*/
*/
fix = {
fix = {
hackname = cxx_cmnt_hpux;
hackname = cxx_cmnt_hpux;
...
@@ -312,8 +340,14 @@ fix = {
...
@@ -312,8 +340,14 @@ fix = {
* and '0' lies the character '/'. This will *NOT*
* and '0' lies the character '/'. This will *NOT*
* match '#endif / * foo * /', but it also wont match
* match '#endif / * foo * /', but it also wont match
* '#endif / done' either.
* '#endif / done' either.
*
* We use the pattern [!-.0-z{|}~] instead of [^/ \t] to match a noncomment
* following #else or #endif because some buggy egreps think [^/] matches
* newline, and they thus think `#else ' matches
* `#e[ndiflse]*[ \t]+[^/ \t]'.
* [!-.0-~] does not work properly on AIX 4.1.
*/
*/
select = "^[ \t]*#[ \t]*endif[ \t]+[!-.0-~]";
select = "^[ \t]*#[ \t]*endif[ \t]+[!-.0-
z\{\|\}\
~]";
/*
/*
* First, join the continued input lines.
* First, join the continued input lines.
...
@@ -362,12 +396,11 @@ fix = {
...
@@ -362,12 +396,11 @@ fix = {
/*
/*
*
assert.h and sys/mman.h on HP/UX are
not C++ ready,
*
sys/mman.h on HP/UX is
not C++ ready,
* even though NO_IMPLICIT_EXTERN_C is defined on HP/UX.
* even though NO_IMPLICIT_EXTERN_C is defined on HP/UX.
*/
*/
fix = {
fix = {
hackname = hpux_cxx_unready;
hackname = hpux_cxx_unready;
files = assert.h;
files = sys/mman.h;
files = sys/mman.h;
bypass = '"C"|__BEGIN_DECLS';
bypass = '"C"|__BEGIN_DECLS';
...
@@ -561,6 +594,20 @@ fix = {
...
@@ -561,6 +594,20 @@ fix = {
/*
/*
* Fix nested comments in Motorola's <limits.h> and <sys/limits.h>
*/
fix = {
hackname = motorola_nested;
files = limits.h
files = sys/limits.h;
sed = "s@^\\(#undef[ \t][ \t]*PIPE_BUF[ \t]*"
"/\\* max # bytes atomic in write to a\\)$@\\1 */@";
sed = "s@\\(/\\*#define\tHUGE_VAL\t3.40282346638528860e+38 \\)"
"\\(/\\*error value returned by Math lib\\*/\\)$@\\1*/ \\2@";
};
/*
* Fixing nested comments in ISC <sys/limits.h>
* Fixing nested comments in ISC <sys/limits.h>
*/
*/
fix = {
fix = {
...
@@ -609,6 +656,7 @@ fix = {
...
@@ -609,6 +656,7 @@ fix = {
* comment. Fortunately, HP/UX already uses #ifndefs in limits.h; if
* comment. Fortunately, HP/UX already uses #ifndefs in limits.h; if
* we find a #ifndef FLT_MIN we assume that all the required #ifndefs
* we find a #ifndef FLT_MIN we assume that all the required #ifndefs
* are there, and we do not add them ourselves.
* are there, and we do not add them ourselves.
* Also fix a nested comment problem in sys/limits.h on Motorola sysV68 R3V7.1
*/
*/
fix = {
fix = {
hackname = limits_ifndefs;
hackname = limits_ifndefs;
...
@@ -627,6 +675,7 @@ fix = {
...
@@ -627,6 +675,7 @@ fix = {
sed = "/[ \t]DBL_MAX[ \t]/a\\\n#endif\n";
sed = "/[ \t]DBL_MAX[ \t]/a\\\n#endif\n";
sed = "/[ \t]DBL_DIG[ \t]/i\\\n#ifndef DBL_DIG\n";
sed = "/[ \t]DBL_DIG[ \t]/i\\\n#ifndef DBL_DIG\n";
sed = "/[ \t]DBL_DIG[ \t]/a\\\n#endif\n";
sed = "/[ \t]DBL_DIG[ \t]/a\\\n#endif\n";
sed = "/^\\(\\/\\*#define\tHUGE_VAL\t3\\.[0-9e+]* *\\)\\/\\*/s//\\1/";
};
};
...
@@ -896,7 +945,7 @@ fix = {
...
@@ -896,7 +945,7 @@ fix = {
'{' "\\\n"
'{' "\\\n"
"\treturn fabs (hypot (x, y));\\\n"
"\treturn fabs (hypot (x, y));\\\n"
'}' "\\\n"
'}' "\\\n"
'#define hypot fake_hypot' "
\n";
"#define hypot\tfake_hypot
\n";
};
};
...
@@ -1814,6 +1863,7 @@ fix = {
...
@@ -1814,6 +1863,7 @@ fix = {
hackname = systypes_for_aix;
hackname = systypes_for_aix;
files = sys/types.h;
files = sys/types.h;
select = "typedef[ \t][ \t]*[A-Za-z_][ \tA-Za-z_]*[ \t]size_t";
select = "typedef[ \t][ \t]*[A-Za-z_][ \tA-Za-z_]*[ \t]size_t";
bypass = "_GCC_SIZE_T";
sed = "/typedef[ \t][ \t]*[A-Za-z_][ \tA-Za-z_]*[ \t]size_t/i\\\n"
sed = "/typedef[ \t][ \t]*[A-Za-z_][ \tA-Za-z_]*[ \t]size_t/i\\\n"
"#ifndef _GCC_SIZE_T\\\n"
"#ifndef _GCC_SIZE_T\\\n"
...
@@ -1841,7 +1891,7 @@ fix = {
...
@@ -1841,7 +1891,7 @@ fix = {
sed = "s/^\\(\tstrncmp()\\),\\n\\(\tstrlen(),\\)$/\\1;\\\n"
sed = "s/^\\(\tstrncmp()\\),\\n\\(\tstrlen(),\\)$/\\1;\\\n"
"extern unsigned int\\\n\\2/";
"extern unsigned int\\\n\\2/";
sed = "/^extern int$/N";
sed = "/^extern int$/N";
sed =
's/^extern int\(\n strlen(),\)/extern size_t\1/'
;
sed =
"s/^extern int\\(\\n\tstrlen(),\\)/extern size_t\\1/"
;
};
};
...
@@ -2192,4 +2242,59 @@ fix = {
...
@@ -2192,4 +2242,59 @@ fix = {
};
};
/*
* Purge some HP-UX 11 files that are only borken after they are "fixed".
*/
fix = {
hackname = zzz_ki_iface;
files = sys/ki_iface.h;
select = 'These definitions are for HP Internal developers';
shell = "cat > /dev/null ; rm -f $file";
};
/*
* Purge some HP-UX 11 files that are only borken after they are "fixed".
*/
fix = {
hackname = zzz_ki;
files = sys/ki.h;
select = '11.00 HP-UX LP64';
shell = "cat > /dev/null ; rm -f $file";
};
/*
* Purge some HP-UX 11 files that are only borken after they are "fixed".
*/
fix = {
hackname = zzz_ki_calls;
files = sys/ki_calls.h;
select = 'KI_MAX_PROCS is an arbitrary number';
shell = "cat > /dev/null ; rm -f $file";
};
/*
* Purge some HP-UX 11 files that are only borken after they are "fixed".
*/
fix = {
hackname = zzz_ki_defs;
files = sys/ki_defs.h;
select = 'Kernel Instrumentation Definitions';
shell = "cat > /dev/null ; rm -f $file";
};
/*
* Purge some HP-UX 11 files that are only borken after they are "fixed".
*/
fix = {
hackname = zzz_time;
files = sys/time.h;
select = 'For CASPEC, look in';
shell = "cat > /dev/null ; rm -f $file";
};
/*EOF*/
/*EOF*/
contrib/fixinc/mkfixinc.sh
View file @
84e0c5a8
#! /bin/sh
#! /bin/sh
machine
=
$1
machine
=
$1
dest
dir
=
$2
dest
=
$2
# *-*-linux-* | \
if
test
-z
"
$dest
"
then
echo
"No destination directory specified"
exit
1
fi
echo
constructing
$dest
for
$machine
case
$machine
in
case
$machine
in
alpha
*
-dec-vms
*
|
\
alpha
*
-dec-vms
*
|
\
...
@@ -34,9 +40,9 @@ case $machine in
...
@@ -34,9 +40,9 @@ case $machine in
powerpcle-
*
-winnt
*
|
\
powerpcle-
*
-winnt
*
|
\
powerpcle-
*
-pe
|
\
powerpcle-
*
-pe
|
\
powerpcle-
*
-cygwin32
|
\
powerpcle-
*
-cygwin32
|
\
*
-
*
-linux-
*
|
\
*
-
*
-gnu
*
)
*
-
*
-gnu
*
)
echo
fixinc
for
$machine
disabled
fixincludes
=
`
basename
$dest
`
fixincludes
=
;;
;;
i[34567]86-dg-dgux
*
|
\
i[34567]86-dg-dgux
*
|
\
...
@@ -71,7 +77,6 @@ case $machine in
...
@@ -71,7 +77,6 @@ case $machine in
fixincludes
=
fixinc.winnt
fixincludes
=
fixinc.winnt
;;
;;
alpha
*
-
*
-linux-gnulibc1
*
|
\
alpha
*
-
*
-netbsd
*
|
\
alpha
*
-
*
-netbsd
*
|
\
arm-
*
-netbsd
*
|
\
arm-
*
-netbsd
*
|
\
i[34567]86-
*
-freebsdelf
*
|
\
i[34567]86-
*
-freebsdelf
*
|
\
...
@@ -88,14 +93,13 @@ case $machine in
...
@@ -88,14 +93,13 @@ case $machine in
;;
;;
*
)
*
)
fixincludes
=
generated
fixincludes
=
`
basename
$dest
`
;;
;;
esac
esac
if
test
-z
"
$fixincludes
"
if
test
-z
"
$fixincludes
"
then
then
$MAKE
install
DESTDIR
=
$destdir
cat
>
$dest
<<-
_EOF_
cat
>
$destdir
/fixinc.sh
<<-
_EOF_
#! /bin/sh
#! /bin/sh
exit 0
exit 0
_EOF_
_EOF_
...
@@ -104,10 +108,12 @@ fi
...
@@ -104,10 +108,12 @@ fi
if
test
-f
"
$fixincludes
"
if
test
-f
"
$fixincludes
"
then
then
cp
$fixincludes
$destdir
/fixinc.sh
echo
copying
$fixincludes
to
$dest
cp
$fixincludes
$dest
exit
0
exit
0
fi
fi
$MAKE
install
DESTDIR
=
$destdir
echo
$MAKE
install
DESTDIR
=
`
dirname
$dest
`
$MAKE
install
DESTDIR
=
`
dirname
$dest
`
exit
1
exit
1
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment