$NetBSD: patch-af,v 1.3 2012/02/15 15:25:15 hans Exp $

Use ginstall on Solaris 11, /usr/ucb/install has been removed.

Run-time path fix for Solaris for the X client libraries.  Without this
patch, libraries such as libXext.so will not contain a run-time link path
to /usr/pkg/xorg/lib, causing run time link failures or possibly linking
with other (non-Pkgsrc) X libraries on the system!

Use pkgsrc CC, CXX and CFLAGS.

--- sun.cf.orig	2005-12-03 18:20:48.000000000 +0100
+++ sun.cf
@@ -429,7 +429,9 @@ XCOMM SunPro C++ CplusplusCompilerMajorV
 #   define XawI18nDefines    -DHAS_WCHAR_H -DHAS_ISW_FUNCS
 #  endif
 # endif
-# if OSMinorVersion > 3
+# if OSMinorVersion >= 11
+#  define InstallCmd	    /usr/bin/ginstall
+# elif OSMinorVersion > 3 
 #  define InstallCmd	    /usr/ucb/install
 # endif
 #ifndef LargefileDefines
@@ -669,29 +671,29 @@ XCOMM SunPro C++ CplusplusCompilerMajorV
 # endif
 # if HasGcc2
 #  ifndef CcCmd
-#   define CcCmd gcc
+#   define CcCmd @@PKGSRC_CC@@
+#  endif
+#  ifndef CppCmd
+#   define CppCmd @@PKGSRC_CPP@@
+#  endif
+#  ifndef CplusplusCmd
+#   define CplusplusCmd @@PKGSRC_CXX@@
 #  endif
 #  ifndef AsCmd
 #   define AsCmd CcCmd -c -x assembler
 #  endif
 #  ifndef OptimizedCDebugFlags
-#   ifdef i386Architecture
-#    define OptimizedCDebugFlags DefaultGcc2i386Opt
-#   elif defined(AMD64Architecture)
-#    define OptimizedCDebugFlags DefaultGcc2AMD64Opt
-#   else
-#    define OptimizedCDebugFlags -O2
-#   endif
+#   define OptimizedCDebugFlags @@PKGSRC_CFLAGS@@
 #  endif
 #  if !defined(SharedLibraryLoadFlags) && !defined(SharedLibraryLdCmd)
 #   if OSMajorVersion == 5 && OSMinorVersion > 6 && defined(i386Architecture)
     /* This is to work around what appears to be a PIC bug in some gcc/egcs
        versions that shows up with the Solaris 7/x86 <ctype.h>. */
 #    define SharedLibraryLdCmd $(LD)
-#    define SharedLibraryLoadFlags -G -z textwarn
+#    define SharedLibraryLoadFlags -G -z textwarn LibraryRpathLoadFlags
 #   else
 #    define SharedLibraryLdCmd $(CC)
-#    define SharedLibraryLoadFlags -shared -z text
+#    define SharedLibraryLoadFlags -shared -z text LibraryRpathLoadFlags
 #   endif
 #  endif
 # else
