Skip to content

Build extension DLLs in ext/ subfolder #16282

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 3 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions .github/scripts/windows/test_task.bat
Original file line number Diff line number Diff line change
Expand Up @@ -116,11 +116,11 @@ rem prepare for mail
curl -sLo hMailServer.exe https://www.hmailserver.com/download_file/?downloadid=271
hMailServer.exe /verysilent
cd %APPVEYOR_BUILD_FOLDER%
%PHP_BUILD_DIR%\php.exe -dextension_dir=%PHP_BUILD_DIR% -dextension=com_dotnet .github\setup_hmailserver.php
%PHP_BUILD_DIR%\php.exe -dextension_dir=%PHP_BUILD_DIR%\ext -dextension=com_dotnet .github\setup_hmailserver.php

mkdir %PHP_BUILD_DIR%\test_file_cache
rem generate php.ini
echo extension_dir=%PHP_BUILD_DIR% > %PHP_BUILD_DIR%\php.ini
echo extension_dir=%PHP_BUILD_DIR%\ext > %PHP_BUILD_DIR%\php.ini
echo opcache.file_cache=%PHP_BUILD_DIR%\test_file_cache >> %PHP_BUILD_DIR%\php.ini
if "%OPCACHE%" equ "1" echo zend_extension=php_opcache.dll >> %PHP_BUILD_DIR%\php.ini
rem work-around for some spawned PHP processes requiring OpenSSL
Expand Down
3 changes: 3 additions & 0 deletions .github/workflows/push.yml
Original file line number Diff line number Diff line change
Expand Up @@ -249,6 +249,9 @@ jobs:
uses: ./.github/actions/setup-windows
- name: Build
run: .github/scripts/windows/build.bat
- name: Show all DLLs
run: dir /s ${{ env.PHP_BUILD_OBJ_DIR }}\*.dll
shell: cmd
- name: Test
run: .github/scripts/windows/test.bat
BENCHMARKING:
Expand Down
18 changes: 9 additions & 9 deletions win32/build/confutils.js
Original file line number Diff line number Diff line change
Expand Up @@ -1367,8 +1367,8 @@ function ADD_EXTENSION_DEP(extname, dependson, optional)
ADD_FLAG("LDFLAGS_" + EXT, "/libpath:$(BUILD_DIR_DEV)\\lib");
ADD_FLAG("DEPS_" + EXT, "$(BUILD_DIR_DEV)\\lib\\php_" + dependson + ".lib");
} else {
ADD_FLAG("LDFLAGS_" + EXT, "/libpath:$(BUILD_DIR)");
ADD_FLAG("DEPS_" + EXT, "$(BUILD_DIR)\\php_" + dependson + ".lib");
ADD_FLAG("LDFLAGS_" + EXT, "/libpath:$(BUILD_DIR)\\ext");
ADD_FLAG("DEPS_" + EXT, "$(BUILD_DIR)\\ext\\php_" + dependson + ".lib");
}

} else {
Expand Down Expand Up @@ -1453,9 +1453,9 @@ function EXTENSION(extname, file_list, shared, cflags, dllname, obj_dir)
}
var libname = dllname.substring(0, dllname.length-4) + ".lib";

var resname = generate_version_info_resource(dllname, extname, configure_module_dirname, false);
var resname = generate_version_info_resource((MODE_PHPIZE ? "" : "ext\\") + dllname, extname, configure_module_dirname, false);
var ld = CMD_MOD1 + '"$(LINK)"';
var manifest_name = generate_version_info_manifest(dllname);
var manifest_name = generate_version_info_manifest((MODE_PHPIZE ? "" : "ext\\") + dllname);

ldflags = "";
if (is_pgo_desired(extname) && (PHP_PGI == "yes" || PHP_PGO != "no")) {
Expand All @@ -1474,14 +1474,14 @@ function EXTENSION(extname, file_list, shared, cflags, dllname, obj_dir)
ldflags = " /PGD:$(PGOPGD_DIR)\\" + dllname.substring(0, dllname.indexOf(".")) + ".pgd";
}

