ports makefile question

Stacy Millions stacy at Millions.Ca
Thu May 13 19:38:04 UTC 2010


I am trying to set configure args based on the version of sqlite that is 
installed, but SQLITE_VER is not set until after bsd.port.post.mk so I 
end up with something like

===============================================================
OPTIONS=	SQLITE	"Enable SQLITE support" on

.include <bsd.port.options.mk>

.if !defined(WITH_SQLITE)
   PLIST_SUB+=     WITH_SQLITE="@comment "
   CONFIGURE_ARGS+=        --without-sqlite --without-sqlite3
.else
   PLIST_SUB+=     WITH_SQLITE=""
   USE_SQLITE=     yes
.endif

.include <bsd.port.mk>

.if defined(WITH_SQLITE)
.if ${SQLITE_VER} == "3" || ${SQLITE_VER} == "34"
   CONFIGURE_ARGS+= --without-sqlite --with-sqlite3
.else
   CONFIGURE_ARGS+= --without-sqlite3 --with-sqlite
.endif
.endif
===============================================================

This works, but I can't help but feel there is a better way. Any 
suggestions?

-stacy


More information about the freebsd-ports mailing list