Makefile revision 965
9eb24f1f84885d5c2e51a7f675264db398c31af7Tinderbox User# CDDL HEADER START
7bd455641455950eff7d21be652c8142b134d32fTinderbox User#
0c27b3fe77ac1d5094ba3521e8142d9e7973133fMark Andrews# The contents of this file are subject to the terms of the
0c27b3fe77ac1d5094ba3521e8142d9e7973133fMark Andrews# Common Development and Distribution License (the "License").
0c27b3fe77ac1d5094ba3521e8142d9e7973133fMark Andrews# You may not use this file except in compliance with the License.
8cbf3b6fc35091abde426930f2eadb8f53476c98Evan Hunt#
866d106459313499d0ca7bfccb4b2d23d5e4377cDavid Lawrence# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
74cb99072c4b0ebd2ccafcfa284288fa760f7a1aMark Andrews# or http://www.opensolaris.org/os/licensing.
bff64bf12b58a6f80e740e94f2e42a32df18113aEvan Hunt# See the License for the specific language governing permissions
866d106459313499d0ca7bfccb4b2d23d5e4377cDavid Lawrence# and limitations under the License.
7c74e180c206e6ed99e8beb820da5f399d845c3eDavid Lawrence#
2baa66562a2f119edffded961d3391f87ff98ec0Ondřej Surý# When distributing Covered Code, include this CDDL HEADER in each
03e200df5dc283f24a6a349f0b31d3eab26da893Mark Andrews# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
a5d43b72413db3edd6b36a58f9bdf2cf6ff692f2Bob Halley# If applicable, add the following below this CDDL HEADER, with the
a5d43b72413db3edd6b36a58f9bdf2cf6ff692f2Bob Halley# fields enclosed by brackets "[]" replaced with your own identifying
63dd46733010bb9622810faa17d88c3e3c28b730Mark Andrews# information: Portions Copyright [yyyy] [name of copyright owner]
a5d43b72413db3edd6b36a58f9bdf2cf6ff692f2Bob Halley#
a5d43b72413db3edd6b36a58f9bdf2cf6ff692f2Bob Halley# CDDL HEADER END
a5d43b72413db3edd6b36a58f9bdf2cf6ff692f2Bob Halley#
ccdac53c027e8964753b36c4d8c7b0e98af501c2Michael Graff
d901b2252d664a5b96bae117416f8ee822dc6691Stephen Jacob#
df3c4c7988b9bae7d121a8ac9ed17a23366a948dDavid Lawrence# Copyright (c) 2011, Oracle and/or its affiliates. All rights reserved.
df3c4c7988b9bae7d121a8ac9ed17a23366a948dDavid Lawrence#
df3c4c7988b9bae7d121a8ac9ed17a23366a948dDavid Lawrence
20256cbc1570e344793555b8c2f43a25bb38e373Mark Andrewsinclude ../../make-rules/shared-macros.mk
20256cbc1570e344793555b8c2f43a25bb38e373Mark Andrews
8b56b8956fc1e6c70efacb4f71db28d0d1f0c577Mark AndrewsPATH=$(dir $(CC)):/usr/bin:/usr/gnu/bin
8b56b8956fc1e6c70efacb4f71db28d0d1f0c577Mark Andrews
f4ea363e3acc321b24ffe95a64a583e8041d6fd5Mark AndrewsCOMPONENT_NAME= gmp
8b56b8956fc1e6c70efacb4f71db28d0d1f0c577Mark AndrewsCOMPONENT_VERSION= 4.3.2
8b56b8956fc1e6c70efacb4f71db28d0d1f0c577Mark AndrewsCOMPONENT_SRC= $(COMPONENT_NAME)-$(COMPONENT_VERSION)
8b56b8956fc1e6c70efacb4f71db28d0d1f0c577Mark AndrewsCOMPONENT_ARCHIVE= $(COMPONENT_SRC).tar.gz
8b56b8956fc1e6c70efacb4f71db28d0d1f0c577Mark AndrewsCOMPONENT_ARCHIVE_HASH= sha1:223c3c89ad98c62e5b8335a75ef37e8241f9bbb0
914eeb33149a0008e26741d9e7d89dcd6f8b6d0bMark AndrewsCOMPONENT_ARCHIVE_URL= http://ftp.gnu.org/gnu/gmp/$(COMPONENT_ARCHIVE)
ccdac53c027e8964753b36c4d8c7b0e98af501c2Michael Graff
a903095bf4512dae561c7f6fc7854a51bebf334aMark Andrewsinclude ../../make-rules/prep.mk
ccdac53c027e8964753b36c4d8c7b0e98af501c2Michael Graffinclude ../../make-rules/configure.mk
a5d43b72413db3edd6b36a58f9bdf2cf6ff692f2Bob Halleyinclude ../../make-rules/ips.mk
a5d43b72413db3edd6b36a58f9bdf2cf6ff692f2Bob Halleyinclude ../../make-rules/lint-libraries.mk
a5d43b72413db3edd6b36a58f9bdf2cf6ff692f2Bob Halley
3d776d762914d1b675b4fd49728ce353ccf6f77eBrian WellingtonPATCH_LEVEL = 0
5b7abbef511cea0b568be0bc8d5b3120a0b9034dEvan Hunt
6b66ee9147e940572a0e873ecbd67456ccb85c39Mark AndrewsCFLAGS += -features=extinl,extensions
ccdac53c027e8964753b36c4d8c7b0e98af501c2Michael GraffCFLAGS += -xustr=ascii_utf16_ushort -xcsi
11dbf2fc38eea8c5d3fe7123718bf197a8bb2e6bMark Andrews# -xthreadvar=%all: allow thread-local storage via __thread
67247b4a8304bac790648a351a95b8b0f4c512a6Mark Andrews# qualifier for all types of variables (global, static and dynamic)
9ed37e8b9ccd53bc37b546fffe487b9547dda3a0Mark AndrewsCFLAGS += -xthreadvar=%all $(CPP_C99_EXTENDED_MATH)
9ed37e8b9ccd53bc37b546fffe487b9547dda3a0Mark AndrewsCFLAGS += $(studio_C99_ENABLE) $(CPP_XPG6MODE)
9ed37e8b9ccd53bc37b546fffe487b9547dda3a0Mark AndrewsCFLAGS += $(studio_PIC)
11dbf2fc38eea8c5d3fe7123718bf197a8bb2e6bMark AndrewsCXXFLAGS = -mt -features=anachronisms,except,rtti,export,extensions,nestedaccess,tmplife,tmplrefstatic
11dbf2fc38eea8c5d3fe7123718bf197a8bb2e6bMark AndrewsCXXFLAGS += -instances=global -template=geninlinefuncs -verbose=template
11dbf2fc38eea8c5d3fe7123718bf197a8bb2e6bMark AndrewsCXXFLAGS += -xbuiltin=%none -xinline=%auto -xlibmil
11dbf2fc38eea8c5d3fe7123718bf197a8bb2e6bMark AndrewsCXXFLAGS += -xustr=ascii_utf16_ushort -xlibmopt
11dbf2fc38eea8c5d3fe7123718bf197a8bb2e6bMark AndrewsCXXFLAGS += $(studio_cplusplus_C99_ENABLE) $(studio_PIC)
11dbf2fc38eea8c5d3fe7123718bf197a8bb2e6bMark AndrewsCXXFLAGS += $(CPP_XPG5MODE)
11dbf2fc38eea8c5d3fe7123718bf197a8bb2e6bMark Andrews# -Qoption ccfe -features=zla: allow VLA/ZLA in C++ (like in C99)
31c7ab4fb3f7710af87dc9c3d64c5daf9a3dea35Mark AndrewsCXXFLAGS += -Qoption ccfe -features=zla
31c7ab4fb3f7710af87dc9c3d64c5daf9a3dea35Mark AndrewsCXXFLAGS += -xF=%none -xthreadvar=%all
31c7ab4fb3f7710af87dc9c3d64c5daf9a3dea35Mark AndrewsCPPFLAGS += $(CPP_POSIX) $(CPP_LARGEFILES)
31c7ab4fb3f7710af87dc9c3d64c5daf9a3dea35Mark AndrewsLDFLAGS += $(LD_Z_REDLOCSYM) $(LD_Z_RESCAN_NOW)
31c7ab4fb3f7710af87dc9c3d64c5daf9a3dea35Mark Andrews
31c7ab4fb3f7710af87dc9c3d64c5daf9a3dea35Mark Andrews# assembler detection for GNU MP and GNU MPFR is done via MPN_PATH
31c7ab4fb3f7710af87dc9c3d64c5daf9a3dea35Mark Andrews# at ./configure time. GNU MPFR wants to know GNU MP's MPN_PATH.
31c7ab4fb3f7710af87dc9c3d64c5daf9a3dea35Mark AndrewsMPN32_i386 = x86/pentium x86 generic
31c7ab4fb3f7710af87dc9c3d64c5daf9a3dea35Mark AndrewsMPN64_i386 = x86_64/pentium4 x86_64 generic
67247b4a8304bac790648a351a95b8b0f4c512a6Mark AndrewsMPN32_sparc = sparc32/v9 sparc32 generic
67247b4a8304bac790648a351a95b8b0f4c512a6Mark AndrewsMPN64_sparc = sparc64 generic
67247b4a8304bac790648a351a95b8b0f4c512a6Mark AndrewsMPN_32 = $(MPN32_$(MACH))
11463c0ac24692e229ec87f307f5e7df3c0a7e10Evan HuntMPN_64 = $(MPN64_$(MACH))
67247b4a8304bac790648a351a95b8b0f4c512a6Mark AndrewsGM4 = /usr/bin/gm4
67247b4a8304bac790648a351a95b8b0f4c512a6Mark AndrewsGSED = /usr/bin/gsed
67247b4a8304bac790648a351a95b8b0f4c512a6Mark Andrews# libgmpxx.so.4 always gets built with unnecessary paths in RUNPATH/RPATH
1c1290afabb3c8f4dd498170ac9592e5be450161Mark AndrewsELFEDIT = /usr/bin/elfedit
67247b4a8304bac790648a351a95b8b0f4c512a6Mark Andrews
67247b4a8304bac790648a351a95b8b0f4c512a6Mark AndrewsCONFIGURE_ENV += CC="$(CC)"
67247b4a8304bac790648a351a95b8b0f4c512a6Mark AndrewsCONFIGURE_ENV += CXX="$(CXX)"
800cfc8a5ce9ffacfc076003b34b5f787f82c701Mark AndrewsCONFIGURE_ENV += CFLAGS="$(CFLAGS)"
32ebb157b1d9409a186c86002827f8a1f4931f5aMark AndrewsCONFIGURE_ENV += CPPFLAGS="$(CPPFLAGS)"
32ebb157b1d9409a186c86002827f8a1f4931f5aMark AndrewsCONFIGURE_ENV += CXXFLAGS="$(CC_BITS) $(CXXFLAGS)"
740e7340c55e9f0cf80c6fbbf7e8d3c1bdeaa255Mark AndrewsCONFIGURE_ENV += LD="$(CC) $(CFLAGS) $(LDFLAGS)"
32ebb157b1d9409a186c86002827f8a1f4931f5aMark AndrewsCONFIGURE_ENV += LDFLAGS="$(LDFLAGS)"
84f95ddb2572641022619950a211aff49e331c98Mukund SivaramanCONFIGURE_ENV += CXXLD="$(CXX) $(CC_BITS) $(CXXFLAGS) $(LDFLAGS)"
32ebb157b1d9409a186c86002827f8a1f4931f5aMark AndrewsCONFIGURE_ENV += CPP="$(CC) $(CPPFLAGS) $(CFLAGS) -E"
32ebb157b1d9409a186c86002827f8a1f4931f5aMark AndrewsCONFIGURE_ENV += CPP_FOR_BUILD="$(CC) $(CPPFLAGS) $(CFLAGS) -E"
32ebb157b1d9409a186c86002827f8a1f4931f5aMark AndrewsCONFIGURE_ENV += CXXCPP="$(CXX) $(CC_BITS) $(CPPFLAGS) $(CXXFLAGS) -E"
71697fd082b1c76562dc80fa91787af3860146bfEvan HuntCONFIGURE_ENV += INSTALL="$(INSTALL)"
1c1290afabb3c8f4dd498170ac9592e5be450161Mark AndrewsCONFIGURE_ENV += CC_FOR_BUILD="$(CC) $(CPPFLAGS) $(CFLAGS)"
11463c0ac24692e229ec87f307f5e7df3c0a7e10Evan HuntCONFIGURE_ENV += M4="$(GM4)"
a97185d9e01800850222878c2af93ea5cb08a68cMark AndrewsCONFIGURE_ENV += SED="$(GSED)"
800cfc8a5ce9ffacfc076003b34b5f787f82c701Mark AndrewsCONFIGURE_ENV += ABI="$(BITS)"
32ebb157b1d9409a186c86002827f8a1f4931f5aMark AndrewsCONFIGURE_ENV += "MPN_PATH=$(MPN_$(BITS))"
32ebb157b1d9409a186c86002827f8a1f4931f5aMark Andrews
800cfc8a5ce9ffacfc076003b34b5f787f82c701Mark AndrewsCONFIGURE_OPTIONS += --includedir=/usr/include/gmp
6fa84a3e255ef9e6233f0a8d134fc6d273f04599Evan HuntCONFIGURE_OPTIONS += --localstatedir=/var
19d80ce5844e00a021643759adcbe27c11b485a0Witold KrecickiCONFIGURE_OPTIONS += --enable-shared
67247b4a8304bac790648a351a95b8b0f4c512a6Mark AndrewsCONFIGURE_OPTIONS += --disable-static
67247b4a8304bac790648a351a95b8b0f4c512a6Mark AndrewsCONFIGURE_OPTIONS += --disable-libtool-lock
67247b4a8304bac790648a351a95b8b0f4c512a6Mark AndrewsCONFIGURE_OPTIONS += --disable-alloca
67247b4a8304bac790648a351a95b8b0f4c512a6Mark AndrewsCONFIGURE_OPTIONS += --enable-cxx
67247b4a8304bac790648a351a95b8b0f4c512a6Mark AndrewsCONFIGURE_OPTIONS += --enable-fft
67247b4a8304bac790648a351a95b8b0f4c512a6Mark AndrewsCONFIGURE_OPTIONS += --enable-mpbsd
19d80ce5844e00a021643759adcbe27c11b485a0Witold KrecickiCONFIGURE_OPTIONS += --disable-fat
19d80ce5844e00a021643759adcbe27c11b485a0Witold KrecickiCONFIGURE_OPTIONS += --with-pic
19d80ce5844e00a021643759adcbe27c11b485a0Witold Krecicki
19d80ce5844e00a021643759adcbe27c11b485a0Witold KrecickiPROTOUSRSHAREINFODIR = $(PROTOUSRSHAREDIR)/info
19d80ce5844e00a021643759adcbe27c11b485a0Witold KrecickiPROTOUSRSHAREHTMLDIR = $(PROTOUSRSHAREDIR)/doc/gmp/html
19d80ce5844e00a021643759adcbe27c11b485a0Witold KrecickiPROTOUSRSHAREMAN3DIR = $(PROTOUSRSHAREDIR)/man/man3
8bcd80824c51c802c2927236b012cd526f569b04Mark AndrewsPROTOUSRINCLUDEDIR = $(PROTOUSRDIR)/include
6fa84a3e255ef9e6233f0a8d134fc6d273f04599Evan HuntPROTOPKGCONFIGDIR = $(PROTOUSRLIBDIR)/pkgconfig
8bcd80824c51c802c2927236b012cd526f569b04Mark AndrewsPROTOPKGCONFIGDIR64 = $(PROTOUSRLIBDIR64)/pkgconfig
6fa84a3e255ef9e6233f0a8d134fc6d273f04599Evan Hunt
67247b4a8304bac790648a351a95b8b0f4c512a6Mark AndrewsCOMPONENT_POST_INSTALL_ACTION = \
67247b4a8304bac790648a351a95b8b0f4c512a6Mark Andrews ( $(MKDIR) $(PROTOUSRSHAREHTMLDIR) ; \
67247b4a8304bac790648a351a95b8b0f4c512a6Mark Andrews $(MKDIR) $(PROTOUSRSHAREMAN3DIR) ; \
6fa84a3e255ef9e6233f0a8d134fc6d273f04599Evan Hunt $(MKDIR) $(PROTOPKGCONFIGDIR) ; \
206e697f24e47b8868bd68a5b6ef42f5f62e39d5Evan Hunt $(MKDIR) $(PROTOPKGCONFIGDIR64) ; \
6fa84a3e255ef9e6233f0a8d134fc6d273f04599Evan Hunt $(ELFEDIT) -e "dyn:runpath $(USRLIBDIR)" \
6fa84a3e255ef9e6233f0a8d134fc6d273f04599Evan Hunt $(PROTOUSRLIBDIR)/libgmpxx.so.4.1.2 ; \
6fa84a3e255ef9e6233f0a8d134fc6d273f04599Evan Hunt $(ELFEDIT) -e "dyn:runpath $(USRLIBDIR64)" \
6fa84a3e255ef9e6233f0a8d134fc6d273f04599Evan Hunt $(PROTOUSRLIBDIR64)/libgmpxx.so.4.1.2 ; \
6fa84a3e255ef9e6233f0a8d134fc6d273f04599Evan Hunt $(ELFEDIT) -e "dyn:rpath $(USRLIBDIR)" \
6fa84a3e255ef9e6233f0a8d134fc6d273f04599Evan Hunt $(PROTOUSRLIBDIR)/libgmpxx.so.4.1.2 ; \
6fa84a3e255ef9e6233f0a8d134fc6d273f04599Evan Hunt $(ELFEDIT) -e "dyn:rpath $(USRLIBDIR64)" \
6fa84a3e255ef9e6233f0a8d134fc6d273f04599Evan Hunt $(PROTOUSRLIBDIR64)/libgmpxx.so.4.1.2 ; \
6fa84a3e255ef9e6233f0a8d134fc6d273f04599Evan Hunt $(GSED) -e "s/MACH64/$(MACH64)/g" \
2a80bc01530013293016172b1dcc1d12471ccf33Mark Andrews $(COMPONENT_DIR)/Solaris/libgmp-64.pc > $(COMPONENT_DIR)/libgmp.pc ; \
6fa84a3e255ef9e6233f0a8d134fc6d273f04599Evan Hunt $(GSED) -e "s/MACH64/$(MACH64)/g" \
6fa84a3e255ef9e6233f0a8d134fc6d273f04599Evan Hunt $(COMPONENT_DIR)/Solaris/libgmpxx-64.pc > \
6fa84a3e255ef9e6233f0a8d134fc6d273f04599Evan Hunt $(COMPONENT_DIR)/libgmpxx.pc ; \
6fa84a3e255ef9e6233f0a8d134fc6d273f04599Evan Hunt $(MV) $(PROTOUSRINCLUDEDIR)/gmp.h $(PROTOUSRINCLUDEDIR)/gmp/ ; \
6fa84a3e255ef9e6233f0a8d134fc6d273f04599Evan Hunt $(MV) $(PROTOUSRINCLUDEDIR)/mp.h $(PROTOUSRINCLUDEDIR)/gmp/ ; \
6fa84a3e255ef9e6233f0a8d134fc6d273f04599Evan Hunt $(INSTALL) -m 0644 $(COMPONENT_DIR)/Solaris/index.html \
6fa84a3e255ef9e6233f0a8d134fc6d273f04599Evan Hunt $(PROTOUSRSHAREHTMLDIR)/ ; \
6fa84a3e255ef9e6233f0a8d134fc6d273f04599Evan Hunt $(INSTALL) -m 0644 $(COMPONENT_DIR)/Solaris/libgmp.pc \
6fa84a3e255ef9e6233f0a8d134fc6d273f04599Evan Hunt $(PROTOPKGCONFIGDIR) ; \
6fa84a3e255ef9e6233f0a8d134fc6d273f04599Evan Hunt $(INSTALL) -m 0644 $(COMPONENT_DIR)/Solaris/libgmpxx.pc \
6fa84a3e255ef9e6233f0a8d134fc6d273f04599Evan Hunt $(PROTOPKGCONFIGDIR) ; \
6fa84a3e255ef9e6233f0a8d134fc6d273f04599Evan Hunt $(INSTALL) -m 0644 $(COMPONENT_DIR)/libgmp.pc \
6fa84a3e255ef9e6233f0a8d134fc6d273f04599Evan Hunt $(PROTOPKGCONFIGDIR64) ; \
6fa84a3e255ef9e6233f0a8d134fc6d273f04599Evan Hunt $(INSTALL) -m 0644 $(COMPONENT_DIR)/libgmpxx.pc \
6fa84a3e255ef9e6233f0a8d134fc6d273f04599Evan Hunt $(PROTOPKGCONFIGDIR64) ; \
6fa84a3e255ef9e6233f0a8d134fc6d273f04599Evan Hunt $(INSTALL) -m 0644 $(COMPONENT_DIR)/Solaris/libgmp.3 \
6fa84a3e255ef9e6233f0a8d134fc6d273f04599Evan Hunt $(PROTOUSRSHAREMAN3DIR)/ )
6fa84a3e255ef9e6233f0a8d134fc6d273f04599Evan Hunt
6fa84a3e255ef9e6233f0a8d134fc6d273f04599Evan Hunt# common targets
6fa84a3e255ef9e6233f0a8d134fc6d273f04599Evan Huntbuild: $(BUILD_32_and_64)
6fa84a3e255ef9e6233f0a8d134fc6d273f04599Evan Hunt
6fa84a3e255ef9e6233f0a8d134fc6d273f04599Evan Huntinstall: $(INSTALL_32_and_64)
6fa84a3e255ef9e6233f0a8d134fc6d273f04599Evan Hunt
6fa84a3e255ef9e6233f0a8d134fc6d273f04599Evan Hunttest: $(TEST_32_and_64)
6fa84a3e255ef9e6233f0a8d134fc6d273f04599Evan Hunt
6fa84a3e255ef9e6233f0a8d134fc6d273f04599Evan HuntBUILD_PKG_DEPENDENCIES = $(BUILD_TOOLS)
6fa84a3e255ef9e6233f0a8d134fc6d273f04599Evan Hunt
6fa84a3e255ef9e6233f0a8d134fc6d273f04599Evan Huntinclude ../../make-rules/depend.mk
6fa84a3e255ef9e6233f0a8d134fc6d273f04599Evan Hunt
6fa84a3e255ef9e6233f0a8d134fc6d273f04599Evan Hunt