Makefile revision 7292
c313914d0e66b20969215e519bbf2ab4ecf39512Tinderbox User# CDDL HEADER START
c80e152862cc3e3207dc837fde7116bd4c0e4b9dTinderbox User# The contents of this file are subject to the terms of the
8d1b3ceb4d491ce32572f1702f37ed585eede993Evan Hunt# Common Development and Distribution License (the "License").
8d1b3ceb4d491ce32572f1702f37ed585eede993Evan Hunt# You may not use this file except in compliance with the License.
d77cb075aae5595e460e3299bfc1e8ea5d42b560Evan Hunt# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
30ca20f720ad0887772a79e7abb25b4fa0e4b5b0Mark Andrews# See the License for the specific language governing permissions
30ca20f720ad0887772a79e7abb25b4fa0e4b5b0Mark Andrews# and limitations under the License.
30ca20f720ad0887772a79e7abb25b4fa0e4b5b0Mark Andrews# When distributing Covered Code, include this CDDL HEADER in each
701a93f5a592e4652343e049aa495d409c3ee133Mark Andrews# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
7ec97ae74e42ec21b354fd2d1366313b41d947d6Evan Hunt# If applicable, add the following below this CDDL HEADER, with the
701a93f5a592e4652343e049aa495d409c3ee133Mark Andrews# fields enclosed by brackets "[]" replaced with your own identifying
701a93f5a592e4652343e049aa495d409c3ee133Mark Andrews# information: Portions Copyright [yyyy] [name of copyright owner]
002f1373374a0b72fc0329baa682917929bef168Tony Finch# CDDL HEADER END
8f1ed05dc0aae7ae6c3da6ec6d405df61257a61eMark Andrews# Copyright (c) 2011, 2016, Oracle and/or its affiliates. All rights reserved.
f1740da065d4555039fe8bb53beb4153e3f94de3Mark Andrews sha256:7be3ad1641b99b17f6a8be6a976f1f954e997c41e919ad7e0c418fe848c13c97
f1740da065d4555039fe8bb53beb4153e3f94de3Mark AndrewsCOMPONENT_ARCHIVE_URL= http://ftp.gnu.org/gnu/gmp/$(COMPONENT_ARCHIVE)
31c7ab4fb3f7710af87dc9c3d64c5daf9a3dea35Mark Andrews# We need to build an extra static version of this library for
fc04365d2f83f197c8a54545dd9cd4ce6a209940Mark AndrewsWANBOOT_CONFIGURE = $(BUILD_DIR)/wanboot-amd64/.configured
fc04365d2f83f197c8a54545dd9cd4ce6a209940Mark AndrewsWANBOOT_BUILD = $(BUILD_DIR)/wanboot-amd64/.built
7cbac360bf98c0a52b2d6866ad887616c32d4d3aMark AndrewsWANBOOT_INSTALL = $(BUILD_DIR)/wanboot-amd64/.installed
2cf0fe3b8092f64f8f68ae3693fe2e73e90ad1a4Mark AndrewsCFLAGS.shared += -xustr=ascii_utf16_ushort -xcsi
2cf0fe3b8092f64f8f68ae3693fe2e73e90ad1a4Mark Andrews# -xthreadvar=%all: allow thread-local storage via __thread
2cf0fe3b8092f64f8f68ae3693fe2e73e90ad1a4Mark Andrews# qualifier for all types of variables (global, static and dynamic)
2cf0fe3b8092f64f8f68ae3693fe2e73e90ad1a4Mark AndrewsCFLAGS.shared += -xthreadvar=%all $(CPP_C99_EXTENDED_MATH)
4221d9cd1d02311fbf9b5f08a038f5af78b10b4aEvan HuntCFLAGS.shared += $(studio_C99_ENABLE) $(CPP_XPG6MODE)
4221d9cd1d02311fbf9b5f08a038f5af78b10b4aEvan Hunt# Set the wanboot CFLAGS as needed for the wanboot compilation
929329d2d66a7e1083c70a9c918381935bf12799Mukund SivaramanCFLAGS.wanboot += -fno-asynchronous-unwind-tables
afefd754734f896bf3e0590177fff83e7cdfdf35Mark AndrewsCXXFLAGS.shared = -mt -features=anachronisms,except,rtti,export,extensions,nestedaccess,tmplife,tmplrefstatic
afefd754734f896bf3e0590177fff83e7cdfdf35Mark AndrewsCXXFLAGS.shared += -instances=global -template=geninlinefuncs
afefd754734f896bf3e0590177fff83e7cdfdf35Mark AndrewsCXXFLAGS.shared += -xbuiltin=%none -xinline=%auto -xlibmil
f0353a586c2bfbae999193cb644b6bc94c7944d8Mark AndrewsCXXFLAGS.shared += -xustr=ascii_utf16_ushort -xlibmopt
f0353a586c2bfbae999193cb644b6bc94c7944d8Mark AndrewsCXXFLAGS.shared += $(studio_cplusplus_C99_ENABLE) $(studio_PIC)
7ff28f5befbee76048a23e504dcd3f9a44ce6209Evan Hunt# -Qoption ccfe -features=zla: allow VLA/ZLA in C++ (like in C99)
cad79077bd5b2616bc4a7a6b3cbc0953bef8917fMark Andrews '-e "/libtool/d"' \
cad79077bd5b2616bc4a7a6b3cbc0953bef8917fMark Andrews '-e "/-m32/d"' \
cad79077bd5b2616bc4a7a6b3cbc0953bef8917fMark Andrews '-e "/-m64/d"' \
adfe58e8e5cd1890585e92b67f1fd01989a1fa7dMark Andrews '-e "/DEPDIR=/d"' \
adfe58e8e5cd1890585e92b67f1fd01989a1fa7dMark Andrews '-e "/ld: warning/d"' \
adfe58e8e5cd1890585e92b67f1fd01989a1fa7dMark Andrews '-e "/creating /d"' \
c3237dec879f82855403ff7e3ba87b298172efd5Mark Andrews '-e "/gm4 /d"' \
c3237dec879f82855403ff7e3ba87b298172efd5Mark Andrews '-e "s/^make\[[0-9]\{1,\}\]/make/g"'
c3237dec879f82855403ff7e3ba87b298172efd5Mark Andrews# assembler detection for GNU MP and GNU MPFR is done via MPN_PATH
c3237dec879f82855403ff7e3ba87b298172efd5Mark Andrews# at ./configure time. GNU MPFR wants to know GNU MP's MPN_PATH.
534057c9f91a3eb6e0541f3526459c716239b337Mark AndrewsCONFIGURE_ENV += LD="$(CC) $(CFLAGS) $(LDFLAGS)"
0f14b041328c062b1fa391887376388dfc8b2fe5Mark AndrewsCONFIGURE_ENV += CXXLD="$(CXX) $(CC_BITS) $(CXXFLAGS) $(LDFLAGS)"
0f14b041328c062b1fa391887376388dfc8b2fe5Mark AndrewsCONFIGURE_ENV += CPP="$(CC) $(CPPFLAGS) $(CFLAGS) -E"
0f14b041328c062b1fa391887376388dfc8b2fe5Mark AndrewsCONFIGURE_ENV += CPP_FOR_BUILD="$(CC) $(CPPFLAGS) $(CFLAGS) -E"
0f14b041328c062b1fa391887376388dfc8b2fe5Mark AndrewsCONFIGURE_ENV += CXXCPP="$(CXX) $(CC_BITS) $(CPPFLAGS) $(CXXFLAGS) -E"
f7f4730e563a2749629fe7fef4cd9513cd2bfab7Mark AndrewsCONFIGURE_ENV += CC_FOR_BUILD="$(CC) $(CPPFLAGS) $(CFLAGS)"
a5a1cbece45e6ca68aafe3b9b995eac6b0f45dd2Mark AndrewsCONFIGURE_OPTIONS += --includedir=$(USRINCDIR)/gmp
677f507de7c546c187c1505c48bc7b440545485cMark Andrews# Set the wanboot configure options as needed for wanboot
bf459d24a117ae2c54c37016430b41cd6d73491cMark AndrewsCONFIGURE_OPTIONS.wanboot += --disable-profiling
bf459d24a117ae2c54c37016430b41cd6d73491cMark AndrewsCONFIGURE_OPTIONS.wanboot += --disable-minithres
677f507de7c546c187c1505c48bc7b440545485cMark AndrewsCONFIGURE_OPTIONS.wanboot += --disable-libtool-lock
f53e0bda467d96dfeeba1b4da30c37b37766bb75Evan HuntPROTOUSRSHAREHTMLDIR = $(PROTOUSRSHAREDIR)/doc/gmp/html
f53e0bda467d96dfeeba1b4da30c37b37766bb75Evan Hunt# libgmpxx.so.4 always gets built with unnecessary paths in RUNPATH/RPATH
a38f07c73790170842e4523b4a474d01ca0dede1Michał Kępień $(COMPONENT_DIR)/Solaris/libgmp-64.pc > $(COMPONENT_DIR)/libgmp.pc ; \
39d5523a8afc73cbdb4fa426de2ce071267a5d6fMark Andrews $(MV) $(PROTOUSRINCDIR)/gmp.h $(PROTOUSRINCDIR)/gmp/ ; \
39d5523a8afc73cbdb4fa426de2ce071267a5d6fMark Andrews $(MV) $(PROTOUSRINCDIR)/mp.h $(PROTOUSRINCDIR)/gmp/ ; \
39d5523a8afc73cbdb4fa426de2ce071267a5d6fMark Andrews $(INSTALL) -m 0644 $(COMPONENT_DIR)/Solaris/index.html \
1f4a3c7088594d1b64cd734eb69e1fd023fde8bfMichał Kępień $(INSTALL) -m 0644 $(COMPONENT_DIR)/Solaris/libgmp.pc \
91827e6fd3851a5fe129ef5409ff45833ca01a0eMark Andrews $(INSTALL) -m 0644 $(COMPONENT_DIR)/Solaris/libgmpxx.pc \
91827e6fd3851a5fe129ef5409ff45833ca01a0eMark Andrews $(INSTALL) -m 0644 $(COMPONENT_DIR)/libgmp.pc \
35aae5884f410180706a89a9715bf9a85eeeb4b7Michał Kępień $(INSTALL) -m 0644 $(COMPONENT_DIR)/libgmpxx.pc \
57b1d64d9ae12d56973716e96f9743a00d47af4aMichał Kępień $(INSTALL) -m 0644 $(COMPONENT_DIR)/Solaris/libgmp.3 \
2d517e233ff3b3fcd272eb5b2e2d3db6d31a1681Michał Kępień $(MV) $(PROTOUSRLIBDIR64)/libgmp.a $(PROTO_DIR)/usr/lib/grub/wanboot/libgmp.a; \
09c3efda414314d7edcfb2aed9463fb935fc95a6Mark Andrews $(STRIP) -x $(PROTOUSRLIBDIR)/grub/wanboot/libgmp.a; \
09c3efda414314d7edcfb2aed9463fb935fc95a6Mark Andrews $(MCS) -d $(PROTOUSRLIBDIR)/grub/wanboot/libgmp.a; \
86d2f9abc8493321aacb0d540485de4d562fb734Mark Andrews $(AR) ts $(PROTOUSRLIBDIR)/grub/wanboot/libgmp.a )
86d2f9abc8493321aacb0d540485de4d562fb734Mark Andrews# Skipping this during automated tests since it hangs sometimes
86d2f9abc8493321aacb0d540485de4d562fb734Mark Andrews# common targets
09c3efda414314d7edcfb2aed9463fb935fc95a6Mark Andrews$(BUILD_DIR)/$(MACH32)/.configured: CPPFLAGS += $(CPPFLAGS.shared)
86d2f9abc8493321aacb0d540485de4d562fb734Mark Andrews$(BUILD_DIR)/$(MACH32)/.configured: CFLAGS += $(CFLAGS.shared)
c7e57ce1b0bca9bc7da14bec485f7a7e3e4c761fMichał Kępień$(BUILD_DIR)/$(MACH32)/.configured: CXXFLAGS += $(CXXFLAGS.shared)
c7e57ce1b0bca9bc7da14bec485f7a7e3e4c761fMichał Kępień$(BUILD_DIR)/$(MACH32)/.configured: CONFIGURE_OPTIONS += $(CONFIGURE_OPTIONS.shared)
c7e57ce1b0bca9bc7da14bec485f7a7e3e4c761fMichał Kępień$(BUILD_DIR)/$(MACH64)/.configured: CPPFLAGS += $(CPPFLAGS.shared)
3ed16e796dba90c96933c8a8a3f5b9404d8d3e61Mark Andrews$(BUILD_DIR)/$(MACH64)/.configured: CFLAGS += $(CFLAGS.shared)
3ed16e796dba90c96933c8a8a3f5b9404d8d3e61Mark Andrews$(BUILD_DIR)/$(MACH64)/.configured: CXXFLAGS += $(CXXFLAGS.shared)
3ed16e796dba90c96933c8a8a3f5b9404d8d3e61Mark Andrews$(BUILD_DIR)/$(MACH64)/.configured: CONFIGURE_OPTIONS += $(CONFIGURE_OPTIONS.shared)
14d8a144779b54b103d2da741a2242bf5f9052f7Mark Andrews$(BUILD_DIR)/wanboot-amd64/.configured: COMPILER=gcc
14d8a144779b54b103d2da741a2242bf5f9052f7Mark Andrews$(BUILD_DIR)/wanboot-amd64/.configured: CPPFLAGS += $(CPPFLAGS.wanboot)
70e041bea19b6ad9522b89c2299ad315a2deaafdMark Andrews$(BUILD_DIR)/wanboot-amd64/.configured: CFLAGS += $(CFLAGS.wanboot)
70e041bea19b6ad9522b89c2299ad315a2deaafdMark Andrews$(BUILD_DIR)/wanboot-amd64/.configured: CXXFLAGS += $(CXXFLAGS.wanboot)
70e041bea19b6ad9522b89c2299ad315a2deaafdMark Andrews$(BUILD_DIR)/wanboot-amd64/.configured: CONFIGURE_OPTIONS += $(CONFIGURE_OPTIONS.wanboot)
a55438eda32ecebf43ead45b216662b7923a465fMark Andrews$(BUILD_DIR)/$(MACH32)/.installed: COMPONENT_POST_INSTALL_ACTION = $(COMPONENT_POST_INSTALL_ACTION.shared)
a55438eda32ecebf43ead45b216662b7923a465fMark Andrews$(BUILD_DIR)/$(MACH64)/.installed: COMPONENT_POST_INSTALL_ACTION = $(COMPONENT_POST_INSTALL_ACTION.shared)