These Patches to the buildroot-ng  add a new target to Apache (apache-dynamic) 
and to libapr (libapr-dynamic) that allows Apache to have dynamic loaded 
modules.

Currently I have the modules all being distributed with apache-dynamic - but 
these could be distributed as separate packages.

The size of the dynamic apache is about half that of the static version - 
which has got to be good... and if the modules are split out -then that would 
be good for footprint.

I have also added a target for php5 that allows php5 to be loaded as an apache 
module. (php5-apache)

The main issue with  doing this is that it requires two separate streams of 
libraries built into the staging area - and when compiling - we need to be 
able to switch between the two.

I'm not sure how this kind of dependency should be handled... or should it 
just always be modular apache and separate out the modules.

OptWare has apache set up as modules - and I largely coppied that format, 
including their patch for apxs.in.


Also a new patch file for apache is required, the patches follow the new file. 
(couldn't get svn to create a diff for me on that!)

Signed-off-by: Michael Geddes<michael at frog.wheelycreek.net>
---

----------feeds/packages/net/apache/ ---------------8<--------------
--- httpd-2.2.4.orig/support/apxs.in    2005-02-04 12:21:18.000000000 -0800
+++ httpd-2.2.4/support/apxs.in 2005-02-20 09:53:13.861402759 -0800
@@ -199,18 +199,19 @@
     ($httpd = $0) =~ s:support/apxs$::;
 }
 
