Add support for building on solaris, working around namespace
authorChris Lattner <sabre@nondot.org>
Tue, 24 Jun 2008 17:44:42 +0000 (17:44 +0000)
committerChris Lattner <sabre@nondot.org>
Tue, 24 Jun 2008 17:44:42 +0000 (17:44 +0000)
polution problems from system headers.  Patch by Nathan Keynes!

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@52682 91177308-0d34-0410-b5e6-96231b3b80d8

Makefile.rules
include/llvm/System/Solaris.h [new file with mode: 0644]
utils/GenLibDeps.pl

index 74b5a32ae850e6f46f69748a01671eaa27fd2dab..b8006a2a1f748f474cf06d28fe8c2161f827e77e 100644 (file)
@@ -451,6 +451,10 @@ ifdef UNIVERSAL
   DISABLE_AUTO_DEPENDENCIES=1
 endif
 
+ifeq ($(OS),SunOS)
+CPP.BaseFlags += -include llvm/System/Solaris.h
+endif
+
 LD.Flags      += -L$(LibDir) -L$(LLVMLibDir) 
 CPP.BaseFlags += -D_GNU_SOURCE -D__STDC_LIMIT_MACROS
 # All -I flags should go here, so that they don't confuse llvm-config.
diff --git a/include/llvm/System/Solaris.h b/include/llvm/System/Solaris.h
new file mode 100644 (file)
index 0000000..15adb74
--- /dev/null
@@ -0,0 +1,40 @@
+/*===- llvm/System/Solaris.h ------------------------------------*- C++ -*-===*
+ *
+ *                     The LLVM Compiler Infrastructure
+ *
+ * This file is distributed under the University of Illinois Open Source
+ * License. See LICENSE.TXT for details.
+ *
+ *===----------------------------------------------------------------------===*
+ *
+ * This file contains portability fixes for Solaris hosts.
+ *
+ *===----------------------------------------------------------------------===*/
+
+#ifndef LLVM_SYSTEM_SOLARIS_H
+#define LLVM_SYSTEM_SOLARIS_H
+
+#include <sys/types.h>
+#include <sys/regset.h>
+
+#undef CS
+#undef DS
+#undef ES
+#undef FS
+#undef GS
+#undef SS
+#undef EAX
+#undef ECX
+#undef EDX
+#undef EBX
+#undef ESP
+#undef EBP
+#undef ESI
+#undef EDI
+#undef EIP
+#undef UESP
+#undef EFL
+#undef ERR
+#undef TRAPNO
+
+#endif
index 74eedd3383bcac469dd2252a04e9de6a9d073bc9..35811b4e3cd132c33ff7a6a3af19fd0da32817bd 100755 (executable)
@@ -96,7 +96,7 @@ sub gen_one_entry {
     print "  <dt><b>$lib</b</dt><dd><ul>\n";
   }
   open UNDEFS, 
-    "$nmPath -g -u $Directory/$lib | sed -e 's/^  *U //' | sort | uniq |";
+    "$nmPath -g -u $Directory/$lib | sed -e 's/^[ 0]* U //' | sort | uniq |";
   my %DepLibs;
   while (<UNDEFS>) {
     chomp;