Skip site navigation (1)Skip section navigation (2)
Date:      Sat, 28 Jun 2003 19:38:57 +0200
From:      Jens Rehsack <rehsack@liwing.de>
To:        Alex Dupre <sysadmin@alexdupre.com>
Cc:        Norikatsu Shigemura <nork@FreeBSD.org>
Subject:   lang/php4: questions and suggestions
Message-ID:  <3EFDD2B1.4050100@liwing.de>

next in thread | raw e-mail | index | archive | help
Another question: A FreeBSD user (Benjamin Thelen) request some php
support for an addon named 'umn-mapserver' which requires www/php4-cgi
(and maybe others) compiled with configure arg '--with-regex=system'.
I've seen you don't enable '--with-regex', neither php4 builtin one nor
system (what isn't recommented to be used, of course). To give Benjamin
a better support for his requirement, maybe a port addition of the
program he uses may a nice thing :-)

Before I start it (or maybe you want to do it), I just want to talk back
to you how the requirement of --with-regex or --with-regex=system should
be handled for those systems?

A quick solution will be the define of a constant named WITH_REGEX, and
if it's sth. like [Ss][Yy][Ss][Tt][Ee][Mm], '--with-regex=system' is
added to CONFIGURE_ARGS, '--with-regex' otherwise.

To avoid overwiting PHP4_OPTIONS defined in /etc/make.conf,
Makefile.local, /usr/local/etc/pkgtools.conf or sucked in from
${PHP4_OPTFILE}, sth. like PHP4_ALSO_OPTIONS (only used from ports
which require php4) could be a nice way. What's your oppinion to
that problem?

Another conflict I see is the huge usage of constants of the form
WITH_${EXT}. Let me explain it more detailed of the quote:

On 5/5/2002 12:47 AM, Andrey A. Chernov wrote:
AC> And please rename all variables using APACHE_* and WITH_APACHE_*
prefixes
AC> not only to eliminate potential conflicts but to allow all Apache port
AC> variables appearse as single block in /etc/make.conf

Former I bothered you with my php4 requirements, I bothered some others
with some patches, too :-)
One of the was Andrey A. Chernov, the maintainer of www/apache13 and
many more. He told me, and I had to agree because he was right, that all
variables and constants which will be used/recognized in the port,
should have a prefix. The argument that don't do that may conflict with
dependend ports and other ones (when defined in /etc/make.conf) is a
real good one. And especially lang/php4 and it's slave ports should
respect this arguments more than others, because it defines previously
unknown variables when an option in the configuration is turned on.

I imagine 'bout sth. like
.if defined(WITH_MYSQL)
WITH_PHP4_MYSQL=${WITH_MYSQL}
.endif

...

if defined(WITH_PHP4_MYSQL)
DEFAULT_PHP4_MYSQL?=	41
.if	(${WITH_PHP4_MYSQL} != 3) && (${WITH_PHP4_MYSQL} != 40) && \
	(${WITH_PHP4_MYSQL} != 41)
.if exists(${LOCALBASE}/lib/mysql/libmysqlclient.so.10)
WITH_PHP4_MYSQL=3
.elif exists(${LOCALBASE}/lib/mysql/libmysqlclient.so.14)
WITH_PHP4_MYSQL=40
.elif exists(${LOCALBASE}/lib/mysql/libmysqlclient.so.12)
WITH_PHP4_MYSQL=41
.endif
.endif

.if	(${WITH_PHP4_MYSQL} != 3) && (${WITH_PHP4_MYSQL} != 40) && \
	(${WITH_PHP4_MYSQL} != 41)
WITH_PHP4_MYSQL=${DEFAULT_PHP4_MYSQL}
.endif

.if ${WITH_PHP4_MYSQL} == 3
LIB_DEPENDS+=   mysqlclient.10:${PORTSDIR}/databases/mysql323-client
.elif ${WITH_PHP4_MYSQL} == 40
LIB_DEPENDS+=   mysqlclient.12:${PORTSDIR}/databases/mysql40-client
.elif ${WITH_PHP4_MYSQL} == 41
LIB_DEPENDS+=   mysqlclient.14:${PORTSDIR}/databases/mysql41-client
.endif

CONFIGURE_ARGS+=--with-mysql=${LOCALBASE}
.endif

Ok, I see MYSQL as an example was a little bit unlucky, but you can
also see what in my humble oppinion would be a good solution for such
complex dependencies.

I will be very interested in comments about each point.

Best,
Jens



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