ports/74541: [patch] ports/mail/p5-Sendmail-Milter does not compile with threaded perl installed

Chad M. Fraleigh chadf at bookcase.com
Sat Dec 11 00:30:48 UTC 2004

> 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 at 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

	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 at 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
+.if ${PERL_THREADED} != "YES"
 IGNORE=		"Requires perl compiled manually with threads."



More information about the freebsd-ports-bugs mailing list