# -*- 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 # $Id: Portfile 150035 2016-07-09 00:54:54Z devans@macports.org $ PortSystem 1.0 PortGroup muniversal 1.0 name gmp version 6.1.1 categories devel math license LGPL-3+ maintainers mcalhoun openmaintainer platforms darwin description GNU multiple precision arithmetic library long_description \ GNU MP is a library for arbitrary precision arithmetic, operating on\ signed integers, rational numbers, and floating point numbers. It \ has a rich set of functions, and the functions have a regular \ interface. GNU MP is designed to be as fast as possible, both for \ small operands and for huge operands. The speed is achieved by using\ fullwords as the basic arithmetic type, by using fast algorithms, by\ carefully optimized assembly code for the most common inner loops \ for a lots of CPUs, and by a general emphasis on speed (instead of \ simplicity or elegance). homepage http://gmplib.org/ master_sites gnu checksums rmd160 833b1dea9d3ce993e63cb3c629ab792e1e7197bb \ sha256 a8109865f2893f1373b0a8ed5ff7429de8db696fc451b1036bd7bdf95bbeffd6 use_bzip2 yes use_parallel_build yes patchfiles \ patch-Makefile.in.diff configure.args --enable-cxx # Prevent precompiled binaries. # See #41614. # might not be needed if we decide to add: #default_variants +core2 archive_sites configure.universal_args-delete --disable-dependency-tracking # The gmp configure script looks for gawk, mawk, nawk, then awk last. # Search for /usr/bin/awk first. # nawk, at least, fails (see #43773). configure.env-append AWK=/usr/bin/awk # Clear all options that affect CFLAGS and CXXFLAGS, since the configure # script tries to build the fastest library for the build machine if # CFLAGS and CXXFLAGS are undefined. # # On PowerPC machines, CFLAGS must be empty to get -force_cpusubtype_ALL. # # Append all extra flags to compiler name, which is a far from ideal solution. # the following code must run BEFORE configure.cc is modified set configure_cc_save ${configure.cc} # # do not let configure set CC in gmp-h.in because we modify CC later and # we do not want these modifications to end up in the installed header file # ugly workaround for #49801 # for upstream discussion, see https://gmplib.org/list-archives/gmp-discuss/2015-November/thread.html#5910 post-patch { reinplace "s|\"@CC@\"|\"${configure_cc_save}\"|g" ${worksrcpath}/gmp-h.in } # Append the -stdlib flags to CXX, since we still want to select the C++ STL. set cxx_stdlibflags {} if {[string match *clang* ${configure.cxx}]} { configure.cxx-append -stdlib=${configure.cxx_stdlib} configure.cxx_stdlib } # See #43262 if {${configure.sdkroot} ne ""} { configure.cc-append -isysroot${configure.sdkroot} configure.cxx-append -isysroot${configure.sdkroot} configure.sdkroot } configure.cc_archflags configure.cxx_archflags configure.ld_archflags configure.cflags configure.cxxflags configure.pipe no test.run yes test.target check # see configure.ac for possible CPU values and what each does set processors {core2} foreach processor ${processors} { # only one processor variant can be used, so create a list of every other processor variant to conflict with set conflicts_list "" foreach processor_conflict ${processors} { if { ${processor_conflict} ne ${processor} } { lappend conflicts_list ${processor_conflict} } } # use eval to ensure a list of conflicts works properly eval "variant ${processor} conflicts ${conflicts_list} description {do not let ${name} determine CPU type; build for ${processor}} { }" } # if any of the processor variants are active, CPU is not auto-detected set auto_cpu true foreach processor ${processors} { if { [variant_isset ${processor}] } { configure.args-append --build=${processor}-apple-${os.platform}${os.version} set auto_cpu false } } # config.guess: "Print the host system CPU-VENDOR-OS." # config.guess calls configfsf.guess and then tries to improve the result # # prior to 5.0.2, configfsf.guess returned # i386-apple-darwinX.X.X or powerpc-apple-darwinX.X.X # even on 64-bit processors # if config.guess were unable to improve on the result # (e.g. a new unrecognized processor), then the configure script # used i386 or powerpc as the CPU type and a 64-bit build attempt # resulted in an error (see #28892) # as of 5.0.2, configfsf.guess can return # x86_64-apple-darwinX.X.X and powerpc64-apple-darwinX.X.X, which, # if not improved, would at least produce a (slow) 64-bit build # # up to 6.0.0a, all improved CPU types on x86 macs were of the form # core2 or corei* (coreisbr for Sandy Bridge, coreihwl for Haswell, etc.) # starting with 6.1.0, improved CPU types on x86 macs have less uniform # names (sandybridge for Sandy Bridge, haswell for Haswell, etc.) # # in an attempt to accommodate all situations, # test if the CPU was improved and warn if it was not # if { ${auto_cpu} } { pre-configure { set build_triplet [split [exec -ignorestderr /usr/bin/env CC=${configure.cc} ${worksrcpath}/config.guess] -] set build_cpu [lindex $build_triplet 0] if { ${build_cpu} eq "x86_64" || ${build_cpu} eq "i386" || ${build_cpu} eq "powerpc64" || ${build_cpu} eq "powerpc" } { ui_warn "No processor dependent assembly code being used. gmp might be slower." # version 5.0.2 should make the following unnecessary #configure.args-append --build=core2-[join [lrange $build_triplet 1 end] -] } } } if {![variant_isset universal]} { if {${build_arch} eq "x86_64"} { configure.env-append ABI=64 } elseif {${build_arch} eq "ppc64"} { configure.env-append ABI=mode64 } else { configure.env-append ABI=32 } } else { # Keep configure.cflags and configure.cxxflags empty. set merger_arch_flag no array set merger_configure_env { ppc ABI=32 i386 ABI=32 ppc64 ABI=mode64 x86_64 ABI=64 } # Since CFLAGS and CXXFLAGS must be empty, append -arch ... to CC and CXX. merger_arch_compiler yes # -arch i386 on causes the test suite to fail, so override muniversal_get_arch_flag in muniversal portgroup # Only append -arch ... to compiler if cross compiling. # i386 code is generated by setting ABI=32 proc muniversal_get_arch_flag {arch {fortran ""}} { global os.arch if {${os.arch} eq "i386" && (${arch} eq "i386" || ${arch} eq "x86_64")} { set archf "" } elseif {${os.arch} eq "powerpc" && (${arch} eq "ppc" && ${arch} eq "ppc64")} { set archf "" } else { set archf "-arch ${arch}" } return ${archf} } # universal_archs_to_use might not be set before pre-fetch. pre-destroot { global merger_dont_diff merger_configure_env # PortGroup muniversal has difficulty merging three files. if { [llength ${universal_archs_to_use}] == 3 } { set merger_dont_diff "${prefix}/include/gmp.h" } } # For cross-compiling, set C compiler and pre-processor. if {${os.arch} eq "i386"} { if { ${os.major} >= 10 } { lappend merger_configure_env(ppc) CC_FOR_BUILD=${configure.cc} CPP_FOR_BUILD=${configure.cpp} } lappend merger_configure_env(ppc64) CC_FOR_BUILD=${configure.cc} CPP_FOR_BUILD=${configure.cpp} } else { lappend merger_configure_env(i386) CC_FOR_BUILD=${configure.cc} CPP_FOR_BUILD=${configure.cpp} lappend merger_configure_env(x86_64) CC_FOR_BUILD=${configure.cc} CPP_FOR_BUILD=${configure.cpp} } } platform powerpc { # See #9053 patchfiles-append patch-config.guess.diff }