|
1 # CDDL HEADER START |
|
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 # |
|
22 # Copyright (c) 2011, Oracle and/or its affiliates. All rights reserved. |
|
23 # |
|
24 |
|
25 include ../../make-rules/shared-macros.mk |
|
26 |
|
27 PATH=$(dir $(CC)):/usr/bin:/usr/gnu/bin |
|
28 |
|
29 COMPONENT_NAME= mpfr |
|
30 COMPONENT_VERSION= 2.4.2 |
|
31 COMPONENT_SRC= $(COMPONENT_NAME)-$(COMPONENT_VERSION) |
|
32 COMPONENT_ARCHIVE= $(COMPONENT_SRC).tar.gz |
|
33 COMPONENT_ARCHIVE_HASH= sha1:d2c3504bd0318dda8332ca80523659e9779c367c |
|
34 COMPONENT_ARCHIVE_URL= http://www.mpfr.org/$(COMPONENT_NAME)-$(COMPONENT_VERSION)/$(COMPONENT_ARCHIVE) |
|
35 |
|
36 include ../../make-rules/prep.mk |
|
37 include ../../make-rules/configure.mk |
|
38 include ../../make-rules/ips.mk |
|
39 include ../../make-rules/lint-libraries.mk |
|
40 |
|
41 PATCH_LEVEL = 0 |
|
42 |
|
43 CFLAGS += -features=extinl,extensions |
|
44 CFLAGS += -xustr=ascii_utf16_ushort -xcsi |
|
45 # -xthreadvar=%all: allow thread-local storage via __thread |
|
46 # qualifier for all types of variables (global, static and dynamic) |
|
47 CFLAGS += -xthreadvar=%all -mt $(CPP_C99_EXTENDED_MATH) |
|
48 CFLAGS += $(studio_C99_ENABLE) $(CPP_XPG6MODE) |
|
49 CFLAGS += $(studio_PIC) |
|
50 LDFLAGS += $(LD_Z_REDLOCSYM) $(LD_Z_RESCAN_NOW) |
|
51 |
|
52 MPN32_i386 = x86/pentium x86 generic |
|
53 MPN64_i386 = x86_64/pentium4 x86_64 generic |
|
54 MPN32_sparc = sparc32/v9 sparc32 generic |
|
55 MPN64_sparc = sparc64 generic |
|
56 MPN32 = $(MPN32_$(MACH)) |
|
57 MPN64 = $(MPN64_$(MACH)) |
|
58 |
|
59 GMPINCDIR = /usr/include/gmp |
|
60 GMPLIBDIR_32 = /usr/lib |
|
61 GMPLIBDIR_64 = /usr/lib/$(MACH64) |
|
62 MPFRMULHIGH = 2048 |
|
63 |
|
64 GSED = /usr/bin/gsed |
|
65 |
|
66 CONFIGURE_ENV += CC="$(CC)" |
|
67 CONFIGURE_ENV += CFLAGS="$(CFLAGS)" |
|
68 CONFIGURE_ENV += CPPFLAGS="$(CPPFLAGS)" |
|
69 CONFIGURE_ENV += LD="$(CC) $(CFLAGS) $(LDFLAGS)" |
|
70 CONFIGURE_ENV += LDFLAGS="$(LDFLAGS)" |
|
71 CONFIGURE_ENV += CPP="$(CC) $(CPPFLAGS) $(CFLAGS) -E" |
|
72 CONFIGURE_ENV += INSTALL="$(INSTALL)" |
|
73 CONFIGURE_ENV += SED="$(GSED)" |
|
74 CONFIGURE_ENV += ABI="$(BITS)" |
|
75 CONFIGURE_ENV += "MPN_PATH=$(MPN_$(BITS))" |
|
76 |
|
77 CONFIGURE_OPTIONS += --includedir=/usr/include/mpfr |
|
78 CONFIGURE_OPTIONS += --localstatedir=/var |
|
79 CONFIGURE_OPTIONS += --enable-shared |
|
80 CONFIGURE_OPTIONS += --disable-static |
|
81 CONFIGURE_OPTIONS += --disable-libtool-lock |
|
82 CONFIGURE_OPTIONS += --enable-thread-safe |
|
83 CONFIGURE_OPTIONS += --enable-tests-timeout=0 |
|
84 CONFIGURE_OPTIONS += --with-gmp-include=$(GMPINCDIR) |
|
85 CONFIGURE_OPTIONS += --with-gmp-lib=$(GMPLIBDIR_$(BITS)) |
|
86 CONFIGURE_OPTIONS += --with-mulhigh-size=$(MPFRMULHIGH) |
|
87 CONFIGURE_OPTIONS += --with-pic |
|
88 |
|
89 LINT_FLAGS += -I/usr/include/gmp |
|
90 |
|
91 PROTOUSRSHAREINFODIR = $(PROTOUSRSHAREDIR)/info |
|
92 PROTOUSRSHAREHTMLDIR = $(PROTOUSRSHAREDIR)/doc/mpfr/html |
|
93 PROTOUSRSHAREMAN3DIR = $(PROTOUSRSHAREDIR)/man/man3 |
|
94 PROTOUSRINCLUDEDIR = $(PROTOUSRDIR)/include |
|
95 PROTOPKGCONFIGDIR = $(PROTOUSRLIBDIR)/pkgconfig |
|
96 PROTOPKGCONFIGDIR64 = $(PROTOUSRLIBDIR64)/pkgconfig |
|
97 |
|
98 COMPONENT_POST_INSTALL_ACTION = \ |
|
99 ( $(MKDIR) $(PROTOUSRSHAREHTMLDIR) ; \ |
|
100 $(MKDIR) $(PROTOUSRSHAREMAN3DIR) ; \ |
|
101 $(MKDIR) $(PROTOPKGCONFIGDIR) ; \ |
|
102 $(MKDIR) $(PROTOPKGCONFIGDIR64) ; \ |
|
103 $(GSED) -e "s^\#include <gmp.h>^\#include <gmp/gmp.h>^g" \ |
|
104 $(PROTOUSRINCLUDEDIR)/mpfr/mpfr.h > \ |
|
105 $(PROTOUSRINCLUDEDIR)/mpfr/mpfr.h.sed ; \ |
|
106 $(CP) -fp $(PROTOUSRINCLUDEDIR)/mpfr/mpfr.h.sed \ |
|
107 $(PROTOUSRINCLUDEDIR)/mpfr/mpfr.h ; \ |
|
108 $(RM) -f $(PROTOUSRINCLUDEDIR)/mpfr/mpfr.h.sed ; \ |
|
109 $(GSED) -e "s/MACH64/$(MACH64)/g" \ |
|
110 $(COMPONENT_DIR)/Solaris/libmpfr-64.pc > $(COMPONENT_DIR)/libmpfr.pc ; \ |
|
111 $(INSTALL) -m 0644 $(COMPONENT_DIR)/Solaris/index.html \ |
|
112 $(PROTOUSRSHAREHTMLDIR)/ ; \ |
|
113 $(INSTALL) -m 0644 $(COMPONENT_DIR)/Solaris/libmpfr.pc \ |
|
114 $(PROTOPKGCONFIGDIR) ; \ |
|
115 $(INSTALL) -m 0644 $(COMPONENT_DIR)/libmpfr.pc \ |
|
116 $(PROTOPKGCONFIGDIR64) ; \ |
|
117 $(INSTALL) -m 0644 $(COMPONENT_DIR)/Solaris/libmpfr.3 \ |
|
118 $(PROTOUSRSHAREMAN3DIR)/ ) |
|
119 |
|
120 # common targets |
|
121 build: $(BUILD_32_and_64) |
|
122 |
|
123 install: $(INSTALL_32_and_64) |
|
124 |
|
125 test: $(TEST_32_and_64) |
|
126 |
|
127 BUILD_PKG_DEPENDENCIES = $(BUILD_TOOLS) |
|
128 |
|
129 include ../../make-rules/depend.mk |
|
130 |