Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 10 Dec 2004 19:30:46 -0500 (EST)
From:      "Chad M. Fraleigh" <chadf@bookcase.com>
To:        freebsd-ports-bugs@FreeBSD.org
Subject:   Re: ports/74541: [patch] ports/mail/p5-Sendmail-Milter does not compile with threaded perl installed
Message-ID:  <20041210190416.R82406@bookcase.com>
In-Reply-To: <200412090937.iB99b0uw034894@freefall.freebsd.org>
References:  <200412090937.iB99b0uw034894@freefall.freebsd.org>

next in thread | previous in thread | raw e-mail | index | archive | help

> Somehow I feel that his isn't going to work since 'make' will try to run
> 'perl' before it gets to the point of installing it as a prerequisite:
>
> p5-Sendmail-Milter@menelaos [10:33:56]> make
> perl: not found
> "Makefile", line 20: warning: "perl -e 'use Config; if($$Config{usethreads}) { print "YES" }'" returned non-zero status

	I expected perl to be bundled with the base OS, but I can accept
older/newer/other OS's that may not have it.

	A slight adjustment of adding "|| exit 0" to the end of the perl
command will suppress the error. The will leave it with the following
options:

	1) There is no perl installed.

	- In this case the original error is given, telling the user to
install a threaded perl.


	2) The non-threaded perl is installed.

	- Give the original error, so the user will know to uninstall
their current perl (if a port) and manually install the threaded perl.


	3) Threaded perl is installed.

	- Continue and compile the port.


	Now condition #1 isn't ideal, but I'm not sure how to tell a
prerequisite to compile with specific make options (i.e.
WITH_THREADS=yes). One way around this would be to create a
ports/lang/perl5[.8]-threaded wrapper port and make that the prerequisite
build. And even without that extra step, this would still be better than
it currently is by not erroneously telling the user to do what has already
been done (or having to hack the Makefile to make it work).

	Here is an updated patch:

--- Makefile.orig	Thu Aug  7 16:44:51 2003
+++ Makefile	Thu Dec  9 07:20:27 2004
@@ -15,7 +15,13 @@
 MAINTAINER=	ports@FreeBSD.org
 COMMENT=	A module to write mail filters in Perl using sendmail's mail filter API

+.if !defined(PERL_THREADED)
+PERL_THREADED!=	perl -e 'use Config; if($$Config{usethreads}) { print "YES" }' || exit 0
+.endif
+
+.if ${PERL_THREADED} != "YES"
 IGNORE=		"Requires perl compiled manually with threads."
+.endif

 PERL_CONFIGURE=	yes
 MAN3PREFIX=	${PREFIX}/lib/perl5/${PERL_VERSION}



-Chad



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20041210190416.R82406>