Makefile problem

Scot Hetzel swhetzel at gmail.com
Thu Aug 3 20:59:37 UTC 2006


On 8/3/06, Beech Rintoul <beech at alaskaparadise.com> wrote:
> I have an ongoing problem with the makefile for ftp/proftpd. This problem
> existed when I took over maintainership of the port and I'd like to fix it if
> possible before the next update.
>
> When I run portlint, I get the following:
>
> FATAL: Makefile: [131]: USE_OPENSSL is set after including bsd.port.pre.mk.
>
> I can cheat by adding a space instead of a tab after the line and turn it into
> a warning, but I'd really like to fix this properly. I've tried moving
> bsd.port.pre.mk to various places, but all I accomplish is changing the
> error.
>
> Can someone take a look at this and maybe give me a suggestion?
>
Since you include bsd.openssl.mk in the ports Makefile after the
include for bsd.port.pre.mk, you don't need to set the USE_OPENSSL
variable.

 .include <${PORTSDIR}/Mk/bsd.port.pre.mk>
 :
 .if defined(WITH_OPENSSL)
 CFLAGS+=	-DHAVE_OPENSSL
-USE_OPENSSL= YES
 .include <${PORTSDIR}/Mk/bsd.openssl.mk>
 PROFTPD_LIBS+=	-lssl -lcrypto -L${LOCALBASE}/lib
 MODULES:=${MODULES}:mod_tls
 .if defined(WITH_LDAP_TLS)
 EXTRA_PATCHES+=	${FILESDIR}/extra_patch-ldap-tls-mod_ldap.c
 .endif
 .endif


The same thing can be done to the ftp/curl port:

1. Get rid of USE_OPENSSL before bsd.port.pre.mk

-.if defined(WITHOUT_SSL)
-USE_OPENSSL= YES
-.endif

.include <bsd.port.pre.mk>

2. add a new option for OpenSSL that defaults to on

OPTIONS=	CARES "Asynchronous DNS resolution via c-ares" off \
		CURL_DEBUG "Enable curl diagnostic output" off \
+		SSL "OpenSSL Support" on \
+		GNUTLS "Use GNU TLS if OpenSSL is OFF" off \
-		GNUTLS "Use GNU TLS if WITHOUT_SSL is specified" off \
		IPV6 "IPv6 support" on \
		KERBEROS4 "Kerberos 4 authentication" off \
		LIBIDN "Internationalized Domain Names via libidn" off \
		NTLM "NTLM authentication" off


3. Change:

.if !defined(WITHOUT_SSL)
CONFIGURE_ARGS+=	--with-ssl=${OPENSSLBASE}
.else
CONFIGURE_ARGS+=	--without-ssl
.endif

to

.if !defined(WITHOUT_SSL)
 .include "${PORTSDIR}/Mk/bsd.openssl.mk"
.include <bsd.openssl.mk>
CONFIGURE_ARGS+=	--with-ssl=${OPENSSLBASE}
.else
CONFIGURE_ARGS+=	--without-ssl
.endif

Do we need to specify the full patch to bsd.openssl.mk, or can we
getaway with just:

.include <bsd.openssl.mk>

in the ports Makefile.

This should fix the ports that have an optional dependancy on OpenSSL.

Scot
-- 
DISCLAIMER:
No electrons were mamed while sending this message. Only slightly bruised.


More information about the freebsd-ports mailing list