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.
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.
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]
22 # Copyright (c) 2011, 2012, Oracle and/or its affiliates. All rights reserved.
23 # Copyright (c) 2016, Aurelien Larcher. All rights reserved.
26 include ..
/..
/..
/make-rules
/shared-macros.mk
28 PATH
=$(dir $(CC
)):/usr
/bin
:/usr
/gnu
/bin
31 COMPONENT_VERSION
= 6.1.2
33 COMPONENT_SUMMARY
= GNU Multiple Precision Bignum Library
34 COMPONENT_PROJECT_URL
= http
://gmplib.org
/
35 COMPONENT_FMRI
= library
/gmp
36 COMPONENT_CLASSIFICATION
=Development
/High Performance Computing
37 COMPONENT_SRC
= $(COMPONENT_NAME
)-$(COMPONENT_VERSION
)
38 COMPONENT_ARCHIVE
= $(COMPONENT_SRC
).
tar.bz2
39 COMPONENT_ARCHIVE_URL
= http
://ftp.gnu.org
/gnu
/gmp
/$(COMPONENT_ARCHIVE
)
40 COMPONENT_ARCHIVE_HASH
= \
41 sha256
:5275bb04f4863a13516b2f39392ac5e272f5e1bb8057b18aec1c9b79d73d8fb2
42 COMPONENT_LICENSE
= LGPLv3
,GPLv3
,FDLv1.3
44 include $(WS_MAKE_RULES
)/prep.mk
45 include $(WS_MAKE_RULES
)/configure.mk
46 include $(WS_MAKE_RULES
)/ips.mk
50 CLOBBER_PATHS
+= libgmp.
pc libgmpxx.
pc
52 CFLAGS
+= $(CPP_C99_EXTENDED_MATH
)
54 CFLAGS
+= -fexceptions
55 CPPFLAGS
+= $(CPP_POSIX
) $(CPP_LARGEFILES
)
56 LDFLAGS
+= $(LD_Z_REDLOCSYM
) $(LD_Z_RESCAN_NOW
)
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
))
68 CONFIGURE_ENV
+= CC
="$(CC)"
69 CONFIGURE_ENV
+= CXX
="$(CXX)"
70 CONFIGURE_ENV
+= CFLAGS
="$(CFLAGS)"
71 CONFIGURE_ENV
+= CPPFLAGS
="$(CPPFLAGS)"
72 CONFIGURE_ENV
+= CXXFLAGS
="$(CC_BITS) $(CXXFLAGS)"
73 CONFIGURE_ENV
+= LD
="$(CC) $(CFLAGS) $(LDFLAGS)"
74 CONFIGURE_ENV
+= LDFLAGS
="$(LDFLAGS)"
75 CONFIGURE_ENV
+= CXXLD
="$(CXX) $(CC_BITS) $(CXXFLAGS) $(LDFLAGS)"
76 CONFIGURE_ENV
+= CPP
="$(CC) $(CPPFLAGS) $(CFLAGS) -E"
77 CONFIGURE_ENV
+= CPP_FOR_BUILD
="$(CC) $(CPPFLAGS) $(CFLAGS) -E"
78 CONFIGURE_ENV
+= CXXCPP
="$(CXX) $(CC_BITS) $(CPPFLAGS) $(CXXFLAGS) -E"
79 CONFIGURE_ENV
+= INSTALL
="$(INSTALL)"
80 CONFIGURE_ENV
+= CC_FOR_BUILD
="$(CC) $(CPPFLAGS) $(CFLAGS)"
81 CONFIGURE_ENV
+= M4
="$(GM4)"
82 CONFIGURE_ENV
+= ABI
="$(BITS)"
83 CONFIGURE_ENV
+= "MPN_PATH=$(MPN_$(BITS))"
85 CONFIGURE_OPTIONS
+= --includedir=/usr
/include/gmp
86 CONFIGURE_OPTIONS
+= --localstatedir
=/var
87 CONFIGURE_OPTIONS
+= --enable-shared
88 CONFIGURE_OPTIONS
+= --disable-static
89 CONFIGURE_OPTIONS
+= --disable-libtool-lock
90 CONFIGURE_OPTIONS
+= --disable-alloca
91 CONFIGURE_OPTIONS
+= --enable-cxx
92 CONFIGURE_OPTIONS
+= --enable-fft
93 CONFIGURE_OPTIONS
+= --disable-fat
94 CONFIGURE_OPTIONS
+= --with-pic
96 PROTOUSRSHAREINFODIR
= $(PROTOUSRSHAREDIR
)/info
97 PROTOUSRSHAREHTMLDIR
= $(PROTOUSRSHAREDIR
)/doc
/gmp
/html
98 PROTOUSRSHAREMAN3DIR
= $(PROTOUSRSHAREDIR
)/man
/man3
99 PROTOUSRINCLUDEDIR
= $(PROTOUSRDIR
)/include
100 PROTOPKGCONFIGDIR
= $(PROTOUSRLIBDIR
)/pkgconfig
101 PROTOPKGCONFIGDIR64
= $(PROTOUSRLIBDIR64
)/pkgconfig
105 COMPONENT_POST_INSTALL_ACTION
= \
106 ( $(MKDIR
) $(PROTOUSRSHAREHTMLDIR
) ; \
107 $(MKDIR
) $(PROTOUSRSHAREMAN3DIR
) ; \
108 $(MKDIR
) $(PROTOPKGCONFIGDIR
) ; \
109 $(MKDIR
) $(PROTOPKGCONFIGDIR64
) ; \
110 $(GSED
) -e
"s/MACH64/$(MACH64)/g" \
111 $(COMPONENT_DIR
)/Solaris
/libgmp-64.
pc > $(COMPONENT_DIR
)/libgmp.
pc ; \
112 $(GSED
) -e
"s/MACH64/$(MACH64)/g" \
113 $(COMPONENT_DIR
)/Solaris
/libgmpxx-64.
pc > \
114 $(COMPONENT_DIR
)/libgmpxx.
pc ; \
115 $(MV
) $(PROTOUSRINCLUDEDIR
)/gmp.h
$(PROTOUSRINCLUDEDIR
)/gmp
/ ; \
116 $(MV
) $(PROTOUSRINCLUDEDIR
)/mp.h
$(PROTOUSRINCLUDEDIR
)/gmp
/ ; \
117 $(INSTALL
) -m
0644 $(COMPONENT_DIR
)/Solaris
/libgmp.
pc \
118 $(PROTOPKGCONFIGDIR
) ; \
119 $(INSTALL
) -m
0644 $(COMPONENT_DIR
)/Solaris
/libgmpxx.
pc \
120 $(PROTOPKGCONFIGDIR
) ; \
121 $(INSTALL
) -m
0644 $(COMPONENT_DIR
)/libgmp.
pc \
122 $(PROTOPKGCONFIGDIR64
) ; \
123 $(INSTALL
) -m
0644 $(COMPONENT_DIR
)/libgmpxx.
pc \
124 $(PROTOPKGCONFIGDIR64
) ; \
125 $(INSTALL
) -m
0644 $(COMPONENT_DIR
)/Solaris
/libgmp
.3 \
126 $(PROTOUSRSHAREMAN3DIR
)/ )
128 ENV
+= -i AUTOMAKE_VERSION
=$(AUTOMAKE_VERSION
) AUTOCONF_VERSION
=$(AUTOCONF_VERSION
)
129 $(INSTALL_32
): $(INSTALL_64
)
131 build
: $(BUILD_32_and_64
)
133 install: $(INSTALL_32_and_64
)
135 test: $(TEST_32_and_64
)
137 REQUIRED_PACKAGES
+= system
/library
138 REQUIRED_PACKAGES
+= system
/library
/g
++-6-runtime
139 REQUIRED_PACKAGES
+= system
/library
/gcc-6-runtime