[53388] trunk/dports/_resources/port1.0/group/muniversal-1.0.tcl

Marcus Calhoun-Lopez mcalhoun at macports.org
Sat Jul 4 12:49:07 PDT 2009


-arch was used over -m once before (see http://lists.macosforge.org/pipermail/macports-dev/2009-April/008158.html) 
, but was changed back
due to the reasons given in the message.

Is there a compelling reason -arch should be preferred now?

-Marcus

On Jul 4, 2009, at 10:38 AM, jmr at macports.org wrote:

> Revision53388Authorjmr at macports.orgDate2009-07-04 07:38:11 -0700  
> (Sat, 04 Jul 2009)Log Message
> clag the arch_flag_supported proc from trunk's portconfigure and  
> always use -arch when supported
> Modified Paths
> 	• trunk/dports/_resources/port1.0/group/muniversal-1.0.tcl
> Diff
> Modified: trunk/dports/_resources/port1.0/group/muniversal-1.0.tcl  
> (53387 => 53388)
>
> --- trunk/dports/_resources/port1.0/group/muniversal-1.0.tcl	 
> 2009-07-04 14:22:52 UTC (rev 53387)
> +++ trunk/dports/_resources/port1.0/group/muniversal-1.0.tcl	 
> 2009-07-04 14:38:11 UTC (rev 53388)
> @@ -56,19 +56,41 @@
>  default merger_arch_flag {yes}
>  default merger_arch_compiler {yes}
>
> +proc muniversal_arch_flag_supported {args} {
> +    global configure.compiler
> +    switch -exact ${configure.compiler} {
> +        gcc-4.0 -
> +        gcc-4.2 -
> +        llvm-gcc-4.2 -
> +        clang -
> +        apple-gcc-4.0 -
> +        apple-gcc-4.2 {
> +            return yes
> +        }
> +        default {
> +            return no
> +        }
> +    }
> +}
> +
>  proc muniversal_get_arch_flag {arch} {
>      global os.arch
> -    # Prefer -m to -arch
> -    set archf "-arch ${arch}"
> -    if { ${os.arch}=="i386" && ${arch}=="i386" } {
> -        set archf -m32
> -    } elseif { ${os.arch}=="i386" && ${arch}=="x86_64" } {
> -        set archf -m64
> -    } elseif { ${os.arch}=="powerpc" && ${arch}=="ppc" } {
> -        set archf -m32
> -    } elseif { ${os.arch}=="powerpc" && ${arch}=="ppc64" } {
> -        set archf -m64
> -    }
> +    # Prefer -arch to -m
> +    if {[muniversal_arch_flag_supported]} {
> +        set archf "-arch ${arch}"
> +    } else {
> +        if { ${os.arch}=="i386" && ${arch}=="i386" } {
> +            set archf -m32
> +        } elseif { ${os.arch}=="i386" && ${arch}=="x86_64" } {
> +            set archf -m64
> +        } elseif { ${os.arch}=="powerpc" && ${arch}=="ppc" } {
> +            set archf -m32
> +        } elseif { ${os.arch}=="powerpc" && ${arch}=="ppc64" } {
> +            set archf -m64
> +        } else {
> +            return -code error "selected compiler can't build for $ 
> {arch}"
> +        }
> +    }
>      return ${archf}
>  }
>
> _______________________________________________
> macports-changes mailing list
> macports-changes at lists.macosforge.org
> http://lists.macosforge.org/mailman/listinfo.cgi/macports-changes



More information about the macports-dev mailing list