OSDN Git Service

Merge from fixincl-branch
[pf3gnuchains/gcc-fork.git] / gcc / fixinc / inclhack.sh
index 9e993ea..f56e9a5 100755 (executable)
@@ -2,7 +2,7 @@
 #
 # DO NOT EDIT THIS FILE   (inclhack.sh)
 # 
-# It has been autogen-ed  Friday October 16, 1998 at 07:29:49 AM PDT
+# It has been autogen-ed  Wednesday January 27, 1999 at 09:03:36 AM PST
 # From the definitions    inclhack.def
 # and the template file   inclhack.tpl
 #
@@ -10,7 +10,7 @@
 # files which are fixed to work correctly with ANSI C and placed in a
 # directory that GNU C will search.
 #
-# This script contains 104 fixup scripts.
+# This script contains 105 fixup scripts.
 #
 # See README-fixinc for more information.
 #
@@ -125,10 +125,7 @@ for INPUT in ${INPUTLIST} ; do
 
 cd ${ORIGDIR}
 
-cd ${INPUT} || {
-  echo 'fixincludes:  input dir `'$INPUT"' is an invalid directory"
-  exit 1
-}
+cd ${INPUT} || continue
 
 #
 # # # # # # # # # # # # # # # # # # # # #
@@ -2464,7 +2461,30 @@ extern unsigned int\
 
 
     #
-    # Fix  84:  Ultrix_Atof_Param
+    # Fix  84:  Ultrix_Fix_Fixproto
+    #
+    case "$file" in ./sys/utsname.h )
+    if ( test -n "`egrep 'ULTRIX' $file`"
+       ) > /dev/null 2>&1 ; then
+    fixlist="${fixlist}
+      ultrix_fix_fixproto"
+    if [ ! -r ${DESTDIR}/$file ]
+    then infile=$file
+    else infile=${DESTDIR}/$file ; fi 
+
+    sed -e '/^[        ]*extern[       ]*int[  ]*uname();$/i\
+struct utsname;
+' \
+          < $infile > ${DESTDIR}/$file.
+    
+    mv -f ${DESTDIR}/$file. ${DESTDIR}/$file
+    fi # end of selection 'if'
+    ;; # case end for file name test
+    esac
+
+
+    #
+    # Fix  85:  Ultrix_Atof_Param
     #
     case "$file" in ./math.h )
     fixlist="${fixlist}
@@ -2486,7 +2506,7 @@ extern unsigned int\
 
 
     #
-    # Fix  85:  Ultrix_Const
+    # Fix  86:  Ultrix_Const
     #
     case "$file" in ./stdio.h )
     fixlist="${fixlist}
@@ -2512,7 +2532,7 @@ extern unsigned int\
 
 
     #
-    # Fix  86:  Ultrix_Ifdef
+    # Fix  87:  Ultrix_Ifdef
     #
     case "$file" in ./sys/file.h )
     if ( test -n "`egrep '#ifdef KERNEL' $file`"
@@ -2533,7 +2553,7 @@ extern unsigned int\
 
 
     #
-    # Fix  87:  Ultrix_Nested_Cmnt
+    # Fix  88:  Ultrix_Nested_Cmnt
     #
     case "$file" in ./rpc/svc.h )
     fixlist="${fixlist}
@@ -2551,7 +2571,7 @@ extern unsigned int\
 
 
     #
