wez             Fri Jan  9 08:17:59 2004 EDT

  Modified files:              
    /php-src/win32/build        Makefile confutils.js mkdist.php 
  Log:
  Separate pecl extensions and sapi into their own target, and have mkdist.php
  create a separate pecl dir and zip when building a win32 snapshot.
  
Index: php-src/win32/build/Makefile
diff -u php-src/win32/build/Makefile:1.15 php-src/win32/build/Makefile:1.16
--- php-src/win32/build/Makefile:1.15   Thu Jan  8 12:33:29 2004
+++ php-src/win32/build/Makefile        Fri Jan  9 08:17:58 2004
@@ -14,13 +14,13 @@
 #  | Author: Wez Furlong <[EMAIL PROTECTED]>                           |
 #  +----------------------------------------------------------------------+
 #
-# $Id: Makefile,v 1.15 2004/01/08 17:33:29 sniper Exp $
+# $Id: Makefile,v 1.16 2004/01/09 13:17:58 wez Exp $
 # This is the makefile template for the win32 build
 
 CC="$(CL)"
 LD="$(LINK)"
 
-all: $(BUILD_DIR) $(BUILD_DIRS_SUB) generated_files $(EXT_TARGETS) $(SAPI_TARGETS)
+all: $(BUILD_DIR) $(BUILD_DIRS_SUB) generated_files $(EXT_TARGETS) $(PECL_TARGETS) 
$(SAPI_TARGETS)
 
 generated_files: Zend\zend_ini_parser.c \
        Zend\zend_language_parser.c Zend\zend_ini_scanner.c \
@@ -87,11 +87,15 @@
 
 build-dist: $(BUILD_DIR)\deplister.exe
        -rmdir /s /q $(BUILD_DIR)\php-$(PHP_VERSION_STRING)
+       -rmdir /s /q $(BUILD_DIR)\php-$(PHP_VERSION_STRING)-pecl
        -del /f /q $(BUILD_DIR)\php-$(PHP_VERSION_STRING).zip
-       $(BUILD_DIR)\php.exe -n win32/build/mkdist.php "$(BUILD_DIR)" "$(PHPDLL)" 
"$(SAPI_TARGETS)" "$(EXT_TARGETS)" "$(SNAPSHOT_TEMPLATE)"
+       $(BUILD_DIR)\php.exe -n win32/build/mkdist.php "$(BUILD_DIR)" "$(PHPDLL)" 
"$(SAPI_TARGETS)" "$(EXT_TARGETS)" "$(PECL_TARGETS)" "$(SNAPSHOT_TEMPLATE)"
        cd $(BUILD_DIR)\php-$(PHP_VERSION_STRING)
        -$(ZIP) -9 -r ..\php-$(PHP_VERSION_STRING).zip .
        cd ..\..
+       cd $(BUILD_DIR)\php-$(PHP_VERSION_STRING)-pecl
+       -$(ZIP) -9 -r ..\php-$(PHP_VERSION_STRING)-pecl.zip .
+       cd ..\..
 
 dist: all build-dist
 snap: build-snap build-dist
@@ -100,7 +104,7 @@
        $(CL) /Fo$(BUILD_DIR)\ /Fd$(BUILD_DIR)\ /Fp$(BUILD_DIR)\ /FR$(BUILD_DIR) 
-o$(BUILD_DIR)\deplister.exe win32\build\deplister.c imagehlp.lib
 
 msi-installer: dist
-       $(BUILD_DIR)\php.exe ..\php-installer\build-installer.php "$(BUILD_DIR)" 
"$(PHPDLL)" "$(SAPI_TARGETS)" "$(EXT_TARGETS)"
+       $(BUILD_DIR)\php.exe ..\php-installer\build-installer.php "$(BUILD_DIR)" 
"$(PHPDLL)" "$(SAPI_TARGETS)" "$(EXT_TARGETS)" "$(PECL_TARGETS)"
 
 install: all
        @copy $(BUILD_DIR)\*.exe $(PHP_PREFIX) /y >nul
