]> granicus.if.org Git - php/commitdiff
Added --enable-debug-pack which will create a zip file with *.pdb debug
authorEdin Kadribasic <edink@php.net>
Fri, 25 Feb 2005 00:20:19 +0000 (00:20 +0000)
committerEdin Kadribasic <edink@php.net>
Fri, 25 Feb 2005 00:20:19 +0000 (00:20 +0000)
symbol files. Could be used to allow windows users to use free Microsoft
debugging tools to generate useful backtraces.

Debug tools can be found at:
http://www.microsoft.com/whdc/devtools/debugging/installx86.mspx

CLAGS used described in:
http://support.microsoft.com/default.aspx?scid=kb;en-us;291585

Only tested on VC 6.0.

win32/build/Makefile
win32/build/config.w32

index 2ce549929256fa3138b7db4e1a35145e9489167f..77ea3c3a0227ddf60db01cbd20d62a64ff5e5089 100644 (file)
@@ -107,6 +107,7 @@ build-dist: $(BUILD_DIR)\deplister.exe
        -rmdir /s /q $(BUILD_DIR)\php-$(PHP_VERSION_STRING)
        -rmdir /s /q $(BUILD_DIR)\pecl-$(PHP_VERSION_STRING)
        -del /f /q $(BUILD_DIR)\php-$(PHP_VERSION_STRING)-Win32.zip
+       -del /f /q $(BUILD_DIR)\php-debug-pack-$(PHP_VERSION_STRING)-Win32.zip
        -del /f /q $(BUILD_DIR)\pecl-$(PHP_VERSION_STRING)-Win32.zip
        $(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)
@@ -115,6 +116,9 @@ build-dist: $(BUILD_DIR)\deplister.exe
        cd $(BUILD_DIR)\pecl-$(PHP_VERSION_STRING)
        -$(ZIP) -9 -r ..\pecl-$(PHP_VERSION_STRING)-Win32.zip .
        cd ..\..
+       cd $(BUILD_DIR)
+       -$(ZIP) -9 php-debug-pack-$(PHP_VERSION_STRING)-Win32.zip *.pdb
+       cd ..\..
 
 dist: all build-dist
 snap: build-snap build-dist
index 9c0ee80e7e2a9dd871e422400c5750df336bddc0..40980315b0c323a1217665de8eb259249e40c1ed 100644 (file)
@@ -19,8 +19,11 @@ PATH_PROG('lemon');
 PATH_PROG('mc', WshShell.Environment("Process").Item("PATH"));
 
 ARG_ENABLE('debug', 'Compile with debugging symbols', "no");
+ARG_ENABLE('debug-pack', 'Release binaries with external debug symbols (--enable-debug must not be specified)', 'no');
+if (PHP_DEBUG == "yes" && PHP_DEBUG_PACK == "yes") {
+       ERROR("Use of both --enable-debug and --enable-debug-pack not allowed.");
+}
 ARG_ENABLE('zts', 'Thread safety', 'yes');
-
 // Configures the hard-coded installation dir
 ARG_ENABLE('prefix', 'where PHP will be installed', '');
 if (PHP_PREFIX == '') {
@@ -64,6 +67,11 @@ if (PHP_DEBUG == "yes") {
        // version of the libc
        ADD_FLAG("PHP_LDFLAGS", "/nodefaultlib:msvcrt");
 } else {
+       // Generate external debug files when --enable-debug-pack is specified
+       if (PHP_DEBUG_PACK == "yes") {
+               ADD_FLAG("CFLAGS", "/Zi");
+               ADD_FLAG("LDFLAGS", "/incremental:no /debug /opt:ref,icf");
+       }
        // Equivalent to Release_TSInline build -> best optimization
        ADD_FLAG("CFLAGS", "/LD /MD /W3 /Ox /D NDebug /D NDEBUG \
 /D ZEND_WIN32_FORCE_INLINE /GB /GF /D ZEND_DEBUG=0");