summaryrefslogtreecommitdiffstats
path: root/WebKitTools/wx
diff options
context:
space:
mode:
authorBen Murdoch <benm@google.com>2009-08-11 17:01:47 +0100
committerBen Murdoch <benm@google.com>2009-08-11 18:21:02 +0100
commit0bf48ef3be53ddaa52bbead65dfd75bf90e7a2b5 (patch)
tree2943df35f62d885c89d01063cc528dd73b480fea /WebKitTools/wx
parent7e7a70bfa49a1122b2597a1e6367d89eb4035eca (diff)
downloadexternal_webkit-0bf48ef3be53ddaa52bbead65dfd75bf90e7a2b5.zip
external_webkit-0bf48ef3be53ddaa52bbead65dfd75bf90e7a2b5.tar.gz
external_webkit-0bf48ef3be53ddaa52bbead65dfd75bf90e7a2b5.tar.bz2
Merge in WebKit r47029.
Diffstat (limited to 'WebKitTools/wx')
-rw-r--r--WebKitTools/wx/browser/wscript54
-rwxr-xr-xWebKitTools/wx/build-wxwebkit78
-rw-r--r--WebKitTools/wx/build/build_utils.py143
-rw-r--r--WebKitTools/wx/build/settings.py265
-rw-r--r--WebKitTools/wx/build/waf_extensions.py79
-rw-r--r--WebKitTools/wx/build/wxpresets.py78
6 files changed, 666 insertions, 31 deletions
diff --git a/WebKitTools/wx/browser/wscript b/WebKitTools/wx/browser/wscript
new file mode 100644
index 0000000..fb8d81f
--- /dev/null
+++ b/WebKitTools/wx/browser/wscript
@@ -0,0 +1,54 @@
+#! /usr/bin/env python
+
+# Copyright (C) 2009 Kevin Ollivier All rights reserved.
+#
+# Redistribution and use in source and binary forms, with or without
+# modification, are permitted provided that the following conditions
+# are met:
+# 1. Redistributions of source code must retain the above copyright
+# notice, this list of conditions and the following disclaimer.
+# 2. Redistributions in binary form must reproduce the above copyright
+# notice, this list of conditions and the following disclaimer in the
+# documentation and/or other materials provided with the distribution.
+#
+# THIS SOFTWARE IS PROVIDED BY APPLE COMPUTER, INC. ``AS IS'' AND ANY
+# EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+# PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE COMPUTER, INC. OR
+# CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
+# EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+# PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
+# PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
+# OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+#
+# wxBrowser sample app build script for the waf build system
+
+import sys
+
+from settings import *
+
+include_paths = [os.path.join(wk_root, 'WebKit', 'wx')]
+
+def set_options(opt):
+ common_set_options(opt)
+
+def configure(conf):
+ common_configure(conf)
+
+def build(bld):
+ import Options
+
+ obj = bld.new_task_gen(
+ features = 'cxx cprogram',
+ includes = ' '.join(include_paths),
+ source = 'browser.cpp',
+ target = 'wxBrowser',
+ uselib = 'WX CURL ICU XSLT XML WXWEBKIT ' + waf_configname,
+ libpath = [output_dir],
+ uselib_local = '',
+ install_path = output_dir)
+
+ if sys.platform.startswith('darwin'):
+ obj.mac_app = True
diff --git a/WebKitTools/wx/build-wxwebkit b/WebKitTools/wx/build-wxwebkit
index a4db5f2..db03251 100755
--- a/WebKitTools/wx/build-wxwebkit
+++ b/WebKitTools/wx/build-wxwebkit
@@ -43,7 +43,7 @@ fi
WKWINLIBS=WebKitLibraries/win
WINDEPS=" $WKWINLIBS/lib/pthreadVC2.dll"
-WINDEPS="$WINDEPS $WKWINLIBS/bin/icuuc34.dll $WKWINLIBS/bin/icudt34.dll $WKWINLIBS/bin/icuin34.dll"
+WINDEPS="$WINDEPS $WKWINLIBS/bin/icuuc40.dll $WKWINLIBS/bin/icudt40.dll $WKWINLIBS/bin/icuin40.dll"
WINDEPS="$WINDEPS $WKWINLIBS/bin/libcurl.dll $WKWINLIBS/bin/libeay32.dll $WKWINLIBS/bin/ssleay32.dll $WKWINLIBS/bin/zlib1.dll"
WINDEPS="$WINDEPS $WKWINLIBS/lib/sqlite3.dll"
WINDEPS="$WINDEPS $WKWINLIBS/bin/libxml2.dll $WKWINLIBS/bin/libxslt.dll"
@@ -179,7 +179,7 @@ function do_make {
cd $olddir
else
if [ -f $dir/GNUmakefile ]; then
- make -C $dir -f GNUmakefile $MAKE_ARGS CXXFLAGS="$cxxflags" $@
+ make -C $dir -f GNUmakefile $MAKE_ARGS CXXFLAGS="$cxxflags -fvisibility=hidden -fvisibility-inlines-hidden" $@
fi
fi
if [ $? != 0 ]; then
@@ -216,10 +216,13 @@ if [ $do_clean != 1 ]; then
# we need to do this because Bakefile doesn't know which
# platform it's running on with GNU format, and so it defaults
# to the standard Unix file endings and linker args.
- if [ "${OSTYPE:0:6}" = "darwin" ]; then
- sed "s/libwebcore-wx.so/libwebcore-wx.dylib/" < $WK_ROOT/WebCore/GNUmakefile > temp
- mv temp $WK_ROOT/WebCore/GNUmakefile
-
+ if [ "${OSTYPE:0:6}" = "darwin" ]; then
+ sed "s/libjscore.so/libjscore.dylib/" < $WK_ROOT/JavaScriptCore/GNUmakefile > temp
+ mv temp $WK_ROOT/JavaScriptCore/GNUmakefile
+
+ sed "s/\-shared/\-dynamiclib/" < $WK_ROOT/JavaScriptCore/GNUmakefile > temp
+ mv temp $WK_ROOT/JavaScriptCore/GNUmakefile
+
sed "s/\-shared/\-dynamiclib/" < $WK_ROOT/WebCore/GNUmakefile > temp
mv temp $WK_ROOT/WebCore/GNUmakefile
@@ -240,24 +243,43 @@ if [ $do_clean != 1 ]; then
$WK_ROOT/WebKitTools/wx/install-unix-extras
fi
+
+ export CREATE_HASH_TABLE="$WK_ROOT/JavaScriptCore/create_hash_table"
cd $WK_ROOT/JavaScriptCore
- ./make-generated-sources.sh
+ mkdir -p DerivedSources/JavaScriptCore
+ cd DerivedSources/JavaScriptCore
+
+ make -f ../../DerivedSources.make JavaScriptCore=../.. BUILT_PRODUCTS_DIR=../.. all FEATURE_DEFINES="ENABLE_DATABASE ENABLE_XSLT ENABLE_JAVASCRIPT_DEBUGGER"
if [ $? != 0 ]; then
- exit $?
+ exit 1
fi
cd $WK_ROOT/WebCore
- ./make-generated-sources.sh FEATURE_DEFINES="ENABLE_DATABASE"
+ mkdir -p DerivedSources/WebCore
+ cd DerivedSources/WebCore
+ make -f ../../DerivedSources.make all WebCore=../.. SOURCE_ROOT=../.. FEATURE_DEFINES="ENABLE_DATABASE ENABLE_XSLT ENABLE_JAVASCRIPT_DEBUGGER"
if [ $? != 0 ]; then
- exit $?
+ exit 1
fi
fi
fi
-if [ $do_build == 1 -o $do_clean == 1 ]; then
- # Build steps
+if [ $do_build == 1 -o $do_clean == 1 ]; then
WXGC_DEFINE=""
+ EXTRA_CPPFLAGS=""
+
+ if [ "${OSTYPE:0:6}" == "cygwin" ]; then
+ PLATFORM_OS="win"
+ elif [ "${OSTYPE:0:6}" == "darwin" ]; then
+ PLATFORM_OS="mac"
+ EXTRA_CPPFLAGS="-DMAC_OS_X_VERSION_MIN_REQUIRED=1040"
+ use_wxgc=1
+ else
+ PLATFORM_OS="linux"
+ use_wxgc=1
+ fi
+
if [ $use_wxgc == 1 ]; then
WXGC_DEFINE="-DWTF_USE_WXGC=1"
fi
@@ -265,31 +287,23 @@ if [ $do_build == 1 -o $do_clean == 1 ]; then
if [ "${OSTYPE:0:6}" == "cygwin" -a $wxdebug == 1 ]; then
WX_EXT=d
fi
- if [ "${OSTYPE:0:6}" == "cygwin" -a $wxpython == 1 ]; then
+ if [ $wxpython == 1 ]; then
other_args=WX_PYTHON=1
WX_EXT=h
wxdebug=1
fi
-
- if [ "${OSTYPE:0:6}" == "cygwin" ]; then
- PLATFORM_OS="win"
- elif [ "${OSTYPE:0:6}" == "darwin" ]; then
- PLATFORM_OS="mac"
- else
- PLATFORM_OS="linux"
- use_wxgc=1 # Linux requires us to use wxgc to get proper drawing.
- fi
WINDEPS="$WINDEPS $WXWIN/lib/vc_dll/wxmsw28u${WX_EXT}_core_vc.dll $WXWIN/lib/vc_dll/wxbase28u${WX_EXT}_vc.dll"
- do_make $WK_ROOT/JavaScriptCore "-DBUILDING_WX__=1 $WXGC_DEFINE" WX_DEBUG=$wxdebug DEBUG=$debug WEBKIT_ROOT=$WK_ROOTDIR PLATFORM_OS=$PLATFORM_OS $other_args
+ do_make $WK_ROOT/JavaScriptCore "-DBUILDING_WX__=1 $WXGC_DEFINE $EXTRA_CPPFLAGS" WX_DEBUG=$wxdebug DEBUG=$debug WEBKIT_ROOT=$WK_ROOTDIR PLATFORM_OS=$PLATFORM_OS $other_args
mkdir -p $WEBKITOUTPUTDIR/JavaScriptCore
cp -p $WK_ROOT/JavaScriptCore/API/*.h $WEBKITOUTPUTDIR/JavaScriptCore/
- do_make $WK_ROOT/WebCore "-DBUILDING_WX__=1 $WXGC_DEFINE" WX_DEBUG=$wxdebug WEBKIT_ROOT=$WK_ROOTDIR DEBUG=$debug PLATFORM_OS=$PLATFORM_OS $other_args
- do_make $WK_ROOT/WebKit/wx "-DBUILDING_WX__=1 -DWXMAKINGDLL_WEBKIT=1 $WXGC_DEFINE" WX_DEBUG=$wxdebug DEBUG=$debug WEBKIT_ROOT=$WK_ROOTDIR PLATFORM_OS=$PLATFORM_OS $other_args
- do_make $WK_ROOT/WebKitTools/wx/browser "-DBUILDING_WX__=1 -DWXUSINGDLL_WEBKIT=1 $WXGC_DEFINE" WX_DEBUG=$wxdebug DEBUG=$debug WEBKIT_ROOT=$WK_ROOTDIR PLATFORM_OS=$PLATFORM_OS $other_args
+ do_make $WK_ROOT/WebCore "-DBUILDING_WX__=1 $WXGC_DEFINE $EXTRA_CPPFLAGS" WX_DEBUG=$wxdebug WEBKIT_ROOT=$WK_ROOTDIR DEBUG=$debug PLATFORM_OS=$PLATFORM_OS $other_args
+ do_make $WK_ROOT/WebKit/wx "-DBUILDING_WX__=1 -DWXMAKINGDLL_WEBKIT=1 $WXGC_DEFINE $EXTRA_CPPFLAGS" WX_DEBUG=$wxdebug DEBUG=$debug WEBKIT_ROOT=$WK_ROOTDIR PLATFORM_OS=$PLATFORM_OS $other_args
+ do_make $WK_ROOT/WebKitTools/wx/browser "-DBUILDING_WX__=1 -DWXUSINGDLL_WEBKIT=1 $WXGC_DEFINE $EXTRA_CPPFLAGS" WX_DEBUG=$wxdebug DEBUG=$debug WEBKIT_ROOT=$WK_ROOTDIR PLATFORM_OS=$PLATFORM_OS $other_args
+ do_make $WK_ROOT/WebKitTools/DumpRenderTree/wx "-DBUILDING_WX__=1 -DWXUSINGDLL_WEBKIT=1 $WXGC_DEFINE $EXTRA_CPPFLAGS" WX_DEBUG=$wxdebug DEBUG=$debug WEBKIT_ROOT=$WK_ROOTDIR PLATFORM_OS=$PLATFORM_OS $other_args
if [ $do_clean == 1 ]; then
rm -rf $WK_ROOT/JavaScriptCore/DerivedSources
@@ -349,17 +363,19 @@ if [ $do_build == 1 -o $do_clean == 1 ]; then
cp webview.py $WEBKITOUTPUTDIR/webview.py
PY_INCLUDE=`python -c "import sys,distutils.sysconfig; sys.stdout.write(distutils.sysconfig.get_python_inc())"`
- PY_VERSION=`python -c "import sys; sys.stdout.write(str(sys.version_info[0]) + str(sys.version_info[1]))"`
- PY_LIBDIR=`python -c "import distutils.sysconfig; import sys; sys.stdout.write(distutils.sysconfig.PREFIX)"`
if [ "${OSTYPE:0:6}" == "cygwin" ]; then
+ PY_LIBDIR=`python -c "import distutils.sysconfig; import sys; sys.stdout.write(distutils.sysconfig.PREFIX)"`
PY_LIBDIR="$PY_LIBDIR\\Libs"
+ PY_LIB=`python -c "import sys; sys.stdout.write('python' + sys.version[:3])"`
+ PY_LIB=`python -c "sys.stdout.write('$PY_LIB'.replace('.', ''))"`
else
- PY_LIBDIR="$PY_LIBDIR/lib"
+ PY_LIB=`python-config --libs`
+ PY_LIBDIR=`python-config --ldflags`
fi
- do_make $WK_ROOT/WebKit/wx/bindings/python "-DBUILDING_WX__=1 -DWXUSINGDLL=1 -DWXUSINGDLL_WEBKIT=1 -I$PY_INCLUDE -I$WX_PREFIX/wxPython/include -I$WX_PREFIX/../wxPython/include $WXGC_DEFINE" \
- WX_DEBUG=$wxdebug DEBUG=$debug WEBKIT_ROOT=$WK_ROOTDIR PLATFORM_OS=$PLATFORM_OS PYTHON_VERSION=$PY_VERSION PYTHON_LIBDIR=$PY_LIBDIR $other_args
+ do_make $WK_ROOT/WebKit/wx/bindings/python "-DBUILDING_WX__=1 -DWXUSINGDLL=1 -DWXUSINGDLL_WEBKIT=1 -I$PY_INCLUDE -I$WX_PREFIX/wxPython/include -I$WX_PREFIX/../wxPython/include $WXGC_DEFINE $EXTRA_CPPFLAGS" \
+ WX_DEBUG=$wxdebug DEBUG=$debug WEBKIT_ROOT=$WK_ROOTDIR PLATFORM_OS=$PLATFORM_OS PYTHON_LIB=$PY_LIB PYTHON_LIBDIR=$PY_LIBDIR $other_args
if [ "${OSTYPE:0:6}" == "cygwin" ]; then
if [ -f $WEBKITOUTPUTDIR/_webview.pyd -a -f $WEBKITOUTPUTDIR/_webview.dll ]; then
rm $WEBKITOUTPUTDIR/_webview.pyd
diff --git a/WebKitTools/wx/build/build_utils.py b/WebKitTools/wx/build/build_utils.py
new file mode 100644
index 0000000..f6daf3a
--- /dev/null
+++ b/WebKitTools/wx/build/build_utils.py
@@ -0,0 +1,143 @@
+# Copyright (C) 2009 Kevin Ollivier All rights reserved.
+#
+# Redistribution and use in source and binary forms, with or without
+# modification, are permitted provided that the following conditions
+# are met:
+# 1. Redistributions of source code must retain the above copyright
+# notice, this list of conditions and the following disclaimer.
+# 2. Redistributions in binary form must reproduce the above copyright
+# notice, this list of conditions and the following disclaimer in the
+# documentation and/or other materials provided with the distribution.
+#
+# THIS SOFTWARE IS PROVIDED BY APPLE COMPUTER, INC. ``AS IS'' AND ANY
+# EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+# PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE COMPUTER, INC. OR
+# CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
+# EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+# PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
+# PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
+# OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+#
+# Helper functions for the WebKit build.
+
+import glob
+import os
+import sys
+import urllib
+import urlparse
+
+import Logs
+
+def get_output(command):
+ """
+ Windows-compatible function for getting output from a command.
+ """
+ f = os.popen(command)
+ return f.read().strip()
+
+def get_excludes(root, patterns):
+ """
+ Get a list of exclude patterns going down several dirs.
+ TODO: Make this fully recursive.
+ """
+ excludes = []
+
+ for pattern in patterns:
+ subdir_pattern = os.sep + '*'
+ for subdir in [subdir_pattern, subdir_pattern*2, subdir_pattern*3]:
+ adir = root + subdir + os.sep + pattern
+ files = glob.glob(adir)
+ for afile in files:
+ excludes.append(os.path.basename(afile))
+
+ return excludes
+
+def get_dirs_for_features(root, features, dirs):
+ """
+ Find which directories to include in the list of build dirs based upon the
+ enabled port(s) and features.
+ """
+ outdirs = dirs
+ for adir in dirs:
+ for feature in features:
+ relpath = os.path.join(adir, feature)
+ featuredir = os.path.join(root, relpath)
+ if os.path.exists(featuredir) and not relpath in outdirs:
+ outdirs.append(relpath)
+
+ return outdirs
+
+def download_if_newer(url, destdir):
+ """
+ Checks if the file on the server is newer than the one in the user's tree,
+ and if so, downloads it.
+
+ Returns the filename of the downloaded file if downloaded, or None if
+ the existing file matches the one on the server.
+ """
+ obj = urlparse.urlparse(url)
+ filename = os.path.basename(obj.path)
+ destfile = os.path.join(destdir, filename)
+
+ urlobj = urllib.urlopen(url)
+ size = long(urlobj.info().getheader('Content-Length'))
+
+ def download_callback(downloaded, block_size, total_size):
+ downloaded = block_size * downloaded
+ if downloaded > total_size:
+ downloaded = total_size
+ sys.stdout.write('%s %d of %d bytes downloaded\r' % (filename, downloaded, total_size))
+
+ # NB: We don't check modified time as Python doesn't yet handle timezone conversion
+ # properly when converting strings to time objects.
+ if not os.path.exists(destfile) or os.path.getsize(destfile) != size:
+ urllib.urlretrieve(url, destfile, download_callback)
+ print ''
+ return destfile
+
+ return None
+
+def update_wx_deps(wk_root, msvc_version='msvc2008'):
+ """
+ Download and update tools needed to build the wx port.
+ """
+ Logs.info('Ensuring wxWebKit dependencies are up-to-date.')
+
+ wklibs_dir = os.path.join(wk_root, 'WebKitLibraries')
+ waf = download_if_newer('http://wxwebkit.wxcommunity.com/downloads/deps/waf', os.path.join(wk_root, 'WebKitTools', 'wx'))
+ if waf:
+ # TODO: Make the build restart itself after an update.
+ Logs.warn('Build system updated, please restart build.')
+ sys.exit(1)
+
+ # since this module is still experimental
+ #swig_module = download_if_newer('http://wxwebkit.wxcommunity.com/downloads/deps/swig.py', os.path.join(wk_root, 'WebKit', 'wx', 'bindings', 'python'))
+
+ if sys.platform.startswith('win'):
+ Logs.info('downloading deps package')
+ archive = download_if_newer('http://wxwebkit.wxcommunity.com/downloads/deps/wxWebKitDeps-%s.zip' % msvc_version, wklibs_dir)
+ if archive and os.path.exists(archive):
+ os.system('unzip -o %s -d %s' % (archive, os.path.join(wklibs_dir, msvc_version)))
+
+ elif sys.platform.startswith('darwin'):
+ os.system('%s/WebKitTools/wx/install-unix-extras' % wk_root)
+
+def includeDirsForSources(sources):
+ include_dirs = []
+ for group in sources:
+ for source in group:
+ dirname = os.path.dirname(source)
+ if not dirname in include_dirs:
+ include_dirs.append(dirname)
+
+ return include_dirs
+
+def flattenSources(sources):
+ flat_sources = []
+ for group in sources:
+ flat_sources.extend(group)
+
+ return flat_sources
diff --git a/WebKitTools/wx/build/settings.py b/WebKitTools/wx/build/settings.py
new file mode 100644
index 0000000..b09f0bc
--- /dev/null
+++ b/WebKitTools/wx/build/settings.py
@@ -0,0 +1,265 @@
+# Copyright (C) 2009 Kevin Ollivier All rights reserved.
+#
+# Redistribution and use in source and binary forms, with or without
+# modification, are permitted provided that the following conditions
+# are met:
+# 1. Redistributions of source code must retain the above copyright
+# notice, this list of conditions and the following disclaimer.
+# 2. Redistributions in binary form must reproduce the above copyright
+# notice, this list of conditions and the following disclaimer in the
+# documentation and/or other materials provided with the distribution.
+#
+# THIS SOFTWARE IS PROVIDED BY APPLE COMPUTER, INC. ``AS IS'' AND ANY
+# EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+# PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE COMPUTER, INC. OR
+# CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
+# EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+# PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
+# PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
+# OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+#
+# Common elements of the waf build system shared by all projects.
+
+import commands
+import os
+import platform
+import sys
+
+from build_utils import *
+from waf_extensions import *
+
+# to be moved to wx when it supports more configs
+from wxpresets import *
+
+wk_root = os.path.abspath(os.path.join(os.path.dirname(__file__), '../../..'))
+
+if sys.platform.startswith('win'):
+ if not 'WXWIN' in os.environ:
+ print "Please set WXWIN to the directory containing wxWidgets."
+ sys.exit(1)
+
+ wx_root = os.environ['WXWIN']
+else:
+ wx_root = commands.getoutput('wx-config --prefix')
+
+jscore_dir = os.path.join(wk_root, 'JavaScriptCore')
+webcore_dir = os.path.join(wk_root, 'WebCore')
+wklibs_dir = os.path.join(wk_root, 'WebKitLibraries')
+
+common_defines = []
+common_cxxflags = []
+common_includes = []
+common_libs = []
+common_libpaths = []
+common_frameworks = []
+
+jscore_dirs = [
+ 'API',
+ 'bytecode',
+ 'bytecompiler',
+ 'debugger',
+ 'DerivedSources',
+ 'interpreter',
+ 'jit',
+ 'parser',
+ 'pcre',
+ 'profiler',
+ 'runtime',
+ 'wtf',
+ 'wtf/unicode',
+ 'wtf/unicode/icu',
+]
+
+webcore_dirs = [
+ 'accessibility',
+ 'bindings/js',
+ 'bridge',
+ 'bridge/c',
+ 'css',
+ 'DerivedSources',
+ 'dom',
+ 'dom/default',
+ 'editing',
+ 'history',
+ 'html',
+ 'inspector',
+ 'loader',
+ 'loader/appcache',
+ 'loader/archive',
+ 'loader/icon',
+ 'page',
+ 'page/animation',
+ 'platform',
+ 'platform/animation',
+ 'platform/graphics',
+ 'platform/graphics/transforms',
+ 'platform/image-decoders',
+ 'platform/image-decoders/bmp',
+ 'platform/image-decoders/gif',
+ 'platform/image-decoders/ico',
+ 'platform/image-decoders/jpeg',
+ 'platform/image-decoders/png',
+ 'platform/image-decoders/xbm',
+ 'platform/image-decoders/zlib',
+ 'platform/network',
+ 'platform/sql',
+ 'platform/text',
+ 'plugins',
+ 'rendering',
+ 'rendering/style',
+ 'storage',
+ 'xml'
+]
+
+config_file = os.path.join(wk_root, 'WebKitBuild', 'Configuration')
+config = 'Debug'
+
+if os.path.exists(config_file):
+ config = open(config_file).read()
+
+output_dir = os.path.join(wk_root, 'WebKitBuild', config)
+
+waf_configname = config.upper()
+
+build_port = "wx"
+building_on_win32 = sys.platform.startswith('win')
+
+if building_on_win32:
+ if config == 'Release':
+ waf_configname = waf_configname + ' CRT_MULTITHREADED_DLL'
+ else:
+ waf_configname = waf_configname + ' CRT_MULTITHREADED_DLL_DBG'
+
+create_hash_table = wk_root + "/JavaScriptCore/create_hash_table"
+if building_on_win32:
+ create_hash_table = get_output('cygpath --unix "%s"' % create_hash_table)
+os.environ['CREATE_HASH_TABLE'] = create_hash_table
+
+feature_defines = ['ENABLE_DATABASE', 'ENABLE_XSLT', 'ENABLE_JAVASCRIPT_DEBUGGER']
+
+def common_set_options(opt):
+ """
+ Initialize common options provided to the user.
+ """
+ opt.tool_options('compiler_cxx')
+ opt.tool_options('compiler_cc')
+ opt.tool_options('python')
+
+ opt.add_option('--wxpython', action='store_true', default=False, help='Create the wxPython bindings.')
+
+def common_configure(conf):
+ """
+ Configuration used by all targets, called from the target's configure() step.
+ """
+ conf.check_tool('compiler_cxx')
+ conf.check_tool('compiler_cc')
+ conf.check_tool('python')
+ conf.check_python_headers()
+
+ if sys.platform.startswith('darwin'):
+ conf.check_tool('osx')
+
+ msvc_version = 'msvc2008'
+ if building_on_win32:
+ found_versions = conf.get_msvc_versions()
+ if found_versions[0][0] == 'msvc 9.0':
+ msvc_version = 'msvc2008'
+ elif found_versions[0][0] == 'msvc 8.0':
+ msvc_version = 'msvc2005'
+
+ msvclibs_dir = ''
+ if build_port == "wx":
+ update_wx_deps(wk_root, msvc_version)
+ msvclibs_dir = os.path.join(wklibs_dir, msvc_version, 'win')
+
+ conf.env.append_value('CXXDEFINES', ['BUILDING_WX__=1', 'WTF_USE_WXGC=1'])
+
+ if building_on_win32:
+ conf.env.append_value('LIBPATH', os.path.join(msvclibs_dir, 'lib'))
+ # wx settings
+ wxdefines, wxincludes, wxlibs, wxlibpaths = get_wxmsw_settings(wx_root, shared=True, unicode=True, wxPython=True)
+ conf.env['CXXDEFINES_WX'] = wxdefines
+ conf.env['CPPPATH_WX'] = wxincludes
+ conf.env['LIB_WX'] = wxlibs
+ conf.env['LIBPATH_WX'] = wxlibpaths
+
+ if sys.platform.startswith('darwin'):
+ conf.env['LIB_ICU'] = ['icucore']
+ # Apple does not ship the ICU headers with Mac OS X, so WebKit includes a copy of 3.2 headers
+ conf.env['CPPPATH_ICU'] = [os.path.join(jscore_dir, 'icu'), os.path.join(webcore_dir, 'icu')]
+
+ conf.env.append_value('CPPPATH', wklibs_dir)
+ conf.env.append_value('LIBPATH', wklibs_dir)
+
+ #conf.env['PREFIX'] = output_dir
+
+ libprefix = ''
+ if building_on_win32:
+ libprefix = 'lib'
+
+ conf.env['LIB_JSCORE'] = [libprefix + 'jscore']
+ conf.env['LIB_WEBCORE'] = [libprefix + 'webcore']
+ conf.env['LIB_WXWEBKIT'] = ['wxwebkit']
+ conf.env['CXXDEFINES_WXWEBKIT'] = ['WXUSINGDLL_WEBKIT']
+
+ conf.env.append_value('CXXDEFINES', feature_defines)
+ if config == 'Release':
+ conf.env.append_value('CPPDEFINES', 'NDEBUG')
+
+ if building_on_win32:
+ conf.env.append_value('CPPPATH', [
+ os.path.join(jscore_dir, 'os-win32'),
+ os.path.join(msvclibs_dir, 'include'),
+ os.path.join(msvclibs_dir, 'include', 'pthreads'),
+ os.path.join(msvclibs_dir, 'lib'),
+ ])
+
+ conf.env.append_value('LIB', ['libpng', 'libjpeg', 'pthreadVC2'])
+ # common win libs
+ conf.env.append_value('LIB', [
+ 'kernel32', 'user32','gdi32','comdlg32','winspool','winmm',
+ 'shell32', 'comctl32', 'ole32', 'oleaut32', 'uuid', 'advapi32',
+ 'wsock32', 'gdiplus'])
+
+ conf.env['LIB_ICU'] = ['icudt', 'icule', 'iculx', 'icuuc', 'icuin', 'icuio', 'icutu']
+
+ #curl
+ conf.env['LIB_CURL'] = ['libcurl']
+
+ #sqlite3
+ conf.env['CPPPATH_SQLITE3'] = [os.path.join(msvclibs_dir, 'include', 'SQLite')]
+ conf.env['LIB_SQLITE3'] = ['sqlite3']
+
+ #libxml2
+ conf.env['LIB_XML'] = ['libxml2']
+
+ #libxslt
+ conf.env['LIB_XSLT'] = ['libxslt']
+ else:
+ if build_port == 'wx':
+ conf.env.append_value('LIB', ['png', 'pthread'])
+ conf.env.append_value('LIBPATH', os.path.join(wklibs_dir, 'unix', 'lib'))
+ conf.env.append_value('CPPPATH', os.path.join(wklibs_dir, 'unix', 'include'))
+ conf.env.append_value('CXXFLAGS', ['-fPIC', '-DPIC'])
+
+ conf.check_cfg(path='wx-config', args='--cxxflags --libs', package='', uselib_store='WX')
+
+ conf.check_cfg(path='xslt-config', args='--cflags --libs', package='', uselib_store='XSLT')
+ conf.check_cfg(path='xml2-config', args='--cflags --libs', package='', uselib_store='XML')
+ conf.check_cfg(path='curl-config', args='--cflags --libs', package='', uselib_store='CURL')
+ if sys.platform.startswith('darwin'):
+ conf.env.append_value('LIB', ['WebCoreSQLite3'])
+
+ if not sys.platform.startswith('darwin'):
+ conf.check_cfg(package='cairo', args='--cflags --libs', uselib_store='WX')
+ conf.check_cfg(package='pango', args='--cflags --libs', uselib_store='WX')
+ conf.check_cfg(package='gtk+-2.0', args='--cflags --libs', uselib_store='WX')
+ conf.check_cfg(package='sqlite3', args='--cflags --libs', uselib_store='SQLITE3')
+ conf.check_cfg(path='icu-config', args='--cflags --ldflags', package='', uselib_store='ICU')
+
+
+
+
diff --git a/WebKitTools/wx/build/waf_extensions.py b/WebKitTools/wx/build/waf_extensions.py
new file mode 100644
index 0000000..fcf34df
--- /dev/null
+++ b/WebKitTools/wx/build/waf_extensions.py
@@ -0,0 +1,79 @@
+# Copyright (C) 2009 Kevin Ollivier All rights reserved.
+#
+# Redistribution and use in source and binary forms, with or without
+# modification, are permitted provided that the following conditions
+# are met:
+# 1. Redistributions of source code must retain the above copyright
+# notice, this list of conditions and the following disclaimer.
+# 2. Redistributions in binary form must reproduce the above copyright
+# notice, this list of conditions and the following disclaimer in the
+# documentation and/or other materials provided with the distribution.
+#
+# THIS SOFTWARE IS PROVIDED BY APPLE COMPUTER, INC. ``AS IS'' AND ANY
+# EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+# PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE COMPUTER, INC. OR
+# CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
+# EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+# PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
+# PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
+# OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+#
+# This module is for code where we override waf's default behavior or extend waf
+
+import os
+import subprocess
+import sys
+
+import Utils
+
+# version of exec_command that handles Windows command lines longer than 32000 chars
+def exec_command(s, **kw):
+ filename = ''
+ if sys.platform.startswith('win') and len(' '.join(s)) > 32000:
+ import tempfile
+ file = tempfile.NamedTemporaryFile(delete=False)
+ filename = file.name
+ file.write(' '.join(s[1:]))
+ file.close()
+
+ s = [s[0], '@' + filename]
+
+ if 'log' in kw:
+ kw['stdout'] = kw['stderr'] = kw['log']
+ del(kw['log'])
+ kw['shell'] = isinstance(s, str)
+
+ def cleanup():
+ try:
+ if os.path.exists(filename):
+ os.remove(filename)
+ except:
+ pass
+
+ try:
+ proc = subprocess.Popen(s, **kw)
+ result = proc.wait()
+ cleanup()
+ return result
+
+ except OSError:
+ cleanup()
+ raise
+
+Utils.exec_command = exec_command
+
+# Better performing h_file to keep hashing from consuming lots of time
+import stat
+def h_file(filename):
+ st = os.stat(filename)
+ if stat.S_ISDIR(st[stat.ST_MODE]): raise IOError('not a file')
+ m = Utils.md5()
+ m.update(str(st.st_mtime))
+ m.update(str(st.st_size))
+ m.update(filename)
+ return m.digest()
+
+Utils.h_file = h_file
diff --git a/WebKitTools/wx/build/wxpresets.py b/WebKitTools/wx/build/wxpresets.py
new file mode 100644
index 0000000..677720c
--- /dev/null
+++ b/WebKitTools/wx/build/wxpresets.py
@@ -0,0 +1,78 @@
+# Copyright (C) 2009 Kevin Ollivier All rights reserved.
+#
+# Redistribution and use in source and binary forms, with or without
+# modification, are permitted provided that the following conditions
+# are met:
+# 1. Redistributions of source code must retain the above copyright
+# notice, this list of conditions and the following disclaimer.
+# 2. Redistributions in binary form must reproduce the above copyright
+# notice, this list of conditions and the following disclaimer in the
+# documentation and/or other materials provided with the distribution.
+#
+# THIS SOFTWARE IS PROVIDED BY APPLE COMPUTER, INC. ``AS IS'' AND ANY
+# EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+# PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE COMPUTER, INC. OR
+# CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
+# EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+# PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
+# PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
+# OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+#
+# Library for functions to determine wx settings based on configuration
+
+import os
+
+def get_wxmsw_settings(wx_root, shared = False, unicode = False, debug = False, wxPython=False):
+ if not os.path.exists(wx_root):
+ print "Directory %s does not exist." % wx_root
+ sys.exit(1)
+
+ defines = ['__WXMSW__']
+ includes = [os.path.join(wx_root, 'include')]
+ cxxflags = []
+ libs = []
+ libpaths = []
+
+ libdir = os.path.join(wx_root, 'lib')
+ ext = ''
+ postfix = 'vc'
+
+ if shared:
+ defines.append('WXUSINGDLL')
+ libdir = os.path.join(libdir, 'vc_dll')
+ else:
+ libdir = os.path.join(libdir, 'vc_lib')
+
+ if unicode:
+ defines.append('_UNICODE')
+ ext += 'u'
+
+ depext = ''
+ if wxPython:
+ ext += 'h'
+ depext += 'h'
+ elif debug:
+ ext += 'd'
+ depext += 'd'
+
+ configdir = os.path.join(libdir, 'msw' + ext)
+ libpaths.append(libdir)
+ includes.append(configdir)
+
+ def get_wxlib_name(name):
+ prefix = 'wxmsw'
+ if name == 'base':
+ return 'wxbase28%s' % (ext)
+
+ return "wxmsw28%s_%s" % (ext, name)
+
+ libs.extend(['wxzlib' + depext, 'wxjpeg' + depext, 'wxpng' + depext, 'wxexpat' + depext])
+ libs.extend([get_wxlib_name('base'), get_wxlib_name('core')])
+
+ if wxPython or debug:
+ defines.append('__WXDEBUG__')
+
+ return (defines, includes, libs, libpaths)