Aurelien Larcher
2018-01-20 2136604c82fa97645ec6488d4a395fdaebb7eba4
commit | author | age
614c6a 1 # CDDL HEADER START
ST 2 #
3 # The contents of this file are subject to the terms of the
4 # Common Development and Distribution License (the "License").
5 # You may not use this file except in compliance with the License.
6 #
7 # You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
8 # or http://www.opensolaris.org/os/licensing.
9 # See the License for the specific language governing permissions
10 # and limitations under the License.
11 #
12 # When distributing Covered Code, include this CDDL HEADER in each
13 # file and include the License file at usr/src/OPENSOLARIS.LICENSE.
14 # If applicable, add the following below this CDDL HEADER, with the
15 # fields enclosed by brackets "[]" replaced with your own identifying
16 # information: Portions Copyright [yyyy] [name of copyright owner]
17 #
18 # CDDL HEADER END
19 #
20
21 #
7999b2 22 # Copyright (c) 2011, 2012, Oracle and/or its affiliates. All rights reserved.
a1070d 23 # Copyright (c) 2016, Aurelien Larcher. All rights reserved.
614c6a 24 #
ST 25
a1070d 26 include ../../../make-rules/shared-macros.mk
614c6a 27
ST 28 PATH=$(dir $(CC)):/usr/bin:/usr/gnu/bin
29
a1070d 30 COMPONENT_NAME=                    gmp
AL 31 COMPONENT_VERSION=            6.1.2
01e4d6 32 COMPONENT_REVISION=            1
a1070d 33 COMPONENT_SUMMARY=            GNU Multiple Precision Bignum Library
60e6e0 34 COMPONENT_PROJECT_URL=    http://gmplib.org/
a1070d 35 COMPONENT_FMRI=                    library/gmp    
AL 36 COMPONENT_CLASSIFICATION=Development/High Performance Computing
37 COMPONENT_SRC=          $(COMPONENT_NAME)-$(COMPONENT_VERSION)
d24e2d 38 COMPONENT_ARCHIVE=      $(COMPONENT_SRC).tar.bz2
614c6a 39 COMPONENT_ARCHIVE_URL=  http://ftp.gnu.org/gnu/gmp/$(COMPONENT_ARCHIVE)
a1070d 40 COMPONENT_ARCHIVE_HASH= \
AL 41   sha256:5275bb04f4863a13516b2f39392ac5e272f5e1bb8057b18aec1c9b79d73d8fb2
42 COMPONENT_LICENSE=            LGPLv3,GPLv3,FDLv1.3
614c6a 43
a1070d 44 include $(WS_MAKE_RULES)/prep.mk
AL 45 include $(WS_MAKE_RULES)/configure.mk
46 include $(WS_MAKE_RULES)/ips.mk
614c6a 47
ST 48 PATCH_LEVEL = 0
49
7999b2 50 CLOBBER_PATHS += libgmp.pc libgmpxx.pc
MS 51
d04af1 52 CFLAGS += $(CPP_C99_EXTENDED_MATH)
d24e2d 53 CFLAGS += -std=c99 
AP 54 CFLAGS += -fexceptions
614c6a 55 CPPFLAGS += $(CPP_POSIX) $(CPP_LARGEFILES)
ST 56 LDFLAGS += $(LD_Z_REDLOCSYM) $(LD_Z_RESCAN_NOW)
57
58 # assembler detection for GNU MP and GNU MPFR is done via MPN_PATH
59 # at ./configure time. GNU MPFR wants to know GNU MP's MPN_PATH.
60 MPN32_i386 = x86/pentium x86 generic
61 MPN64_i386 = x86_64/pentium4 x86_64 generic
62 MPN32_sparc = sparc32/v9 sparc32 generic
63 MPN64_sparc = sparc64 generic
64 MPN_32 = $(MPN32_$(MACH))
65 MPN_64 = $(MPN64_$(MACH))
66 GM4 = /usr/bin/gm4
67 GSED = /usr/bin/gsed
68 # libgmpxx.so.4 always gets built with unnecessary paths in RUNPATH/RPATH
69 ELFEDIT = /usr/bin/elfedit
70
71 CONFIGURE_ENV += CC="$(CC)"
72 CONFIGURE_ENV += CXX="$(CXX)"
73 CONFIGURE_ENV += CFLAGS="$(CFLAGS)"
74 CONFIGURE_ENV += CPPFLAGS="$(CPPFLAGS)"
75 CONFIGURE_ENV += CXXFLAGS="$(CC_BITS) $(CXXFLAGS)"
76 CONFIGURE_ENV += LD="$(CC) $(CFLAGS) $(LDFLAGS)"
77 CONFIGURE_ENV += LDFLAGS="$(LDFLAGS)"
78 CONFIGURE_ENV += CXXLD="$(CXX) $(CC_BITS) $(CXXFLAGS) $(LDFLAGS)"
79 CONFIGURE_ENV += CPP="$(CC) $(CPPFLAGS) $(CFLAGS) -E"
80 CONFIGURE_ENV += CPP_FOR_BUILD="$(CC) $(CPPFLAGS) $(CFLAGS) -E"
81 CONFIGURE_ENV += CXXCPP="$(CXX) $(CC_BITS) $(CPPFLAGS) $(CXXFLAGS) -E"
82 CONFIGURE_ENV += INSTALL="$(INSTALL)"
83 CONFIGURE_ENV += CC_FOR_BUILD="$(CC) $(CPPFLAGS) $(CFLAGS)"
84 CONFIGURE_ENV += M4="$(GM4)"
85 CONFIGURE_ENV += SED="$(GSED)"
86 CONFIGURE_ENV += ABI="$(BITS)"
87 CONFIGURE_ENV += "MPN_PATH=$(MPN_$(BITS))"
88
89 CONFIGURE_OPTIONS += --includedir=/usr/include/gmp
90 CONFIGURE_OPTIONS += --localstatedir=/var
91 CONFIGURE_OPTIONS += --enable-shared
92 CONFIGURE_OPTIONS += --disable-static
93 CONFIGURE_OPTIONS += --disable-libtool-lock
94 CONFIGURE_OPTIONS += --disable-alloca
95 CONFIGURE_OPTIONS += --enable-cxx
96 CONFIGURE_OPTIONS += --enable-fft
97 CONFIGURE_OPTIONS += --disable-fat
98 CONFIGURE_OPTIONS += --with-pic
99
100 PROTOUSRSHAREINFODIR = $(PROTOUSRSHAREDIR)/info
101 PROTOUSRSHAREHTMLDIR = $(PROTOUSRSHAREDIR)/doc/gmp/html
102 PROTOUSRSHAREMAN3DIR = $(PROTOUSRSHAREDIR)/man/man3
103 PROTOUSRINCLUDEDIR = $(PROTOUSRDIR)/include
104 PROTOPKGCONFIGDIR = $(PROTOUSRLIBDIR)/pkgconfig
105 PROTOPKGCONFIGDIR64 = $(PROTOUSRLIBDIR64)/pkgconfig
106
a1070d 107 GMP_SOVERSION=4.5.2
AL 108
614c6a 109 COMPONENT_POST_INSTALL_ACTION = \
ST 110     ( $(MKDIR) $(PROTOUSRSHAREHTMLDIR) ; \
111       $(MKDIR) $(PROTOUSRSHAREMAN3DIR) ; \
112       $(MKDIR) $(PROTOPKGCONFIGDIR) ; \
113       $(MKDIR) $(PROTOPKGCONFIGDIR64) ; \
114       $(GSED) -e "s/MACH64/$(MACH64)/g" \
a1070d 115                     $(COMPONENT_DIR)/Solaris/libgmp-64.pc > $(COMPONENT_DIR)/libgmp.pc ; \
614c6a 116       $(GSED) -e "s/MACH64/$(MACH64)/g" \
a1070d 117                     $(COMPONENT_DIR)/Solaris/libgmpxx-64.pc > \
AL 118                             $(COMPONENT_DIR)/libgmpxx.pc ; \
614c6a 119       $(MV) $(PROTOUSRINCLUDEDIR)/gmp.h $(PROTOUSRINCLUDEDIR)/gmp/ ; \
ST 120       $(MV) $(PROTOUSRINCLUDEDIR)/mp.h $(PROTOUSRINCLUDEDIR)/gmp/ ; \
121       $(INSTALL) -m 0644 $(COMPONENT_DIR)/Solaris/libgmp.pc \
a1070d 122                     $(PROTOPKGCONFIGDIR) ; \
614c6a 123       $(INSTALL) -m 0644 $(COMPONENT_DIR)/Solaris/libgmpxx.pc \
a1070d 124                     $(PROTOPKGCONFIGDIR) ; \
614c6a 125       $(INSTALL) -m 0644 $(COMPONENT_DIR)/libgmp.pc \
a1070d 126                     $(PROTOPKGCONFIGDIR64) ; \
614c6a 127       $(INSTALL) -m 0644 $(COMPONENT_DIR)/libgmpxx.pc \
a1070d 128                     $(PROTOPKGCONFIGDIR64) ; \
614c6a 129       $(INSTALL) -m 0644 $(COMPONENT_DIR)/Solaris/libgmp.3 \
a1070d 130                     $(PROTOUSRSHAREMAN3DIR)/ )
614c6a 131
a1070d 132 ENV += -i
AL 133
614c6a 134 build: $(BUILD_32_and_64)
ST 135
136 install: $(INSTALL_32_and_64)
137
138 test: $(TEST_32_and_64)
139
a1070d 140 REQUIRED_PACKAGES += system/library
AL 141 REQUIRED_PACKAGES += system/library/g++-4-runtime
213660 142 REQUIRED_PACKAGES += system/library/gcc-6-runtime