Re: Allow out-of-box-build for MSVC 2005

From: Date: Thu, 01 Feb 2007 17:09:55 +0000
Subject: Re: Allow out-of-box-build for MSVC 2005
References: 1 2 3 4  Groups: php.gtk.dev 
Request: Send a blank email to php-gtk-dev+get-3664@lists.php.net to get a copy of this message
Andrei, hi, Can I just ask you to run a quick test to check that this part of Elizabeth's patch doesn't send your build system into a frenzy? Cheers... Index: main/php_gtk.h =================================================================== RCS file: /repository/php-gtk/main/php_gtk.h,v retrieving revision 1.138 diff -u -r1.138 php_gtk.h --- main/php_gtk.h 15 Oct 2006 00:48:48 -0000 1.138 +++ main/php_gtk.h 30 Jan 2007 20:38:50 -0000 @@ -23,13 +23,13 @@ #ifndef _PHP_GTK_H #define _PHP_GTK_H -#include "php.h" -#include "php_ini.h" #ifdef PHP_WIN32 #include "config.w32.h" #else #include "config.h" #endif +#include "php.h" +#include "php_ini.h" ----- Original Message ----- From: "Elizabeth Smith" <emsmith@elizabethmariesmith.com> To: <php-gtk-dev@lists.php.net> Sent: Thursday, February 01, 2007 1:45 AM Subject: Re: [PHP-GTK-DEV] Allow out-of-box-build for MSVC 2005
And here is patch version #2, Oh how much fun - I forgot a file in the last patch (you have to tell the gtk extension which php lib to build against with the zts option...oops) - and I also fixed the /gx thing by just switching it to ehsc(I wish they'd stop deprecating everything...) Thanks, Elizabeth Smith
--------------------------------------------------------------------------------
Index: ext/gtk+/config.w32 =================================================================== RCS file: /repository/php-gtk/ext/gtk+/config.w32,v retrieving revision 1.5 diff -u -r1.5 config.w32 --- ext/gtk+/config.w32 24 Oct 2006 12:46:14 -0000 1.5 +++ ext/gtk+/config.w32 1 Feb 2007 01:35:11 -0000 @@ -1,5 +1,21 @@ - -if (CHECK_HEADER("main/php.h") && CHECK_LIB(PHP_GTK_DEBUG != "no" ? "php5ts_debug.lib" : "php5ts.lib", "php-gtk") && +var check_lib; +if(PHP_GTK_DEBUG == 'yes' && PHP_GTK_ZTS == 'yes') +{ + check_lib = "php5ts_debug.lib"; +} +else if(PHP_GTK_DEBUG == 'yes') +{ + check_lib = "php5_debug.lib"; +} +else if(PHP_GTK_ZTS == 'yes') +{ + check_lib = "php5ts.lib"; +} +else +{ + check_lib = "php5.lib"; +} +if (CHECK_HEADER("main/php.h") && CHECK_LIB(check_lib, "php-gtk") && CHECK_HEADER("iconv.h") && CHECK_LIB("iconv.lib", "php-gtk") && CHECK_HEADER("libintl.h") && CHECK_LIB("intl.lib", "php-gtk") && CHECK_HEADER("atk/atk.h") && CHECK_LIB("atk-1.0.lib", "php-gtk") && Index: main/php_gtk.h =================================================================== RCS file: /repository/php-gtk/main/php_gtk.h,v retrieving revision 1.138 diff -u -r1.138 php_gtk.h --- main/php_gtk.h 15 Oct 2006 00:48:48 -0000 1.138 +++ main/php_gtk.h 30 Jan 2007 20:38:50 -0000 @@ -23,13 +23,13 @@ #ifndef _PHP_GTK_H #define _PHP_GTK_H -#include "php.h" -#include "php_ini.h" #ifdef PHP_WIN32 #include "config.w32.h" #else #include "config.h" #endif +#include "php.h" +#include "php_ini.h" /* workaround for expat-related declaration in PHP compat file */ #ifdef lookup Index: win32/config.w32.in =================================================================== RCS file: /repository/php-gtk/win32/config.w32.in,v retrieving revision 1.12 diff -u -r1.12 config.w32.in --- win32/config.w32.in 17 Jun 2006 14:47:08 -0000 1.12 +++ win32/config.w32.in 1 Feb 2007 01:33:29 -0000 @@ -14,6 +14,9 @@ PATH_PROG('link', WshShell.Environment("Process").Item("PATH"), "LD"); PATH_PROG('nmake'); +// Try locating manifest tool +PATH_PROG('mt', WshShell.Environment("Process").Item("PATH"), "MT"); + // we don't want to define LIB, as that will override the default library path set in that env var PATH_PROG('lib', null, 'MAKE_LIB'); PATH_PROG('php'); @@ -45,6 +48,7 @@ ARG_WITH('php-build', 'Path to where you extracted http://www.php.net/extra/win32build.zip. Assumes that it is a sibling of this source dir (..\\php_build) if not specified', 'no'); ARG_WITH('cygwin', 'Path to cygwin utilities on your system', '\\cygwin'); +ARG_ENABLE('zts', 'Thread safety', 'yes'); // stick objects somewhere outside of the source tree ARG_ENABLE('object-out-dir', 'Alternative location for binary objects during build', ''); @@ -56,6 +60,10 @@ } 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_GTK_DEBUG == "yes" && PHP_GTK_DEBUG_PACK == "yes") { + ERROR("Use of both --enable-debug and --enable-debug-pack not allowed."); +} // Set some debug-specific options if (PHP_GTK_DEBUG == "yes") { @@ -81,11 +89,16 @@ DEFINE("LIBS", "kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib"); if (PHP_GTK_DEBUG == "yes") { - DEFINE("CFLAGS", "/nologo /LDd /MDd /Gm /ZI /GZ /I . /I ..\\ /I ..\\.. /I main /I ..\\main /I ext /I ..\\ext /I ..\\php5\\main /I ..\\php5\\Zend /I ..\\php5\\TSRM /D ZEND_WIN32 /D ZTS=1 /D ZEND_DEBUG=1 /D PHP_WIN32 /D WIN32 /D _DEBUG /D _WINDOWS /D _MBCS /D _USRDLL"); + DEFINE("CFLAGS", "/nologo /LDd /MDd /Gm /EHsc /ZI /GZ /I . /I ..\\ /I ..\\.. /I main /I ..\\main /I ext /I ..\\ext /I ..\\php5\\main /I ..\\php5\\Zend /I ..\\php5\\TSRM /D ZEND_WIN32 /D ZEND_DEBUG=1 /D PHP_WIN32 /D WIN32 /D _DEBUG /D _WINDOWS /D _MBCS /D _USRDLL"); ADD_FLAG("LDFLAGS", "/debug"); } else { - DEFINE("CFLAGS", "/nologo /MD /W3 /GX /O2 /I . /I ..\\ /I ..\\.. /I main /I ..\\main /I ext /I ..\\ext /I ..\\php5\\main /I ..\\php5\\Zend /I ..\\php5\\TSRM /D ZEND_WIN32 /D ZTS=1 /D ZEND_DEBUG=0 /D PHP_WIN32 /D WIN32 /D NDEBUG /D _WINDOWS /D _MBCS /D _USRDLL"); + DEFINE("CFLAGS", "/nologo /MD /W3 /O2 /EHsc /I . /I ..\\ /I ..\\.. /I main /I ..\\main /I ext /I ..\\ext /I ..\\php5\\main /I ..\\php5\\Zend /I ..\\php5\\TSRM /D ZEND_WIN32 /D ZEND_DEBUG=0 /D PHP_WIN32 /D WIN32 /D NDEBUG /D _WINDOWS /D _MBCS /D _USRDLL"); + // Generate external debug files when --enable-debug-pack is specified + if (PHP_GTK_DEBUG_PACK == "yes") { + ADD_FLAG("CFLAGS", "/Zi"); + ADD_FLAG("LDFLAGS", "/incremental:no /debug /opt:ref,icf"); + } } if (VCVERS < 14) { @@ -97,6 +110,15 @@ // fun stuff: MS deprecated ANSI stdio and similar functions - disable warnings // GS hardens the binary against buffer overruns ADD_FLAG('CFLAGS', '/GS /wd4996 '); + if (PHP_GTK_DEBUG == "yes") + { + // Set some debug/release specific options + ADD_FLAG('CFLAGS', ' /RTC1 '); + } +} + +if (PHP_GTK_ZTS == "yes") { + ADD_FLAG("CFLAGS", "/D ZTS=1"); } if (PHP_GTK_PHP_BUILD == 'no') { Index: win32/confutils.js =================================================================== RCS file: /repository/php-gtk/win32/confutils.js,v retrieving revision 1.19 diff -u -r1.19 confutils.js --- win32/confutils.js 17 Jul 2006 17:00:09 -0000 1.19 +++ win32/confutils.js 30 Jan 2007 21:18:50 -0000 @@ -668,6 +668,7 @@ MFO.WriteLine("$(BUILD_DIR)\\" + dllname + ": $(" + EXT + "_GLOBAL_OBJS)" + res_var); MFO.WriteLine("\t" + ld + " /out:$(BUILD_DIR)\\" + dllname + " $(" + EXT + "_LDFLAGS)" + dllflags + " $(LDFLAGS) $(" + EXT + "_GLOBAL_OBJS) $(LIBS_" + EXT + ")" + dep_libs + " $(LIBS)" + res_var); + MFO.WriteLine("\t-@$(_VC_MANIFEST_EMBED_DLL)"); MFO.WriteBlankLines(1); MFO.WriteLine(dllname + ": $(BUILD_DIR)\\" + dllname); @@ -968,6 +969,16 @@ MF.WriteLine(keys[i] + "=" + configure_subst.Item(keys[i]) + " "); } + MF.WriteLine("!if $(MT) == \"\""); + MF.WriteBlankLines(1); + MF.WriteLine("_VC_MANIFEST_EMBED_DLL="); + MF.WriteBlankLines(1); + MF.WriteLine("!else"); + MF.WriteBlankLines(1); + MF.WriteLine("_VC_MANIFEST_EMBED_DLL= $(MT) -nologo -manifest $@.manifest -outputresource:$@;2"); + MF.WriteBlankLines(1); + MF.WriteLine("!endif"); + MF.WriteBlankLines(1); MF.WriteLine("all: $(EXT_TARGETS)");
--------------------------------------------------------------------------------
-- PHP-GTK Development Mailing List (http://gtk.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php


« previous php.gtk.dev (#3664) next »