I'm trying to write a port for some work I'm doing and I have trouble with the conceptuals of the makefile.
The 'install_db4.sh' gets and installs db4 into the ${WRKSRC} successfully, but after that I need to set the environment variable BDB for ./configure to ${WRKSRC}/db4. No matter what I do, I don't get anything in ${BDB}.
I tried various "export" commands, and also the shell-style "BDB=${WRKSRC}" but no dice.
How do you set an environment variable in Makefile?
Makefile:
# The ./configure script tries to use pkg-config to derive the SSL CFLAGS and
# libraries, but pkg-config requires libssl.pc which is only installed by the
# ports' security/openssl and not present in the base system. So if we are to
# use the base's SSL, then we trick ./configure to not use pkg-config by
# setting some related environment variables.
.if ${SSL_DEFAULT} == base
CONFIGURE_ENV+= CRYPTO_CFLAGS="-I${OPENSSLINC}" \
CRYPTO_LIBS="-lcrypto" \
SSL_CFLAGS="-I${OPENSSLINC}" \
SSL_LIBS="-lssl"
.endif
pre-configure:
.if ! ${PORT_OPTIONS:MWALLET_BDBMODERN}
@${SH} ${WRKSRC}/contrib/install_db4.sh ${WRKSRC}
export BDB := "${WRKSRC}/db4"
echo ${BDB}
exit
.endif
@${SH} ${WRKSRC}/autogen.sh
.include <bsd.port.mk>
The 'install_db4.sh' gets and installs db4 into the ${WRKSRC} successfully, but after that I need to set the environment variable BDB for ./configure to ${WRKSRC}/db4. No matter what I do, I don't get anything in ${BDB}.
I tried various "export" commands, and also the shell-style "BDB=${WRKSRC}" but no dice.
How do you set an environment variable in Makefile?