OSDN Git Service

* lex.c (lang_init_options): New function.
[pf3gnuchains/gcc-fork.git] / gcc / fixincludes
index 8400c6f..b795a94 100755 (executable)
@@ -411,6 +411,37 @@ typedef __SIZE_TYPE__ size_t;\
   fi
 done
 
+# 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'.
+for file in libgen.h dirent.h ftw.h grp.h ndbm.h pthread.h pwd.h signal.h standards.h stdlib.h string.h stropts.h time.h unistd.h
+do
+  if [ -r $file ] && [ ! -r ${LIB}/$file ]; then
+    cp $file ${LIB}/$file >/dev/null 2>&1 || echo "Can't copy $file"
+    chmod +w ${LIB}/$file 2>/dev/null
+    chmod a+r ${LIB}/$file 2>/dev/null
+  fi
+
+  if [ -r ${LIB}/$file ]; then
+    echo Fixing $file extern_prefix
+    sed -e 's/^[       ]*#[    ]*define[       ]*\([^(]*\)\(([^)]*)\)[         ]*\(_.\)\1\2[   ]*$/#define \1 \3\1/' ${LIB}/$file > ${LIB}/${file}.sed
+    rm -f ${LIB}/$file; mv ${LIB}/${file}.sed ${LIB}/$file
+    if cmp $file ${LIB}/$file >/dev/null 2>&1; then
+      rm ${LIB}/$file
+    else
+      # Find any include directives that use "file".
+      for include in `egrep '^[       ]*#[    ]*include[      ]*"[^/]' ${LIB}/$file | sed -e 's/^[    ]*#[    ]*include[      ]*"\([^"]*\)".*$/\1/'`; do
+       dir=`echo $file | sed -e s'|/[^/]*$||'`
+       required="$required ${INPUT} $dir/$include ${LIB}/$dir/$include"
+      done
+    fi
+  fi
+done
 # Fix one other error in this file: a mismatched quote not inside a C comment.
 file=sundev/vuid_event.h
 if [ -r $file ] && [ ! -r ${LIB}/$file ]; then
@@ -1135,7 +1166,7 @@ if [ -r ${LIB}/$file ]; then
   fi
 fi
 
-# 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
 file=sys/pci.h
 if [ -r ${LIB}/$file ]; then
   if egrep 'System Private Structures' ${LIB}/$file > /dev/null; then
@@ -1147,6 +1178,48 @@ if [ -r ${LIB}/$file ]; then
   fi
 fi
 
+# And also with a few more HP-UX 11 headers which are only broken
+# after they are "fixed".
+file=sys/ki_iface.h
+if [ -r ${LIB}/$file ]; then
+  if egrep 'These definitions are for HP Internal developers' ${LIB}/$file > /dev/null; then
+    echo Fixing $file, overeager sed script
+    rm ${LIB}/$file
+  fi
+fi
+
+file=sys/ki.h
+if [ -r ${LIB}/$file ]; then
+  if egrep '11.00 HP-UX LP64' ${LIB}/$file > /dev/null; then
+    echo Fixing $file, overeager sed script
+    rm ${LIB}/$file
+  fi
+fi
+
+file=sys/ki_calls.h
+if [ -r ${LIB}/$file ]; then
+  if egrep 'KI_MAX_PROCS is an arbitrary number' ${LIB}/$file > /dev/null; then
+    echo Fixing $file, overeager sed script
+    rm ${LIB}/$file
+  fi
+fi
+
+file=sys/ki_defs.h
+if [ -r ${LIB}/$file ] ; then
+  if egrep 'Kernel Instrumentation Definitions' ${LIB}/$file > /dev/null; then
+    echo Fixing $file, overeager sed script
+    rm ${LIB}/$file
+  fi
+fi
+
+file=sys/time.h
+if [ -r ${LIB}/$file ] ; then
+  if egrep 'For CASPEC, look in' ${LIB}/$file > /dev/null; then
+    echo Fixing $file, overeager sed script
+    rm ${LIB}/$file
+  fi
+fi
+
 # Some IRIX header files contains the string "//"
 for file in elf_abi.h elf.h; do
   if [ -r ${LIB}/$file ]; then