-unless (-x "$httpd") {
-       error("$httpd not found or not executable");
-       exit 1;
-}
-
-unless (grep /mod_so/, `. $envvars && $httpd -l`) {
-    error("Sorry, no shared object support for Apache");
-    error("available under your platform. Make sure");
-    error("the Apache module mod_so is compiled into");
-    error("your server binary `$httpd'.");
-    exit 1;
-}
+### these checks will not work when cross-compiling into a staging area!
+#unless (-x "$httpd") {
+#      error("$httpd not found or not executable");
+#      exit 1;
+#}
+#
+#unless (grep /mod_so/, `. $envvars && $httpd -l`) {
+#    error("Sorry, no shared object support for Apache");
+#    error("available under your platform. Make sure");
+#    error("the Apache module mod_so is compiled into");
+#    error("your server binary `$httpd'.");
+#    exit 1;
+#}
 
 sub get_config_vars{
     my ($file, $rh_config) = @_;
@@ -528,9 +529,10 @@
 
     #   activate module via LoadModule/AddModule directive
     if ($opt_a or $opt_A) {
+       ### when staging, this should be non-fatal
         if (not -f "$CFG_SYSCONFDIR/$CFG_TARGET.conf") {
             error("Config file $CFG_SYSCONFDIR/$CFG_TARGET.conf not found");
-            exit(1);
+            exit(0);
         }
 
         open(FP, "<$CFG_SYSCONFDIR/$CFG_TARGET.conf") || die;
-----------------------------------------------------------------------------------------------------------------------------------------------

Start patches

Index: package/apr/Makefile
===================================================================
--- package/apr/Makefile        (revision 10543)
+++ package/apr/Makefile        (working copy)
@@ -28,10 +28,16 @@
   URL:=http://apr.apache.org/
 endef
 
+define Package/libapr-dynamic
+  SECTION:=libs
+  CATEGORY:=Libraries
+  DEPENDS:=+libpthread
+  TITLE:=Apache Portable Runtime Library (dyn)
+  URL:=http://apr.apache.org/
+endef
+
 CONFIGURE_ARGS += \
-       --with-devrandom=/dev/urandom \
-       --disable-dso \
-       --enable-ipv6
+       --with-devrandom=/dev/urandom
 
 CONFIGURE_VARS += \
        ac_cv_file__dev_zero=yes \
@@ -41,28 +47,64 @@
        ac_cv_sizeof_ssize_t=4 \
        LDFLAGS="$$$$LDFLAGS -lpthread" \
 
-define Build/Compile
+ifneq ($(CONFIG_PACKAGE_libapr),)
+define Build/Compile/libapr
+       echo configuring APR
+       $(call Build/Configure/Default, \
+               --disable-dso \
+               --enable-ipv6\
+       )
+       echo Building APR
        $(MAKE) -C $(PKG_BUILD_DIR) DESTDIR="$(PKG_INSTALL_DIR)" all install
+       $(CP)   $(PKG_INSTALL_DIR)/usr/bin/apr-1-config 
$(PKG_INSTALL_DIR)/usr/bin/apr-1-config.static
 endef
+endif
 
+ifneq ($(CONFIG_PACKAGE_libapr-dynamic),)
+define Build/Compile/libapr-dynamic
+       echo configuring APR Dynamic
+       $(call Build/Configure/Default, \
+               --disable-static \
+               --enable-layout=GNU \
+               --enable-lfs \
+               --enable-ipv6 \
+       )
+       echo Building APR Dynamic
+       $(MAKE) -C $(PKG_BUILD_DIR) DESTDIR="$(PKG_INSTALL_DIR)" clean all 
install
+       $(CP)   $(PKG_INSTALL_DIR)/usr/bin/apr-1-config 
$(PKG_INSTALL_DIR)/usr/bin/apr-1-config.dynamic
+endef
+endif
+
+define Build/Compile
+       $(call Build/Compile/libapr)
+       $(call Build/Compile/libapr-dynamic)
+endef
+
+define Build/Configure
+   echo NOT configuring APR
+endef
+
 define Build/InstallDev
-       $(INSTALL_DIR) $(2)/bin $(1)/usr/include/apr-1 $(1)/usr/lib 
$(1)/usr/lib/pkgconfig $(1)/usr/share/build-1
-       $(CP)   $(PKG_INSTALL_DIR)/usr/bin/apr-1-config \
-               $(2)/bin
-       $(CP)   $(PKG_INSTALL_DIR)/usr/include/apr-1/* \
-               $(1)/usr/include/apr-1/
-       $(CP)   $(PKG_INSTALL_DIR)/usr/lib/libapr-1.{la,a,so*} \
-               $(1)/usr/lib/
-       $(CP)   $(PKG_INSTALL_DIR)/usr/lib/pkgconfig/apr-1.pc \
-               $(1)/usr/lib/pkgconfig/
-       $(CP)   $(PKG_INSTALL_DIR)/usr/share/build-1/* \
-               $(1)/usr/share/build-1/
-       $(SED) 
's,^datadir=\"/usr/share\",datadir=\"$(STAGING_DIR)/usr/share\",g' 
$(2)/bin/apr-1-config
-       
$(SED) 
's,^installbuilddir=\"/usr/share/build-1\",installbuilddir=\"$(STAGING_DIR)/usr/share/build-1\",g'
 
$(2)/bin/apr-1-config
-       $(SED) 
's,^libdir=\"$$$${exec_prefix}/lib,libdir=\"$(STAGING_DIR)/usr/lib,g' 
$(2)/bin/apr-1-config
-       
$(SED) 
's,^includedir=\"$$$${prefix}/include/,includedir=\"$(STAGING_DIR)/usr/include/,g'
 
$(2)/bin/apr-1-config
-       $(SED) 's,-L$$$$libdir,,g' $(2)/bin/apr-1-config
-       $(SED) 's,-R$$$$libdir,,g' $(2)/bin/apr-1-config
+       if [ -d $(STAGING_DIR)/usr/include/apr-1.no ] ; then \
+         rm -rf $(STAGING_DIR)/usr/include/apr-1 \
+         mv $(STAGING_DIR)/usr/include/apr-1.no   
$(STAGING_DIR)/usr/include/apr-1 ; fi
+       if [ -d $(STAGING_DIR)/usr/include/apache2.no ] ; then \
+         mv $(STAGING_DIR)/usr/include/apache2.no 
$(STAGING_DIR)/usr/include/apache2 ; fi
+       $(INSTALL_DIR) $(2)/bin $(1)/usr/include/apr-1 $(1)/usr/lib 
$(1)/usr/lib/pkgconfig $(1)/usr/share/build-1 $(1)/usr/include/apache2
+       $(CP)   $(PKG_INSTALL_DIR)/usr/bin/apr-1-config*    $(2)/bin || true
+       $(CP)   $(PKG_INSTALL_DIR)/usr/include/apr-1/*      
$(1)/usr/include/apr-1 || true
+       $(CP)   $(PKG_INSTALL_DIR)/usr/include/apache2/*    
$(1)/usr/include/apache2 || true
+       $(CP)   $(PKG_INSTALL_DIR)/usr/lib/lib{apr-1,apr}.{la,a,so*} 
$(1)/usr/lib || 
true
+       $(CP)   $(PKG_INSTALL_DIR)/usr/lib/pkgconfig/apr-1.pc 
$(1)/usr/lib/pkgconfig || true 
+       $(CP)   $(PKG_INSTALL_DIR)/usr/share/build-1/*      
$(1)/usr/share/build-1 || true
+       for i in $(2)/bin/apr-1-config* ; do \
+         $(SED) 
's,^datadir=\"/usr/share\",datadir=\"$(STAGING_DIR)/usr/share\",g' 
$$$$i; \
+         
$(SED) 
's,^installbuilddir=\"/usr/share/build-1\",installbuilddir=\"$(STAGING_DIR)/usr/share/build-1\",g'
 
$$$$i ; \
+         
$(SED) 's,^libdir=\"$$$${exec_prefix}/lib,libdir=\"$(STAGING_DIR)/usr/lib,g' 
$$$$i ; \
+         
$(SED) 
's,^includedir=\"$$$${prefix}/include/,includedir=\"$(STAGING_DIR)/usr/include/,g'
 
$$$$i ; \
+         $(SED) 's,-L$$$$libdir,,g' $$$$i ; \
+         $(SED) 's,-R$$$$libdir,,g' $$$$i ; \
+       done
        $(SED) 's,/usr/share/build-1,$(STAGING_DIR)/usr/share/build-1,g' 
$(1)/usr/share/build-1/apr_rules.mk
 endef
 
@@ -71,4 +113,11 @@
        $(CP) $(PKG_INSTALL_DIR)/usr/lib/libapr-1.so.* $(1)/usr/lib/
 endef
 
+define Package/libapr-dynamic/install
+       $(INSTALL_DIR) $(1)/usr/lib
+       $(CP) $(PKG_INSTALL_DIR)/usr/lib/libapr.so.* $(1)/usr/lib/
+endef
+
 $(eval $(call BuildPackage,libapr))
+$(eval $(call BuildPackage,libapr-dynamic))
+
Index: package/apr-util/Makefile
===================================================================
--- package/apr-util/Makefile   (revision 10543)
+++ package/apr-util/Makefile   (working copy)
@@ -47,15 +47,18 @@
 endef
 
 define Build/InstallDev
-       $(INSTALL_DIR) $(2)/bin $(1)/usr/include/apr-1/ $(1)/usr/lib  
$(1)/usr/lib/pkgconfig/
-       $(CP)   $(PKG_INSTALL_DIR)/usr/bin/apu-1-config \
-               $(2)/bin
-       $(CP)   $(PKG_INSTALL_DIR)/usr/include/apr-1/* \
-               $(1)/usr/include/apr-1/
-       $(CP)   $(PKG_INSTALL_DIR)/usr/lib/libaprutil-1.{la,a,so*} \
-               $(1)/usr/lib/
-       $(CP)   $(PKG_INSTALL_DIR)/usr/lib/pkgconfig/apr-util-1.pc \
-               $(1)/usr/lib/pkgconfig/
+       if [ -d $(STAGING_DIR)/usr/include/apr-1.no ] ; then \
+         echo Found apr-1.no - rename to apr-1; \
+         rm -rf $(STAGING_DIR)/usr/include/apr-1; \
+         mv $(STAGING_DIR)/usr/include/apr-1.no 
$(STAGING_DIR)/usr/include/apr-1 ; 
fi
+       $(INSTALL_DIR) $(2)/bin $(1)/usr/include/apr-1/ $(1)/usr/lib  
$(1)/usr/lib/pkgconfig/ $(1)/usr/include/apr-1.keep/
+       $(CP)   $(PKG_INSTALL_DIR)/usr/bin/apu-1-config            $(2)/bin
+       $(CP)   $(PKG_INSTALL_DIR)/usr/include/apr-1/*             
$(1)/usr/include/apr-1/
+       $(CP)   $(PKG_INSTALL_DIR)/usr/include/apr-1/*             
$(1)/usr/include/apr-1.keep/
+       $(CP)   $(PKG_INSTALL_DIR)/usr/lib/libaprutil-1.{la,so*}   $(1)/usr/lib/
+       [ ! -e $(PKG_INSTALL_DIR)/usr/lib/libaprutil-1.a ] \
+       || $(CP)   $(PKG_INSTALL_DIR)/usr/lib/libaprutil-1.a       $(1)/usr/lib/
+       $(CP)   $(PKG_INSTALL_DIR)/usr/lib/pkgconfig/apr-util-1.pc 
$(1)/usr/lib/pkgconfig/
        $(SED) 's, -e \"s -I$$$$prefix/lib  g\",,g' $(2)/bin/apu-1-config
        $(SED) 
's,^libdir=\"$$$${exec_prefix}/lib,libdir=\"$(STAGING_DIR)/usr/lib,g' 
$(2)/bin/apu-1-config
        
$(SED) 
's,^includedir=\"$$$${prefix}/include/,includedir=\"$(STAGING_DIR)/usr/include/,g'
 
$(2)/bin/apu-1-config
Index: feeds/packages/net/apache/Makefile
===================================================================
--- feeds/packages/net/apache/Makefile  (revision 10543)
+++ feeds/packages/net/apache/Makefile  (working copy)
@@ -40,9 +40,15 @@
 define Package/apache-server
   $(call Package/apache/Default)
   TITLE:=The apache server & and some tools
-  DEPENDS:=apache
+  DEPENDS:=+libapr-dynamic +libaprutil +zlib +libexpat +libpcre +libopenssl 
+libsqlite3
 endef
 
+define Package/apache-server-dynamic
+  $(call Package/apache/Default)
+  TITLE:=The apache server & and some tools
+  DEPENDS:=+libapr +libaprutil +zlib +libexpat +libpcre +libopenssl 
+libsqlite3
+endef
+
 define Package/apache-server/description
        Take care that you don't include apache at the moment into your image
        please select it only as module because busybox will override
@@ -54,7 +60,11 @@
        for running your webif, you'll need to change the parameters in the
        scripts and configure the rest in /etc/httpd.conf.
 endef
+define Package/apache-server-dynamic/description
+  $(call Package/apache-server/description)
+endef
 
+
 define Package/apache-server/conffiles
 /etc/apache/httpd.conf
 /etc/apache/extra/httpd-autoindex.conf
@@ -75,10 +85,11 @@
 define Package/apache-icons
   $(call Package/apache/Default)
   TITLE:=Icons from Apache
-  DEPENDS:=apache
+#  DEPENDS:=apache
 endef
 
-define Build/Configure 
+define Build/Configure/apache-server
+       echo Configure apache server
        $(call Build/Configure/Default, \
                --with-apr="$(STAGING_DIR)/host/bin/apr-1-config" \
                --with-apr-util="$(STAGING_DIR)/host/bin/apu-1-config" \
@@ -96,33 +107,196 @@
        )
 endef
 
-define Build/Compile   
+APACHE_MPM=worker
+define Build/Configure/apache-server-dynamic
+       echo Configure apache server dynamic
+       $(call Build/Configure/Default, \
+               --with-apr="$(STAGING_DIR)/host/bin/apr-1-config.dynamic" \
+               --with-apr-util="$(STAGING_DIR)/host/bin/apu-1-config" \
+               --with-pcre="$(STAGING_DIR)/host/bin/pcre-config" \
+               --enable-http \
+               --enable-ssl \
+               --enable-proxy \
+               --enable-layout=GNU \
+               --with-mpm=$(APACHE_MPM) \
+               --enable-mods-shared=all \
+               --enable-cache \
+               --enable-file-cache \
+               --disable-disk-cache \
+               --enable-mem-cache \
+               --enable-deflate \
+               --enable-maintainer-mode \
+               --enable-mime-magic \
+               --without-suexec-bin \
+               --sysconfdir=/etc/apache \
+               ap_void_ptr_lt_long=no \
+               logfiledir="/var/log" \
+       )
+endef
+ifneq ($(CONFIG_PACKAGE_apache-server),)
+define Build/Compile/apache-server
+       echo $(call Buid/Configure/apache-server)
+
+       echo Compiling apache server - static
+       echo move away the 'dynamic' build apr library exports
+       if [ -d $(STAGING_DIR)/usr/include/apache2 ] ; then \
+         mv $(STAGING_DIR)/usr/include/apache2 
$(STAGING_DIR)/usr/include/apache2.no ; fi
+       echo Move in the  'static' target
+       if [ -d $(STAGING_DIR)/usr/include/apr-1.no ] ; then \
+         echo Found apr-1.no - rename to apr-1; \
+         rm -rf $(STAGING_DIR)/usr/include/apr-1 ; \
+         mv $(STAGING_DIR)/usr/include/apr-1.no 
$(STAGING_DIR)/usr/include/apr-1 ; 
fi
+
+       $(CP) $(STAGING_DIR)/usr/include/apr-1.keep/* 
$(STAGING_DIR)/usr/include/apr-1
+
+       if ([ -e $(STAGING_DIR)/host/bin/apr-1-config ] && [ -e 
$(STAGING_DIR)/host/bin/apr-1-config.static ])  ; then \
+          cp  $(STAGING_DIR)/host/bin/apr-1-config.static 
$(STAGING_DIR)/host/bin/apr-1-config ; fi
+       $(call Build/Configure/Default, \
+               --with-apr="$(STAGING_DIR)/host/bin/apr-1-config" \
+               --with-apr-util="$(STAGING_DIR)/host/bin/apu-1-config" \
+               --with-pcre="$(STAGING_DIR)/host/bin/pcre-config" \
+               --enable-http \
+               --enable-ssl \
+               --enable-proxy \
+               --disable-disk-cache \
+               --enable-maintainer-mode \
+               --enable-mime-magic \
+               --without-suexec-bin \
+               --sysconfdir=/etc/apache \
+               ap_void_ptr_lt_long=no \
+               logfiledir="/var/log" \
+       )
+       echo Clean - because of the dynamic build
+       $(CP) $(PKG_BUILD_DIR)/server/test_char.h $(PKG_BUILD_DIR)/tt_char.h
+       $(MAKE) -C $(PKG_BUILD_DIR)  clean
+       $(CP) $(PKG_BUILD_DIR)/tt_char.h $(PKG_BUILD_DIR)/server/test_char.h
+       echo Compiling apache server
        $(MAKE) -C $(PKG_BUILD_DIR) \
                DESTDIR="$(PKG_INSTALL_DIR)" \
                all install
+       # if you need docs take a look into the build-dir :)
+       rm -rf  $(PKG_INSTALL_DIR)/ser/usr/man/ \
+               $(PKG_INSTALL_DIR)/usr/share/manual/
+       mv $(PKG_INSTALL_DIR) $(PKG_BUILD_DIR)/ipkg-server
 endef
+endif
 
+ifneq ($(CONFIG_PACKAGE_apache-server-dynamic),)
+define Build/Compile/apache-server-dynamic
+       $(CP) $(PKG_BUILD_DIR)/server/test_char.h $(PKG_BUILD_DIR)/tt_char.h
+       [ -e $(PKG_BUILD_DIR)/Makefile ] && $(MAKE) -C $(PKG_BUILD_DIR) clean
+       $(CP) $(PKG_BUILD_DIR)/tt_char.h $(PKG_BUILD_DIR)/server/test_char.h
+
+       if ([ -e $(STAGING_DIR)/host/bin/apr-1-config ] && [ -e 
$(STAGING_DIR)/host/bin/apr-1-config.dynamic ]); then \
+         cp  $(STAGING_DIR)/host/bin/apr-1-config.dynamic 
$(STAGING_DIR)/host/bin/apr-1-config ; fi
+
+       if [ -d $(STAGING_DIR)/usr/include/apache2.no ] ; then \
+         mv $(STAGING_DIR)/usr/include/apache2.no 
$(STAGING_DIR)/usr/include/apache2 ; fi
+       # move away the 'static' build apr library exports
+       # Copy in the apr utilities includes
+       if [ -d $(STAGING_DIR)/usr/include/apr-1 ] ; then \
+         if [ ! -d $(STAGING_DIR)/usr/include/apr-1.no ] ; \
+         then mv $(STAGING_DIR)/usr/include/apr-1 
$(STAGING_DIR)/usr/include/apr-1.no ; \
+         fi ; \
+         $(INSTALL_DIR) $(STAGING_DIR)/usr/include/apr-1 ;  \
+         $(CP) $(STAGING_DIR)/usr/include/apr-1.keep/* 
$(STAGING_DIR)/usr/include/apr-1 ; \
+       fi
+
+       #       --with-mpm=$(APACHE_MPM) 
+       echo $(call Buid/Configure/apache-server-dynamic)
+       $(call Build/Configure/Default, \
+               --with-apr="$(STAGING_DIR)/host/bin/apr-1-config" \
+               --with-apr-util="$(STAGING_DIR)/host/bin/apu-1-config" \
+               --with-pcre="$(STAGING_DIR)/host/bin/pcre-config" \
+               --enable-http \
+               --enable-ssl \
+               --enable-proxy \
+               --enable-layout=GNU \
+               --enable-mods-shared=all \
+               --enable-cache \
+               --enable-file-cache \
+               --disable-disk-cache \
+               --enable-mem-cache \
+               --enable-deflate \
+               --enable-maintainer-mode \
+               --enable-mime-magic \
+               --without-suexec-bin \
+               --sysconfdir=/etc/apache \
+               ap_void_ptr_lt_long=no \
+               logfiledir="/var/log" \
+       )
+       echo Compiling apache server
+       $(MAKE) -C $(PKG_BUILD_DIR) \
+               DESTDIR="$(PKG_INSTALL_DIR)" \
+               all install
+       # if you need docs take a look into the build-dir :)
+       rm -rf  $(PKG_INSTALL_DIR)/ser/usr/man/ \
+               $(PKG_INSTALL_DIR)/usr/share/manual/
+       mv $(PKG_INSTALL_DIR) $(PKG_BUILD_DIR)/ipkg-server-dynamic
+
+       if [ -d $(STAGING_DIR)/usr/include/apr-1.no ] ; then \
+         echo Found apr-1.no - rename to apr-1; \
+         rm -rf $(STAGING_DIR)/usr/include/apr-1; \
+         mv $(STAGING_DIR)/usr/include/apr-1.no 
$(STAGING_DIR)/usr/include/apr-1 ; 
fi
+endef
+endif
+
+define Build/Compile   
+       $(call Build/Compile/apache-server)
+       $(call Build/Compile/apache-server-dynamic)
+endef
+
+define Build/Configure
+endef
+
+ifneq ($(CONFIG_PACKAGE_apache-server-dynamic),)
 define Build/InstallDev
-       rm -rf  $(PKG_INSTALL_DIR)/usr/man/ \
-               $(PKG_INSTALL_DIR)/usr/share/manual/
-       # if you need docs take a look into the build-dir :)
        mkdir -p $(1)/etc
-       $(CP)   $(PKG_INSTALL_DIR)/etc/* \
+       $(CP)   $(PKG_BUILD_DIR)/ipkg-server-dynamic/etc/* \
                $(1)/etc
        mkdir -p $(1)/usr/include
-       $(CP)   $(PKG_INSTALL_DIR)/usr/include/* \
+       $(CP)   $(PKG_BUILD_DIR)/ipkg-server-dynamic/usr/include/* \
                $(1)/usr/include
        mkdir -p $(1)/usr/lib
-       $(CP)   $(PKG_INSTALL_DIR)/usr/lib/httpd.exp \
+       $(CP)   $(PKG_BUILD_DIR)/ipkg-server-dynamic/usr/lib/httpd.exp \
                $(1)/usr/lib
        mkdir -p $(1)/usr/sbin
-       $(CP)   $(PKG_INSTALL_DIR)/usr/sbin/* \
+       $(CP)   $(PKG_BUILD_DIR)/ipkg-server-dynamic/usr/sbin/* \
                $(1)/usr/sbin
        mkdir -p $(1)/usr/share
-       $(CP)   $(PKG_INSTALL_DIR)/usr/share/* \
+       $(CP)   $(PKG_BUILD_DIR)/ipkg-server-dynamic/usr/share/* \
                $(1)/usr/share
+       $(SED) 's,/usr/share/build,$(STAGING_DIR)/usr/share/build,g' \
+               $(1)/usr/sbin/apxs
+       mkdir -p $(1)/usr/share/build
+       $(CP)   $(PKG_BUILD_DIR)/ipkg-server-dynamic/usr/share/build/*  
$(1)/usr/share/build || true
+       $(SED) 's!^\([a-z_]\+ = \)/usr!\1$(STAGING_DIR)/usr!' \
+               $(1)/usr/share/build/config_vars.mk
+       $(SED) 's!^\(AP[RU]_CONFIG = \)/usr!\1$(STAGING_DIR)/host!' \
+               $(1)/usr/share/build/config_vars.mk
 endef
+else
+define Build/InstallDev
+       mkdir -p $(1)/etc
+       $(CP)   $(PKG_BUILD_DIR)/ipkg-server/etc/* \
+               $(1)/etc
+       mkdir -p $(1)/usr/include
+       $(CP)   $(PKG_BUILD_DIR)/ipkg-server/usr/include/* \
+               $(1)/usr/include
+       mkdir -p $(1)/usr/lib
+       $(CP)   $(PKG_BUILD_DIR)/ipkg-server/usr/lib/httpd.exp \
+               $(1)/usr/lib
+       mkdir -p $(1)/usr/sbin
+       $(CP)   $(PKG_BUILD_DIR)/ipkg-server/usr/sbin/* \
+               $(1)/usr/sbin
+       mkdir -p $(1)/usr/share
+       $(CP)   $(PKG_BUILD_DIR)/ipkg-server/usr/share/* \
+               $(1)/usr/share
 
+endef
+endif
+
+
 define Package/apache-server/preinst
        rm /usr/sbin/httpd
        echo -e "You should take a look in the initscripts, busybox's httpd \n\
@@ -132,16 +306,31 @@
 define Package/apache-server/install
        $(INSTALL_DIR) $(1)/usr/sbin
        # we don't need apxs on the router, it's just for building apache 
modules.  
-       $(INSTALL_BIN) 
$(PKG_INSTALL_DIR)/usr/sbin/{ab,apachectl,checkgid,dbmmanage,envvars,envvars-std,htcacheclean,htdbm,htdigest,htpasswd,httpd,httxt2dbm,logresolve,rotatelogs}
 
$(1)/usr/sbin/
+       $(INSTALL_BIN) 
$(PKG_BUILD_DIR)/ipkg-server/usr/sbin/{ab,apachectl,checkgid,dbmmanage,envvars,envvars-std,htcacheclean,htdbm,htdigest,htpasswd,httpd,httxt2dbm,logresolve,rotatelogs}
 
$(1)/usr/sbin/
        $(INSTALL_DIR) $(1)/usr/lib
-       $(CP) $(PKG_INSTALL_DIR)/usr/lib/httpd.exp $(1)/usr/lib/
+       $(CP) $(PKG_BUILD_DIR)/ipkg-server/usr/lib/httpd.exp $(1)/usr/lib/
        $(INSTALL_DIR) $(1)/usr/share
-       $(CP) $(PKG_INSTALL_DIR)/usr/share/{error,htdocs,cgi-bin,build} 
$(1)/usr/share/
+       $(CP) 
$(PKG_BUILD_DIR)/ipkg-server/usr/share/{error,htdocs,cgi-bin,build} 
$(1)/usr/share/
        $(INSTALL_DIR) $(1)/etc/apache
-       $(CP) $(PKG_INSTALL_DIR)/etc/apache/{magic,mime.types,extra} 
$(1)/etc/apache/
+       $(CP) $(PKG_BUILD_DIR)/ipkg-server/etc/apache/{magic,mime.types,extra} 
$(1)/etc/apache/
        $(CP) ./files/etc/apache/httpd.conf $(1)/etc/apache/
 endef
+define Package/apache-server-dynamic/install
+       $(INSTALL_DIR) $(1)/usr/sbin
+       # we don't need apxs on the router, it's just for building apache 
modules.  
+       $(INSTALL_BIN) 
$(PKG_BUILD_DIR)/ipkg-server-dynamic/usr/sbin/{ab,apachectl,checkgid,dbmmanage,envvars,envvars-std,htcacheclean,htdbm,htdigest,htpasswd,httpd,httxt2dbm,logresolve,rotatelogs}
 
$(1)/usr/sbin/
+       $(INSTALL_DIR) $(1)/usr/lib
+       $(CP) $(PKG_BUILD_DIR)/ipkg-server-dynamic/usr/lib/httpd.exp 
$(1)/usr/lib/
+       $(INSTALL_DIR) $(1)/usr/share
+       $(CP) 
$(PKG_BUILD_DIR)/ipkg-server-dynamic/usr/share/{error,htdocs,cgi-bin,build} 
$(1)/usr/share/
+       $(INSTALL_DIR) $(1)/etc/apache
+       $(CP) 
$(PKG_BUILD_DIR)/ipkg-server-dynamic/etc/apache/{magic,mime.types,extra} 
$(1)/etc/apache/
+       $(CP) ./files/etc/apache/httpd.conf $(1)/etc/apache/
+       $(INSTALL_DIR) $(1)/usr/share/apache2/
+       $(CP) $(PKG_BUILD_DIR)/ipkg-server-dynamic/usr/lib/* 
$(1)/usr/share/apache2/
 
+endef
+
 define Package/apache-server/postrm
        rm -rf /usr/sbin/httpd
        ln -s /bin/busybox /usr/sbin/httpd
@@ -151,9 +340,15 @@
 
 define Package/apache-icons/install
        $(INSTALL_DIR) $(1)/usr/share
-       $(CP) $(PKG_INSTALL_DIR)/usr/share/icons $(1)/usr/share/
+       # $(CP) $(PKG_INSTALL_DIR)/usr/share/icons $(1)/usr/share/
+       if [ -d $(PKG_BUILD_DIR)/ipkg-server/ ] ; \
+       then $(CP) $(PKG_BUILD_DIR)/ipkg-server/usr/share/icons $(1)/usr/share/ 
; \
+       else $(CP) $(PKG_BUILD_DIR)/ipkg-server-dynamic/usr/share/icons 
$(1)/usr/share/ ; \
+       fi
 endef
 
 $(eval $(call BuildPackage,apache))
 $(eval $(call BuildPackage,apache-server))
+$(eval $(call BuildPackage,apache-server-dynamic))
 $(eval $(call BuildPackage,apache-icons))
+
Index: feeds/packages/lang/php5/Makefile
===================================================================
--- feeds/packages/lang/php5/Makefile   (revision 10543)
+++ feeds/packages/lang/php5/Makefile   (working copy)
@@ -75,6 +75,18 @@
  This package contains the FastCGI version of the PHP5 interpreter.
 endef
 
+define Package/php5-apache
+  $(call Package/php5/Default)
+  DEPENDS:=php5 +apache-server-dynamic
+  TITLE+= (Apache)
+endef
+
+define Package/php5-apache/description
+$(call Package/php5/Default/description)
+ This package contains the Apache module version of the PHP5 interpreter.
+endef
+
+
 define Package/php5-mod-curl
   $(call Package/php5/Default)
   DEPENDS:=php5 +libcurl
@@ -203,6 +215,7 @@
   CONFIG_PACKAGE_php5-cli:=m
   CONFIG_PACKAGE_php5-cgi:=m
   CONFIG_PACKAGE_php5-fastcgi:=m
+  CONFIG_PACKAGE_php5-apache:=m
   CONFIG_PACKAGE_php5-mod-curl:=m
   CONFIG_PACKAGE_php5-mod-gd:=m
   CONFIG_PACKAGE_php5-mod-gmp:=m
@@ -275,6 +288,9 @@
 else
   PKG_CONFIGURE_OPTS+= --disable-apc
 endif
+ifneq ($(CONFIG_PACKAGE_php5-apache),)
+  PKG_BUILD_DEPENDS+= apache-server-dynamic
+endif
 
 define Build/Configure
 endef
@@ -338,10 +354,34 @@
   endef
 endif
 
+ifneq ($(CONFIG_PACKAGE_php5-apache),)
+  define Build/Compile/php5-apache
+       -$(MAKE) -C $(PKG_BUILD_DIR) clean
+       rm $(PKG_BUILD_DIR)/configure
+       cd $(PKG_BUILD_DIR) && ./buildconf --force
+       $(call Build/Configure/Default, \
+               $(PKG_CONFIGURE_OPTS) \
+               --enable-cli \
+               --enable-cgi \
+               --disable-fastcgi \
+               --disable-force-cgi-redirect \
+               --enable-discard-path \
+               --with-apxs2=$(STAGING_DIR)/usr/sbin/apxs \
+               , \
+               LIBS="$(PKG_CONFIGURE_LIBS)" \
+               php_cv_cc_rpath="no" \
+       )
+       $(MAKE) -C $(PKG_BUILD_DIR)
+       mkdir -p $(PKG_BUILD_DIR)/apache_module/
+       $(CP) $(PKG_BUILD_DIR)/libs/libphp5.* $(PKG_BUILD_DIR)/apache_module/
+  endef
+endif
+
 define Build/Compile
        $(call Build/Compile/php5-cli)
        $(call Build/Compile/php5-cgi)
        $(call Build/Compile/php5-fastcgi)
+       $(call Build/Compile/php5-apache)
 endef
 
 define Package/php5/conffiles
@@ -370,6 +410,11 @@
        $(INSTALL_BIN) ./files/php.init $(1)/etc/init.d/php
 endef
 
+define Package/php5-apache/install
+       $(INSTALL_DIR) $(1)/usr/lib
+       $(CP) $(PKG_BUILD_DIR)/apache_module/* $(1)/usr/lib 
+endef
+
 define BuildPlugin
   define Package/$(1)/install
        [ -z "$(2)" ] || $(INSTALL_DIR) $$(1)/usr/lib/php
@@ -385,6 +430,7 @@
 $(eval $(call BuildPackage,php5-cli))
 $(eval $(call BuildPackage,php5-cgi))
 $(eval $(call BuildPackage,php5-fastcgi))
+$(eval $(call BuildPackage,php5-apache))
 $(eval $(call BuildPlugin,php5-mod-curl,curl))
 $(eval $(call BuildPlugin,php5-mod-ftp,ftp))
 $(eval $(call BuildPlugin,php5-mod-gd,gd))

-------------------------------------------------------

-------------------------------------------------------
_______________________________________________
openwrt-devel mailing list
[email protected]
http://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel

Reply via email to