-    # Fix  88:  Ultrix_Static
+    # Fix  89:  Ultrix_Static
     #
     case "$file" in ./machine/cpu.h )
     if ( test -n "`egrep '#include \"r[34]_cpu' $file`"
@@ -2574,7 +2594,7 @@ extern unsigned int\
 
 
     #
-    # Fix  89:  Undefine_Null
+    # Fix  90:  Undefine_Null
     #
     if ( test -n "`egrep '^#[  ]*define[       ]*[     ]NULL[  ]' $file`" -a \
               -z "`egrep '#[   ]*(ifn|un)def[  ]*[     ]NULL($|[       ])' $file`"
@@ -2595,7 +2615,7 @@ extern unsigned int\
 
 
     #
-    # Fix  90:  Va_I960_Macro
+    # Fix  91:  Va_I960_Macro
     #
     case "$file" in ./arch/i960/archI960.h )
     if ( test -n "`egrep '__(vsiz|vali|vpad|alignof__)' $file`"
@@ -2619,7 +2639,7 @@ extern unsigned int\
 
 
     #
-    # Fix  91:  Void_Null
+    # Fix  92:  Void_Null
     #
     case "$file" in ./curses.h | \
        ./dbm.h | \
@@ -2650,7 +2670,7 @@ extern unsigned int\
 
 
     #
-    # Fix  92:  Vxworks_Gcc_Problem
+    # Fix  93:  Vxworks_Gcc_Problem
     #
     case "$file" in ./types/vxTypesBase.h )
     if ( test -n "`egrep '__GNUC_TYPEOF_FEATURE_BROKEN_USE_DEFAULT_UNTIL_FIXED__' $file`"
@@ -2692,7 +2712,7 @@ extern unsigned int\
 
 
     #
-    # Fix  93:  Vxworks_Needs_Vxtypes
+    # Fix  94:  Vxworks_Needs_Vxtypes
     #
     case "$file" in ./time.h )
     if ( test -n "`egrep 'uint_t[      ][      ]*_clocks_per_sec' $file`"
@@ -2713,7 +2733,7 @@ extern unsigned int\
 
 
     #
-    # Fix  94:  Vxworks_Needs_Vxworks
+    # Fix  95:  Vxworks_Needs_Vxworks
     #
     case "$file" in ./sys/stat.h )
     if ( test -n "`egrep '#[   ]define[        ][      ]*__INCstath' $file`" -a \
@@ -2739,7 +2759,7 @@ extern unsigned int\
 
 
     #
-    # Fix  95:  Vxworks_Time
+    # Fix  96:  Vxworks_Time
     #
     case "$file" in ./time.h )
     if ( test -n "`egrep 'VOIDFUNCPTR' $file`" -a \
@@ -2771,7 +2791,7 @@ typedef void (*__gcc_VOIDFUNCPTR) ();\
 
 
     #
-    # Fix  96:  X11_Class
+    # Fix  97:  X11_Class
     #
     case "$file" in ./X11/ShellP.h )
     if ( test -z "`egrep '__cplusplus' $file`"
@@ -2799,7 +2819,7 @@ typedef void (*__gcc_VOIDFUNCPTR) ();\
 
 
     #
-    # Fix  97:  X11_Class_Usage
+    # Fix  98:  X11_Class_Usage
     #
     case "$file" in ./Xm/BaseClassI.h )
     if ( test -z "`egrep '__cplusplus' $file`"
@@ -2820,7 +2840,7 @@ typedef void (*__gcc_VOIDFUNCPTR) ();\
 
 
     #
-    # Fix  98:  X11_New
+    # Fix  99:  X11_New
     #
     case "$file" in ./Xm/Traversal.h )
     if ( test -z "`egrep '__cplusplus' $file`"
@@ -2849,7 +2869,7 @@ typedef void (*__gcc_VOIDFUNCPTR) ();\
 
 
     #
-    # Fix  99:  X11_Sprintf
+    # Fix 100:  X11_Sprintf
     #
     case "$file" in ./X11*/Xmu.h )
     fixlist="${fixlist}
@@ -2869,7 +2889,7 @@ extern char *     sprintf();\
 
 
     #
-    # Fix 100:  Zzz_Ki_Iface
+    # Fix 101:  Zzz_Ki_Iface
     #
     case "$file" in ./sys/ki_iface.h )
     if ( test -n "`egrep 'These definitions are for HP Internal developers' $file`"
@@ -2896,7 +2916,7 @@ cat > /dev/null ) < $infile > ${DESTDIR}/$file.
 
 
     #
-    # Fix 101:  Zzz_Ki
+    # Fix 102:  Zzz_Ki
     #
     case "$file" in ./sys/ki.h )
     if ( test -n "`egrep '11.00 HP-UX LP64' $file`"
@@ -2923,7 +2943,7 @@ cat > /dev/null ) < $infile > ${DESTDIR}/$file.
 
 
     #
-    # Fix 102:  Zzz_Ki_Calls
+    # Fix 103:  Zzz_Ki_Calls
     #
     case "$file" in ./sys/ki_calls.h )
     if ( test -n "`egrep 'KI_MAX_PROCS is an arbitrary number' $file`"
@@ -2950,7 +2970,7 @@ cat > /dev/null ) < $infile > ${DESTDIR}/$file.
 
 
     #
-    # Fix 103:  Zzz_Ki_Defs
+    # Fix 104:  Zzz_Ki_Defs
     #
     case "$file" in ./sys/ki_defs.h )
     if ( test -n "`egrep 'Kernel Instrumentation Definitions' $file`"
@@ -2977,7 +2997,7 @@ cat > /dev/null ) < $infile > ${DESTDIR}/$file.
 
 
     #
-    # Fix 104:  Zzz_Time
+    # Fix 105:  Zzz_Time
     #
     case "$file" in ./sys/time.h )
     if ( test -n "`egrep 'For CASPEC, look in' $file`"
@@ -3041,18 +3061,20 @@ while [ $# != 0 ]; do
     #
     cd ${INPUT}
     cd $1
-    if [ -r $2 ] && [ ! -r $3 ]; then
-      cp $2 $3 >/dev/null 2>&1 || echo "Can't copy $2" >&2
-      chmod +w $3 2>/dev/null
-      chmod a+r $3 2>/dev/null
-      echo Copied $2
-      for include in `egrep '^[        ]*#[    ]*include[      ]*"[^/]' $3 |
+    if [ -f $2 ] ; then
+      if [ -r $2 ] && [ ! -r $3 ]; then
+        cp $2 $3 >/dev/null 2>&1 || echo "Can't copy $2" >&2
+        chmod +w $3 2>/dev/null
+        chmod a+r $3 2>/dev/null
+        echo Copied $2
+        for include in `egrep '^[      ]*#[    ]*include[      ]*"[^/]' $3 |
              sed -e 's/^[      ]*#[    ]*include[      ]*"\([^"]*\)".*$/\1/'`
-      do
-       dir=`echo $2 | sed -e s'|/[^/]*$||'`
-       dir2=`echo $3 | sed -e s'|/[^/]*$||'`
-       newreq="$newreq $1 $dir/$include $dir2/$include"
-      done
+        do
+         dir=`echo $2 | sed -e s'|/[^/]*$||'`
+         dir2=`echo $3 | sed -e s'|/[^/]*$||'`
+         newreq="$newreq $1 $dir/$include $dir2/$include"
+        done
+      fi
     fi
     shift; shift; shift
   done
@@ -3081,6 +3103,6 @@ done
 
 cd $ORIGDIR
 rm -f include/assert.h
-cp ${EGCS_SRCDIR}/assert.h include/assert.h
+cp ${srcdir}/assert.h include/assert.h || exit 1
 chmod a+r include/assert.h