summaryrefslogtreecommitdiff
path: root/lang/php4
diff options
context:
space:
mode:
authorAlex Dupre <ale@FreeBSD.org>2006-05-06 13:26:49 +0000
committerAlex Dupre <ale@FreeBSD.org>2006-05-06 13:26:49 +0000
commitf12d3a0ccb6b5f12408152f1e699e0d91ebfe909 (patch)
tree7e77ab1846eeb19035bf34f40c8aa72a0f2fd4db /lang/php4
parentUpdate maintainer address (diff)
Simplify PHP base ports infrastructure:
- remove all slave ports - add the ability to build all SAPIs concurrently - update php5 to 5.1.4 *Read* the UPDATING file *before* trying to update PHP (or at least before mailing me).
Notes
Notes: svn path=/head/; revision=161492
Diffstat (limited to 'lang/php4')
-rw-r--r--lang/php4/Makefile163
-rw-r--r--lang/php4/files/patch-TSRM_threads.m411
-rw-r--r--lang/php4/files/patch-acinclude.m429
-rw-r--r--lang/php4/files/patch-configure38
-rw-r--r--lang/php4/files/patch-configure.in42
-rw-r--r--lang/php4/files/patch-main::php_config.h.in6
-rw-r--r--lang/php4/files/patch-main_SAPI.c8
-rw-r--r--lang/php4/files/patch-sapi_cgi_Makefile.frag9
-rw-r--r--lang/php4/files/patch-sapi_cgi_config9.m454
-rw-r--r--lang/php4/files/patch-scripts::phpize.in6
-rw-r--r--lang/php4/pkg-plist3
11 files changed, 223 insertions, 146 deletions
diff --git a/lang/php4/Makefile b/lang/php4/Makefile
index f0f8d5adad77..23d81b91bfa1 100644
--- a/lang/php4/Makefile
+++ b/lang/php4/Makefile
@@ -7,7 +7,7 @@
PORTNAME= php4
PORTVERSION= 4.4.2
-PORTREVISION?= 1
+PORTREVISION?= 2
CATEGORIES?= lang devel www
MASTER_SITES= ${MASTER_SITE_PHP:S,$,:release,} \
http://downloads.php.net/ilia/:rc \
@@ -22,92 +22,99 @@ COMMENT?= PHP Scripting Language (Apache Module and CLI)
LATEST_LINK= ${PKGNAMEPREFIX}${PORTNAME}${PKGNAMESUFFIX}
USE_BZIP2= yes
-.if !defined(PKGNAMESUFFIX) || ${PKGNAMESUFFIX} == "-cgi" || ${PKGNAMESUFFIX} == "-cli"
-GNU_CONFIGURE= yes
-USE_REINPLACE= yes
+.if !defined(PKGNAMESUFFIX)
+USE_AUTOTOOLS= autoconf:259
USE_GETOPT_LONG=yes
CONFIGURE_ARGS= --enable-versioning \
--enable-memory-limit \
--with-layout=GNU \
--with-config-file-scan-dir=${PREFIX}/etc/php \
- --disable-all
+ --disable-all \
+ --program-prefix=""
-.if !defined(WITH_REGEX_TYPE) || ${WITH_REGEX_TYPE} == "php"
-CONFIGURE_ARGS+=--with-regex=php
-.else
-.if ${WITH_REGEX_TYPE} == "system"
-CONFIGURE_ARGS+=--with-regex=system
-.else
-.if ${WITH_REGEX_TYPE} == "apache"
-CONFIGURE_ARGS+=--with-regex=apache
-.endif
-.endif
-.endif
+OPTIONS= CLI "Build CLI version" on \
+ CGI "Build CGI version" on \
+ APACHE "Build Apache module" off \
+ DEBUG "Enable debug" off \
+ MULTIBYTE "Enable zend multibyte support" off \
+ IPV6 "Enable ipv6 support" on \
+ REDIRECT "Enable force-cgi-redirect support (CGI only)" off \
+ DISCARD "Enable discard-path support (CGI only)" off \
+ FASTCGI "Enable fastcgi support (CGI only)" on \
+ PATHINFO "Enable path-info-check support (CGI only)" on \
+ OPENSSL "Build static OpenSSL extension" off
+
+CONFLICTS= php5-5*
+
+MAN1= php-config.1 phpize.1
+
+.include <bsd.port.pre.mk>
-.if !defined(PKGNAMEPREFIX) && !defined(PKGNAMESUFFIX)
-PHP_SAPI= full
-WITH_APACHE= yes
+.if !defined(WITHOUT_CLI)
+PHP_SAPI+= cli
+PLIST_SUB+= CLI=""
+MAN1+= php.1
.else
-.if !defined(PKGNAMEPREFIX)
-PHP_SAPI= ${PKGNAMESUFFIX:S/-//}
+# XXX Temporary hack
+.if !defined(WITHOUT_CGI)
+PLIST_SUB+= CLI=""
.else
-PHP_SAPI= ${PKGNAMEPREFIX:S/_//}
-WITH_APACHE= yes
+PLIST_SUB+= CLI="@comment "
.endif
+CONFIGURE_ARGS+=--disable-cli
.endif
-.if defined(WITH_APACHE)
-PKGMESSAGE= ${PKGDIR}/pkg-message.mod
-USE_APACHE= 1.3+
-MODULENAME= lib${PORTNAME}
-SHORTMODNAME= ${PORTNAME}
+.if !defined(WITHOUT_CGI)
+PHP_SAPI+= cgi
+PLIST_SUB+= CGI=""
+.if defined(WITH_REDIRECT)
+CONFIGURE_ARGS+=--enable-force-cgi-redirect
.endif
-
-.if ${PHP_SAPI} == "cgi"
-OPTIONS= REDIRECT "Enable force-cgi-redirect support" off \
- DISCARD "Enable discard-path support" off \
- FASTCGI "Enable fastcgi support" off \
- PATHINFO "Enable path-info-check support" on
+.if defined(WITH_DISCARD)
+CONFIGURE_ARGS+=--enable-discard-path
.endif
-OPTIONS+= DEBUG "Enable debug" off \
- MULTIBYTE "Enable zend multibyte support" off \
- IPV6 "Enable ipv6 support" on \
- OPENSSL "Build static OpenSSL extension" off
-
-CONFLICTS?= php4-cli-4* mod_php4-4* php4-cgi-4*
-CONFLICTS+= php5-5* php5-cli-5* mod_php5-5* php5-cgi-5*
-
-.if ${PHP_SAPI} == "cgi" || ${PHP_SAPI} == "mod"
-CONFIGURE_ARGS+=--disable-cli
+.if !defined(WITHOUT_FASTCGI)
+CONFIGURE_ARGS+=--enable-fastcgi
.endif
-
-MAN1= php-config.1 phpize.1
-.if ${PHP_SAPI} != "mod"
-PLIST_SUB+= CLICGI=""
-.if ${PHP_SAPI} != "cgi"
-MAN1+= php.1
+.if defined(WITHOUT_PATHINFO)
+CONFIGURE_ARGS+=--disable-path-info-check
.endif
.else
-PLIST_SUB+= CLICGI="@comment "
+PLIST_SUB+= CGI="@comment "
+CONFIGURE_ARGS+=--disable-cgi
.endif
.if defined(WITH_APACHE)
+PHP_SAPI+= mod
+USE_APACHE= 1.3+
+.include "${PORTSDIR}/Mk/bsd.apache.mk"
+.if ${APACHE_VERSION} > 13
+CONFIGURE_ARGS+=--with-apxs2=${APXS}
+.else
+CONFIGURE_ARGS+=--with-apxs=${APXS}
+.endif
+PKGMESSAGE= ${PKGDIR}/pkg-message.mod
+MODULENAME= lib${PORTNAME}
+SHORTMODNAME= ${PORTNAME}
PLIST_SUB+= APACHE=""
.else
PLIST_SUB+= APACHE="@comment "
.endif
-.if ${PHP_SAPI} == "cli"
-CONFIGURE_ARGS+=--disable-cgi
+.if !defined(WITH_REGEX_TYPE) || ${WITH_REGEX_TYPE} == "php"
+CONFIGURE_ARGS+=--with-regex=php
+.elif defined(WITH_REGEX_TYPE) && ${WITH_REGEX_TYPE} == "system"
+CONFIGURE_ARGS+=--with-regex=system
+.elif defined(WITH_REGEX_TYPE) && ${WITH_REGEX_TYPE} == "apache"
+CONFIGURE_ARGS+=--with-regex=apache
.endif
-.include <bsd.port.pre.mk>
-
CONFIGURE_ENV+= ac_cv_pthreads_lib=${PTHREAD_LIBS} \
- ac_cv_pthreads_cflags=${PTHREAD_CFLAGS}
+ ac_cv_pthreads_cflags=${PTHREAD_CFLAGS} \
+ pthreads_working="yes"
-MAKE_ENV+= LDFLAGS="${LDFLAGS}"
+ MAKE_ENV+= LDFLAGS="${LDFLAGS}"
.if defined(WITH_OPENSSL)
.include "${PORTSDIR}/Mk/bsd.openssl.mk"
@@ -116,14 +123,6 @@ CONFIGURE_ARGS+=--with-openssl=${OPENSSLBASE} \
LDFLAGS+= -L${OPENSSLLIB} -lcrypto -lssl
.endif
-.if defined(WITH_APACHE)
-.if ${APACHE_VERSION} > 13
-CONFIGURE_ARGS+=--with-apxs2=${APXS}
-.else
-CONFIGURE_ARGS+=--with-apxs=${APXS}
-.endif
-.endif
-
.if defined(WITH_DEBUG)
CONFIGURE_ARGS+=--enable-debug
.endif
@@ -136,44 +135,16 @@ CONFIGURE_ARGS+=--enable-zend-multibyte
CONFIGURE_ARGS+=--disable-ipv6
.endif
-.if ${PHP_SAPI} == "cgi"
-.if defined(WITH_REDIRECT)
-CONFIGURE_ARGS+=--enable-force-cgi-redirect
-.endif
-.if defined(WITH_DISCARD)
-CONFIGURE_ARGS+=--enable-discard-path
-.endif
-.if defined(WITH_FASTCGI)
-CONFIGURE_ARGS+=--enable-fastcgi
-.endif
-.if defined(WITHOUT_PATHINFO)
-CONFIGURE_ARGS+=--disable-path-info-check
-.endif
-.endif
-
-_PORTSDIR!= ${REALPATH} ${PORTSDIR}
-PHP_PORT= ${.CURDIR:S|^${_PORTSDIR}||:S|^/||}
-
post-patch:
@${TOUCH} ${WRKSRC}/ext/php_config.h
@${REINPLACE_CMD} "s|^\(extension_dir\)|; \1|" ${WRKSRC}/php.ini-*
-.if ${PHP_SAPI} == "full"
pre-configure:
- @${ECHO_CMD} ""
- @${ECHO_CMD} "You are building the Apache Module and the Command Line Interpreter of PHP."
- @${ECHO_CMD} ""
- @${ECHO_CMD} "Use port:"
- @${ECHO_CMD} " lang/php4-cli for Command Line Interpreter only"
- @${ECHO_CMD} " www/php4-cgi for Common Gateway Interface only"
- @${ECHO_CMD} " www/mod_php4 for Apache Module only"
- @${ECHO_CMD} ""
-.endif
+ @${CAT} ${WRKSRC}/acinclude.m4 ${WRKSRC}/build/libtool.m4 > ${WRKSRC}/aclocal.m4
post-build:
@${ECHO_CMD} "PHP_VER=4" > ${WRKDIR}/php.conf
@${ECHO_CMD} "PHP_VERSION=${PORTVERSION}" >> ${WRKDIR}/php.conf
- @${ECHO_CMD} "PHP_PORT=\$${PORTSDIR}/${PHP_PORT}" >> ${WRKDIR}/php.conf
@${ECHO_CMD} "PHP_SAPI=${PHP_SAPI}" >> ${WRKDIR}/php.conf
.if defined(WITH_OPENSSL)
@${ECHO_CMD} "PHP_EXT_INC=openssl" >> ${WRKDIR}/php.conf
@@ -184,6 +155,10 @@ post-install:
@${INSTALL_DATA} ${WRKSRC}/php.ini-recommended ${PREFIX}/etc
@${INSTALL_DATA} ${WRKDIR}/php.conf ${PREFIX}/etc
@${TOUCH} ${PREFIX}/include/php/ext/php_config.h
+# XXX Temporary hack
+.if !defined(WITHOUT_CGI) && defined(WITHOUT_CLI)
+ @${LN} -sf ${PREFIX}/bin/php-cgi ${PREFIX}/bin/php
+.endif
.if defined(WITH_APACHE)
@${CAT} ${PKGMESSAGE}
.endif
diff --git a/lang/php4/files/patch-TSRM_threads.m4 b/lang/php4/files/patch-TSRM_threads.m4
new file mode 100644
index 000000000000..3f75b837b071
--- /dev/null
+++ b/lang/php4/files/patch-TSRM_threads.m4
@@ -0,0 +1,11 @@
+--- TSRM/threads.m4.orig Fri May 5 08:02:38 2006
++++ TSRM/threads.m4 Fri May 5 08:02:59 2006
+@@ -164,7 +164,7 @@ dnl
+ dnl
+ AC_DEFUN([PTHREADS_ASSIGN_VARS],[
+ if test -n "$ac_cv_pthreads_lib"; then
+- LIBS="$LIBS -l$ac_cv_pthreads_lib"
++ LIBS="$LIBS $ac_cv_pthreads_lib"
+ fi
+
+ if test -n "$ac_cv_pthreads_cflags"; then
diff --git a/lang/php4/files/patch-acinclude.m4 b/lang/php4/files/patch-acinclude.m4
index 853082ef6319..94e15f9f3d58 100644
--- a/lang/php4/files/patch-acinclude.m4
+++ b/lang/php4/files/patch-acinclude.m4
@@ -1,6 +1,29 @@
---- acinclude.m4.orig Fri Sep 23 11:20:22 2005
-+++ acinclude.m4 Tue Nov 15 23:25:54 2005
-@@ -1709,9 +1709,9 @@
+--- acinclude.m4.orig Mon Dec 19 23:29:11 2005
++++ acinclude.m4 Fri May 5 08:05:43 2006
+@@ -84,7 +84,7 @@
+ dnl
+ dnl which array to append to?
+ AC_DEFUN([PHP_ADD_SOURCES],[
+- PHP_ADD_SOURCES_X($1, $2, $3, ifelse($4,cli,PHP_CLI_OBJS,ifelse($4,sapi,PHP_SAPI_OBJS,PHP_GLOBAL_OBJS)))
++ PHP_ADD_SOURCES_X($1, $2, $3, ifelse($4,cli,PHP_CLI_OBJS,ifelse($4,sapi,PHP_SAPI_OBJS,ifelse($4,cgi,PHP_CGI_OBJS,PHP_GLOBAL_OBJS))))
+ ])
+ dnl
+ dnl _PHP_ASSIGN_BUILD_VARS(type)
+@@ -1305,12 +1305,8 @@
+
+ if test "$3" != "shared" && test "$3" != "yes" && test "$4" = "cli"; then
+ dnl ---------------------------------------------- CLI static module
+- if test "$PHP_SAPI" = "cgi"; then
+- PHP_ADD_SOURCES(PHP_EXT_DIR($1),$2,$ac_extra,)
+- EXT_STATIC="$EXT_STATIC $1"
+- else
+ PHP_ADD_SOURCES(PHP_EXT_DIR($1),$2,$ac_extra,cli)
+- fi
++ PHP_ADD_SOURCES(PHP_EXT_DIR($1),$2,$ac_extra,cgi)
+ EXT_CLI_STATIC="$EXT_CLI_STATIC $1"
+ fi
+ PHP_ADD_BUILD_DIR($ext_builddir)
+@@ -1713,9 +1709,9 @@
test -z "$PHP_IMAP_SSL" && PHP_IMAP_SSL=no
dnl Fallbacks for different configure options
diff --git a/lang/php4/files/patch-configure b/lang/php4/files/patch-configure
deleted file mode 100644
index 0b4f226749ae..000000000000
--- a/lang/php4/files/patch-configure
+++ /dev/null
@@ -1,38 +0,0 @@
---- configure.orig Sun Oct 30 12:06:37 2005
-+++ configure Tue Nov 15 23:25:55 2005
-@@ -2900,7 +2900,7 @@
- save_LIBS=$LIBS
-
- if test -n "$ac_cv_pthreads_lib"; then
-- LIBS="$LIBS -l$ac_cv_pthreads_lib"
-+ LIBS="$LIBS $ac_cv_pthreads_lib"
- fi
-
- if test -n "$ac_cv_pthreads_cflags"; then
-@@ -9725,7 +9725,7 @@
- if test "$enable_experimental_zts" = "yes"; then
-
- if test -n "$ac_cv_pthreads_lib"; then
-- LIBS="$LIBS -l$ac_cv_pthreads_lib"
-+ LIBS="$LIBS $ac_cv_pthreads_lib"
- fi
-
- if test -n "$ac_cv_pthreads_cflags"; then
-@@ -9742,8 +9742,6 @@
- case $host_alias in
- *solaris*)
- PTHREAD_FLAGS="-D_POSIX_PTHREAD_SEMANTICS -D_REENTRANT";;
-- *freebsd*)
-- PTHREAD_FLAGS="-D_REENTRANT -D_THREAD_SAFE";;
- *linux*)
- PTHREAD_FLAGS=-D_REENTRANT;;
- *aix*)
-@@ -98846,7 +98844,7 @@
- save_LIBS=$LIBS
-
- if test -n "$ac_cv_pthreads_lib"; then
-- LIBS="$LIBS -l$ac_cv_pthreads_lib"
-+ LIBS="$LIBS $ac_cv_pthreads_lib"
- fi
-
- if test -n "$ac_cv_pthreads_cflags"; then
diff --git a/lang/php4/files/patch-configure.in b/lang/php4/files/patch-configure.in
new file mode 100644
index 000000000000..b3e0c11e4777
--- /dev/null
+++ b/lang/php4/files/patch-configure.in
@@ -0,0 +1,42 @@
+--- configure.in.orig Fri May 5 08:06:58 2006
++++ configure.in Fri May 5 08:09:15 2006
+@@ -261,7 +261,6 @@ dnl ## Apache module, CGI etc.)
+ dnl .
+ dnl -------------------------------------------------------------------------
+
+-PTHREADS_CHECK
+ PHP_HELP_SEPARATOR([SAPI modules:])
+ PHP_SHLIB_SUFFIX_NAME
+ PHP_SAPI=default
+@@ -287,7 +286,6 @@ AC_MSG_RESULT([$PHP_SAPI])
+
+ if test "$enable_experimental_zts" = "yes"; then
+ PTHREADS_ASSIGN_VARS
+- PTHREADS_FLAGS
+ fi
+
+ if test "$PHP_ENABLE_FASTCGI" = "yes"; then
+@@ -1235,18 +1233,15 @@ CFLAGS="\$(CFLAGS_CLEAN) $standard_libto
+ INLINE_CFLAGS="$INLINE_CFLAGS $standard_libtool_flag"
+ CXXFLAGS="$CXXFLAGS $standard_libtool_flag"
+
+-all_targets='$(OVERALL_TARGET) $(PHP_MODULES) $(PHP_CLI_TARGET)'
+-install_targets="$install_modules $install_pear install-build install-headers install-programs"
++all_targets='$(OVERALL_TARGET) $(PHP_MODULES) $(PHP_CLI_TARGET) $(PHP_CGI_TARGET)'
++install_targets="$PHP_INSTALL_CLI_TARGET $PHP_INSTALL_CGI_TARGET $install_modules $install_pear install-build install-headers install-programs"
+
+ case $PHP_SAPI in
+- cgi)
++ apache)
+ install_targets="install-sapi $install_targets"
+ ;;
+- cli)
+- install_targets="$PHP_INSTALL_CLI_TARGET $install_targets"
+- ;;
+- *)
+- install_targets="install-sapi $PHP_INSTALL_CLI_TARGET $install_targets"
++ apache2handler)
++ install_targets="install-sapi $install_targets"
+ ;;
+ esac
+
diff --git a/lang/php4/files/patch-main::php_config.h.in b/lang/php4/files/patch-main::php_config.h.in
index ca828a919078..0b470b3f484a 100644
--- a/lang/php4/files/patch-main::php_config.h.in
+++ b/lang/php4/files/patch-main::php_config.h.in
@@ -1,6 +1,6 @@
---- main/php_config.h.in.orig Sun Oct 30 12:06:40 2005
-+++ main/php_config.h.in Wed Nov 16 09:18:14 2005
-@@ -2606,6 +2606,9 @@
+--- main/php_config.h.in.orig Thu Jan 12 19:24:28 2006
++++ main/php_config.h.in Fri May 5 08:02:13 2006
+@@ -2624,6 +2624,9 @@
/* Whether to build zip as dynamic module */
#undef COMPILE_DL_ZIP
diff --git a/lang/php4/files/patch-main_SAPI.c b/lang/php4/files/patch-main_SAPI.c
index 2e7f7431d9cd..7064b4797140 100644
--- a/lang/php4/files/patch-main_SAPI.c
+++ b/lang/php4/files/patch-main_SAPI.c
@@ -1,6 +1,6 @@
---- main/SAPI.c.orig Fri Apr 15 10:50:01 2005
-+++ main/SAPI.c Fri Apr 15 10:50:14 2005
-@@ -565,7 +565,7 @@
+--- main/SAPI.c.orig Sun Jan 1 14:46:59 2006
++++ main/SAPI.c Fri May 5 08:02:13 2006
+@@ -582,7 +582,7 @@
ptr++;
len--;
}
@@ -9,7 +9,7 @@
if(!strncmp(ptr, "image/", sizeof("image/")-1)) {
zend_alter_ini_entry("zlib.output_compression", sizeof("zlib.output_compression"), "0", sizeof("0") - 1, PHP_INI_USER, PHP_INI_STAGE_RUNTIME);
}
-@@ -712,7 +712,7 @@
+@@ -729,7 +729,7 @@
return SUCCESS;
}
diff --git a/lang/php4/files/patch-sapi_cgi_Makefile.frag b/lang/php4/files/patch-sapi_cgi_Makefile.frag
new file mode 100644
index 000000000000..c10be19f4703
--- /dev/null
+++ b/lang/php4/files/patch-sapi_cgi_Makefile.frag
@@ -0,0 +1,9 @@
+--- sapi/cgi/Makefile.frag.orig Fri May 5 08:09:42 2006
++++ sapi/cgi/Makefile.frag Fri May 5 08:10:05 2006
+@@ -1,2 +1,5 @@
+-$(SAPI_CGI_PATH): $(PHP_GLOBAL_OBJS) $(PHP_SAPI_OBJS)
++$(SAPI_CGI_PATH): $(PHP_GLOBAL_OBJS) $(PHP_CGI_OBJS)
+ $(BUILD_CGI)
++
++install-cgi: $(SAPI_CGI_PATH)
++ @$(INSTALL_CGI)
diff --git a/lang/php4/files/patch-sapi_cgi_config9.m4 b/lang/php4/files/patch-sapi_cgi_config9.m4
new file mode 100644
index 000000000000..2d10bb0ac156
--- /dev/null
+++ b/lang/php4/files/patch-sapi_cgi_config9.m4
@@ -0,0 +1,54 @@
+--- sapi/cgi/config9.m4.orig Fri May 5 08:10:10 2006
++++ sapi/cgi/config9.m4 Fri May 5 08:15:23 2006
+@@ -81,7 +81,6 @@ main()
+ ])
+
+
+-if test "$PHP_SAPI" = "default"; then
+ AC_MSG_CHECKING(for CGI build)
+ if test "$PHP_SAPI_CGI" != "no"; then
+ AC_MSG_RESULT(yes)
+@@ -149,25 +148,38 @@ if test "$PHP_SAPI" = "default"; then
+ AC_DEFINE_UNQUOTED(PHP_FCGI_STATIC, $PHP_FCGI_STATIC, [ ])
+ AC_MSG_RESULT($PHP_ENABLE_FASTCGI)
+
+- INSTALL_IT="@echo \"Installing PHP CGI into: \$(INSTALL_ROOT)\$(bindir)/\"; \$(INSTALL) -m 0755 \$(SAPI_CGI_PATH) \$(INSTALL_ROOT)\$(bindir)/\$(program_prefix)php\$(program_suffix)"
+- PHP_SELECT_SAPI(cgi, program, $PHP_FCGI_FILES cgi_main.c getopt.c, $PHP_FCGI_INCLUDE, '$(SAPI_CGI_PATH)')
++ INSTALL_CGI="@echo \"Installing PHP CGI into: \$(INSTALL_ROOT)\$(bindir)/\"; \$(INSTALL) -m 0755 \$(SAPI_CGI_PATH) \$(INSTALL_ROOT)\$(bindir)/\$(program_prefix)php-cgi\$(program_suffix)"
++ PHP_ADD_SOURCES(sapi/cgi, $PHP_FCGI_FILES cgi_main.c getopt.c, $PHP_FCGI_INCLUDE, cgi)
++ PHP_ADD_SOURCES(/main, internal_functions.c,,cgi)
+
+ case $host_alias in
+ *darwin*)
+ BUILD_CGI="\$(CC) \$(CFLAGS_CLEAN) \$(EXTRA_CFLAGS) \$(EXTRA_LDFLAGS_PROGRAM) \$(LDFLAGS) \$(NATIVE_RPATHS) \$(PHP_GLOBAL_OBJS:.lo=.o) \$(PHP_SAPI_OBJS:.lo=.o) \$(PHP_FRAMEWORKS) \$(EXTRA_LIBS) \$(ZEND_EXTRA_LIBS) -o \$(SAPI_CGI_PATH)"
+ ;;
+ *)
+- BUILD_CGI="\$(LIBTOOL) --mode=link \$(CC) -export-dynamic \$(CFLAGS_CLEAN) \$(EXTRA_CFLAGS) \$(EXTRA_LDFLAGS_PROGRAM) \$(LDFLAGS) \$(PHP_RPATHS) \$(PHP_GLOBAL_OBJS) \$(PHP_SAPI_OBJS) \$(EXTRA_LIBS) \$(ZEND_EXTRA_LIBS) -o \$(SAPI_CGI_PATH)"
++ BUILD_CGI="\$(LIBTOOL) --mode=link \$(CC) -export-dynamic \$(CFLAGS_CLEAN) \$(EXTRA_CFLAGS) \$(EXTRA_LDFLAGS_PROGRAM) \$(LDFLAGS) \$(PHP_RPATHS) \$(PHP_GLOBAL_OBJS) \$(PHP_CGI_OBJS) \$(EXTRA_LIBS) \$(ZEND_EXTRA_LIBS) -o \$(SAPI_CGI_PATH)"
+ ;;
+ esac
+
++ PHP_CGI_TARGET="\$(SAPI_CGI_PATH)"
++ PHP_INSTALL_CGI_TARGET="install-cgi"
+ PHP_SUBST(BUILD_CGI)
++ PHP_SUBST(INSTALL_CGI)
++ PHP_SUBST(PHP_CGI_OBJS)
++ PHP_SUBST(PHP_CGI_TARGET)
++ PHP_SUBST(PHP_INSTALL_CGI_TARGET)
+
+- elif test "$PHP_SAPI_CLI" != "no"; then
+- AC_MSG_RESULT(no)
++ if test "$PHP_SAPI" = "default" ; then
++ PHP_BUILD_PROGRAM($SAPI_CGI_PATH)
++ fi
++ else
++ AC_MSG_RESULT(no)
++ if test "$PHP_SAPI" = "default" ; then
++ if test "$PHP_SAPI_CLI" != "no" ; then
+ OVERALL_TARGET=
+ PHP_SAPI=cli
+ else
+ AC_MSG_ERROR([No SAPIs selected.])
+ fi
++ fi
+ fi
diff --git a/lang/php4/files/patch-scripts::phpize.in b/lang/php4/files/patch-scripts::phpize.in
index 83f38a656499..9db65b6f616a 100644
--- a/lang/php4/files/patch-scripts::phpize.in
+++ b/lang/php4/files/patch-scripts::phpize.in
@@ -1,5 +1,5 @@
---- scripts/phpize.in.orig Wed Jun 15 19:13:52 2005
-+++ scripts/phpize.in Wed Jul 13 09:30:59 2005
+--- scripts/phpize.in.orig Sun Sep 4 06:41:00 2005
++++ scripts/phpize.in Fri May 5 08:02:13 2006
@@ -94,8 +94,8 @@
phpize_check_autotools()
@@ -9,5 +9,5 @@
+ test -z "$PHP_AUTOCONF" && PHP_AUTOCONF=autoconf259
+ test -z "$PHP_AUTOHEADER" && PHP_AUTOHEADER=autoheader259
- if ! test -x "`$php_shtool path $PHP_AUTOCONF`"; then
+ if test ! -x "`$php_shtool path $PHP_AUTOCONF`"; then
cat <<EOF
diff --git a/lang/php4/pkg-plist b/lang/php4/pkg-plist
index 209024ef1f08..26f9c70d1036 100644
--- a/lang/php4/pkg-plist
+++ b/lang/php4/pkg-plist
@@ -1,4 +1,5 @@
-%%CLICGI%%bin/php
+%%CLI%%bin/php
+%%CGI%%bin/php-cgi
bin/php-config
bin/phpize
etc/php.conf