Index: php-src/win32/build/confutils.js
diff -u php-src/win32/build/confutils.js:1.35 php-src/win32/build/confutils.js:1.36
--- php-src/win32/build/confutils.js:1.35       Fri Jan  9 06:19:40 2004
+++ php-src/win32/build/confutils.js    Fri Jan  9 08:17:58 2004
@@ -17,7 +17,7 @@
   +----------------------------------------------------------------------+
 */
 
-// $Id: confutils.js,v 1.35 2004/01/09 11:19:40 wez Exp $
+// $Id: confutils.js,v 1.36 2004/01/09 13:17:58 wez Exp $
 
 var STDOUT = WScript.StdOut;
 var STDERR = WScript.StdErr;
@@ -773,7 +773,13 @@
        MFO.WriteLine("\t" + ld + " /nologo /out:$(BUILD_DIR)\\" + makefiletarget + " 
" + ldflags + " $(" + SAPI + "_GLOBAL_OBJS) $(BUILD_DIR)\\$(PHPLIB) $(LDFLAGS_" + SAPI 
+ ") $(LIBS_" + SAPI + ") $(BUILD_DIR)\\" + resname);
 
        DEFINE('CFLAGS_' + SAPI + '_OBJ', '$(CFLAGS_' + SAPI + ')');
-       ADD_FLAG("SAPI_TARGETS", makefiletarget);
+
+       if (configure_module_dirname.match("pecl")) {
+               ADD_FLAG("PECL_TARGETS", makefiletarget);
+       } else {
+               ADD_FLAG("SAPI_TARGETS", makefiletarget);
+       }
+
        MFO.WriteBlankLines(1);
 }
 
@@ -865,7 +871,11 @@
                MFO.WriteLine("\t" + ld + " /out:$(BUILD_DIR)\\" + dllname + " 
$(DLL_LDFLAGS) $(LDFLAGS) $(LDFLAGS_" + EXT + ") $(" + EXT + "_GLOBAL_OBJS) 
$(BUILD_DIR)\\$(PHPLIB) $(LIBS_" + EXT + ") $(LIBS) $(BUILD_DIR)\\" + resname);
                MFO.WriteBlankLines(1);
 
-               ADD_FLAG("EXT_TARGETS", dllname);
+               if (configure_module_dirname.match("pecl")) {
+                       ADD_FLAG("PECL_TARGETS", dllname);
+               } else {
+                       ADD_FLAG("EXT_TARGETS", dllname);
+               }
                MFO.WriteLine(dllname + ": $(BUILD_DIR)\\" + dllname);
                MFO.WriteLine("[EMAIL PROTECTED] EXT " + extname + " build complete");
                MFO.WriteBlankLines(1);
Index: php-src/win32/build/mkdist.php
diff -u php-src/win32/build/mkdist.php:1.6 php-src/win32/build/mkdist.php:1.7
--- php-src/win32/build/mkdist.php:1.6  Wed Jan  7 18:11:54 2004
+++ php-src/win32/build/mkdist.php      Fri Jan  9 08:17:58 2004
@@ -1,25 +1,30 @@
-<?php # $Id: mkdist.php,v 1.6 2004/01/07 23:11:54 wez Exp $
+<?php # $Id: mkdist.php,v 1.7 2004/01/09 13:17:58 wez Exp $
 /* piece together a windows binary distro */
 
 $build_dir = $argv[1];
 $phpdll = $argv[2];
 $sapi_targets = explode(" ", $argv[3]);
 $ext_targets = explode(" ", $argv[4]);
-$snapshot_template = $argv[5];
+$pecl_targets = explode(" ", $argv[5]);
+$snapshot_template = $argv[6];
 
 $is_debug = preg_match("/^debug/i", $build_dir);
 
 echo "Making dist for $build_dir\n";
 
 $dist_dir = $build_dir . "/php-" . phpversion();
+$pecl_dir = $dist_dir . "-pecl";
+
 @mkdir($dist_dir);
 @mkdir("$dist_dir/ext");
 @mkdir("$dist_dir/dev");
 @mkdir("$dist_dir/extras");
[EMAIL PROTECTED]($pecl_dir);
 
 /* figure out additional DLL's that are required */
 $extra_dll_deps = array();
 $per_module_deps = array();
+$pecl_dll_deps = array();
 
 function get_depends($module)
 {
@@ -55,10 +60,12 @@
                'msvcrt.dll',
 
                );
-       global $build_dir, $extra_dll_deps, $ext_targets, $sapi_targets, $phpdll, 
$per_module_deps;
+       global $build_dir, $extra_dll_deps, $ext_targets, $sapi_targets, 
$pecl_targets, $phpdll, $per_module_deps, $pecl_dll_deps;
        
        $bd = strtolower(realpath($build_dir));
 
+       $is_pecl = in_array($module, $pecl_targets);
+       
        $cmd = "$GLOBALS[build_dir]\\deplister.exe \"$module\" 
\"$GLOBALS[build_dir]\"";
        $proc = proc_open($cmd, 
                        array(1 => array("pipe", "w")),
@@ -73,7 +80,7 @@
                /* ignore stuff in our build dir, but only if it is
             * one of our targets */
                if (((in_array($depbase, $sapi_targets) ||
-                               in_array($depbase, $ext_targets)) ||
+                               in_array($depbase, $ext_targets) || in_array($depbase, 
$pecl_targets)) ||
                                $depbase == $phpdll) && 
file_exists($GLOBALS['build_dir'] . "/$depbase")) {
                        continue;
                }
@@ -82,8 +89,14 @@
                        continue;
                }
                
