Makefile revision 618
c5c4113dfcabb1eed3d4bdf7609de5170027a794nw# CDDL HEADER START
c5c4113dfcabb1eed3d4bdf7609de5170027a794nw#
c5c4113dfcabb1eed3d4bdf7609de5170027a794nw# The contents of this file are subject to the terms of the
c5c4113dfcabb1eed3d4bdf7609de5170027a794nw# Common Development and Distribution License (the "License").
c5c4113dfcabb1eed3d4bdf7609de5170027a794nw# You may not use this file except in compliance with the License.
c5c4113dfcabb1eed3d4bdf7609de5170027a794nw#
c5c4113dfcabb1eed3d4bdf7609de5170027a794nw# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
c5c4113dfcabb1eed3d4bdf7609de5170027a794nw# or http://www.opensolaris.org/os/licensing.
c5c4113dfcabb1eed3d4bdf7609de5170027a794nw# See the License for the specific language governing permissions
c5c4113dfcabb1eed3d4bdf7609de5170027a794nw# and limitations under the License.
c5c4113dfcabb1eed3d4bdf7609de5170027a794nw#
c5c4113dfcabb1eed3d4bdf7609de5170027a794nw# When distributing Covered Code, include this CDDL HEADER in each
c5c4113dfcabb1eed3d4bdf7609de5170027a794nw# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
c5c4113dfcabb1eed3d4bdf7609de5170027a794nw# If applicable, add the following below this CDDL HEADER, with the
c5c4113dfcabb1eed3d4bdf7609de5170027a794nw# fields enclosed by brackets "[]" replaced with your own identifying
c5c4113dfcabb1eed3d4bdf7609de5170027a794nw# information: Portions Copyright [yyyy] [name of copyright owner]
c5c4113dfcabb1eed3d4bdf7609de5170027a794nw#
c5c4113dfcabb1eed3d4bdf7609de5170027a794nw# CDDL HEADER END
c5c4113dfcabb1eed3d4bdf7609de5170027a794nw#
c5c4113dfcabb1eed3d4bdf7609de5170027a794nw
c5c4113dfcabb1eed3d4bdf7609de5170027a794nw#
9b214d32697277d03ed2e5d98c4a7bfef16dcf4dJordan Brown# Copyright (c) 2011, Oracle and/or its affiliates. All rights reserved.
c5c4113dfcabb1eed3d4bdf7609de5170027a794nw#
c5c4113dfcabb1eed3d4bdf7609de5170027a794nw
c5c4113dfcabb1eed3d4bdf7609de5170027a794nwinclude ../../make-rules/shared-macros.mk
c5c4113dfcabb1eed3d4bdf7609de5170027a794nw
c5c4113dfcabb1eed3d4bdf7609de5170027a794nwPATH=$(dir $(CC)):/usr/bin:/usr/gnu/bin
c5c4113dfcabb1eed3d4bdf7609de5170027a794nw
c5c4113dfcabb1eed3d4bdf7609de5170027a794nwCOMPONENT_NAME= gmp
c5c4113dfcabb1eed3d4bdf7609de5170027a794nwCOMPONENT_VERSION= 4.3.2
c5c4113dfcabb1eed3d4bdf7609de5170027a794nwCOMPONENT_PROJECT_URL= http://gmplib.org/
c5c4113dfcabb1eed3d4bdf7609de5170027a794nwCOMPONENT_SRC= $(COMPONENT_NAME)-$(COMPONENT_VERSION)
c5c4113dfcabb1eed3d4bdf7609de5170027a794nwCOMPONENT_ARCHIVE= $(COMPONENT_SRC).tar.gz
c5c4113dfcabb1eed3d4bdf7609de5170027a794nwCOMPONENT_ARCHIVE_HASH= sha1:223c3c89ad98c62e5b8335a75ef37e8241f9bbb0
c5c4113dfcabb1eed3d4bdf7609de5170027a794nwCOMPONENT_ARCHIVE_URL= http://ftp.gnu.org/gnu/gmp/$(COMPONENT_ARCHIVE)
c5c4113dfcabb1eed3d4bdf7609de5170027a794nw
c5c4113dfcabb1eed3d4bdf7609de5170027a794nwinclude ../../make-rules/prep.mk
c5c4113dfcabb1eed3d4bdf7609de5170027a794nwinclude ../../make-rules/configure.mk
c5c4113dfcabb1eed3d4bdf7609de5170027a794nwinclude ../../make-rules/ips.mk
c5c4113dfcabb1eed3d4bdf7609de5170027a794nwinclude ../../make-rules/lint-libraries.mk
c5c4113dfcabb1eed3d4bdf7609de5170027a794nw
c5c4113dfcabb1eed3d4bdf7609de5170027a794nwPATCH_LEVEL = 0
c5c4113dfcabb1eed3d4bdf7609de5170027a794nw
c5c4113dfcabb1eed3d4bdf7609de5170027a794nwCFLAGS += -features=extinl,extensions
c5c4113dfcabb1eed3d4bdf7609de5170027a794nwCFLAGS += -xustr=ascii_utf16_ushort -xcsi
c5c4113dfcabb1eed3d4bdf7609de5170027a794nw# -xthreadvar=%all: allow thread-local storage via __thread
c5c4113dfcabb1eed3d4bdf7609de5170027a794nw# qualifier for all types of variables (global, static and dynamic)
c5c4113dfcabb1eed3d4bdf7609de5170027a794nwCFLAGS += -xthreadvar=%all $(CPP_C99_EXTENDED_MATH)
c5c4113dfcabb1eed3d4bdf7609de5170027a794nwCFLAGS += $(studio_C99_ENABLE) $(CPP_XPG6MODE)
c5c4113dfcabb1eed3d4bdf7609de5170027a794nwCFLAGS += $(studio_PIC)
c5c4113dfcabb1eed3d4bdf7609de5170027a794nwCXXFLAGS = -mt -features=anachronisms,except,rtti,export,extensions,nestedaccess,tmplife,tmplrefstatic
c5c4113dfcabb1eed3d4bdf7609de5170027a794nwCXXFLAGS += -instances=global -template=geninlinefuncs -verbose=template
c5c4113dfcabb1eed3d4bdf7609de5170027a794nwCXXFLAGS += -xbuiltin=%none -xinline=%auto -xlibmil
c5c4113dfcabb1eed3d4bdf7609de5170027a794nwCXXFLAGS += -xustr=ascii_utf16_ushort -xlibmopt
c5c4113dfcabb1eed3d4bdf7609de5170027a794nwCXXFLAGS += $(studio_cplusplus_C99_ENABLE) $(studio_PIC)
32ff2b3c67debc0dc66e07986e072d489ea88322Julian PullenCXXFLAGS += $(CPP_XPG5MODE)
c5c4113dfcabb1eed3d4bdf7609de5170027a794nw# -Qoption ccfe -features=zla: allow VLA/ZLA in C++ (like in C99)
32ff2b3c67debc0dc66e07986e072d489ea88322Julian PullenCXXFLAGS += -Qoption ccfe -features=zla
32ff2b3c67debc0dc66e07986e072d489ea88322Julian PullenCXXFLAGS += -xF=%none -xthreadvar=%all
32ff2b3c67debc0dc66e07986e072d489ea88322Julian PullenCPPFLAGS += $(CPP_POSIX) $(CPP_LARGEFILES)
32ff2b3c67debc0dc66e07986e072d489ea88322Julian PullenLDFLAGS += $(LD_Z_REDLOCSYM) $(LD_Z_RESCAN_NOW)
c5c4113dfcabb1eed3d4bdf7609de5170027a794nw
c5c4113dfcabb1eed3d4bdf7609de5170027a794nw# assembler detection for GNU MP and GNU MPFR is done via MPN_PATH
c5c4113dfcabb1eed3d4bdf7609de5170027a794nw# at ./configure time. GNU MPFR wants to know GNU MP's MPN_PATH.
c5c4113dfcabb1eed3d4bdf7609de5170027a794nwMPN32_i386 = x86/pentium x86 generic
c5c4113dfcabb1eed3d4bdf7609de5170027a794nwMPN64_i386 = x86_64/pentium4 x86_64 generic
c5c4113dfcabb1eed3d4bdf7609de5170027a794nwMPN32_sparc = sparc32/v9 sparc32 generic
c5c4113dfcabb1eed3d4bdf7609de5170027a794nwMPN64_sparc = sparc64 generic
c5c4113dfcabb1eed3d4bdf7609de5170027a794nwMPN_32 = $(MPN32_$(MACH))
c5c4113dfcabb1eed3d4bdf7609de5170027a794nwMPN_64 = $(MPN64_$(MACH))
c5c4113dfcabb1eed3d4bdf7609de5170027a794nwGM4 = /usr/bin/gm4
c5c4113dfcabb1eed3d4bdf7609de5170027a794nwGSED = /usr/bin/gsed
c5c4113dfcabb1eed3d4bdf7609de5170027a794nw# libgmpxx.so.4 always gets built with unnecessary paths in RUNPATH/RPATH
c5c4113dfcabb1eed3d4bdf7609de5170027a794nwELFEDIT = /usr/bin/elfedit
c5c4113dfcabb1eed3d4bdf7609de5170027a794nw
c5c4113dfcabb1eed3d4bdf7609de5170027a794nwCONFIGURE_ENV += CC="$(CC)"
c5c4113dfcabb1eed3d4bdf7609de5170027a794nwCONFIGURE_ENV += CXX="$(CXX)"
c5c4113dfcabb1eed3d4bdf7609de5170027a794nwCONFIGURE_ENV += CFLAGS="$(CFLAGS)"
c5c4113dfcabb1eed3d4bdf7609de5170027a794nwCONFIGURE_ENV += CPPFLAGS="$(CPPFLAGS)"
c5c4113dfcabb1eed3d4bdf7609de5170027a794nwCONFIGURE_ENV += CXXFLAGS="$(CC_BITS) $(CXXFLAGS)"
c5c4113dfcabb1eed3d4bdf7609de5170027a794nwCONFIGURE_ENV += LD="$(CC) $(CFLAGS) $(LDFLAGS)"
c5c4113dfcabb1eed3d4bdf7609de5170027a794nwCONFIGURE_ENV += LDFLAGS="$(LDFLAGS)"
c5c4113dfcabb1eed3d4bdf7609de5170027a794nwCONFIGURE_ENV += CXXLD="$(CXX) $(CC_BITS) $(CXXFLAGS) $(LDFLAGS)"
c5c4113dfcabb1eed3d4bdf7609de5170027a794nwCONFIGURE_ENV += CPP="$(CC) $(CPPFLAGS) $(CFLAGS) -E"
c5c4113dfcabb1eed3d4bdf7609de5170027a794nwCONFIGURE_ENV += CPP_FOR_BUILD="$(CC) $(CPPFLAGS) $(CFLAGS) -E"
c5c4113dfcabb1eed3d4bdf7609de5170027a794nwCONFIGURE_ENV += CXXCPP="$(CXX) $(CC_BITS) $(CPPFLAGS) $(CXXFLAGS) -E"
c5c4113dfcabb1eed3d4bdf7609de5170027a794nwCONFIGURE_ENV += INSTALL="$(INSTALL)"
c5c4113dfcabb1eed3d4bdf7609de5170027a794nwCONFIGURE_ENV += CC_FOR_BUILD="$(CC) $(CPPFLAGS) $(CFLAGS)"
c5c4113dfcabb1eed3d4bdf7609de5170027a794nwCONFIGURE_ENV += M4="$(GM4)"
c5c4113dfcabb1eed3d4bdf7609de5170027a794nwCONFIGURE_ENV += SED="$(GSED)"
c5c4113dfcabb1eed3d4bdf7609de5170027a794nwCONFIGURE_ENV += ABI="$(BITS)"
c5c4113dfcabb1eed3d4bdf7609de5170027a794nwCONFIGURE_ENV += "MPN_PATH=$(MPN_$(BITS))"
c5c4113dfcabb1eed3d4bdf7609de5170027a794nw
c5c4113dfcabb1eed3d4bdf7609de5170027a794nwCONFIGURE_OPTIONS += --includedir=/usr/include/gmp
c5c4113dfcabb1eed3d4bdf7609de5170027a794nwCONFIGURE_OPTIONS += --localstatedir=/var
CONFIGURE_OPTIONS += --enable-shared
CONFIGURE_OPTIONS += --disable-static
CONFIGURE_OPTIONS += --disable-libtool-lock
CONFIGURE_OPTIONS += --disable-alloca
CONFIGURE_OPTIONS += --enable-cxx
CONFIGURE_OPTIONS += --enable-fft
CONFIGURE_OPTIONS += --enable-mpbsd
CONFIGURE_OPTIONS += --disable-fat
CONFIGURE_OPTIONS += --with-pic
PROTOUSRSHAREINFODIR = $(PROTOUSRSHAREDIR)/info
PROTOUSRSHAREHTMLDIR = $(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)/ )
# 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