From 72f73b7785c03018bb03606898c65ae40cfc0d22 Mon Sep 17 00:00:00 2001 From: Wez Furlong Date: Sun, 7 Dec 2003 02:58:56 +0000 Subject: [PATCH] tweak build so that it mirrors the source filesystem layout under the build dir. This allows GD extension to build. --- ext/gd/config.w32 | 54 +++++++++++++++++++++------------------- win32/build/config.w32 | 2 ++ win32/build/confutils.js | 26 +++++++++++++------ 3 files changed, 49 insertions(+), 33 deletions(-) diff --git a/ext/gd/config.w32 b/ext/gd/config.w32 index 99d5f215d3..c01568f7ca 100644 --- a/ext/gd/config.w32 +++ b/ext/gd/config.w32 @@ -1,7 +1,7 @@ // $Id$ // vim:ft=javascript -ARG_WITH("gd", "Bundled GD support", "no"); +ARG_WITH("gd", "Bundled GD support", "yes"); if (PHP_GD != "no") { if (CHECK_LIB("libjpeg.lib", "gd", PHP_GD) && @@ -10,32 +10,36 @@ if (PHP_GD != "no") { CHECK_LIB("zlib.lib", "gd", PHP_GD) && CHECK_HEADER_ADD_INCLUDE("gd.h", "CFLAGS_GD", "ext\\gd\\libgd;" + PHP_GD)) { - EXTENSION("gd", "gd.c gdttf.c"); - ADD_SOURCES("ext/gd/libgd", "gd2copypal.c gd_arc_f_buggy.c gd.c gdcache.c gdfontg.c gdfontl.c gdfontmb.c gdfonts.c gdfontt.c gdft.c gd_gd2.c gd_gd.c gd_gif_in.c gdhelpers.c gd_io.c gd_io_dp.c gd_io_file.c gd_io_ss.c gd_jpeg.c gdkanji.c gd_png.c gd_ss.c gdtables.c gd_topal.c gd_wbmp.c gdxpm.c wbmp.c xbm.c", "gd"); + EXTENSION("gd", "gd.c gdttf.c", null, "-Iext/gd/libgd"); + ADD_SOURCES("ext/gd/libgd", "gd2copypal.c gd_arc_f_buggy.c gd.c \ + gdcache.c gdfontg.c gdfontl.c gdfontmb.c gdfonts.c gdfontt.c \ + gdft.c gd_gd2.c gd_gd.c gd_gif_in.c gdhelpers.c gd_io.c gd_io_dp.c \ + gd_io_file.c gd_io_ss.c gd_jpeg.c gdkanji.c gd_png.c gd_ss.c \ + gdtables.c gd_topal.c gd_wbmp.c gdxpm.c wbmp.c xbm.c", "gd"); AC_DEFINE('HAVE_LIBGD', 1, 'GD support'); ADD_FLAG("CFLAGS_GD", " \ - /D HAVE_GD_BUNDLED=1 \ - /D HAVE_GD_GD2 \ - /D HAVE_GD_GIF_READ=1 \ - /D HAVE_GDIMAGECOLORRESOLVE=1 \ - /D HAVE_GD_IMAGESETBRUSH=1 \ - /D HAVE_GD_IMAGESETTILE=1 \ - /D HAVE_GD_JPG \ - /D HAVE_GD_PNG \ - /D HAVE_GD_STRINGFTEX=1 \ - /D HAVE_GD_STRINGTTF=1 \ - /D HAVE_GD_WBMP \ - /D HAVE_GD_XBM \ - /D HAVE_LIBFREETYPE=1 \ - /D HAVE_LIBGD13=1 \ - /D HAVE_LIBGD15=1 \ - /D HAVE_LIBGD20=1 \ - /D HAVE_LIBGD204=1 \ - /D HAVE_LIBJPEG \ - /D HAVE_LIBPNG \ - /D USE_GD_IMGSTRTTF \ - /D USE_GD_IOCTX \ - /D MSWIN32 \ +/D HAVE_GD_BUNDLED=1 \ +/D HAVE_GD_GD2 \ +/D HAVE_GD_GIF_READ=1 \ +/D HAVE_GDIMAGECOLORRESOLVE=1 \ +/D HAVE_GD_IMAGESETBRUSH=1 \ +/D HAVE_GD_IMAGESETTILE=1 \ +/D HAVE_GD_JPG \ +/D HAVE_GD_PNG \ +/D HAVE_GD_STRINGFTEX=1 \ +/D HAVE_GD_STRINGTTF=1 \ +/D HAVE_GD_WBMP \ +/D HAVE_GD_XBM \ +/D HAVE_LIBFREETYPE=1 \ +/D HAVE_LIBGD13=1 \ +/D HAVE_LIBGD15=1 \ +/D HAVE_LIBGD20=1 \ +/D HAVE_LIBGD204=1 \ +/D HAVE_LIBJPEG \ +/D HAVE_LIBPNG \ +/D USE_GD_IMGSTRTTF \ +/D USE_GD_IOCTX \ +/D MSWIN32 \ "); } else { WARNING("gd not enabled; libraries and headers not found"); diff --git a/win32/build/config.w32 b/win32/build/config.w32 index 6f9dc592df..e19c7350bc 100644 --- a/win32/build/config.w32 +++ b/win32/build/config.w32 @@ -95,6 +95,8 @@ if (PHP_PHP_BUILD == 'no') { PHP_PHP_BUILD = "..\\php_build"; } else if (FSO.FolderExists("..\\win32build")) { PHP_PHP_BUILD = "..\\win32build"; + } else if (FSO.FolderExists("..\\php-win32-dev\\php_build")) { + PHP_PHP_BUILD = "..\\php-win32-dev\\php_build"; } } diff --git a/win32/build/confutils.js b/win32/build/confutils.js index 3275f18ae5..78e58662a9 100644 --- a/win32/build/confutils.js +++ b/win32/build/confutils.js @@ -17,7 +17,7 @@ +----------------------------------------------------------------------+ */ -// $Id: confutils.js,v 1.18 2003-12-06 00:00:31 wez Exp $ +// $Id: confutils.js,v 1.19 2003-12-07 02:58:56 wez Exp $ var STDOUT = WScript.StdOut; var STDERR = WScript.StdErr; @@ -631,16 +631,26 @@ function ADD_SOURCES(dir, file_list, target) dir = dir.replace(new RegExp("/", "g"), "\\"); + var mangle_dir = dir.replace(new RegExp("[\\\\/.]", "g"), "_"); + var objs_line = ""; var srcs_line = ""; var sub_build = "$(BUILD_DIR)\\"; -// if (target != "php") { - build_dirs[build_dirs.length] = target; - sub_build += target + "\\"; -// } - DEFINE("CFLAGS_BD_" + target.toUpperCase(), "/Fo" + sub_build + " /Fd" + sub_build + " /Fp" + sub_build + " /FR" + sub_build + " "); + sub_build += dir + "\\"; + + var dirs = dir.split("\\"); + var i, d = ""; + for (i = 0; i < dirs.length; i++) { + d += dirs[i]; + build_dirs[build_dirs.length] = d; + d += "\\"; + } + + var bd_flags_name = "CFLAGS_BD_" + mangle_dir.toUpperCase(); + + DEFINE(bd_flags_name, "/Fo" + sub_build + " /Fd" + sub_build + " /Fp" + sub_build + " /FR" + sub_build + " "); for (i in file_list) { src = file_list[i]; @@ -657,13 +667,13 @@ function ADD_SOURCES(dir, file_list, target) } } else { MFO.WriteLine(sub_build + obj + ": " + dir + "\\" + src); - MFO.WriteLine("\t$(CC) $(CFLAGS) $(" + flags + ") $(CFLAGS_BD_" + target.toUpperCase() + ") -c " + dir + "\\" + src + " -o " + sub_build + obj); + MFO.WriteLine("\t$(CC) $(CFLAGS) $(" + flags + ") $(" + bd_flags_name + ") -c " + dir + "\\" + src + " -o " + sub_build + obj); } } if (PHP_ONE_SHOT == "yes") { MFO.WriteLine(objs_line + ": " + srcs_line); - MFO.WriteLine("\t$(CC) $(CFLAGS) $(" + flags + ") $(CFLAGS_BD_" + target.toUpperCase() + ") -c " + srcs_line); + MFO.WriteLine("\t$(CC) $(CFLAGS) $(" + flags + ") $(" + bd_flags_name + ") -c " + srcs_line); } DEFINE(sym, tv); -- 2.50.1