Opened 12 years ago

Closed 12 years ago

#17865 closed defect (fixed)

deleting all default configure flags causes error.

Reported by: tonytung@… Owned by: macports-tickets@…
Priority: Normal Milestone: MacPorts 1.8.0
Component: base Version: 1.7.0
Keywords: cppflags ldflags Cc: tonytung@…, MarcusCalhoun-Lopez (Marcus Calhoun-Lopez), blb@…
Port: tcl


In the tcl port, -I${prefix}/include is removed from cppflags:

configure.cppflags-delete  -I${prefix}/include

When handle_option-delete processes this, it yields an empty string and unsets the option.

# Handle option-delete                                                                                          
# @param option name of the option                                                                              
# @param args arguments                                                                                         
proc handle_option-delete {option args} {
    global $option user_options option_procs

    if {![info exists user_options($option)] && [info exists $option]} {
        set temp [set $option]
        foreach val $args {
            set temp [ldelete $temp $val]
        if {$temp eq ""} {
            unset $option
        } else {
            set $option $temp

This results in portconfigure.tcl declaring ${configure.cppflags} as an unknown variable in configure_main(..), yielding this error message:

Error: Target org.macports.configure returned: can't read "configure.cppflags": no such variable

Replacing these lines:

append_list_to_environment_value configure "CPPFLAGS" ${configure.cppflags}
append_list_to_environment_value configure "LDFLAGS" ${configure.ldflags}


catch {append_list_to_environment_value configure "CPPFLAGS" ${configure.cppflags}}
catch {append_list_to_environment_value configure "LDFLAGS" ${configure.ldflags}}

seems to do the trick (i.e., everything builds fine).

Change History (5)

comment:1 Changed 12 years ago by tonytung@…

Cc: tonytung@… added

Cc Me!

comment:2 Changed 12 years ago by MarcusCalhoun-Lopez (Marcus Calhoun-Lopez)

Cc: mcalhoun@… added

Cc Me!

comment:3 Changed 12 years ago by blb@…

Cc: blb@… added

Note that I committed a kludge to the tcl port in r44859 to work around this for now.

comment:4 Changed 12 years ago by blb@…

Milestone: MacPorts 1.8.0

comment:5 Changed 12 years ago by tobypeterson

Resolution: fixed
Status: newclosed

r44901 ... this is simpler and more reasonable behavior for "*-delete", and doesn't appear to cause any problems.

Note: See TracTickets for help on using tickets.