I'm surprised by the behavior of conditionals involving variables set in /etc/mk.conf. For example, the audio/jack Makefile has these lines: .ifdef DEBUG CONFIGURE_ARGS += --enable-debug .endif
With DEBUG=-g in /etc/mk.conf, CONFIGURE_ARGS does *not* have the "--enable-debug" string. Here's a short transcript that illustrates the problem: x2: 8010>grep ^DEBUG /etc/mk.conf DEBUG=-g x2: 8011>(cd /usr/ports/audio/jack/ && make dump-vars)|grep CONFIGURE_ARGS audio/jack.CONFIGURE_ARGS=--enable-shared --with-default-tmpdir=/var/tmp --disable-portaudio --disable-optimize --prefix='/usr/local' --sysconfdir='/etc' --mandir='/usr/local/man' --infodir='/usr/local/info' x2: 8012>(cd /usr/ports/audio/jack/ && make DEBUG=-g dump-vars)|grep CONFIGURE_ARGS audio/jack.CONFIGURE_ARGS=--enable-shared --with-default-tmpdir=/var/tmp --disable-portaudio --disable-optimize --enable-debug --prefix='/usr/local' --sysconfdir='/etc' --mandir='/usr/local/man' --infodir='/usr/local/info' I'm probably misunderstanding some make nuances here... I did find that putting the above lines after the ".include <bsd.port.mk>" line did make it work the way I expected. Is there another/better way to evaluate mk.conf variables? FWIW, the following ports seem to use something similar: audio/jack/Makefile graphics/ffmpeg/Makefile mail/mutt/Makefile.inc net/pidgin/Makefile net/pmacct/Makefile print/ghostscript/gnu/Makefile print/libspectre/Makefile sysutils/gamin/Makefile www/cherokee/Makefile x11/gnome/scan/Makefile x11/pinot/Makefile