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
5d53a417
Commit
5d53a417
authored
Aug 04, 1993
by
John Hassey
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Initial revision
From-SVN: r5064
parent
3a08477a
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
179 additions
and
0 deletions
+179
-0
gcc/fixinc.dgux
+179
-0
No files found.
gcc/fixinc.dgux
0 → 100755
View file @
5d53a417
#!/bin/sh
#
# modified for dgux by hassey@dg-rtp.dg.com based on
#
# fixinc.svr4 written by Ron Guilmette (rfg@ncd.com).
#
# This file is part of GNU CC.
#
# GNU CC is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2, or (at your option)
# any later version.
#
# GNU CC is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with GNU CC; see the file COPYING. If not, write to
# the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA.
#
#
# See README-fixinc for more information.
# Directory where gcc sources (and sometimes special include files) live.
SRCDIR
=
${
3
-
${
SRCDIR
-.
}}
# Directory containing the original header files.
INPUT
=
${
2
-
${
INPUT
-/usr/include
}}
# Fail if no arg to specify a directory for the output.
if
[
x
$1
=
x
]
then
echo
fixincludes: no output directory specified
exit
1
fi
# Directory in which to store the results.
LIB
=
${
1
?
"fixincludes: output directory not specified"
}
# Make sure it exists.
if
[
!
-d
$LIB
]
;
then
mkdir
$LIB
||
exit
1
fi
ORIG_DIR
=
`
pwd
`
# Make LIB absolute if it is relative.
# Don't do this if not necessary, since may screw up automounters.
case
$LIB
in
/
*
)
;;
*
)
cd
$LIB
;
LIB
=
`
${
PWDCMD
-pwd
}
`
;;
esac
echo
'Building fixincludes in '
${
LIB
}
# Determine whether this filesystem has symbolic links.
if
ln
-s
X
$LIB
/ShouldNotExist 2>/dev/null
;
then
rm
-f
$LIB
/ShouldNotExist
LINKS
=
true
else
LINKS
=
false
fi
echo
'Making directories:'
cd
${
INPUT
}
if
$LINKS
;
then
files
=
`
ls
-LR
| sed
-n
s/:
$/
/p
`
else
files
=
`
find
.
-type
d
-print
| sed
'/^.$/d'
`
fi
for
file
in
$files
;
do
rm
-rf
$LIB
/
$file
if
[
!
-d
$LIB
/
$file
]
then
mkdir
$LIB
/
$file
fi
done
# treetops gets an alternating list
# of old directories to copy
# and the new directories to copy to.
treetops
=
"
${
INPUT
}
${
LIB
}
"
if
$LINKS
;
then
echo
'Making internal symbolic directory links'
for
file
in
$files
;
do
dest
=
`
ls
-ld
$file
| sed
-n
's/.*-> //p'
`
if
[
"
$dest
"
]
;
then
cwd
=
`
pwd
`
# In case $dest is relative, get to $file's dir first.
cd
${
INPUT
}
cd
`
echo
./
$file
| sed
-n
's&[^/]*$&&p'
`
# Check that the target directory exists.
# Redirections changed to avoid bug in sh on Ultrix.
(
cd
$dest
)
>
/dev/null 2>&1
if
[
$?
=
0
]
;
then
cd
$dest
# X gets the dir that the link actually leads to.
x
=
`
pwd
`
# If link leads back into ${INPUT},
# make a similar link here.
if
expr
$x
:
"
${
INPUT
}
/.*"
>
/dev/null
;
then
# Y gets the actual target dir name, relative to ${INPUT}.
y
=
`
echo
$x
| sed
-n
"s&
${
INPUT
}
/&&p"
`
# DOTS is the relative path from ${LIB}/$file's dir back to ${LIB}.
dots
=
`
echo
"
$file
"
|
sed
-e
's@^./@@'
-e
's@[^/][^/]*@..@g'
-e
's@..$@@'
`
echo
$file
'->'
$dots$y
': Making link'
rm
-fr
${
LIB
}
/
$file
>
/dev/null 2>&1
ln
-s
$dots$y
${
LIB
}
/
$file
>
/dev/null 2>&1
else
# If the link is to outside ${INPUT},
# treat this directory as if it actually contained the files.
# This line used to have $dest instead of $x.
# $dest seemed to be wrong for links found in subdirectories
# of ${INPUT}. Does this change break anything?
treetops
=
"
$treetops
$x
${
LIB
}
/
$file
"
fi
fi
cd
$cwd
fi
done
fi
# Completely replace <_int_varargs.h> with a file that defines
# va_list and gnuc_va_list
file
=
_int_varargs.h
if
[
-r
${
INPUT
}
/
$file
]
;
then
echo
Replacing
$file
cat
>
${
LIB
}
/
$file
<<
EOF
/* This file was generated by fixinc.dgux. */
/* Define __gnuc_va_list, just as in gstdarg.h. */
#ifndef __GNUC_VA_LIST
#define __GNUC_VA_LIST
#if defined(__svr4__) || defined(_AIX) || defined(_M_UNIX)
typedef char *__gnuc_va_list;
#else
typedef void *__gnuc_va_list;
#endif
#endif
typedef __gnuc_va_list va_list;
EOF
chmod a+r
${
LIB
}
/
$file
fi
echo
'Removing unneeded directories:'
cd
$LIB
files
=
`
find
.
-type
d
-print
| sort
-r
`
for
file
in
$files
;
do
rmdir
$LIB
/
$file
>
/dev/null 2>&1
done
if
$LINKS
;
then
echo
'Making internal symbolic non-directory links'
cd
${
INPUT
}
files
=
`
find
.
-type
l
-print
`
for
file
in
$files
;
do
dest
=
`
ls
-ld
$file
| sed
-n
's/.*-> //p'
`
if
expr
"
$dest
"
:
'[^/].*'
>
/dev/null
;
then
target
=
${
LIB
}
/
`
echo
file | sed
"s|[^/]*
\$
|
$dest
|"
`
if
[
-f
$target
]
;
then
ln
-s
$dest
${
LIB
}
/
$file
>
/dev/null 2>&1
fi
fi
done
fi
cd
${
ORIG_DIR
}
exit
0
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