Ticket #20985: gmp-Portfile

File gmp-Portfile, 3.4 KB (added by informatimago (Pascal J. Bourguignon), 15 years ago)

The devel/gmp/Portfile I have (it's version 4.3.1 release 1)

Line 
1# -*- coding: utf-8; mode: tcl; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- vim:fenc=utf-8:ft=tcl:et:sw=4:ts=4:sts=4
2# $Id: Portfile 54734 2009-08-01 11:56:18Z mcalhoun@macports.org $
3
4PortSystem 1.0
5PortGroup  muniversal  1.0
6
7name            gmp
8version         4.3.1
9revision        1
10categories      devel math
11maintainers     mcalhoun openmaintainer
12platforms       darwin
13description     GNU multiple precision arithmetic library
14long_description \
15    GNU MP is a library for arbitrary precision arithmetic, operating on\
16    signed integers, rational numbers, and floating point numbers. It   \
17    has a rich set of functions, and the functions have a regular       \
18    interface. GNU MP is designed to be as fast as possible, both for   \
19    small operands and for huge operands. The speed is achieved by using\
20    fullwords as the basic arithmetic type, by using fast algorithms, by\
21    carefully optimized assembly code for the most common inner loops   \
22    for a lots of CPUs, and by a general emphasis on speed (instead of  \
23    simplicity or elegance).
24
25homepage        http://gmplib.org/
26master_sites    gnu
27
28checksums       md5     26cec15a90885042dd4a15c4003b08ae \
29                sha1    acbd1edc61230b1457e9742136994110e4f381b2 \
30                rmd160  f325d809dde1f87816eea3697bcfe00f3ec8f10d
31
32use_bzip2       yes
33use_parallel_build yes
34
35# See http://trac.macports.org/ticket/16634
36patchfiles      patch-gmp-h.in.diff
37
38configure.args  --infodir=${prefix}/share/info \
39                --enable-cxx
40
41# if CFLAGS and CXXFLAGS are undefined, configure script tries to build fastest library for build machine.
42# On PowerPC machines, CFLAGS must be empty to get -force_cpusubtype_ALL.
43pre-configure {
44    # Set in pre-configure so any universal flags are removed as well.
45    configure.cflags
46    configure.cxxflags
47}
48configure.pipe  no
49
50# Since CFLAGS and CXXFLAGS must be empty, append -arch ... to CC and CXX.
51merger_arch_compiler yes
52
53test.run        yes
54test.cmd        make
55test.target     check
56
57if {![variant_isset universal]} {
58    if {[info exists build_arch] && ${build_arch} == "x86_64"} {
59        configure.env   ABI=64
60    } else {
61        configure.env   ABI=32
62    }
63} else {
64    # Keep configure.cflags and configure.cxxflags empty.
65    set merger_arch_flag no
66
67    array set merger_configure_env {
68        ppc     ABI=32
69        i386    ABI=32
70        ppc64   ABI=mode64
71        x86_64  ABI=64
72    }
73
74    # universal_archs_to_use might not be set before pre-fetch.
75    pre-destroot {
76        global merger_dont_diff merger_configure_env
77
78        # PortGroup muniversal has difficulty merging three files.
79        if  { [llength ${universal_archs_to_use}] == 3 } {
80            set merger_dont_diff "${prefix}/include/gmp.h"
81        }
82    }
83
84    # For cross-compiling, set C compiler and pre-precessor.
85    if { ${os.arch}=="i386" } {
86        if { ${os.major} >= 10 } {
87            lappend merger_configure_env(ppc)  CC_FOR_BUILD=${configure.cc} CPP_FOR_BUILD=${configure.cpp}
88        }
89        lappend merger_configure_env(ppc64)    CC_FOR_BUILD=${configure.cc} CPP_FOR_BUILD=${configure.cpp}
90    } else {
91        lappend merger_configure_env(i386)     CC_FOR_BUILD=${configure.cc} CPP_FOR_BUILD=${configure.cpp}
92        lappend merger_configure_env(x86_64)   CC_FOR_BUILD=${configure.cc} CPP_FOR_BUILD=${configure.cpp}
93    }
94}
95
96platform powerpc {
97    # See http://trac.macports.org/ticket/9053
98    patchfiles-append  patch-config.guess.diff
99}