]> Gitweb @ Texas Instruments - Open Source Git Repositories - git.TI.com/gitweb - opencl/llvm.git/commitdiff
Link .so files correctly on either linux or solaris
authorChris Lattner <sabre@nondot.org>
Fri, 13 Sep 2002 21:41:07 +0000 (21:41 +0000)
committerChris Lattner <sabre@nondot.org>
Fri, 13 Sep 2002 21:41:07 +0000 (21:41 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@3703 91177308-0d34-0410-b5e6-96231b3b80d8

Makefile.common
Makefile.rules

index 029c2c987a5814e5254d30acbb71311f6b91a0f6..ba24c10dc64e477a28c66dc8332bb5fb9d127529 100644 (file)
@@ -139,11 +139,6 @@ endif
 LinkG    := $(Link) -g  -L $(LIBDEBUG)
 LinkO    := $(Link) -O3 -L $(LIBRELEASE)
 
-# Create a .so file from a .o files...
-#MakeSO   := $(CXX) -shared $(PROFILE)
-MakeSO   := $(CXX) -G $(PROFILE)
-MakeSOO  := $(MakeSO) -O3
-
 # Create one .o file from a bunch of .o files...
 Relink = ld -r
 
@@ -199,6 +194,23 @@ endif
 
 ifdef LIBRARYNAME
 
+# Figure out how to make a .so file on this platform.  This is really gross and
+# should be autoconfiscated (automake actually), but should hopefully work on
+# linux and solaris.
+#
+
+# Create a .so file from a .o files...
+UNAME := $(shell uname)
+
+ifeq ($(UNAME), SunOS)
+MakeSO   := $(CXX) -G $(PROFILE)
+else
+MakeSO   := $(CXX) -shared $(PROFILE)
+endif
+
+MakeSOO  := $(MakeSO) -O3
+
+
 LIBNAME_O    := $(LIBRELEASE)/lib$(LIBRARYNAME).so
 LIBNAME_G    := $(LIBDEBUG)/lib$(LIBRARYNAME).so
 LIBNAME_AO   := $(LIBRELEASE)/lib$(LIBRARYNAME).a
index 029c2c987a5814e5254d30acbb71311f6b91a0f6..ba24c10dc64e477a28c66dc8332bb5fb9d127529 100644 (file)
@@ -139,11 +139,6 @@ endif
 LinkG    := $(Link) -g  -L $(LIBDEBUG)
 LinkO    := $(Link) -O3 -L $(LIBRELEASE)
 
-# Create a .so file from a .o files...
-#MakeSO   := $(CXX) -shared $(PROFILE)
-MakeSO   := $(CXX) -G $(PROFILE)
-MakeSOO  := $(MakeSO) -O3
-
 # Create one .o file from a bunch of .o files...
 Relink = ld -r
 
@@ -199,6 +194,23 @@ endif
 
 ifdef LIBRARYNAME
 
+# Figure out how to make a .so file on this platform.  This is really gross and
+# should be autoconfiscated (automake actually), but should hopefully work on
+# linux and solaris.
+#
+
+# Create a .so file from a .o files...
+UNAME := $(shell uname)
+
+ifeq ($(UNAME), SunOS)
+MakeSO   := $(CXX) -G $(PROFILE)
+else
+MakeSO   := $(CXX) -shared $(PROFILE)
+endif
+
+MakeSOO  := $(MakeSO) -O3
+
+
 LIBNAME_O    := $(LIBRELEASE)/lib$(LIBRARYNAME).so
 LIBNAME_G    := $(LIBDEBUG)/lib$(LIBRARYNAME).so
 LIBNAME_AO   := $(LIBRELEASE)/lib$(LIBRARYNAME).a