From: Jim Wilson Date: Tue, 26 Jan 1993 23:29:45 +0000 (-0800) Subject: Change all uses of EX to SED. X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=e13502d79ce4828eb0f61444cfc2417be7c93acf;p=gcc.git Change all uses of EX to SED. From-SVN: r3355 --- diff --git a/gcc/fixinc.svr4 b/gcc/fixinc.svr4 index b23136f51fb..ad94d81178c 100755 --- a/gcc/fixinc.svr4 +++ b/gcc/fixinc.svr4 @@ -63,15 +63,6 @@ case $LIB in ;; esac -# This prevents /bin/ex from failing if the current terminal type is -# unrecognizable. -TERM=dumb -export TERM -# This prevents /bin/ex from failing if the EXINIT environment variable -# was set to something invalid. -EXINIT="" -export EXINIT - echo 'Building fixincludes in ' ${LIB} # Determine whether this filesystem has symbolic links. @@ -279,28 +270,24 @@ if [ \! -z "$file_to_fix" ]; then cp $file_to_fix /tmp/$base chmod +w /tmp/$base chmod a+r /tmp/$base - ex /tmp/$base </dev/null 2>&1; then \ + sed -e '/^#define[ ]*NULL[ ]*0$/c\ +#ifndef NULL\ +#ifdef __cplusplus\ +#define __NULL_TYPE\ +#else /* !defined(__cplusplus) */\ +#define __NULL_TYPE (void *)\ +#endif /* !defined(__cplusplus) */\ +#define NULL (__NULL_TYPE 0)\ +#endif /* !defined(NULL) */' /tmp/$base > /tmp/$base.sed + if cmp $file_to_fix /tmp/$base.sed >/dev/null 2>&1; then \ true else echo Fixed $file_to_fix rm -f ${LIB}/$file - cp /tmp/$base ${LIB}/$file + cp /tmp/$base.sed ${LIB}/$file chmod a+r ${LIB}/$file fi - rm -f /tmp/$base + rm -f /tmp/$base /tmp/$base.sed fi # Likewise fix the definition of NULL in so that it is conditional @@ -321,26 +308,22 @@ if [ \! -z "$file_to_fix" ]; then echo Checking $file_to_fix cp $file_to_fix /tmp/$base chmod +w /tmp/$base - ex /tmp/$base </dev/null 2>&1; then \ + sed -e '/^#define[ ]*NULL[ ]*0$/c\ +#ifdef __cplusplus\ +#define __NULL_TYPE\ +#else /* !defined(__cplusplus) */\ +#define __NULL_TYPE (void *)\ +#endif /* !defined(__cplusplus) */\ +#define NULL (__NULL_TYPE 0)' /tmp/$base > /tmp/$base.sed + if cmp $file_to_fix /tmp/$base.sed >/dev/null 2>&1; then \ true else echo Fixed $file_to_fix rm -f ${LIB}/$file - cp /tmp/$base ${LIB}/$file + cp /tmp/$base.sed ${LIB}/$file chmod a+r ${LIB}/$file fi - rm -f /tmp/$base + rm -f /tmp/$base /tmp/$base.sed fi # Likewise fix the definition of NULL in so that it is conditional @@ -361,28 +344,24 @@ if [ \! -z "$file_to_fix" ]; then echo Checking $file_to_fix cp $file_to_fix /tmp/$base chmod +w /tmp/$base - ex /tmp/$base </dev/null 2>&1; then \ + sed -e '/^#define[ ]*NULL[ ]*((char \*) 0)$/c\ +#ifndef NULL\ +#ifdef __cplusplus\ +#define __NULL_TYPE\ +#else /* !defined(__cplusplus) */\ +#define __NULL_TYPE (void *)\ +#endif /* !defined(__cplusplus) */\ +#define NULL (__NULL_TYPE 0)\ +#endif /* !defined(NULL) */' /tmp/$base > /tmp/$base.sed + if cmp $file_to_fix /tmp/$base.sed >/dev/null 2>&1; then \ true else echo Fixed $file_to_fix rm -f ${LIB}/$file - cp /tmp/$base ${LIB}/$file + cp /tmp/$base.sed ${LIB}/$file chmod a+r ${LIB}/$file fi - rm -f /tmp/$base + rm -f /tmp/$base /tmp/$base.sed fi # Add a prototyped declaration of mmap to . @@ -402,26 +381,22 @@ if [ \! -z "$file_to_fix" ]; then echo Checking $file_to_fix cp $file_to_fix /tmp/$base chmod +w /tmp/$base - ex /tmp/$base </dev/null 2>&1; then \ + sed -e '/^extern caddr_t mmap();$/c\ +#ifdef __STDC__\ +extern caddr_t mmap (caddr_t addr, size_t len, int prot, int flags,\ + int fd, off_t off);\ +#else /* !defined(__STDC__) */\ +extern caddr_t mmap ();\ +#endif /* !defined(__STDC__) */' /tmp/$base > /tmp/$base.sed + if cmp $file_to_fix /tmp/$base.sed >/dev/null 2>&1; then \ true else echo Fixed $file_to_fix rm -f ${LIB}/$file - cp /tmp/$base ${LIB}/$file + cp /tmp/$base.sed ${LIB}/$file chmod a+r ${LIB}/$file fi - rm -f /tmp/$base + rm -f /tmp/$base /tmp/$base.sed fi # Fix declarations of `ftw' and `nftw' in . @@ -441,48 +416,42 @@ if [ \! -z "$file_to_fix" ]; then echo Checking $file_to_fix cp $file_to_fix /tmp/$base chmod +w /tmp/$base - ex /tmp/$base </dev/null 2>&1; then \ + sed -e '/^extern int ftw(const/c\ +#if !defined(_STYPES)\ +static\ +#else\ +extern\ +#endif\ + int ftw(const char *, int (*)(const char *, const struct stat *, int), int);' \ + -e '/^extern int nftw/c\ +#if defined(_STYPES)\ +static\ +#else\ +extern\ +#endif\ + int nftw(const char *, int (*)(const char *, const struct stat *, int, struct FTW *),int, int);' \ + -e '/^extern int ftw(),/c\ +#if !defined(_STYPES)\ +static\ +#else\ +extern\ +#endif\ + int ftw();\ +#if defined(_STYPES)\ +static\ +#else\ +extern\ +#endif\ + int nftw();' /tmp/$base > /tmp/$base.sed + if cmp $file_to_fix /tmp/$base.sed >/dev/null 2>&1; then \ true else echo Fixed $file_to_fix rm -f ${LIB}/$file - cp /tmp/$base ${LIB}/$file + cp /tmp/$base.sed ${LIB}/$file chmod a+r ${LIB}/$file fi - rm -f /tmp/$base + rm -f /tmp/$base /tmp/$base.sed fi # Add a `static' declaration of `getrnge' into . @@ -509,24 +478,20 @@ if [ \! -z "$file_to_fix" ]; then else cp $file_to_fix /tmp/$base chmod +w /tmp/$base - ex /tmp/$base </dev/null 2>&1; then \ + sed -e '/^static int[ ]*size;/c\ +static int size ;\ +\ +static int getrnge ();' /tmp/$base > /tmp/$base.sed + if cmp $file_to_fix /tmp/$base.sed >/dev/null 2>&1; then \ true else echo Fixed $file_to_fix rm -f ${LIB}/$file - cp /tmp/$base ${LIB}/$file + cp /tmp/$base.sed ${LIB}/$file chmod a+r ${LIB}/$file fi fi - rm -f /tmp/$base + rm -f /tmp/$base /tmp/$base.sed fi # Disable apparent native compiler optimization cruft in SVR4.2 @@ -548,19 +513,16 @@ if [ \! -z "$file_to_fix" ]; then echo Checking $file_to_fix cp $file_to_fix /tmp/$base chmod +w /tmp/$base - ex /tmp/$base </dev/null 2>&1; then \ + sed -e 'g/#define.*__std_hdr_/d' /tmp/$base > /tmp/$base.sed + if cmp $file_to_fix /tmp/$base.sed >/dev/null 2>&1; then \ true else echo Fixed $file_to_fix rm -f ${LIB}/$file - cp /tmp/$base ${LIB}/$file + cp /tmp/$base.sed ${LIB}/$file chmod a+r ${LIB}/$file fi - rm -f /tmp/$base + rm -f /tmp/$base /tmp/$base.sed fi # Add a #define of _SIGACTION_ into . @@ -581,23 +543,19 @@ if [ \! -z "$file_to_fix" ]; then echo Checking $file_to_fix cp $file_to_fix /tmp/$base chmod +w /tmp/$base - ex /tmp/$base </dev/null 2>&1; then \ + sed -e '/^struct sigaction {/c\ +#define _SIGACTION_\ +struct sigaction {' \ + -e '1,$s/(void *(\*)())/(void (*)(int))/' /tmp/$base > /tmp/$base.sed + if cmp $file_to_fix /tmp/$base.sed >/dev/null 2>&1; then \ true else echo Fixed $file_to_fix rm -f ${LIB}/$file - cp /tmp/$base ${LIB}/$file + cp /tmp/$base.sed ${LIB}/$file chmod a+r ${LIB}/$file fi - rm -f /tmp/$base + rm -f /tmp/$base /tmp/$base.sed fi # Fix declarations of `makedev', `major', and `minor' in . @@ -617,36 +575,27 @@ if [ \! -z "$file_to_fix" ]; then echo Checking $file_to_fix cp $file_to_fix /tmp/$base chmod +w /tmp/$base - ex /tmp/$base </dev/null 2>&1; then \ + sed -e '/^dev_t makedev(const/c\ +static dev_t makedev(const major_t, const minor_t);' \ + -e '/^dev_t makedev()/c\ +static dev_t makedev();' \ + -e '/^major_t major(const/c\ +static major_t major(const dev_t);' \ + -e '/^major_t major()/c\ +static major_t major();' \ + -e '/^minor_t minor(const/c\ +static minor_t minor(const dev_t);' \ + -e '/^minor_t minor()/c\ +static minor_t minor();' /tmp/$base > /tmp/$base.sed + if cmp $file_to_fix /tmp/$base.sed >/dev/null 2>&1; then \ true else echo Fixed $file_to_fix rm -f ${LIB}/$file - cp /tmp/$base ${LIB}/$file + cp /tmp/$base.sed ${LIB}/$file chmod a+r ${LIB}/$file fi - rm -f /tmp/$base + rm -f /tmp/$base /tmp/$base.sed fi # Fix reference to NMSZ in . @@ -1126,46 +1075,50 @@ if [ \! -z "$file_to_fix" ]; then echo Checking $file_to_fix cp $file_to_fix /tmp/$base chmod +w /tmp/$base - ex /tmp/$base < /tmp/$base.sed + if cmp $file_to_fix /tmp/$base.sed >/dev/null 2>&1; then \ + true + else + echo Fixed $file_to_fix + rm -f ${LIB}/$file + cp /tmp/$base.sed ${LIB}/$file + chmod a+r ${LIB}/$file + fi + rm -f /tmp/$base /tmp/$base.sed fi # Sony NEWSOS 5.0 does not support the complete ANSI C standard.