Browse Source

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.
PEAR_1_4DEV
Wez Furlong 23 years ago
parent
commit
2aa33945fc
  1. 10
      win32/build/Makefile
  2. 16
      win32/build/confutils.js
  3. 46
      win32/build/mkdist.php

10
win32/build/Makefile

@ -20,7 +20,7 @@
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-snap:
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 @@ $(BUILD_DIR)\deplister.exe: win32\build\deplister.c
$(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

16
win32/build/confutils.js

@ -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 @@ function SAPI(sapiname, file_list, makefiletarget, cflags)
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 @@ function EXTENSION(extname, file_list, shared, cflags, dllname)
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("\t@echo EXT " + extname + " build complete");
MFO.WriteBlankLines(1);

46
win32/build/mkdist.php

@ -5,21 +5,26 @@ $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");
@mkdir($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 @@ function get_depends($module)
'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 @@ function get_depends($module)
/* 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 @@ function get_depends($module)
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_file_list($build_dir, "$dist_dir", $sapi_targets);
/* 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 @@ fwrite($fp, "\r\n\r\n");
/* 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 @@ foreach ($extra_dll_deps as $dll) {
}
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)
{

Loading…
Cancel
Save