]> andersk Git - splint.git/commitdiff
Put builtin -D flags for specific arcitectures.
authordrl7x <drl7x>
Thu, 10 Jan 2002 05:14:54 +0000 (05:14 +0000)
committerdrl7x <drl7x>
Thu, 10 Jan 2002 05:14:54 +0000 (05:14 +0000)
config.hin
configure
configure.ac
src/cpplib.c

index f2d96bc422aeecb8ae6fe964a8c231f5f84a9c64..f7a5d508f1b2639281a2fabf30e5214d02d1ff8c 100644 (file)
@@ -35,6 +35,8 @@
 /* drl: can't get autoheader to work so I had to enter these manually.
  figure out autoheader at some point... */
 
+#undef UNAME
 #undef BUILD
 #undef HOST
 #undef TARGET
index 2433660fcd96b15cdfa2691ac052ec0f242755c9..ea4f3bffe585f96fd54a7392b87116efef5e9e7f 100755 (executable)
--- a/configure
+++ b/configure
@@ -3108,6 +3108,11 @@ EOF
 
 #just define some Header constants for now...
 
+UNAME=`uname`
+cat >>confdefs.h <<EOF
+#define UNAME "${UNAME}"
+EOF
+
 cat >>confdefs.h <<EOF
 #define BUILD "${build}"
 EOF
@@ -3249,7 +3254,7 @@ DEFS=-DHAVE_CONFIG_H
 : ${CONFIG_STATUS=./config.status}
 ac_clean_files_save=$ac_clean_files
 ac_clean_files="$ac_clean_files $CONFIG_STATUS"
-{ echo "$as_me:3252: creating $CONFIG_STATUS" >&5
+{ echo "$as_me:3257: creating $CONFIG_STATUS" >&5
 echo "$as_me: creating $CONFIG_STATUS" >&6;}
 cat >$CONFIG_STATUS <<_ACEOF
 #! $SHELL
@@ -3425,7 +3430,7 @@ cat >>$CONFIG_STATUS <<\EOF
     echo "$ac_cs_version"; exit 0 ;;
   --he | --h)
     # Conflict between --help and --header
