ENV to macports

Timothy Lee TimLee at rochester.rr.com
Tue Feb 3 19:08:57 PST 2009


Is it possible to 'pass in' environment variables to the 'port  
install' command?

Or is the only way to pass something like CFLAGS to macports is  
through a portfile?

For example... I would like to
$sudo port install pan2 CFLAGS="-isysroot /Developers/SDKs/ 
MacOSX10.4u.sdk"

thoughts?

On Feb 3, 2009, at 9:46 PM, Rainer Müller wrote:

> Bradley Giesbrecht wrote:
>> If your building a Portfile here is a piece of the postfix Portfile:
>>
>> variant ldap description "add ldap support via openldap" {
>>     depends_lib-append  port:openldap
>>     set CCARGS      [concat ${CCARGS} -DHAS_LDAP]
>>     set AUXLIBS     [concat ${AUXLIBS} -lldap -llber]
>> }
>
> `set' does not affect the environment at all, these are just local Tcl
> variables.
>
> If you need special variables in the environment for building, specify
> configure.env (and build.env) in the Portfile. But also note there are
> predefined options to set CFLAGS, LDFLAGS and others, namely
> configure.cflags, configure.ldflags, etc. They should be preferred  
> over
> manipulating configure.env.
>
> They are explained in the guide:
> <http://guide.macports.org/#reference.phases.configure>
>
> HTH,
> Rainer



More information about the macports-users mailing list