You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@stdcxx.apache.org by el...@apache.org on 2008/06/04 00:30:05 UTC

svn commit: r662906 - in /stdcxx/branches/4.2.x/etc/config: GNUmakefile.tst gcc.config

Author: elemings
Date: Tue Jun  3 15:30:04 2008
New Revision: 662906

URL: http://svn.apache.org/viewvc?rev=662906&view=rev
Log:
2008-06-03  Eric Lemings <er...@roguewave.com>

	STDCXX-488
	* etc/config/GNUmakefile.tst (LDFLAGS): Use appropriate form of
	RPATH options in LDFLAGS variable on Darwin platforms.
	* etc/config/gcc.config: Retrieve major OS version on Darwin
	platforms and use @rpath in -install_name flag if building
	on Darwin 9.x (Mac OS 10.5).  Use only library basename for all
	other versions of Darwin.  Also define RPATH variable on Darwin.


Modified:
    stdcxx/branches/4.2.x/etc/config/GNUmakefile.tst
    stdcxx/branches/4.2.x/etc/config/gcc.config

Modified: stdcxx/branches/4.2.x/etc/config/GNUmakefile.tst
URL: http://svn.apache.org/viewvc/stdcxx/branches/4.2.x/etc/config/GNUmakefile.tst?rev=662906&r1=662905&r2=662906&view=diff
==============================================================================
--- stdcxx/branches/4.2.x/etc/config/GNUmakefile.tst (original)
+++ stdcxx/branches/4.2.x/etc/config/GNUmakefile.tst Tue Jun  3 15:30:04 2008
@@ -87,7 +87,13 @@
 TARGET += $(patsubst %.cpp,%.o,$(wildcard *.cpp))
 
 ifneq ($(RPATH),)
-  LDFLAGS += $(RPATH)$(LIBDIR):$(BUILDDIR)/rwtest
+  ifneq ($(shell uname),Darwin)
+    # this form doesn't work on Darwin
+    LDFLAGS += $(RPATH)$(LIBDIR):$(BUILDDIR)/rwtest
+  else
+    # but this form does
+    LDFLAGS += $(RPATH)$(LIBDIR) $(RPATH)$(BUILDDIR)/rwtest
+  endif
 endif
 
 RUNFLAGS += --compat -x "--compat -O -" --ulimit=as:1073741824

Modified: stdcxx/branches/4.2.x/etc/config/gcc.config
URL: http://svn.apache.org/viewvc/stdcxx/branches/4.2.x/etc/config/gcc.config?rev=662906&r1=662905&r2=662906&view=diff
==============================================================================
--- stdcxx/branches/4.2.x/etc/config/gcc.config (original)
+++ stdcxx/branches/4.2.x/etc/config/gcc.config Tue Jun  3 15:30:04 2008
@@ -33,10 +33,14 @@
 CXX_MAJOR := $(shell echo "$(CCVER)" | sed "s/^\([1-9][0-9]*\).*/\1/")
 CXX_MINOR := $(shell echo "$(CCVER)" | sed "s/[1-9]*\.\([0-9]*\).*/\1/")
 
-# determine the major and minor version of the OS on AIX
+# determine the major and minor version of the OS when needed
 ifeq ($(OSNAME),AIX)
     OS_MAJOR := $(shell uname -v)
     OS_MINOR := $(shell uname -r)
+else
+    ifeq ($(OSNAME),Darwin)
+        OS_MAJOR := $(shell uname -r | sed "s/^\([1-9]*\).*/\1/")
+    endif
 endif
 
 # -W and -Wextra are the same
@@ -97,12 +101,16 @@
     # no -shared option for GCC on Mac OS X (Darwin)
     LDSOFLAGS = -shared
 else
-    # Flags needed when linking the library
-    LDSOFLAGS = \
--dynamiclib \
--install_name $(BUILDDIR)/lib/$(LIBNAME) \
--compatibility_version 4 \
--current_version $(LIBVER)
+    # flags needed when linking the library
+    LDSOFLAGS = -dynamiclib \
+-compatibility_version 4 -current_version $(LIBVER)
+
+    # use appropriate install_name
+    ifeq ($(shell [ $(OS_MAJOR) -eq 9 ] && echo 1), 1)
+        LDSOFLAGS += -install_name @rpath/$(LIBNAME)
+    else
+        LDSOFLAGS += -install_name $(LIBNAME)
+    endif
 endif
 
 
@@ -198,6 +206,10 @@
     endif
 endif
 
+ifeq ($(OSNAME),Darwin)
+    RPATH = -Wl,-rpath,
+endif
+
 # debug/optimization options
 DEBUG_CXXFLAGS  = -g
 DEBUG_CPPFLAGS  =