-    { { echo "$as_me:3428: error: ambiguous option: $1
+    { { echo "$as_me:3433: error: ambiguous option: $1
 Try \`$0 --help' for more information." >&5
 echo "$as_me: error: ambiguous option: $1
 Try \`$0 --help' for more information." >&2;}
@@ -3444,7 +3449,7 @@ Try \`$0 --help' for more information." >&2;}
     ac_need_defaults=false;;
 
   # This is an error.
-  -*) { { echo "$as_me:3447: error: unrecognized option: $1
+  -*) { { echo "$as_me:3452: error: unrecognized option: $1
 Try \`$0 --help' for more information." >&5
 echo "$as_me: error: unrecognized option: $1
 Try \`$0 --help' for more information." >&2;}
@@ -3497,7 +3502,7 @@ do
   "doc/Makefile" ) CONFIG_FILES="$CONFIG_FILES doc/Makefile" ;;
   "default-1" ) CONFIG_COMMANDS="$CONFIG_COMMANDS default-1" ;;
   "config.h" ) CONFIG_HEADERS="$CONFIG_HEADERS config.h:config.hin" ;;
-  *) { { echo "$as_me:3500: error: invalid argument: $ac_config_target" >&5
+  *) { { echo "$as_me:3505: error: invalid argument: $ac_config_target" >&5
 echo "$as_me: error: invalid argument: $ac_config_target" >&2;}
    { (exit 1); exit 1; }; };;
   esac
@@ -3747,7 +3752,7 @@ done; }
   esac
 
   if test x"$ac_file" != x-; then
-    { echo "$as_me:3750: creating $ac_file" >&5
+    { echo "$as_me:3755: creating $ac_file" >&5
 echo "$as_me: creating $ac_file" >&6;}
     rm -f "$ac_file"
   fi
@@ -3765,7 +3770,7 @@ echo "$as_me: creating $ac_file" >&6;}
       -) echo $tmp/stdin ;;
       [\\/$]*)
          # Absolute (can't be DOS-style, as IFS=:)
-         test -f "$f" || { { echo "$as_me:3768: error: cannot find input file: $f" >&5
+         test -f "$f" || { { echo "$as_me:3773: error: cannot find input file: $f" >&5
 echo "$as_me: error: cannot find input file: $f" >&2;}
    { (exit 1); exit 1; }; }
          echo $f;;
@@ -3778,7 +3783,7 @@ echo "$as_me: error: cannot find input file: $f" >&2;}
            echo $srcdir/$f
          else
            # /dev/null tree
-           { { echo "$as_me:3781: error: cannot find input file: $f" >&5
+           { { echo "$as_me:3786: error: cannot find input file: $f" >&5
 echo "$as_me: error: cannot find input file: $f" >&2;}
    { (exit 1); exit 1; }; }
          fi;;
@@ -3839,7 +3844,7 @@ for ac_file in : $CONFIG_HEADERS; do test "x$ac_file" = x: && continue
   * )   ac_file_in=$ac_file.in ;;
   esac
 
-  test x"$ac_file" != x- && { echo "$as_me:3842: creating $ac_file" >&5
+  test x"$ac_file" != x- && { echo "$as_me:3847: creating $ac_file" >&5
 echo "$as_me: creating $ac_file" >&6;}
 
   # First look for the input files in the build tree, otherwise in the
@@ -3850,7 +3855,7 @@ echo "$as_me: creating $ac_file" >&6;}
       -) echo $tmp/stdin ;;
       [\\/$]*)
          # Absolute (can't be DOS-style, as IFS=:)
-         test -f "$f" || { { echo "$as_me:3853: error: cannot find input file: $f" >&5
+         test -f "$f" || { { echo "$as_me:3858: error: cannot find input file: $f" >&5
 echo "$as_me: error: cannot find input file: $f" >&2;}
    { (exit 1); exit 1; }; }
          echo $f;;
@@ -3863,7 +3868,7 @@ echo "$as_me: error: cannot find input file: $f" >&2;}
            echo $srcdir/$f
          else
            # /dev/null tree
-           { { echo "$as_me:3866: error: cannot find input file: $f" >&5
+           { { echo "$as_me:3871: error: cannot find input file: $f" >&5
 echo "$as_me: error: cannot find input file: $f" >&2;}
    { (exit 1); exit 1; }; }
          fi;;
@@ -3980,7 +3985,7 @@ cat >>$CONFIG_STATUS <<\EOF
   rm -f $tmp/in
   if test x"$ac_file" != x-; then
     if cmp -s $ac_file $tmp/config.h 2>/dev/null; then
-      { echo "$as_me:3983: $ac_file is unchanged" >&5
+      { echo "$as_me:3988: $ac_file is unchanged" >&5
 echo "$as_me: $ac_file is unchanged" >&6;}
     else
       ac_dir=`$as_expr X"$ac_file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
index dd48d85db77d9b1e12a1c89a7f738b769d7aa5a7..43855754664a740be9764634833480d71cb8a0a9 100644 (file)
@@ -160,6 +160,9 @@ AC_DEFINE(UNIX, 1, [Define if you're on a Unixy system])
 
 #just define some Header constants for now...
 
+UNAME=`uname`
+AC_DEFINE_UNQUOTED(UNAME, "${UNAME}")
+
 AC_DEFINE_UNQUOTED(BUILD, "${build}")
 AC_DEFINE_UNQUOTED(HOST, "${host}")
 AC_DEFINE_UNQUOTED(TARGET, "${target}")
index 33f656a850f150b749d19e3b6ee196cf476f1184..b8837a62d5f78af69c50f8a46723703f8b66287c 100644 (file)
@@ -3708,6 +3708,112 @@ initialize_builtins (cppReader *pfile)
    */
   cpplib_installBuiltin ("__" TARGET_CPU, ctype_int, -1, T_CONST, 2, NULL, -1);
 
+  /*drl 1/2/2002  set some flags based on uname
+    I'd like to be able to do this with autoconf macro instead...
+   */
+
+  /*Thanks to Nelson Beebe for suggesting possible values for these */
+  
+  if (! strcmp (UNAME, "Linux"))
+    {
+#ifdef __ppc
+      cpplib_installBuiltin ("__BIG_ENDIAN__", ctype_int, -1, T_CONST, 2, NULL, -1);
+#endif
+    }
+  
+  else if(! strcmp (UNAME, "Darwin"))
+    {
+      cpplib_installBuiltin ("__ppc__", ctype_int, -1, T_CONST, 2, NULL, -1);
+      cpplib_installBuiltin ("__BIG_ENDIAN__", ctype_int, -1, T_CONST, 2, NULL, -1);
+    }
+  else if(! strcmp (UNAME, "HP-UX"))
+    {
+      cpplib_installBuiltin ("PWB", ctype_int, -1, T_CONST, 2, NULL, -1);
+      cpplib_installBuiltin ("_HIUX_SOURCE", ctype_int, -1, T_CONST, 2, NULL, -1);
+      cpplib_installBuiltin ("_HPUX_SOURCE", ctype_int, -1, T_CONST, 2, NULL, -1);
+      cpplib_installBuiltin ("_PA_RISC1_1", ctype_int, -1, T_CONST, 2, NULL, -1);
+      cpplib_installBuiltin ("__PWB", ctype_int, -1, T_CONST, 2, NULL, -1);
+      cpplib_installBuiltin ("__PWB__", ctype_int, -1, T_CONST, 2, NULL, -1);
+      cpplib_installBuiltin ("__STDC_EXT__", ctype_int, -1, T_CONST, 2, NULL, -1);
+      cpplib_installBuiltin ("__hp9000s700", ctype_int, -1, T_CONST, 2, NULL, -1);
+      cpplib_installBuiltin ("__hp9000s800", ctype_int, -1, T_CONST, 2, NULL, -1);
+      cpplib_installBuiltin ("__hp9000s800__", ctype_int, -1, T_CONST, 2, NULL, -1);
+      cpplib_installBuiltin ("__hp9k8", ctype_int, -1, T_CONST, 2, NULL, -1);
+      cpplib_installBuiltin ("__hp9k8__", ctype_int, -1, T_CONST, 2, NULL, -1);
+      cpplib_installBuiltin ("__hppa", ctype_int, -1, T_CONST, 2, NULL, -1);
+      cpplib_installBuiltin ("__hppa__", ctype_int, -1, T_CONST, 2, NULL, -1);
+      cpplib_installBuiltin ("__hpux", ctype_int, -1, T_CONST, 2, NULL, -1);
+      cpplib_installBuiltin ("__hpux__", ctype_int, -1, T_CONST, 2, NULL, -1);
+      cpplib_installBuiltin ("__unix", ctype_int, -1, T_CONST, 2, NULL, -1);
+      cpplib_installBuiltin ("__unix__", ctype_int, -1, T_CONST, 2, NULL, -1);
+      cpplib_installBuiltin ("hp9000s800", ctype_int, -1, T_CONST, 2, NULL, -1);
+      cpplib_installBuiltin ("hp9k8", ctype_int, -1, T_CONST, 2, NULL, -1);
+      cpplib_installBuiltin ("hppa", ctype_int, -1, T_CONST, 2, NULL, -1);
+      cpplib_installBuiltin ("hpux", ctype_int, -1, T_CONST, 2, NULL, -1);
+      cpplib_installBuiltin ("unix", ctype_int, -1, T_CONST, 2, NULL, -1);
+    }
+  else if(! strcmp (UNAME, "IRIX64"))
+    {
+      cpplib_installBuiltin ("LANGUAGE_C", ctype_int, -1, T_CONST, 2, NULL, -1);
+      cpplib_installBuiltin ("MIPSEB", ctype_int, -1, T_CONST, 2, NULL, -1);
+      cpplib_installBuiltin ("_ABIN32", ctype_int, -1, T_CONST, 2, NULL, -1);
+      cpplib_installBuiltin ("_COMPILER_VERSION", ctype_int, -1, T_CONST, 730, NULL, -1);
+      cpplib_installBuiltin ("_LANGUAGE_C", ctype_int, -1, T_CONST, 2, NULL, -1);
+      cpplib_installBuiltin ("_LONGLONG", ctype_int, -1, T_CONST, 2, NULL, -1);
+      cpplib_installBuiltin ("_MIPSEB", ctype_int, -1, T_CONST, 2, NULL, -1);
+      cpplib_installBuiltin ("_MIPS_FPSET", ctype_int, -1, T_CONST, 32, NULL, -1);
+      cpplib_installBuiltin ("_MIPS_ISA", ctype_int, -1, T_CONST, 3, NULL, -1);
+      /*_MIPS_SIM=_ABIN32*/
+      cpplib_installBuiltin ("_MIPS_SIM", ctype_int, -1, T_CONST, 2, NULL , -1);
+      cpplib_installBuiltin ("_MIPS_SZINT", ctype_int, -1, T_CONST, 32, NULL, -1);
+      cpplib_installBuiltin ("_MIPS_SZLONG", ctype_int, -1, T_CONST, 32, NULL, -1);
+      cpplib_installBuiltin ("_MIPS_SZPTR", ctype_int, -1, T_CONST, 32, NULL, -1);
+      cpplib_installBuiltin ("_MODERN_C", ctype_int, -1, T_CONST, 2, NULL, -1);
+      cpplib_installBuiltin ("_PIC", ctype_int, -1, T_CONST, 2, NULL, -1);
+      cpplib_installBuiltin ("_SGI_SOURCE", ctype_int, -1, T_CONST, 2, NULL, -1);
+      cpplib_installBuiltin ("_SIZE_INT", ctype_int, -1, T_CONST, 32, NULL, -1);
+      cpplib_installBuiltin ("_SIZE_LONG", ctype_int, -1, T_CONST, 32, NULL, -1);
+      cpplib_installBuiltin ("_SIZE_PTR", ctype_int, -1, T_CONST, 32, NULL, -1);
+      cpplib_installBuiltin ("_SVR4_SOURCE", ctype_int, -1, T_CONST, 2, NULL, -1);
+      cpplib_installBuiltin ("_SYSTYPE_SVR4", ctype_int, -1, T_CONST, 2, NULL, -1);
+      cpplib_installBuiltin ("__DSO__", ctype_int, -1, T_CONST, 2, NULL, -1);
+      cpplib_installBuiltin ("__EXTENSIONS__", ctype_int, -1, T_CONST, 2, NULL, -1);
+      cpplib_installBuiltin ("__INLINE_INTRINSICS", ctype_int, -1, T_CONST, 2, NULL, -1);
+      cpplib_installBuiltin ("__MATH_HAS_NO_SIDE_EFFECTS", ctype_int, -1, T_CONST, 2, NULL, -1);
+      cpplib_installBuiltin ("__host_mips", ctype_int, -1, T_CONST, 2, NULL, -1);
+      cpplib_installBuiltin ("__mips", ctype_int, -1, T_CONST, 3, NULL, -1);
+      cpplib_installBuiltin ("__sgi", ctype_int, -1, T_CONST, 2, NULL, -1);
+      cpplib_installBuiltin ("__unix", ctype_int, -1, T_CONST, 2, NULL, -1);
+      cpplib_installBuiltin ("host_mips", ctype_int, -1, T_CONST, 2, NULL, -1);
+      cpplib_installBuiltin ("mips", ctype_int, -1, T_CONST, 2, NULL, -1);
+      cpplib_installBuiltin ("sgi", ctype_int, -1, T_CONST, 2, NULL, -1);
+      cpplib_installBuiltin ("unix", ctype_int, -1, T_CONST, 2, NULL, -1);
+    }
+  else if(! strcmp (UNAME, "OSF1"))
+    {
+      cpplib_installBuiltin ("__alpha", ctype_int, -1, T_CONST, 2, NULL, -1);
+    }
+  else if (!strcmp (UNAME, "Rhapsody"))
+    {
+      cpplib_installBuiltin ("__ppc__", ctype_int, -1, T_CONST, 2, NULL, -1);
+      cpplib_installBuiltin ("__BIG_ENDIAN__", ctype_int, -1, T_CONST, 2, NULL, -1);
+    }
+
+  else if (!strcmp (UNAME, "SunOS"))
+    {
+      cpplib_installBuiltin ("__OPEN_MAX", ctype_int, -1, T_CONST, 20, NULL, -1);
+      cpplib_installBuiltin ("__STDC__", ctype_int, -1, T_CONST, 2, NULL, -1);
+      cpplib_installBuiltin ("__sparc", ctype_int, -1, T_CONST, 2, NULL, -1);
+      /*       This define  "-Dfileno(f)=0" should be inserted but we're going to stick to deinfe constants for now...*/
+    }
+  else
+    {
+      /*
+       types which we have not explictedly handled.
+       AIX, FreeBSD, IRIX, Mach
+       */
+
+    }
   
   if (CPPOPTIONS (pfile)->debug_output)
     {
This page took 0.147671 seconds and 5 git commands to generate.