RFC: Support for future compilers in base

Lawrence Velázquez larryv at macports.org
Mon Feb 18 17:02:47 PST 2013


On Feb 18, 2013, at 7:28 PM, Jeremy Huddleston Sequoia <jeremyhu at macports.org> wrote:

> You'll get:
> 
> ~/src/macports/dports/x11/xwininfo $ port lint
> Can't map the URL 'file://.' to a port description file ("can't use empty string as operand of "!"").
> Please verify that the directory and portfile syntax are correct.
> To use the current port, you must be in a port's directory.

I don't think return is behaving like you (or I) expect. compiler_is_port is returning an empty string, which trips up this conditional in add_automatic_compiler_dependencies:

> # The default value requires substitution before use.
> set compiler [subst ${configure.compiler}]
> if {![compiler_is_port $compiler]} {
>     return
> }

You might have to use expr to force a valid boolean value. This fixed it for me.

>  proc portconfigure::compiler_is_port {compiler} {
> -    return [portconfigure::compiler_port_name ${compiler}] != ""
> +    return [expr {[portconfigure::compiler_port_name ${compiler}] != ""}]
>  }

For correctness (maybe), I made this change for arch_flag_supported also.

>  # internal proc to determine if the compiler supports -arch
>  proc portconfigure::arch_flag_supported {compiler} {
> -    return [string first "macports-gcc" $compiler] != 0 &&
> -           [string first "macports-dragonegg-" $compiler] != 0
> +    return [expr {[string first "macports-gcc" $compiler] != 0 &&
> +                  [string first "macports-dragonegg-" $compiler] != 0}]
>  }

vq

-------------- next part --------------
A non-text attachment was scrubbed...
Name: tcl-boolean-return-patch-with-expr.diff
Type: application/octet-stream
Size: 883 bytes
Desc: not available
URL: <http://lists.macosforge.org/pipermail/macports-dev/attachments/20130218/0df476dd/attachment.obj>


More information about the macports-dev mailing list