diff make/solaris/makefiles/saproc.make @ 3306:405c634f4aaa

7028172: 3/4 SA needs to adapt to Solaris libproc change made in 6748307 Summary: Support build and runtime configs of old and new interfaces as appropriate. Reviewed-by: acorn, never
author dcubed
date Mon, 02 May 2011 14:53:49 -0700
parents 0a8e0d4345b3
children 357d1f583599
line wrap: on
line diff
--- a/make/solaris/makefiles/saproc.make	Fri Apr 29 21:13:00 2011 +0400
+++ b/make/solaris/makefiles/saproc.make	Mon May 02 14:53:49 2011 -0700
@@ -1,5 +1,5 @@
 #
-# Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved.
+# Copyright (c) 2005, 2011, Oracle and/or its affiliates. All rights reserved.
 # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
 #
 # This code is free software; you can redistribute it and/or modify it
@@ -56,6 +56,30 @@
 SA_LFLAGS += -mt -xnolib -norunpath
 endif
 
+# The libproc Pstack_iter() interface changed in Nevada-B159.
+# This logic needs to match
+# agent/src/os/solaris/proc/saproc.cpp: set_has_newer_Pstack_iter():
+#   - skip SunOS 4 or older
+#   - skip Solaris 10 or older
+#   - skip two digit Nevada builds
+#   - skip three digit Nevada builds thru 149
+#   - skip Nevada builds 150-158
+SOLARIS_11_B159_OR_LATER := \
+$(shell uname -r -v \
+    | sed -n ' \
+          /^[0-3]\. /b \
+          /^5\.[0-9] /b \
+          /^5\.10 /b \
+          / snv_[0-9][0-9]$/b \
+          / snv_[01][0-4][0-9]$/b \
+          / snv_15[0-8]$/b \
+          s/.*/-DSOLARIS_11_B159_OR_LATER/p \
+          ')
+
+# Uncomment the following to simulate building on Nevada-B159 or later
+# when actually building on Nevada-B158 or earlier:
+#SOLARIS_11_B159_OR_LATER=-DSOLARIS_11_B159_OR_LATER
+
 $(LIBSAPROC): $(SASRCFILES) $(SAMAPFILE)
 	$(QUIETLY) if [ "$(BOOT_JAVA_HOME)" = "" ]; then \
 	  echo "ALT_BOOTDIR, BOOTDIR or JAVA_HOME needs to be defined to build SA"; \
@@ -68,6 +92,7 @@
 	           -I$(GENERATED)                                       \
 	           -I$(BOOT_JAVA_HOME)/include                          \
 	           -I$(BOOT_JAVA_HOME)/include/$(Platform_os_family)    \
+	           $(SOLARIS_11_B159_OR_LATER)                          \
 	           $(SASRCFILES)                                        \
 	           $(SA_LFLAGS)                                         \
 	           -o $@                                                \