Use configure.ldflags-delete instead of configure.ldflags?

Gellule Xg gellule.xg at
Mon Mar 14 17:29:24 PDT 2011

I am trying to have "-Xlinker -headerpad_max_install_names" added to all
ports' ldflags by modifying
/opt/local/share/macports/Tcl/port1.0/portconfigure.tcl, replacing
default configure.ldflags by:
default configure.ldflags   {"-L${prefix}/lib -Xlinker
This would help with the use of install_name_tool to relocate
libraries produced by macports. I understand that macports results are
not meant to be relocated.

However, a few ports erase configure.ldflags in the Portfile definition
by using configure.ldflags set to empty. This is case for e.g. libiconv.
For this Port, the reason for this is described in "libiconv: make it possible
to build a universal libiconv even when a non-universal libiconv is
already active." Looking through the comments, it seems that:
configure.ldflags-delete -L${prefix}/lib would be sufficient. (And for
symmetry, configure.cppflags-delete -I${prefix}/include)

There are other reasons for removing -I${prefix}/include and
-L${prefix}/lib, that use a set configure.ldflags or configure.cppflags
to empty. They could maybe be replaced by a configure.ldflags-delete or
configure.cppflags-delete as well.

Is that something (the replacement of configure.ldflags by
configure.ldflags-delete, and its cpp flags equivalent) macport would

How about the addition of "-Xlinker -headerpad_max_install_names" as a
default in portconfigure.tcl? Would macport consider it?



More information about the macports-dev mailing list