]> granicus.if.org Git - php/commitdiff
Improve the config.simple.bat for Windows a little;
authorKalle Sommer Nielsen <kalle@php.net>
Tue, 18 Oct 2016 23:14:15 +0000 (01:14 +0200)
committerKalle Sommer Nielsen <kalle@php.net>
Tue, 18 Oct 2016 23:14:15 +0000 (01:14 +0200)
This adds --with-config-profile=foobar, this generates a config.foobar.bat file in the root of php-src directory with the relevant configuration arguments.

.gitignore
win32/build/buildconf.js
win32/build/config.w32
win32/build/confutils.js

index ea5d16a5a4bc285fd8c95e455467b727503fd9d8..81e339a82f443ba7c8398aba5e5880cae89e7042 100644 (file)
@@ -56,7 +56,6 @@ config.cache
 config.h.in
 config.log
 config.nice
-config.nice.bat
 config.status
 config.sub
 config_vars.mk
@@ -285,4 +284,4 @@ win32/*.positions
 win32/ext
 win32/phpts.def
 win32/wsyslog.h
-/config.simple.bat
+config.*.bat
index a00c8aff7b499b46e621026ef3fcb7af430a00ff..b7e964e3e7cbdd63ceaec56543cbf137fe28a1f4 100644 (file)
@@ -23,7 +23,6 @@ WScript.StdOut.WriteLine("Rebuilding configure.js");
 var FSO = WScript.CreateObject("Scripting.FileSystemObject");\r
 var C = FSO.CreateTextFile("configure.js", true);\r
 var B = FSO.CreateTextFile("configure.bat", true);\r
-var A = FSO.CreateTextFile("config.simple.bat", true);\r
 \r
 var modules = "";\r
 var MODULES = WScript.CreateObject("Scripting.Dictionary");\r
@@ -258,8 +257,4 @@ C.WriteBlankLines(1);
 C.Write(file_get_contents("win32/build/configure.tail"));\r
 \r
 B.WriteLine("@echo off");\r
-B.WriteLine("cscript /nologo configure.js %*");\r
-\r
-// Generates config.simple.bat (configure --disable-all --enable-cli --with-mp)\r
-A.WriteLine("@echo off");\r
-A.WriteLine("cscript /nologo configure.js --disable-all --enable-cli --with-mp");
\ No newline at end of file
+B.WriteLine("cscript /nologo configure.js %*");
\ No newline at end of file
index cc921d81a6314c4840f2fca89c549784f08ece33..28c616823cb2584bf0f9c3a6ec101b1896622cee 100644 (file)
@@ -298,3 +298,8 @@ toolset_setup_codegen_arch();
 
 ARG_WITH("all-shared", "Force all the non obligatory extensions to be shared", "no");
 
+// Config profiles (--with-config-profile=<name>) will save a certain config to php-src/config.<name>.bat
+// so that it can be executed like: cofig.<name> instead of a long list of parameters
+//
+// Note, nice as a name is disallowed and will generate a warning and skip saaving
+ARG_WITH('config-profile', 'Name of the configuration profile to save this to in php-src/config.name.bat', 'no');
\ No newline at end of file
index 49b875ba6ad122bf274f769ad1bee62658185dbb..1e6ba365f33fd7f7e60898d1e0048c7c4774e628 100644 (file)
@@ -336,7 +336,10 @@ function conf_process_args()
        args = WScript.Arguments;
        for (i = 0; i < args.length; i++) {
                arg = args(i);
-               nice += ' "' + arg + '"';
+               // Ignore --with-config-profile for config.nice.bat
+               if (arg.toLowerCase().substring(0, arg.indexOf('=')) != '--with-config-profile' && arg != '--with-config-profile') {
+                       nice += ' "' + arg + '"';
+               }
                if (arg == "--help") {
                        configure_help_mode = true;
                        break;
@@ -437,7 +440,7 @@ can be built that way. \
                 'pcre-regex', 'fastcgi', 'force-cgi-redirect',
                 'path-info-check', 'zts', 'ipv6', 'memory-limit',
                 'zend-multibyte', 'fd-setsize', 'memory-manager',
-                't1lib', 'pgi', 'pgo', 'all-shared'
+                't1lib', 'pgi', 'pgo', 'all-shared', 'config-profile'
                );
        var force;
 
@@ -520,9 +523,22 @@ can be built that way. \
 
        STDOUT.WriteLine("Saving configure options to config.nice.bat");
        var nicefile = FSO.CreateTextFile("config.nice.bat", true);
+       nicefile.WriteLine('@echo off');
        nicefile.WriteLine(nice +  " %*");
        nicefile.Close();
 
+       if (PHP_CONFIG_PROFILE != 'no') {
+               if (PHP_CONFIG_PROFILE.toLowerCase() == 'nice') {
+                       WARNING('Config profile name cannot be named \'nice\'');
+               } else {
+                       var config_profile = FSO.CreateTextFile('config.' + PHP_CONFIG_PROFILE + '.bat', true);
+
+                       config_profile.WriteLine('@echo off');
+                       config_profile.WriteLine(nice + ' %*');
+                       config_profile.Close();
+               }
+       }
+
        AC_DEFINE('CONFIGURE_COMMAND', nice, "Configure line");
 }