3 # Copyright (C) 2009 Kevin Ollivier All rights reserved.
5 # Redistribution and use in source and binary forms, with or without
6 # modification, are permitted provided that the following conditions
8 # 1. Redistributions of source code must retain the above copyright
9 # notice, this list of conditions and the following disclaimer.
10 # 2. Redistributions in binary form must reproduce the above copyright
11 # notice, this list of conditions and the following disclaimer in the
12 # documentation and/or other materials provided with the distribution.
14 # THIS SOFTWARE IS PROVIDED BY APPLE COMPUTER, INC. ``AS IS'' AND ANY
15 # EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
16 # IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
17 # PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE COMPUTER, INC. OR
18 # CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
19 # EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
20 # PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
21 # PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
22 # OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
23 # (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
24 # OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
26 # WebCore build script for the waf build system
28 from settings import *
32 if build_port == "wx":
33 webcore_sources['plugins'] = [ 'plugins/PluginDataNone.cpp',
34 'plugins/PluginPackageNone.cpp',
35 'plugins/PluginViewNone.cpp'
39 webcore_dirs.append('platform/wx/wxcode/win')
40 webcore_sources['wx-win'] = [
41 # wxTimer on Windows has a bug that causes it to eat crashes in callbacks
42 # so we need to use the Win port's implementation until the wx bug fix is
43 # widely available (it was fixed in 2.8.10).
44 'platform/win/SharedTimerWin.cpp',
45 'page/win/PageWin.cpp',
48 elif sys.platform.startswith('darwin'):
49 webcore_dirs.append('platform/wx/wxcode/mac/carbon')
50 webcore_sources['wx-mac'] = [
51 'platform/mac/PurgeableBufferMac.cpp',
54 webcore_dirs.append('platform/wx/wxcode/gtk')
56 from TaskGen import taskgen, feature, after
59 def generate_webcore_derived_sources():
60 # build the derived sources
61 derived_sources_dir = os.path.join(webcore_dir, 'DerivedSources')
64 wc_dir = get_output('cygpath --unix "%s"' % wc_dir)
65 if not os.path.exists(derived_sources_dir):
66 os.mkdir(derived_sources_dir)
69 os.chdir(derived_sources_dir)
71 os.system('make -f %s/DerivedSources.make WebCore=%s SOURCE_ROOT=%s all FEATURE_DEFINES="%s"' % (wc_dir, wc_dir, wc_dir, ' '.join(feature_defines)))
75 common_set_options(opt)
78 common_configure(conf)
83 generate_webcore_derived_sources()
85 wk_includes = ['.', '..', 'DerivedSources',
87 os.path.join(wk_root, 'JavaScriptCore'),
88 os.path.join(wk_root, 'WebCore'),
89 'platform/image-decoders',
94 features = [build_port]
95 if build_port == 'wx':
96 features.append('curl')
98 full_dirs = get_dirs_for_features(webcore_dir, features=features, dirs=webcore_dirs)
100 jscore_dir = os.path.join(wk_root, 'JavaScriptCore')
101 for item in os.listdir(jscore_dir):
102 fullpath = os.path.join(jscore_dir, item)
103 if os.path.isdir(fullpath) and not item == "os-win32" and not item == 'icu':
104 wk_includes.append(fullpath)
106 wk_includes += common_includes + full_dirs
109 if building_on_win32:
110 cxxflags.append('/FIWebCorePrefix.h')
112 cxxflags.extend(['-include', 'WebCorePrefix.h'])
114 webcore = bld.new_task_gen(
115 features = 'cc cxx cstaticlib',
116 includes = ' '.join(wk_includes),
117 source = ' '.join(flattenSources(webcore_sources.values())),
120 uselib = 'WX ICU XML XSLT CURL ' + waf_configname,
122 install_path = output_dir,
126 if build_port == 'wx':
127 excludes = get_excludes(webcore_dir, ['*None.cpp', '*CF.cpp', '*Qt.cpp', '*Win.cpp', '*Wince.cpp', '*Gtk.cpp', '*Mac.cpp', '*Safari.cpp', '*Chromium*.cpp','*SVG*.cpp', '*AllInOne.cpp', 'test*bindings.*'])
128 excludes.extend(['UserStyleSheetLoader.cpp', 'RenderMediaControls.cpp'])
130 # intermediate sources
131 excludes.append('CSSValueKeywords.c')
132 excludes.append('CSSPropertyNames.cpp')
133 excludes.append('tokenizer.cpp')
135 # FIXME: these three require headers that I can't seem to find in trunk.
136 # Investigate how to resolve these issues.
137 excludes.append('JSAbstractView.cpp')
138 excludes.append('JSPositionCallback.cpp')
139 excludes.append('JSDOMStringList.cpp')
140 excludes.append('JSInspectorController.cpp')
141 if building_on_win32:
142 excludes.append('SharedTimerWx.cpp')
144 webcore.find_sources_in_dirs(full_dirs, excludes = excludes, exts=['.c', '.cpp'])