aboutsummaryrefslogtreecommitdiffstats
path: root/lang/php4/bsd.php.mk
diff options
context:
space:
mode:
Diffstat (limited to 'lang/php4/bsd.php.mk')
-rw-r--r--lang/php4/bsd.php.mk150
1 files changed, 94 insertions, 56 deletions
diff --git a/lang/php4/bsd.php.mk b/lang/php4/bsd.php.mk
index 59f7191d50dd..1d3f971c0dce 100644
--- a/lang/php4/bsd.php.mk
+++ b/lang/php4/bsd.php.mk
@@ -2,90 +2,128 @@
#
# The user/port can now set this options in the makefiles.
#
-# USE_PHPIZE=yes - Use to build a php extension.
-# WANT_PHP_CLI=yes - Want the CLI version of PHP.
-# WANT_PHP_CGI=yes - Want the CGI version of PHP.
-# WANT_PHP_MOD=yes - Want the Apache Module for PHP.
-# WANT_PHP_WEB=yes - Want the Apache Module or the CGI version of PHP.
+# USE_PHPIZE=yes - Use to build a PHP extension.
+# WANT_PHP_CLI=yes - Want the CLI version of PHP.
+# WANT_PHP_CGI=yes - Want the CGI version of PHP.
+# WANT_PHP_MOD=yes - Want the Apache Module for PHP.
+# WANT_PHP_WEB=yes - Want the Apache Module or the CGI version of PHP.
+# WANT_PHP_PEAR=yes - Want the PEAR framework.
#
# You may combine multiple WANT_PHP_* knobs.
# Don't specify any WANT_PHP_* knob if your port will work with every PHP SAPI.
#
-.if exists(${LOCALBASE}/bin/php) && exists(${LOCALBASE}/bin/pear)
-HAVE_PHP_CLI= yes
-HAVE_PHP= yes
-PHP_PORT= ${PORTSDIR}/lang/php4-cli
+.if exists(${LOCALBASE}/etc/php.conf)
+.include "${LOCALBASE}/etc/php.conf"
.endif
-.if exists(${LOCALBASE}/bin/php) && !exists(${LOCALBASE}/bin/pear)
-HAVE_PHP_CGI= yes
-HAVE_PHP= yes
-PHP_PORT= ${PORTSDIR}/www/php4-cgi
+
+PHP_VER?= 4
+.if !defined(WITH_DEBUG)
+PHP_EXT_DIR?= 20020429
+.else
+PHP_EXT_DIR?= 20020429-debug
.endif
-.if exists(${LOCALBASE}/libexec/apache/libphp4.so) || exists(${LOCALBASE}/libexec/apache2/libphp4.so)
-HAVE_PHP_MOD= yes
-HAVE_PHP= yes
-PHP_PORT= ${PORTSDIR}/www/mod_php4
+.if !defined(WITHOUT_PEAR)
+PHP_PEAR?= yes
+.else
+PHP_PEAR?= no
.endif
-.if defined(HAVE_PHP_CLI) && defined(HAVE_PHP_MOD)
-PHP_PORT= ${PORTSDIR}/lang/php4
+PHP_SAPI?= ""
+
+.if defined(BROKEN_WITH_PHP)
+. for VER in ${BROKEN_WITH_PHP}
+. if (${PHP_VER} == "${VER}")
+BROKEN= "Doesn't work with PHP version : ${PHP_VER} (Doesn't support PHP ${BROKEN_WITH_PHP})"
+. endif
+. endfor
.endif
-.if defined(WANT_PHP_CGI) && (defined(WANT_PHP_CLI) || defined(WANT_PHP_MOD))
+.if defined(WANT_PHP_WEB)
+. if defined(WANT_PHP_CGI) || defined(WANT_PHP_MOD)
.BEGIN:
- @${ECHO_CMD} "The CGI version of PHP avoids the installation of other SAPIs."
- @${ECHO_CMD} "Do not use WANT_PHP_CGI with other WANT_PHP_* knobs."
- @${FALSE}
-.endif
+ @${ECHO_CMD} "If you define WANT_PHP_WEB you cannot set also WANT_PHP_CGI"
+ @${ECHO_CMD} "or WANT_PHP_MOD. Use only one of them."
+ @${FALSE}
+. else
+. if defined(PHP_VERSION) && ${PHP_SAPI} == "cli"
+.BEGIN:
+ @${ECHO_CMD} "This port requires the Apache Module or the CGI version of PHP, but you have"
+ @${ECHO_CMD} "already installed a conflicting PHP port without them."
+ @${FALSE}
+. else
+. if defined(WANT_PHP_CLI) || defined(WANT_PHP_PEAR)
+PHP_PORT?= ${PORTSDIR}/lang/php${PHP_VER}
+. else
+PHP_PORT?= ${PORTSDIR}/www/mod_php${PHP_VER}
+PHP_PEAR?= no
+. endif
+. endif
+. endif
+.else
-.if defined(WANT_PHP_CLI) && !defined(WANT_PHP_MOD)
-.if defined(HAVE_PHP) && !defined(HAVE_PHP_CLI)
+.if defined(WANT_PHP_CGI)
+. if defined(WANT_PHP_CLI) || defined(WANT_PHP_MOD)
.BEGIN:
- @${ECHO_CMD} "This port requires the CLI version of PHP, but you have already"
- @${ECHO_CMD} "installed a conflicting PHP port without CLI."
- @${FALSE}
+ @${ECHO_CMD} "The CGI version of PHP avoids the installation of other SAPIs."
+ @${ECHO_CMD} "Do not use WANT_PHP_CGI with other WANT_PHP_* knobs."
+ @${FALSE}
+. else
+. if defined(PHP_VERSION) && ${PHP_SAPI} != "cgi"
+.BEGIN:
+ @${ECHO_CMD} "This port requires the CGI version of PHP, but you have already"
+ @${ECHO_CMD} "installed a conflicting PHP port without CGI."
+ @${FALSE}
+. else
+PHP_PORT?= ${PORTSDIR}/www/php${PHP_VER}-cgi
+PHP_PEAR?= no
+. endif
+. endif
.else
-PHP_PORT?= ${PORTSDIR}/lang/php4-cli
-.endif
-.endif
-.if defined(WANT_PHP_WEB)
-.if defined(HAVE_PHP) && !defined(HAVE_PHP_CGI) && !defined(HAVE_PHP_MOD)
+.if defined(WANT_PHP_CLI) && !defined(WANT_PHP_MOD)
+. if defined(PHP_VERSION) && ${PHP_SAPI} != "full" && ${PHP_SAPI} != "cli"
.BEGIN:
- @${ECHO_CMD} "This port requires the Apache Module or the CGI version of PHP, but you have"
- @${ECHO_CMD} "already installed a conflicting PHP port without them."
- @${FALSE}
+ @${ECHO_CMD} "This port requires the CLI version of PHP, but you have already"
+ @${ECHO_CMD} "installed a conflicting PHP port without CLI."
+ @${FALSE}
+. else
+PHP_PORT?= ${PORTSDIR}/lang/php${PHP_VER}-cli
+. endif
.else
-PHP_PORT?= ${PORTSDIR}/www/mod_php4
-.endif
-.endif
-.if defined(WANT_PHP_CGI)
-.if defined(HAVE_PHP) && !defined(HAVE_PHP_CGI)
+.if !defined(WANT_PHP_CLI) && defined(WANT_PHP_MOD)
+. if defined(PHP_VERSION) && (${PHP_SAPI} != "full" && ${PHP_SAPI} != "mod")
.BEGIN:
- @${ECHO_CMD} "This port requires the CGI version of PHP, but you have already"
- @${ECHO_CMD} "installed a conflicting PHP port without CGI."
- @${FALSE}
+ @${ECHO_CMD} "This port requires the Apache Module for PHP, but you have already"
+ @${ECHO_CMD} "installed a conflicting PHP port without the Apache Module."
+ @${FALSE}
+. else
+. if defined(WANT_PHP_PEAR)
+PHP_PORT?= ${PORTSDIR}/lang/php${PHP_VER}
+. else
+PHP_PORT?= ${PORTSDIR}/www/mod_php${PHP_VER}
+PHP_PEAR?= no
+. endif
+. endif
.else
-PHP_PORT?= ${PORTSDIR}/www/php4-cgi
+
+PHP_PORT?= ${PORTSDIR}/lang/php${PHP_VER}
+
.endif
+
.endif
-.if defined(WANT_PHP_MOD) && !defined(WANT_PHP_CLI)
-.if defined(HAVE_PHP) && !defined(HAVE_PHP_MOD)
-.BEGIN:
- @${ECHO_CMD} "This port requires the Apache Module for PHP, but you have already"
- @${ECHO_CMD} "installed a conflicting PHP port without the Apache Module."
- @${FALSE}
-.else
-PHP_PORT?= ${PORTSDIR}/www/mod_php4
.endif
+
+.endif
+
+.if defined(WANT_PHP_PEAR) && ${PHP_PEAR} == "no"
+BROKEN= "This port requires the PEAR framework, but you have already" \
+ "installed a PHP port without PEAR"
.endif
-PHP_PORT?= ${PORTSDIR}/lang/php4
RUN_DEPENDS+= ${LOCALBASE}/include/php/main/php.h:${PHP_PORT}
-PHP_EXT_DIR?= 20020429
PLIST_SUB+= PHP_EXT_DIR=${PHP_EXT_DIR}
.if defined(USE_PHPIZE)