defining knobs in pkgtools.conf question

Andy Smith andy at freebsdwiki.org
Thu May 20 17:48:52 PDT 2004


On Wed, May 19, 2004 at 02:20:55PM -0400, Chiang Seng Chang wrote:
> === quote ===
> 
> OPTIONS=        THREADS "Enable thread support" on \
>                 HUGE_STACK_SIZE "Use a larger thread stack" off \
>                 UCS2 "Use UCS2 instead of UCS4 for unicode support" off \
>                 PYMALLOC "Uses python's internal malloc" on
> 
> .include <bsd.port.pre.mk>
> 
> .if defined(WITH_THREADS)
> CONFIGURE_ARGS+=        --with-threads
> CFLAGS+=                ${PTHREAD_CFLAGS}
> .if defined(WITHOUT_HUGE_STACK_SIZE)
> CFLAGS+=                -DTHREAD_STACK_SIZE=0x20000
> .else
> CFLAGS+=                -DTHREAD_STACK_SIZE=0x100000
> .endif # defined(WITHOUT_HUGE_STACK_SIZE)
> CONFIGURE_ENV+=         LDFLAGS="${PTHREAD_LIBS} ${LDFLAGS}"
> .else
> CONFIGURE_ARGS+=        --without-threads
> .if defined(LDFLAGS)
> CONFIGURE_ENV+=         LDFLAGS="${LDFLAGS}"
> .endif # defined(LDFLAGS)
> .endif # defined(WITH_THREADS)
> 
> .if defined(WITHOUT_UCS2)
> CONFIGURE_ARGS+=        --enable-unicode=ucs4
> .endif
> 
> .if defined(WITHOUT_PYMALLOC)
> CONFIGURE_ARGS+=        --without-pymalloc
> .endif
> 
> === end quote ===
> 
> So if I wish to put the knobs into pkgtools.conf so that it can build it 
> batch mode, do I:
> 
>     WITH_THREADS=1
>     WITHOUT_HUGE_STACK_SIZE=1

I think that you only need to match the variables used in the
Makefile.  So the above would be correct, and the following two
should just be omitted:

>     WITH_UCS2=1
>     WITH_PYMALLOC=1

Don't forget you'll need to set BATCH as well.

> I guess my question is how to decide wheather to use WITH_XXX=1 or 
> WITHOUT_XXX=0 ?

Set the exact same variables as the Makefile is testing.

> does WITH_XXX=0 result in #defined(WITH_XXX) returning false ?

I believe not, as "defined()" only tests if that name is defined,
not what its value is.

-- 
http://freebsdwiki.org/ - Encrypted mail welcome - keyid 0xBF15490B
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 187 bytes
Desc: not available
Url : http://lists.freebsd.org/pipermail/freebsd-questions/attachments/20040521/c91e5834/attachment.bin


More information about the freebsd-questions mailing list