MFO.WriteLine("$(BUILD_DIR)\\" + libname + ": $(BUILD_DIR)\\" + dllname);
MFO.WriteLine("$(BUILD_DIR)\\ext\\" + libname + ": $(BUILD_DIR)\\ext\\" + dllname);
MFO.WriteBlankLines(1);
if (MODE_PHPIZE) {
MFO.WriteLine("$(BUILD_DIR)\\" + dllname + ": $(DEPS_" + EXT + ") $(" + EXT + "_GLOBAL_OBJS) $(PHPLIB) $(BUILD_DIR)\\" + resname + " $(BUILD_DIR)\\" + manifest_name);
MFO.WriteLine("\t" + ld + " $(" + EXT + "_GLOBAL_OBJS_RESP) $(PHPLIB) $(LIBS_" + EXT + ") $(LIBS) $(BUILD_DIR)\\" + resname + " /out:$(BUILD_DIR)\\" + dllname + " $(DLL_LDFLAGS) $(LDFLAGS) $(LDFLAGS_" + EXT + ")");
} else {
MFO.WriteLine("$(BUILD_DIR)\\" + dllname + ": $(DEPS_" + EXT + ") $(" + EXT + "_GLOBAL_OBJS) $(BUILD_DIR)\\$(PHPLIB) $(BUILD_DIR)\\" + resname + " $(BUILD_DIR)\\" + manifest_name);
MFO.WriteLine("\t" + ld + " $(" + EXT + "_GLOBAL_OBJS_RESP) $(BUILD_DIR)\\$(PHPLIB) $(LIBS_" + EXT + ") $(LIBS) $(BUILD_DIR)\\" + resname + " /out:$(BUILD_DIR)\\" + dllname + ldflags + " $(DLL_LDFLAGS) $(LDFLAGS) $(LDFLAGS_" + EXT + ")");
MFO.WriteLine("$(BUILD_DIR)\\ext\\" + dllname + ": $(DEPS_" + EXT + ") $(" + EXT + "_GLOBAL_OBJS) $(BUILD_DIR)\\$(PHPLIB) $(BUILD_DIR)\\" + resname + " $(BUILD_DIR)\\" + manifest_name);
MFO.WriteLine("\t" + ld + " $(" + EXT + "_GLOBAL_OBJS_RESP) $(BUILD_DIR)\\$(PHPLIB) $(LIBS_" + EXT + ") $(LIBS) $(BUILD_DIR)\\" + resname + " /out:$(BUILD_DIR)\\ext\\" + dllname + ldflags + " $(DLL_LDFLAGS) $(LDFLAGS) $(LDFLAGS_" + EXT + ")");
}
MFO.WriteLine("\t-" + CMD_MOD2 + "$(_VC_MANIFEST_EMBED_DLL)");
MFO.WriteBlankLines(1);
Expand All @@ -1491,7 +1491,7 @@ function EXTENSION(extname, file_list, shared, cflags, dllname, obj_dir)
} else {
ADD_FLAG("EXT_TARGETS", dllname);
}
MFO.WriteLine(dllname + ": $(BUILD_DIR)\\" + dllname);
MFO.WriteLine(dllname + ": $(BUILD_DIR)\\ext\\" + dllname);
MFO.WriteLine("\t" + CMD_MOD2 + "echo EXT " + extname + " build complete");
MFO.WriteBlankLines(1);

Expand Down Expand Up @@ -2020,7 +2020,7 @@ function generate_tmp_php_ini()
}

var ext_list = ("dl_test," + PHP_TEST_INI_EXT_EXCLUDE).split(",");
INI.WriteLine("extension_dir=" + ini_dir);
INI.WriteLine("extension_dir=" + ini_dir + "\\ext");
for (var i in extensions_enabled) {
if ("shared" != extensions_enabled[i][1]) {
continue;
Expand Down