Ticket #33297: oriToGmp504.patch

File oriToGmp504.patch, 6.1 KB (added by openwiki500@…, 13 years ago)

oriToGmp504.patch

  • Portfile

    diff -rupN gmp.ori/Portfile gmp/Portfile
    old new checksums md5 50c3edcb7c94 
    3333use_bzip2       yes
    3434use_parallel_build yes
    3535
    36 # See #16634
    37 patchfiles      patch-gmp-h.in.diff
    38 
    39 # Sandy Bridge not recognized. See #28892, #30211
    40 patchfiles-append patch-config.guess.i7.diff
    41 
    4236# llvm-gcc-4.2 fails make check
    4337if {${configure.compiler} == "llvm-gcc-4.2"} {
    4438    if {[vercmp $xcodeversion 4.1] >= 0} {
    configure.pipe no 
    6559test.run        yes
    6660test.cmd        make
    6761test.target     check
    68 
    69 post-destroot {
    70     # For the upgrade 4.3.2 -> 5.0.1 (r63519), do not force all packages which depend on GMP to be rebuilt.
    71     ln -s libgmp.dylib ${destroot}${prefix}/lib/libgmp.3.dylib
    72 }
    73 
    74 if {![variant_isset universal]} {
    75     if {${build_arch} == "x86_64"} {
    76         configure.env   ABI=64
    77         # fails to correctly detect some x86_64 models
    78         pre-configure {
    79             set build_triplet [split [exec /usr/bin/env CC=${configure.cc} ${worksrcpath}/config.guess] -]
    80             set build_cpu [lindex $build_triplet 0]
    81             if {$build_cpu != "core2" && $build_cpu != "corei"} {
    82                 ui_warn "No processor dependent assembly code being used. gmp might be slower."
    83                 configure.args-append --build=x86_64-[join [lrange $build_triplet 1 end] -]
    84             }
    85         }
    86     } elseif {${build_arch} == "ppc64"} {
    87         configure.env   ABI=mode64
    88     } else {
    89         configure.env   ABI=32
    90     }
    91 } else {
    92     # Keep configure.cflags and configure.cxxflags empty.
    93     set merger_arch_flag no
    94 
    95     array set merger_configure_env {
    96         ppc     ABI=32
    97         i386    ABI=32
    98         ppc64   ABI=mode64
    99         x86_64  ABI=64
    100     }
    101 
    102     # Since CFLAGS and CXXFLAGS must be empty, append -arch ... to CC and CXX.
    103     merger_arch_compiler yes
    104    
    105     # -arch i386 on causes the test suite to fail, so override muniversal_get_arch_flag in muniversal portgroup
    106     # Only append -arch ... to compiler if cross compiling.
    107     # i386 code is generated by setting ABI=32
    108     proc muniversal_get_arch_flag {arch {fortran ""}} {
    109         global os.arch
    110        
    111         if { ${os.arch}=="i386" && (${arch}=="i386" || ${arch}=="x86_64") } {
    112             set archf ""
    113         } elseif { ${os.arch}=="powerpc" && (${arch}=="ppc" && ${arch}=="ppc64") } {
    114             set archf ""
    115         } else {
    116             set archf "-arch ${arch}"
    117         }
    118         return ${archf}
    119     }
    120    
    121     # universal_archs_to_use might not be set before pre-fetch.
    122     pre-destroot {
    123         global merger_dont_diff merger_configure_env
    124 
    125         # PortGroup muniversal has difficulty merging three files.
    126         if  { [llength ${universal_archs_to_use}] == 3 } {
    127             set merger_dont_diff "${prefix}/include/gmp.h"
    128         }
    129     }
    130 
    131     # For cross-compiling, set C compiler and pre-processor.
    132     if { ${os.arch}=="i386" } {
    133         if { ${os.major} >= 10 } {
    134             lappend merger_configure_env(ppc)  CC_FOR_BUILD=${configure.cc} CPP_FOR_BUILD=${configure.cpp}
    135         }
    136         lappend merger_configure_env(ppc64)    CC_FOR_BUILD=${configure.cc} CPP_FOR_BUILD=${configure.cpp}
    137     } else {
    138         lappend merger_configure_env(i386)     CC_FOR_BUILD=${configure.cc} CPP_FOR_BUILD=${configure.cpp}
    139         lappend merger_configure_env(x86_64)   CC_FOR_BUILD=${configure.cc} CPP_FOR_BUILD=${configure.cpp}
    140     }
    141 }
    142 
    143 platform powerpc {
    144     # See #9053
    145     patchfiles-append  patch-config.guess.diff
    146 }
  • files/patch-config.guess.diff

    diff -rupN gmp.ori/files/patch-config.guess.diff gmp/files/patch-config.guess.diff
    old new  
    1 --- config.guess.orig   2009-05-12 08:12:12.000000000 +0200
    2 +++ config.guess        2009-05-21 10:24:48.000000000 +0200
    3 @@ -355,6 +355,7 @@
    4    unsigned  (*fun)();
    5    unsigned  pvr;
    6  
    7 +  return 0;
    8    /* a separate "fun" variable is necessary for gcc 2.95.2 on MacOS,
    9       it gets a compiler error on a combined cast and call */
    10    fun = (unsigned (*)()) getpvr.a;
  • files/patch-config.guess.i7.diff

    diff -rupN gmp.ori/files/patch-config.guess.i7.diff gmp/files/patch-config.guess.i7.diff
    old new  
    1 --- config.guess.orig   2010-02-06 05:43:13.000000000 -0700
    2 +++ config.guess        2011-04-10 09:11:34.000000000 -0700
    3 @@ -742,6 +742,7 @@
    4           else if (model == 0x25)       modelstr = "corei"; /* WSM Clarkdale/Arrandale */
    5           else if (model == 0x26)       modelstr = "atom";  /* Lincroft */
    6           else if (model == 0x27)       modelstr = "atom";  /* Saltwell */
    7 +         else if (model == 0x2a)       modelstr = "corei"; /* SB */
    8           else if (model == 0x2c)       modelstr = "corei"; /* WSM Gulftown */
    9           else if (model == 0x2e)       modelstr = "corei"; /* NHM Beckton */
    10           break;
  • files/patch-gmp-h.in.diff

    diff -rupN gmp.ori/files/patch-gmp-h.in.diff gmp/files/patch-gmp-h.in.diff
    old new  
    1 --- gmp-h.in.orig       2010-01-07 13:09:02.000000000 -0700
    2 +++ gmp-h.in    2010-01-27 19:35:31.000000000 -0700
    3 @@ -421,13 +421,14 @@
    4      GCC 4.3 and above with -std=c99 or -std=gnu99 implements ISO C99
    5      inline semantics, unless -fgnu89-inline is used.  */
    6  #ifdef __GNUC__
    7 -#if (defined __GNUC_STDC_INLINE__) || (__GNUC__ == 4 && __GNUC_MINOR__ == 2)
    8 +#if __GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 2)
    9  #define __GMP_EXTERN_INLINE extern __inline__ __attribute__ ((__gnu_inline__))
    10 -#else
    11 +#define __GMP_INLINE_PROTOTYPES  1
    12 +#elif !(defined __APPLE__ && defined __MACH__ && __APPLE_CC__ >= 5465 && defined __STDC_VERSION__ && __STDC_VERSION__ >= 199901L)
    13  #define __GMP_EXTERN_INLINE      extern __inline__
    14 -#endif
    15  #define __GMP_INLINE_PROTOTYPES  1
    16  #endif
    17 +#endif
    18  
    19  /* DEC C (eg. version 5.9) supports "static __inline foo()", even in -std1
    20     strict ANSI mode.  Inlining is done even when not optimizing (ie. -O0