make-rules/shared-macros.mk
changeset 7829 2de4f4ace09c
parent 7760 4ab84455407c
child 7834 4c899d201870
equal deleted inserted replaced
7828:f7ee70770225 7829:2de4f4ace09c
   104 # The changset and external source repo used in building the packages.
   104 # The changset and external source repo used in building the packages.
   105 CONSOLIDATION_CHANGESET=$(shell hg identify -i)
   105 CONSOLIDATION_CHANGESET=$(shell hg identify -i)
   106 CONSOLIDATION_REPOSITORY_URL=https://github.com/oracle/solaris-userland.git
   106 CONSOLIDATION_REPOSITORY_URL=https://github.com/oracle/solaris-userland.git
   107 
   107 
   108 # Native OS version
   108 # Native OS version
   109 OS_VERSION :=		$(shell uname -r)
   109 OS_RELEASE :=		$(shell uname -r)
   110 SOLARIS_VERSION =	$(OS_VERSION:5.%=2.%)
   110 SOLARIS_VERSION =	$(OS_RELEASE:5.%=2.%)
       
   111 OS_SUB_VERS_1 :=	$(shell uname -v)
       
   112 OS_SUB_VERS_2 =		$(OS_SUB_VERS_1:s%=%)
       
   113 OS_SUB_VERS_3 =		$(subst _, ,$(OS_SUB_VERS_2))
       
   114 OS_VERSION ?=	$(firstword $(OS_SUB_VERS_3))
   111 # Target OS version
   115 # Target OS version
   112 PKG_SOLARIS_VERSION ?= 5.12
   116 PKG_SOLARIS_VERSION ?= 5.12
   113 
   117 
   114 # We generally build the default branch on the latest release.  But for
   118 # We generally build the default branch on the latest release.  But for
   115 # the FOSS evaluation repo project, we build on the previous release.
   119 # the FOSS evaluation repo project, we build on the previous release.
   116 # Add macros to make that easier.
   120 # Add macros to make that easier.  Note: what started out as Solaris 12
   117 ifeq ($(OS_VERSION),5.12)
   121 # later became 11.4, which is why SOLARIS_11_4_ONLY is set when OS_RELEASE
   118 SOLARIS_12_ONLY =
   122 # is "5.12".
   119 SOLARIS_11_ONLY =\#
   123 ifeq ($(OS_RELEASE),5.12)
       
   124 SOLARIS_11_4_ONLY =
       
   125 SOLARIS_11_3_ONLY =\#
   120 else
   126 else
   121 SOLARIS_12_ONLY =\#
   127 ifeq ($(OS_VERSION),11.4)
   122 SOLARIS_11_ONLY =
   128 SOLARIS_11_4_ONLY =
       
   129 SOLARIS_11_3_ONLY =\#
       
   130 else
       
   131 ifeq ($(OS_VERSION),11.3)
       
   132 SOLARIS_11_4_ONLY =\#
       
   133 SOLARIS_11_3_ONLY =
       
   134 else
       
   135 $(error Unknown OS version "$(OS_VERSION)"; set OS_VERSION to "11.3" or "11.4")
       
   136 endif
       
   137 endif
   123 endif
   138 endif
   124 
   139 
   125 include $(WS_MAKE_RULES)/ips-buildinfo.mk
   140 include $(WS_MAKE_RULES)/ips-buildinfo.mk
   126 
   141 
   127 COMPILER ?=		studio
   142 COMPILER ?=		studio
   724 PKG_CONFIG_PATH.64 = /usr/lib/$(MACH64)/pkgconfig
   739 PKG_CONFIG_PATH.64 = /usr/lib/$(MACH64)/pkgconfig
   725 PKG_CONFIG_DEFAULT = $(PKG_CONFIG_PATH.$(BITS))
   740 PKG_CONFIG_DEFAULT = $(PKG_CONFIG_PATH.$(BITS))
   726 PKG_CONFIG_PATH    = $(subst $(space),:,$(strip \
   741 PKG_CONFIG_PATH    = $(subst $(space),:,$(strip \
   727 			$(PKG_CONFIG_PATHS) $(PKG_CONFIG_DEFAULT)))
   742 			$(PKG_CONFIG_PATHS) $(PKG_CONFIG_DEFAULT)))
   728 
   743 
       
   744 LIBNSL=$(shell elfdump -d /usr/lib/libnsl.so.1 | $(NAWK) 'BEGIN {ret="-lnsl"} $$2 == "FILTER" && $$4 == "libc.so.1" {ret=""} END {print ret}')
       
   745 LIBSOCKET=$(shell elfdump -d /usr/lib/libsocket.so.1 | $(NAWK) 'BEGIN {ret="-lsocket"} $$2 == "FILTER" && $$4 == "libc.so.1" {ret=""} END {print ret}')
       
   746 LIBXNET=$(shell elfdump -d /usr/lib/libxnet.so.1 | $(NAWK) 'BEGIN {ret="-lxnet"} $$2 == "FILTER" && $$4 == "libc.so.1" {ret=""} END {print ret}')
       
   747 
   729 #
   748 #
   730 # C preprocessor flag sets to ease feature selection.  Add the required
   749 # C preprocessor flag sets to ease feature selection.  Add the required
   731 # feature to your Makefile with CPPFLAGS += $(FEATURE_MACRO) and add to
   750 # feature to your Makefile with CPPFLAGS += $(FEATURE_MACRO) and add to
   732 # the component build with CONFIGURE_OPTIONS += CPPFLAGS="$(CPPFLAGS)" or
   751 # the component build with CONFIGURE_OPTIONS += CPPFLAGS="$(CPPFLAGS)" or
   733 # similiar.
   752 # similiar.
  1019 LD_Z_PIE_ENABLE =	-ztype=pie
  1038 LD_Z_PIE_ENABLE =	-ztype=pie
  1020 LD_Z_PIE_DISABLE =
  1039 LD_Z_PIE_DISABLE =
  1021 LD_Z_PIE_MODE =		$(LD_Z_PIE_DISABLE)
  1040 LD_Z_PIE_MODE =		$(LD_Z_PIE_DISABLE)
  1022 
  1041 
  1023 # generic macro names for enabling/disabling security extensions
  1042 # generic macro names for enabling/disabling security extensions
  1024 # -z<extname> is deprecated, but supported, on S12, in favor of
  1043 # -z<extname> is deprecated, but supported, on S11.4 and later, in favor
  1025 # the more flexible -zsx=<extname> format. Security extensions which
  1044 # of the more flexible -zsx=<extname> format. Security extensions which
  1026 # are not supported on S11 use -zsx=<extname> by default.
  1045 # are not supported on S11 use -zsx=<extname> by default.
  1027 
  1046 
  1028 ifeq ($(OS_VERSION), 5.11)
  1047 ifeq ($(OS_VERSION), 11.3)
  1029 ASLR_ENABLE = 			-zaslr=enable
  1048 ASLR_ENABLE = 			-zaslr=enable
  1030 ASLR_DISABLE = 			-zaslr=disable
  1049 ASLR_DISABLE = 			-zaslr=disable
  1031 ASLR_NOT_APPLICABLE = 		-zaslr=disable
  1050 ASLR_NOT_APPLICABLE = 		-zaslr=disable
  1032 
  1051 
  1033 NXSTACK_ENABLE =		-znxstack=enable
  1052 NXSTACK_ENABLE =		-znxstack=enable
  1090 # to explicitly enable ADIHEAP, set ADIHEAP_MODE = $(ADIHEAP_ENABLE)
  1109 # to explicitly enable ADIHEAP, set ADIHEAP_MODE = $(ADIHEAP_ENABLE)
  1091 # to explicitly disable ADIHEAP, set ADIHEAP_MODE = $(ADIHEAP_DISABLE)
  1110 # to explicitly disable ADIHEAP, set ADIHEAP_MODE = $(ADIHEAP_DISABLE)
  1092 # to explicitly enable ADISTACK, set ADISTACK_MODE = $(ADISTACK_ENABLE)
  1111 # to explicitly enable ADISTACK, set ADISTACK_MODE = $(ADISTACK_ENABLE)
  1093 # to explicitly disable ADISTACK, set ADISTACK_MODE = $(ADISTACK_DISABLE)
  1112 # to explicitly disable ADISTACK, set ADISTACK_MODE = $(ADISTACK_DISABLE)
  1094 #
  1113 #
  1095 # ADIHEAP and ADISTACK are not supported on Solaris 11.
  1114 # ADIHEAP and ADISTACK are not supported on Solaris 11.3.
  1096 #
  1115 #
  1097 ifneq ($(OS_VERSION), 5.11)
  1116 ifneq ($(OS_VERSION), 11.3)
  1098 LD_Z_ADIHEAP =		$(ADIHEAP_MODE)
  1117 LD_Z_ADIHEAP =		$(ADIHEAP_MODE)
  1099 LD_Z_ADISTACK =		$(ADISTACK_MODE)
  1118 LD_Z_ADISTACK =		$(ADISTACK_MODE)
  1100 endif
  1119 endif
  1101 
  1120 
  1102 #
  1121 #