-               if (!in_array($dep, $extra_dll_deps)) {
-                       $extra_dll_deps[] = $dep;
+               if ($is_pecl) {
+                       if (!in_array($dep, $pecl_dll_deps)) {
+                               $pecl_dll_deps[] = $dep;
+                       }
+               } else {
+                       if (!in_array($dep, $extra_dll_deps)) {
+                               $extra_dll_deps[] = $dep;
+                       }
                }
 
                $per_module_deps[basename($module)][] = $dep;
@@ -139,6 +152,9 @@
 /* copy the extensions */
 copy_file_list($build_dir, "$dist_dir/ext", $ext_targets);
 
+/* pecl sapi and extensions */
+copy_file_list($build_dir, $pecl_dir, $pecl_targets);
+
 /* populate reading material */
 $text_files = array(
        "LICENSE" =>            "license.txt",
@@ -188,6 +204,9 @@
 /* list dependencies */
 fprintf($fp, "Dependency information:\r\n");
 foreach ($per_module_deps as $modulename => $deps) {
+       if (in_array($modulename, $pecl_targets))
+               continue;
+
        fprintf($fp, "Module: %s\r\n", $modulename);
        fwrite($fp, "===========================\r\n");
        foreach ($deps as $dll) {
@@ -210,6 +229,23 @@
        }
        copy($dll, "$dist_dir/" . basename($dll));
 }
+/* and those for pecl */
+foreach ($pecl_dll_deps as $dll) {
+       if (in_array($dll, $extra_dll_deps)) {
+               /* already in main distro */
+               continue;
+       }
+       if (!file_exists($dll)) {
+               /* try template dir */
+               $tdll = $snapshot_template . "/dlls/" . basename($dll);
+               if (!file_exists($tdll)) {
+                       echo "WARNING: distro depends on $dll, but could not find it 
on your system\n";
+                       continue;
+               }
+               $dll = $tdll;
+       }
+       copy($dll, "$pecl_dir/" . basename($dll));
+}
 
 function copy_dir($source, $dest)
 {

-- 
PHP CVS Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to