Makefile revision 1938
d6fa26d0adaec6c910115be34fe7a5a5f402c14fMark Andrews# CDDL HEADER START
ddccd5811feff696ba460dabfb666ce61040f545Andreas Gustafsson#
5347c0fcb04eaea19d9f39795646239f487c6207Tinderbox User# The contents of this file are subject to the terms of the
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein# Common Development and Distribution License (the "License").
5347c0fcb04eaea19d9f39795646239f487c6207Tinderbox User# You may not use this file except in compliance with the License.
5347c0fcb04eaea19d9f39795646239f487c6207Tinderbox User#
5347c0fcb04eaea19d9f39795646239f487c6207Tinderbox User# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
ddccd5811feff696ba460dabfb666ce61040f545Andreas Gustafsson# or http://www.opensolaris.org/os/licensing.
d6fa26d0adaec6c910115be34fe7a5a5f402c14fMark Andrews# See the License for the specific language governing permissions
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein# and limitations under the License.
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein#
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein# When distributing Covered Code, include this CDDL HEADER in each
fd2597f75693a2279fdf588bd40dfe2407c42028Tinderbox User# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein# If applicable, add the following below this CDDL HEADER, with the
fd2597f75693a2279fdf588bd40dfe2407c42028Tinderbox User# fields enclosed by brackets "[]" replaced with your own identifying
fd2597f75693a2279fdf588bd40dfe2407c42028Tinderbox User# information: Portions Copyright [yyyy] [name of copyright owner]
7911e6f9de303bca5a3d8b34f4330c8f7cecffaeTinderbox User#
7911e6f9de303bca5a3d8b34f4330c8f7cecffaeTinderbox User# CDDL HEADER END
7911e6f9de303bca5a3d8b34f4330c8f7cecffaeTinderbox User#
7911e6f9de303bca5a3d8b34f4330c8f7cecffaeTinderbox User
7911e6f9de303bca5a3d8b34f4330c8f7cecffaeTinderbox User#
7911e6f9de303bca5a3d8b34f4330c8f7cecffaeTinderbox User# Copyright (c) 2011, 2013, Oracle and/or its affiliates. All rights reserved.
7911e6f9de303bca5a3d8b34f4330c8f7cecffaeTinderbox User#
7911e6f9de303bca5a3d8b34f4330c8f7cecffaeTinderbox User
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austeininclude ../../make-rules/shared-macros.mk
7911e6f9de303bca5a3d8b34f4330c8f7cecffaeTinderbox User
7911e6f9de303bca5a3d8b34f4330c8f7cecffaeTinderbox UserPATH=$(dir $(CC)):/usr/bin:/usr/gnu/bin
7911e6f9de303bca5a3d8b34f4330c8f7cecffaeTinderbox User
7911e6f9de303bca5a3d8b34f4330c8f7cecffaeTinderbox UserCOMPONENT_NAME= gnump
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob AusteinCOMPONENT_VERSION= 4.3.2
7911e6f9de303bca5a3d8b34f4330c8f7cecffaeTinderbox UserCOMPONENT_PROJECT_URL= http://gmplib.org/
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob AusteinCOMPONENT_SRC_NAME= gmp
7911e6f9de303bca5a3d8b34f4330c8f7cecffaeTinderbox UserCOMPONENT_SRC= $(COMPONENT_SRC_NAME)-$(COMPONENT_VERSION)
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob AusteinCOMPONENT_ARCHIVE= $(COMPONENT_SRC).tar.gz
fd2597f75693a2279fdf588bd40dfe2407c42028Tinderbox UserCOMPONENT_ARCHIVE_HASH= \
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein sha256:7be3ad1641b99b17f6a8be6a976f1f954e997c41e919ad7e0c418fe848c13c97
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob AusteinCOMPONENT_ARCHIVE_URL= http://ftp.gnu.org/gnu/gmp/$(COMPONENT_ARCHIVE)
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob AusteinCOMPONENT_BUGDB= library/gnump
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein
2eeb74d1cf5355dd98f6d507a10086e16bb08c4bTinderbox Userinclude ../../make-rules/prep.mk
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austeininclude ../../make-rules/configure.mk
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austeininclude ../../make-rules/ips.mk
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austeininclude ../../make-rules/lint-libraries.mk
2eeb74d1cf5355dd98f6d507a10086e16bb08c4bTinderbox User
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob AusteinPATCH_LEVEL = 0
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob AusteinCLOBBER_PATHS += libgmp.pc libgmpxx.pc
2eeb74d1cf5355dd98f6d507a10086e16bb08c4bTinderbox User
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob AusteinCFLAGS += -features=extinl,extensions
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob AusteinCFLAGS += -xustr=ascii_utf16_ushort -xcsi
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein# -xthreadvar=%all: allow thread-local storage via __thread
2eeb74d1cf5355dd98f6d507a10086e16bb08c4bTinderbox User# qualifier for all types of variables (global, static and dynamic)
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob AusteinCFLAGS += -xthreadvar=%all $(CPP_C99_EXTENDED_MATH)
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob AusteinCFLAGS += $(studio_C99_ENABLE) $(CPP_XPG6MODE)
2eeb74d1cf5355dd98f6d507a10086e16bb08c4bTinderbox UserCFLAGS += $(studio_PIC)
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob AusteinCXXFLAGS = -mt -features=anachronisms,except,rtti,export,extensions,nestedaccess,tmplife,tmplrefstatic
7911e6f9de303bca5a3d8b34f4330c8f7cecffaeTinderbox UserCXXFLAGS += -instances=global -template=geninlinefuncs -verbose=template
7911e6f9de303bca5a3d8b34f4330c8f7cecffaeTinderbox UserCXXFLAGS += -xbuiltin=%none -xinline=%auto -xlibmil
7911e6f9de303bca5a3d8b34f4330c8f7cecffaeTinderbox UserCXXFLAGS += -xustr=ascii_utf16_ushort -xlibmopt
fd2597f75693a2279fdf588bd40dfe2407c42028Tinderbox UserCXXFLAGS += $(studio_cplusplus_C99_ENABLE) $(studio_PIC)
7911e6f9de303bca5a3d8b34f4330c8f7cecffaeTinderbox UserCXXFLAGS += $(CPP_XPG5MODE)
7911e6f9de303bca5a3d8b34f4330c8f7cecffaeTinderbox User# -Qoption ccfe -features=zla: allow VLA/ZLA in C++ (like in C99)
7911e6f9de303bca5a3d8b34f4330c8f7cecffaeTinderbox UserCXXFLAGS += -Qoption ccfe -features=zla
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob AusteinCXXFLAGS += -xF=%none -xthreadvar=%all
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob AusteinCPPFLAGS += $(CPP_POSIX) $(CPP_LARGEFILES)
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob AusteinLDFLAGS += $(LD_Z_REDLOCSYM) $(LD_Z_RESCAN_NOW)
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein# assembler detection for GNU MP and GNU MPFR is done via MPN_PATH
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein# at ./configure time. GNU MPFR wants to know GNU MP's MPN_PATH.
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob AusteinMPN32_i386 = x86/pentium x86 generic
7911e6f9de303bca5a3d8b34f4330c8f7cecffaeTinderbox UserMPN64_i386 = x86_64/pentium4 x86_64 generic
7911e6f9de303bca5a3d8b34f4330c8f7cecffaeTinderbox UserMPN32_sparc = sparc32/v9 sparc32 generic
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob AusteinMPN64_sparc = sparc64 generic
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob AusteinMPN_32 = $(MPN32_$(MACH))
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob AusteinMPN_64 = $(MPN64_$(MACH))
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob AusteinGM4 = /usr/bin/gm4
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob AusteinGSED = /usr/bin/gsed
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein# libgmpxx.so.4 always gets built with unnecessary paths in RUNPATH/RPATH
7911e6f9de303bca5a3d8b34f4330c8f7cecffaeTinderbox UserELFEDIT = /usr/bin/elfedit
7911e6f9de303bca5a3d8b34f4330c8f7cecffaeTinderbox User
7911e6f9de303bca5a3d8b34f4330c8f7cecffaeTinderbox UserCONFIGURE_ENV += CC="$(CC)"
fd2597f75693a2279fdf588bd40dfe2407c42028Tinderbox UserCONFIGURE_ENV += CXX="$(CXX)"
7911e6f9de303bca5a3d8b34f4330c8f7cecffaeTinderbox UserCONFIGURE_ENV += CFLAGS="$(CFLAGS)"
7911e6f9de303bca5a3d8b34f4330c8f7cecffaeTinderbox UserCONFIGURE_ENV += CPPFLAGS="$(CPPFLAGS)"
7911e6f9de303bca5a3d8b34f4330c8f7cecffaeTinderbox UserCONFIGURE_ENV += CXXFLAGS="$(CC_BITS) $(CXXFLAGS)"
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob AusteinCONFIGURE_ENV += LD="$(CC) $(CFLAGS) $(LDFLAGS)"
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob AusteinCONFIGURE_ENV += LDFLAGS="$(LDFLAGS)"
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob AusteinCONFIGURE_ENV += CXXLD="$(CXX) $(CC_BITS) $(CXXFLAGS) $(LDFLAGS)"
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob AusteinCONFIGURE_ENV += CPP="$(CC) $(CPPFLAGS) $(CFLAGS) -E"
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob AusteinCONFIGURE_ENV += CPP_FOR_BUILD="$(CC) $(CPPFLAGS) $(CFLAGS) -E"
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob AusteinCONFIGURE_ENV += CXXCPP="$(CXX) $(CC_BITS) $(CPPFLAGS) $(CXXFLAGS) -E"
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob AusteinCONFIGURE_ENV += INSTALL="$(INSTALL)"
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob AusteinCONFIGURE_ENV += CC_FOR_BUILD="$(CC) $(CPPFLAGS) $(CFLAGS)"
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob AusteinCONFIGURE_ENV += M4="$(GM4)"
7911e6f9de303bca5a3d8b34f4330c8f7cecffaeTinderbox UserCONFIGURE_ENV += SED="$(GSED)"
7911e6f9de303bca5a3d8b34f4330c8f7cecffaeTinderbox UserCONFIGURE_ENV += ABI="$(BITS)"
7911e6f9de303bca5a3d8b34f4330c8f7cecffaeTinderbox UserCONFIGURE_ENV += "MPN_PATH=$(MPN_$(BITS))"
fd2597f75693a2279fdf588bd40dfe2407c42028Tinderbox User
7911e6f9de303bca5a3d8b34f4330c8f7cecffaeTinderbox UserCONFIGURE_OPTIONS += --includedir=/usr/include/gmp
7911e6f9de303bca5a3d8b34f4330c8f7cecffaeTinderbox UserCONFIGURE_OPTIONS += --localstatedir=/var
7911e6f9de303bca5a3d8b34f4330c8f7cecffaeTinderbox UserCONFIGURE_OPTIONS += --enable-shared
7911e6f9de303bca5a3d8b34f4330c8f7cecffaeTinderbox UserCONFIGURE_OPTIONS += --disable-static
7911e6f9de303bca5a3d8b34f4330c8f7cecffaeTinderbox UserCONFIGURE_OPTIONS += --disable-libtool-lock
7911e6f9de303bca5a3d8b34f4330c8f7cecffaeTinderbox UserCONFIGURE_OPTIONS += --disable-alloca
7911e6f9de303bca5a3d8b34f4330c8f7cecffaeTinderbox UserCONFIGURE_OPTIONS += --enable-cxx
7911e6f9de303bca5a3d8b34f4330c8f7cecffaeTinderbox UserCONFIGURE_OPTIONS += --enable-fft
7911e6f9de303bca5a3d8b34f4330c8f7cecffaeTinderbox UserCONFIGURE_OPTIONS += --enable-mpbsd
7911e6f9de303bca5a3d8b34f4330c8f7cecffaeTinderbox UserCONFIGURE_OPTIONS += --disable-fat
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob AusteinCONFIGURE_OPTIONS += --with-pic
7911e6f9de303bca5a3d8b34f4330c8f7cecffaeTinderbox User
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob AusteinPROTOUSRSHAREINFODIR = $(PROTOUSRSHAREDIR)/info
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob AusteinPROTOUSRSHAREHTMLDIR = $(PROTOUSRSHAREDIR)/doc/gmp/html
PROTOUSRSHAREMAN3DIR = $(PROTOUSRSHAREDIR)/man/man3
PROTOUSRINCLUDEDIR = $(PROTOUSRDIR)/include
PROTOPKGCONFIGDIR = $(PROTOUSRLIBDIR)/pkgconfig
PROTOPKGCONFIGDIR64 = $(PROTOUSRLIBDIR64)/pkgconfig
COMPONENT_POST_INSTALL_ACTION = \
( $(MKDIR) $(PROTOUSRSHAREHTMLDIR) ; \
$(MKDIR) $(PROTOUSRSHAREMAN3DIR) ; \
$(MKDIR) $(PROTOPKGCONFIGDIR) ; \
$(MKDIR) $(PROTOPKGCONFIGDIR64) ; \
$(ELFEDIT) -e "dyn:runpath $(USRLIBDIR)" \
$(PROTOUSRLIBDIR)/libgmpxx.so.4.1.2 ; \
$(ELFEDIT) -e "dyn:runpath $(USRLIBDIR64)" \
$(PROTOUSRLIBDIR64)/libgmpxx.so.4.1.2 ; \
$(ELFEDIT) -e "dyn:rpath $(USRLIBDIR)" \
$(PROTOUSRLIBDIR)/libgmpxx.so.4.1.2 ; \
$(ELFEDIT) -e "dyn:rpath $(USRLIBDIR64)" \
$(PROTOUSRLIBDIR64)/libgmpxx.so.4.1.2 ; \
$(GSED) -e "s/MACH64/$(MACH64)/g" \
$(COMPONENT_DIR)/Solaris/libgmp-64.pc > $(COMPONENT_DIR)/libgmp.pc ; \
$(GSED) -e "s/MACH64/$(MACH64)/g" \
$(COMPONENT_DIR)/Solaris/libgmpxx-64.pc > \
$(COMPONENT_DIR)/libgmpxx.pc ; \
$(MV) $(PROTOUSRINCLUDEDIR)/gmp.h $(PROTOUSRINCLUDEDIR)/gmp/ ; \
$(MV) $(PROTOUSRINCLUDEDIR)/mp.h $(PROTOUSRINCLUDEDIR)/gmp/ ; \
$(INSTALL) -m 0644 $(COMPONENT_DIR)/Solaris/index.html \
$(PROTOUSRSHAREHTMLDIR)/ ; \
$(INSTALL) -m 0644 $(COMPONENT_DIR)/Solaris/libgmp.pc \
$(PROTOPKGCONFIGDIR) ; \
$(INSTALL) -m 0644 $(COMPONENT_DIR)/Solaris/libgmpxx.pc \
$(PROTOPKGCONFIGDIR) ; \
$(INSTALL) -m 0644 $(COMPONENT_DIR)/libgmp.pc \
$(PROTOPKGCONFIGDIR64) ; \
$(INSTALL) -m 0644 $(COMPONENT_DIR)/libgmpxx.pc \
$(PROTOPKGCONFIGDIR64) ; \
$(INSTALL) -m 0644 $(COMPONENT_DIR)/Solaris/libgmp.3 \
$(PROTOUSRSHAREMAN3DIR)/ )
ASLR_MODE = $(ASLR_NOT_APPLICABLE)
# common targets
build: $(BUILD_32_and_64)
install: $(INSTALL_32_and_64)
test: $(TEST_32_and_64)
BUILD_PKG_DEPENDENCIES = $(BUILD_TOOLS)
include ../../make-rules/depend.mk