Changeset 47780


Ignore:
Timestamp:
Mar 6, 2009, 2:54:47 AM (10 years ago)
Author:
mcalhoun@…
Message:

gmp: Allow configure script to select fastest possible build options.
Allow cross-compiling.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/dports/devel/gmp/Portfile

    r46485 r47780  
    77name            gmp
    88version         4.2.4
    9 revision        1
     9revision        2
    1010categories      devel math
    1111maintainers     mcalhoun openmaintainer
     
    3333use_parallel_build yes
    3434
    35 if {![variant_isset universal]} {
    36     configure.env   ABI=32
    37 }
    38 
    3935configure.args  --infodir=${prefix}/share/info \
    4036                --enable-cxx
     37
     38# if CFLAGS and CXXFLAGS are undefined, configure script tries to build fastest library for build machine.
     39pre-fetch {
     40    # Set in pre-fetch so any universal flags are removed as well.
     41    configure.cflags
     42    configure.cxxflags
     43}
    4144
    4245test.run        yes
     
    4447test.target     check
    4548
    46 platform powerpc {
    47     if {![variant_isset universal]} {
    48         configure.cflags-append -force_cpusubtype_ALL
     49set machine [exec "/usr/bin/machine"]
     50if { ${machine}=="ppc970" } {
     51    # Use special 32-bit mode for G5 processors.
     52    # In http://gmplib.org/manual/ABI-and-ISA.html, mode32 is said to be faster.
     53    set abi32  mode32
     54} else {
     55    set abi32  32
     56}
     57
     58if {![variant_isset universal]} {
     59    configure.env   ABI=${abi32}
     60} else {
     61    # Keep configure.cflags and configure.cxxflags empty.
     62    set merger_arch_flag no
     63
     64    array set merger_configure_env {
     65        i386    ABI=32
     66        ppc64   ABI=mode64
     67        x86_64  ABI=64
     68    }
     69    set merger_configure_env(ppc) ABI=${abi32}
     70
     71    # universal_archs_to_use might not be set before pre-fetch.
     72    pre-fetch {
     73        global merger_dont_diff merger_configure_env
     74
     75        # if building on a G5, merge might not work.
     76        if  { [llength ${universal_archs_to_use}]>2 } {
     77            set merger_dont_diff "${prefix}/include/gmp.h"
     78        }
     79    }
     80
     81    # For cross-compiling, set C compiler and pre-precessor.
     82    if { ${os.arch}=="i386" } {
     83        if { ${os.major} >= 10 } {
     84            lappend merger_configure_env(ppc)  CC_FOR_BUILD=${configure.cc} CPP_FOR_BUILD=${configure.cpp}
     85        }
     86        lappend merger_configure_env(ppc64)    CC_FOR_BUILD=${configure.cc} CPP_FOR_BUILD=${configure.cpp}
     87    } else {
     88        lappend merger_configure_env(i386)     CC_FOR_BUILD=${configure.cc} CPP_FOR_BUILD=${configure.cpp}
     89        lappend merger_configure_env(x86_64)   CC_FOR_BUILD=${configure.cc} CPP_FOR_BUILD=${configure.cpp}
    4990    }
    5091}
    51 
    52 set merger_must_run_binaries yes
    53 set merger_no_3_archs yes
    54 
    55 array set merger_configure_env {
    56     ppc     ABI=32
    57     i386    ABI=32
    58     ppc64   ABI=mode64
    59     x86_64  ABI=64
    60 }
    61 
    62 array set merger_configure_cflags {
    63     ppc     -force_cpusubtype_ALL
    64     ppc64   -force_cpusubtype_ALL
    65 }
Note: See TracChangeset for help on using the changeset viewer.