| 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 | |
|---|
| 4 | PortSystem 1.0 |
|---|
| 5 | PortGroup muniversal 1.0 |
|---|
| 6 | |
|---|
| 7 | name gmp |
|---|
| 8 | version 4.3.1 |
|---|
| 9 | revision 1 |
|---|
| 10 | categories devel math |
|---|
| 11 | maintainers mcalhoun openmaintainer |
|---|
| 12 | platforms darwin |
|---|
| 13 | description GNU multiple precision arithmetic library |
|---|
| 14 | long_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 | |
|---|
| 25 | homepage http://gmplib.org/ |
|---|
| 26 | master_sites gnu |
|---|
| 27 | |
|---|
| 28 | checksums md5 26cec15a90885042dd4a15c4003b08ae \ |
|---|
| 29 | sha1 acbd1edc61230b1457e9742136994110e4f381b2 \ |
|---|
| 30 | rmd160 f325d809dde1f87816eea3697bcfe00f3ec8f10d |
|---|
| 31 | |
|---|
| 32 | use_bzip2 yes |
|---|
| 33 | use_parallel_build yes |
|---|
| 34 | |
|---|
| 35 | # See http://trac.macports.org/ticket/16634 |
|---|
| 36 | patchfiles patch-gmp-h.in.diff |
|---|
| 37 | |
|---|
| 38 | configure.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. |
|---|
| 43 | pre-configure { |
|---|
| 44 | # Set in pre-configure so any universal flags are removed as well. |
|---|
| 45 | configure.cflags |
|---|
| 46 | configure.cxxflags |
|---|
| 47 | } |
|---|
| 48 | configure.pipe no |
|---|
| 49 | |
|---|
| 50 | # Since CFLAGS and CXXFLAGS must be empty, append -arch ... to CC and CXX. |
|---|
| 51 | merger_arch_compiler yes |
|---|
| 52 | |
|---|
| 53 | test.run yes |
|---|
| 54 | test.cmd make |
|---|
| 55 | test.target check |
|---|
| 56 | |
|---|
| 57 | if {![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 | |
|---|
| 96 | platform powerpc { |
|---|
| 97 | # See http://trac.macports.org/ticket/9053 |
|---|
| 98 | patchfiles-append patch-config.guess.diff |
|---|
| 99 | } |
|---|