121 endif |
123 endif |
122 |
124 |
123 include $(WS_MAKE_RULES)/ips-buildinfo.mk |
125 include $(WS_MAKE_RULES)/ips-buildinfo.mk |
124 |
126 |
125 COMPILER ?= studio |
127 COMPILER ?= studio |
126 BITS ?= 32 |
|
127 |
128 |
128 # The values of BITS changes during the build process for components that |
129 # The values of BITS changes during the build process for components that |
129 # are built 32-bit and 64-bit. This macro makes it possible to determine |
130 # are built 32-bit and 64-bit. This macro makes it possible to determine |
130 # which components are only built 64-bit and allow other make-rules files |
131 # which components are only built 64-bit and allow other make-rules files |
131 # to adjust accordingly. |
132 # to adjust accordingly. Possible values are: '32', '64', '32_and_64', |
132 INITIAL_BITS= $(BITS) |
133 # '64_and_32', and 'NO_ARCH' (the orderings specify build preference). |
|
134 BUILD_BITS ?=$(BITS) |
|
135 ifeq ($(strip $(BUILD_BITS)),64) |
|
136 BITS ?= 64 |
|
137 else |
|
138 BITS ?= 32 |
|
139 endif |
|
140 |
|
141 # Based on BUILD_BITS, determine which binaries are preferred for a build. |
|
142 # This macro is for the convenience of other make-rules files and should not be |
|
143 # overridden by developers. |
|
144 ifeq ($(strip $(BUILD_BITS)),64) |
|
145 PREFERRED_BITS=64 |
|
146 endif |
|
147 ifeq ($(strip $(BUILD_BITS)),64_and_32) |
|
148 PREFERRED_BITS=64 |
|
149 endif |
|
150 PREFERRED_BITS ?= 32 |
|
151 |
|
152 # Map target build to macro/variable naming conventions. This macro is for the |
|
153 # convenience of other make-rules files and should not be overridden by |
|
154 # developers. |
|
155 ifeq ($(BUILD_BITS),64_and_32) |
|
156 MK_BITS=32_and_64 |
|
157 else |
|
158 MK_BITS=$(strip $(BUILD_BITS)) |
|
159 endif |
|
160 |
|
161 # Do not assume a default build style for compatibility with older component |
|
162 # Makefiles. If explicitly set, common.mk will automatically include relevant |
|
163 # make-rules files. Possible values are: 'ant', 'archive', 'attpackagemake', |
|
164 # 'cmake', 'configure', 'gnu-component', 'justmake', 'pkg', and 'setup.py'. See |
|
165 # corresponding file in make-rules for details. |
|
166 # BUILD_STYLE= |
133 |
167 |
134 # The default version should go last. |
168 # The default version should go last. |
135 PYTHON_VERSION = 2.7 |
169 PYTHON_VERSION = 2.7 |
136 PYTHON2_VERSIONS = 2.7 |
170 PYTHON2_VERSIONS = 2.7 |
137 PYTHON3_VERSIONS = 3.4 3.5 |
171 PYTHON3_VERSIONS = 3.4 3.5 |
173 USRSHAREMAN1DIR = $(USRSHAREMANDIR)/man1 |
212 USRSHAREMAN1DIR = $(USRSHAREMANDIR)/man1 |
174 USRSHAREMAN1MDIR = $(USRSHAREMANDIR)/man1m |
213 USRSHAREMAN1MDIR = $(USRSHAREMANDIR)/man1m |
175 USRSHAREMAN3DIR = $(USRSHAREMANDIR)/man3 |
214 USRSHAREMAN3DIR = $(USRSHAREMANDIR)/man3 |
176 USRSHAREMAN4DIR = $(USRSHAREMANDIR)/man4 |
215 USRSHAREMAN4DIR = $(USRSHAREMANDIR)/man4 |
177 USRSHAREMAN5DIR = $(USRSHAREMANDIR)/man5 |
216 USRSHAREMAN5DIR = $(USRSHAREMANDIR)/man5 |
|
217 USRSHAREMAN8DIR = $(USRSHAREMANDIR)/man8 |
178 USRLIBDIR64 = $(USRDIR)/lib/$(MACH64) |
218 USRLIBDIR64 = $(USRDIR)/lib/$(MACH64) |
179 PROTOBINDIR = $(PROTO_DIR)/$(BINDIR) |
219 PROTOBINDIR = $(PROTO_DIR)$(BINDIR) |
180 PROTOETCDIR = $(PROTO_DIR)/$(ETCDIR) |
220 PROTOETCDIR = $(PROTO_DIR)$(ETCDIR) |
181 PROTOETCSECDIR = $(PROTO_DIR)/$(ETCDIR)/security |
221 PROTOETCSECDIR = $(PROTO_DIR)$(ETCDIR)/security |
182 PROTOUSRDIR = $(PROTO_DIR)/$(USRDIR) |
222 PROTOUSRDIR = $(PROTO_DIR)$(USRDIR) |
183 PROTOLIBDIR = $(PROTO_DIR)/$(LIBDIR) |
223 PROTOLIBDIR = $(PROTO_DIR)$(LIBDIR) |
184 PROTOSVCMANIFESTDIR = $(PROTOLIBDIR)/svc/manifest |
224 PROTOSVCMANIFESTDIR = $(PROTOLIBDIR)/svc/manifest |
185 PROTOSVCMETHODDIR = $(PROTOLIBDIR)/svc/method |
225 PROTOSVCMETHODDIR = $(PROTOLIBDIR)/svc/method |
186 PROTOUSRBINDIR = $(PROTO_DIR)/$(USRBINDIR) |
226 PROTOUSRBINDIR = $(PROTO_DIR)$(USRBINDIR) |
187 PROTOUSRBINDIR64 = $(PROTO_DIR)/$(USRBINDIR64) |
227 PROTOUSRBINDIR64 = $(PROTO_DIR)$(USRBINDIR64) |
188 PROTOUSRSBINDIR = $(PROTO_DIR)/$(USRSBINDIR) |
228 PROTOUSRSBINDIR = $(PROTO_DIR)$(USRSBINDIR) |
189 PROTOUSRLIBDIR = $(PROTO_DIR)/$(USRLIBDIR) |
229 PROTOUSRLIBDIR = $(PROTO_DIR)$(USRLIBDIR) |
190 PROTOUSRLIBDIR64 = $(PROTO_DIR)/$(USRLIBDIR64) |
230 PROTOUSRLIBDIR64 = $(PROTO_DIR)$(USRLIBDIR64) |
191 PROTOPKGCONFIGDIR = $(PROTOUSRLIBDIR)/pkgconfig |
231 PROTOPKGCONFIGDIR = $(PROTOUSRLIBDIR)/pkgconfig |
192 PROTOPKGCONFIGDIR64 = $(PROTOUSRLIBDIR64)/pkgconfig |
232 PROTOPKGCONFIGDIR64 = $(PROTOUSRLIBDIR64)/pkgconfig |
193 PROTOUSRINCDIR = $(PROTO_DIR)/$(USRINCDIR) |
233 PROTOUSRINCDIR = $(PROTO_DIR)$(USRINCDIR) |
194 PROTOUSRSHAREDIR = $(PROTO_DIR)/$(USRSHAREDIR) |
234 PROTOUSRSHAREDIR = $(PROTO_DIR)$(USRSHAREDIR) |
195 PROTOUSRSHARELIBDIR = $(PROTO_DIR)/$(USRSHARELIBDIR) |
235 PROTOUSRSHARELIBDIR = $(PROTO_DIR)$(USRSHARELIBDIR) |
196 PROTOUSRSHAREDOCDIR = $(PROTO_DIR)/$(USRSHAREDOCDIR) |
236 PROTOUSRSHAREDOCDIR = $(PROTO_DIR)$(USRSHAREDOCDIR) |
197 PROTOUSRSHAREINFODIR = $(PROTOUSRSHAREDIR)/info |
237 PROTOUSRSHAREINFODIR = $(PROTOUSRSHAREDIR)/info |
198 PROTOUSRSHAREMANDIR = $(PROTO_DIR)/$(USRSHAREMANDIR) |
238 PROTOUSRSHAREMANDIR = $(PROTO_DIR)$(USRSHAREMANDIR) |
199 PROTOUSRSHAREMAN1DIR = $(PROTO_DIR)/$(USRSHAREMAN1DIR) |
239 PROTOUSRSHAREMAN1DIR = $(PROTO_DIR)$(USRSHAREMAN1DIR) |
200 PROTOUSRSHAREMAN1MDIR = $(PROTO_DIR)/$(USRSHAREMAN1MDIR) |
240 PROTOUSRSHAREMAN1MDIR = $(PROTO_DIR)$(USRSHAREMAN1MDIR) |
201 PROTOUSRSHAREMAN3DIR = $(PROTO_DIR)/$(USRSHAREMAN3DIR) |
241 PROTOUSRSHAREMAN3DIR = $(PROTO_DIR)$(USRSHAREMAN3DIR) |
202 PROTOUSRSHAREMAN4DIR = $(PROTO_DIR)/$(USRSHAREMAN4DIR) |
242 PROTOUSRSHAREMAN4DIR = $(PROTO_DIR)$(USRSHAREMAN4DIR) |
203 PROTOUSRSHAREMAN5DIR = $(PROTO_DIR)/$(USRSHAREMAN5DIR) |
243 PROTOUSRSHAREMAN5DIR = $(PROTO_DIR)$(USRSHAREMAN5DIR) |
204 PROTOUSRSHARELOCALEDIR = $(PROTO_DIR)/$(USRSHARELOCALEDIR) |
244 PROTOUSRSHAREMAN8DIR = $(PROTO_DIR)$(USRSHAREMAN8DIR) |
205 |
245 PROTOUSRSHARELOCALEDIR = $(PROTO_DIR)$(USRSHARELOCALEDIR) |
206 |
246 |
207 SFWBIN = /usr/sfw/bin |
247 GNUBIN = $(USRGNUDIR)/bin |
208 SFWINCLUDE = /usr/sfw/include |
248 GNULIB = $(USRGNUDIR)/lib |
209 SFWLIB = /usr/sfw/lib |
249 GNULIB64 = $(USRGNUDIR)/lib/$(MACH64) |
210 SFWLIB64 = /usr/sfw/lib/$(MACH64) |
250 GNUSHARE = $(USRGNUDIR)/share |
211 SFWSHARE = /usr/sfw/share |
251 GNUSHAREMAN = $(USRGNUDIR)/share/man |
212 SFWSHAREMAN = /usr/sfw/share/man |
252 GNUSHAREMAN1 = $(USRGNUDIR)/share/man/man1 |
213 SFWSHAREMAN1 = /usr/sfw/share/man/man1 |
253 PROTOGNUBIN = $(PROTO_DIR)$(GNUBIN) |
214 PROTOSFWBIN = $(PROTO_DIR)/$(SFWBIN) |
254 PROTOGNUSHARE = $(PROTO_DIR)$(GNUSHARE) |
215 PROTOSFWLIB = $(PROTO_DIR)/$(SFWLIB) |
255 PROTOGNUSHAREMAN = $(PROTO_DIR)$(GNUSHAREMAN) |
216 PROTOSFWLIB64 = $(PROTO_DIR)/$(SFWLIB64) |
256 PROTOGNUSHAREMAN1 = $(PROTO_DIR)$(GNUSHAREMAN1) |
217 PROTOSFWSHARE = $(PROTO_DIR)/$(SFWSHARE) |
|
218 PROTOSFWSHAREMAN = $(PROTO_DIR)/$(SFWSHAREMAN) |
|
219 PROTOSFWSHAREMAN1 = $(PROTO_DIR)/$(SFWSHAREMAN1) |
|
220 PROTOSFWINCLUDE = $(PROTO_DIR)/$(SFWINCLUDE) |
|
221 |
|
222 GNUBIN = /usr/gnu/bin |
|
223 GNULIB = /usr/gnu/lib |
|
224 GNULIB64 = /usr/gnu/lib/$(MACH64) |
|
225 GNUSHARE = /usr/gnu/share |
|
226 GNUSHAREMAN = /usr/gnu/share/man |
|
227 GNUSHAREMAN1 = /usr/gnu/share/man/man1 |
|
228 PROTOGNUBIN = $(PROTO_DIR)/$(GNUBIN) |
|
229 PROTOGNUSHARE = $(PROTO_DIR)/$(GNUSHARE) |
|
230 PROTOGNUSHAREMAN = $(PROTO_DIR)/$(GNUSHAREMAN) |
|
231 PROTOGNUSHAREMAN1 = $(PROTO_DIR)/$(GNUSHAREMAN1) |
|
232 |
257 |
233 # work around _TIME, _DATE, embedded date chatter in component builds |
258 # work around _TIME, _DATE, embedded date chatter in component builds |
234 # to use, set TIME_CONSTANT in the component Makefile and add $(CONSTANT_TIME) |
259 # to use, set TIME_CONSTANT in the component Makefile and add $(CONSTANT_TIME) |
235 # to the appropriate {CONFIGURE|BUILD|INSTALL}_ENV |
260 # to the appropriate {CONFIGURE|BUILD|INSTALL}_ENV |
236 CONSTANT_TIME = LD_PRELOAD_32=$(WS_TOOLS)/time-$(MACH32).so |
261 CONSTANT_TIME = LD_PRELOAD_32=$(WS_TOOLS)/time-$(MACH32).so |
848 studio_CXXLIB_CSTD = -library=Cstd,Crun |
879 studio_CXXLIB_CSTD = -library=Cstd,Crun |
849 |
880 |
850 # link C++ with the Studio C++ Runtime and Apache Standard C++ library |
881 # link C++ with the Studio C++ Runtime and Apache Standard C++ library |
851 studio_CXXLIB_APACHE = -library=stdcxx4,Crun |
882 studio_CXXLIB_APACHE = -library=stdcxx4,Crun |
852 |
883 |
853 # Add the C++ ABI compatibility flags for older ABI compatibility. The default |
|
854 # is "standard mode" (-compat=5) |
|
855 studio_COMPAT_VERSION_4 = -compat=4 |
|
856 |
|
857 # Tell the compiler that we don't want the studio runpath added to the |
884 # Tell the compiler that we don't want the studio runpath added to the |
858 # linker flags. We never want the Studio location added to the RUNPATH. |
885 # linker flags. We never want the Studio location added to the RUNPATH. |
859 CXXFLAGS += $($(COMPILER)_NORUNPATH) |
886 CXXFLAGS += $($(COMPILER)_NORUNPATH) |
860 |
887 |
861 # Build 32 or 64 bit objects in C++ as well. |
888 # Build 32 or 64 bit objects in C++ as well. |
862 CXXFLAGS += $(CC_BITS) |
889 CXXFLAGS += $(CC_BITS) |
863 |
890 |
864 # Add compiler-specific 'default' features |
891 # Add compiler-specific 'default' features |
865 CXXFLAGS += $(CXXFLAGS.$(COMPILER)) |
892 CXXFLAGS += $(CXXFLAGS.$(COMPILER)) |
866 CXXFLAGS += $(CXXFLAGS.$(COMPILER).$(BITS)) |
893 CXXFLAGS += $(CXXFLAGS.$(COMPILER).$(BITS)) |
|
894 CXXFLAGS += $(CXXFLAGS.$(COMPILER).$(MACH)) |
|
895 CXXFLAGS += $(CXXFLAGS.$(COMPILER).$(MACH).$(BITS)) |
|
896 |
|
897 # Add mach-specific 'default' features |
|
898 CXXFLAGS += $(CXXFLAGS.$(MACH)) |
867 |
899 |
868 # |
900 # |
869 # Solaris linker flag sets to ease feature selection. Add the required |
901 # Solaris linker flag sets to ease feature selection. Add the required |
870 # feature to your Makefile with LDFLAGS += $(FEATURE_MACRO) and add to the |
902 # feature to your Makefile with LDFLAGS += $(FEATURE_MACRO) and add to the |
871 # component build with CONFIGURE_OPTIONS += LDFLAGS="$(LDFLAGS)" or similiar. |
903 # component build with CONFIGURE_OPTIONS += LDFLAGS="$(LDFLAGS)" or similiar. |
872 # |
904 # |
873 |
905 |
874 # set the bittedness that we want to link |
906 # set the bittedness that we want to link |
875 LD_BITS = -$(BITS) |
907 LD_BITS = -$(BITS) |
876 |
908 |
|
909 # Note that spaces are not used after the '-z' below so that these macros can |
|
910 # be used in arguments to the compiler of the form -Wl,$(LD_Z_*). |
|
911 |
877 # Reduce the symbol table size, effectively conflicting with -g. We should |
912 # Reduce the symbol table size, effectively conflicting with -g. We should |
878 # get linker guidance here. |
913 # get linker guidance here. |
879 LD_Z_REDLOCSYM = -z redlocsym |
914 LD_Z_REDLOCSYM = -zredlocsym |
880 |
915 |
881 # Cause the linker to rescan archive libraries and resolve remaining unresolved |
916 # Cause the linker to rescan archive libraries and resolve remaining unresolved |
882 # symbols recursively until all symbols are resolved. Components should be |
917 # symbols recursively until all symbols are resolved. Components should be |
883 # linking in the libraries they need, in the required order. This should |
918 # linking in the libraries they need, in the required order. This should |
884 # only be required if the component's native build is horribly broken. |
919 # only be required if the component's native build is horribly broken. |
885 LD_Z_RESCAN_NOW = -z rescan-now |
920 LD_Z_RESCAN_NOW = -zrescan-now |
886 |
921 |
887 LD_Z_TEXT = -z text |
922 LD_Z_TEXT = -ztext |
888 |
923 |
889 # make sure that -lc is always present when building shared objects. |
924 # make sure that -lc is always present when building shared objects. |
890 LD_DEF_LIBS += -lc |
925 LD_DEF_LIBS += -lc |
891 |
926 |
892 # make sure all symbols are defined. |
927 # make sure all symbols are defined. |
893 LD_Z_DEFS = -z defs |
928 LD_Z_DEFS = -zdefs |
894 |
929 |
895 # eliminate unreferenced dynamic dependencies |
930 # eliminate unreferenced dynamic dependencies |
896 LD_Z_IGNORE = -z ignore |
931 LD_Z_IGNORE = -zignore |
897 |
932 |
898 # eliminate comments |
933 # eliminate comments |
899 LD_Z_STRIP_CLASS = -z strip-class=comment |
934 LD_Z_STRIP_CLASS = -zstrip-class=comment |
900 |
935 |
901 # use direct binding |
936 # use direct binding |
902 LD_B_DIRECT = -Bdirect |
937 LD_B_DIRECT = -Bdirect |
903 |
938 |
904 # use generic macro names for enabling/disabling ASLR |
939 # use generic macro names for enabling/disabling ASLR |
905 ASLR_ENABLE = -z aslr=enable |
940 ASLR_ENABLE = -zaslr=enable |
906 ASLR_DISABLE = -z aslr=disable |
941 ASLR_DISABLE = -zaslr=disable |
907 ASLR_NOT_APPLICABLE = -z aslr=disable |
942 ASLR_NOT_APPLICABLE = -zaslr=disable |
908 ASLR_MODE = $(ASLR_DISABLE) |
943 |
|
944 # Disable ASLR by default unless target build is NO_ARCH. |
|
945 ifeq ($(strip $(BUILD_BITS)),NO_ARCH) |
|
946 ASLR_MODE= $(ASLR_NOT_APPLICABLE) |
|
947 else |
|
948 ASLR_MODE= $(ASLR_DISABLE) |
|
949 endif |
909 |
950 |
910 # by default, turn off Address Space Layout Randomization for ELF executables; |
951 # by default, turn off Address Space Layout Randomization for ELF executables; |
911 # to explicitly enable ASLR, set ASLR_MODE = $(ASLR_ENABLE) |
952 # to explicitly enable ASLR, set ASLR_MODE = $(ASLR_ENABLE) |
912 # in that component's Makefile |
953 # in that component's Makefile |
913 LD_Z_ASLR = $(ASLR_MODE) |
954 LD_Z_ASLR = $(ASLR_MODE) |
922 # Create a non-executable stack when linking. |
963 # Create a non-executable stack when linking. |
923 LD_MAP_NOEXSTK.i386 = -M /usr/lib/ld/map.noexstk |
964 LD_MAP_NOEXSTK.i386 = -M /usr/lib/ld/map.noexstk |
924 LD_MAP_NOEXSTK.sparc = -M /usr/lib/ld/map.noexstk |
965 LD_MAP_NOEXSTK.sparc = -M /usr/lib/ld/map.noexstk |
925 |
966 |
926 # Create a non-executable bss segment when linking. |
967 # Create a non-executable bss segment when linking. |
927 LD_MAP_NOEXBSS = -M /usr/lib/ld/map.noexbss |
968 LD_MAP_NOEXBSS.i386 = -M /usr/lib/ld/map.noexbss |
|
969 LD_MAP_NOEXBSS.sparc = -M /usr/lib/ld/map.noexbss |
928 |
970 |
929 # Create a non-executable data segment when linking. Due to PLT needs, the |
971 # Create a non-executable data segment when linking. Due to PLT needs, the |
930 # data segment must be executable on sparc, but the bss does not. |
972 # data segment must be executable on sparc, but the bss does not. |
931 # see mapfile comments for more information |
973 # see mapfile comments for more information |
932 LD_MAP_NOEXDATA.i386 = -M /usr/lib/ld/map.noexdata |
974 LD_MAP_NOEXDATA.i386 = -M /usr/lib/ld/map.noexdata |
933 LD_MAP_NOEXDATA.sparc = $(LD_MAP_NOEXBSS) |
975 LD_MAP_NOEXDATA.sparc = $(LD_MAP_NOEXBSS.$(MACH)) |
934 |
976 |
935 # Page alignment |
977 # Page alignment |
936 LD_MAP_PAGEALIGN = -M /usr/lib/ld/map.pagealign |
978 LD_MAP_PAGEALIGN = -M /usr/lib/ld/map.pagealign |
937 |
979 |
938 # Linker options to add when only building libraries |
980 # Linker options to add when only building libraries |