2 ###################################################################
3 # Helper script to build with various options.
4 ###################################################################
9 # defines global options
10 machines = ("armv7el", "i586")
11 repositories = ("standard", "i586emul")
17 enableInjectedProfile = False
19 enableDryRun = False # To debug
20 buildMachine = machines[0] # default machie is armv7el
21 buildRepository = repositories[0] # default repository is standard
28 def signalHandler(signal, frame):
29 print ' # SIGINT will be ignored for stable work'
38 print("""# helper scripts to build webkit-efl with dynamic options"
40 # tizen-scripts/build-webkit.py [options]
44 -h, --help : print this message.
45 -d, --debug : build with debug info.
46 -i, --injected-profile : build with injected profile code
47 -l, --layouttest : build for layout test
49 -n, --dry-run : Don't actually run any commands; just print them.
50 -o, --online : build with --online option.
51 -r, --repository [ %s ] : choose repository (default is %s)
52 -s : Add simulator definition (just for testing emulator)
53 -w : Add micro definition (just for testing micro)
54 -v : Fix package version to 123997_0.999.0. It will prevent CMakeCache Errors although version is changed.
55 -u, --unittest : build for unit test
56 -0, --disable-tizen-options : build without tizen options (not supported yet)
57 --makeargs [ targets ] : Just call make targets instead of calling 'cmake ... && make'
58 Below are possible targets ( /fast would be faster but not safe )
60 wtf_efl javascriptcore_efl jsc_efl webcore_efl WebKit2StaticForDebug ewebkit2
61 WebCoreTestSupport gtest
62 forwarding-headerEfl forwarding-headerSoup
63 PluginProcess WebProcess
66 test_ewk2_context test_ewk2_cookie_manager test_ewk2_download_job test_ewk2_settings test_ewk2_view
67 wk2-web-inspector-resources
68 DefaultTheme MiniBrowser
70 """ % (' | '.join(machines), ' | '.join(repositories), buildRepository))
72 specFileName = "packaging/webkit2-efl.spec"
75 if enableInjectedProfile:
76 execute("python TizenScripts/code-injecter.py")
79 execute("cp %s backupForSpecfile.spec" % specFileName)
81 execute("python TizenScripts/fix-version-of-spec.py")
84 if enableInjectedProfile:
85 execute("python TizenScripts/code-injecter.py reset")
88 execute("mv backupForSpecfile.spec %s" % specFileName)
91 execute('sudo echo build start') # touch sudo
99 directoryDefine = '--define=\\\"\"_webkit_build_dir %s\"\\\"' % directoryPath
101 optionsDefine = ' --define=\\\"\"_webkit_cmake_options %s\"\\\"' % extraOptions
103 optionsDefine = optionsDefine + ' --define=\\\"\"_make_option %s\"\\\"' % gMakeOption
106 debugDefine = "--debug"
108 if buildMachine == "i586" and gSimulator:
109 simulatorDefine = ' --define=\\\"\"simulator 1\"\\\"'
112 simulatorDefine = ' --define=\\\"\"sec_build_project_name tizenw2_master\"\\\"'
114 execute('time osce build %s %s %s %s %s %s %s' % (buildRepository, buildMachine, optionsOnline, debugDefine, directoryDefine, optionsDefine, simulatorDefine))
118 global directoryPath, enableDebug, extraOptions, enableInjectedProfile, buildMachine, buildRepository, optionsOnline, enableDryRun, gMakeOption, gSimulator, gMicro, gFixVersion
120 optlist, args = getopt.getopt(sys.argv[1:], 'hdilunm:r:oswv', [ 'help', 'debug', 'injected-profile', 'layouttest', 'unittest', 'dry-run', 'machine=', 'online', 'makeargs=', 'repository=' ])
121 for opt, var in optlist:
122 if opt in ('--help', '-h'):
125 if opt in ('--debug', '-d'):
127 if opt in ('--injected-profile', '-i'):
128 enableInjectedProfile = True
129 extraOptions += " -DENABLE_TIZEN_PROFILE=On"
130 if opt in ('--layouttest', '-l'):
131 directoryPath = "WebKitBuild/Release"
132 extraOptions += " -DENABLE_TIZEN_WEBKIT2_EFL_WTR=1"
133 if opt in ('--unittest', '-u'):
134 directoryPath = "WebKitBuild/Release"
135 # TIZEN_GESTURE and TIZEN_WEBKIT2_TEXT_SELECTION cause segmentation fault while running unit tests.
136 extraOptions += " '-DENABLE_API_TESTS=1 -DENABLE_TIZEN_WEBKIT2_UNIT_TESTS=1 -DENABLE_TIZEN_WEBKIT2_TEXT_SELECTION=0 -DENABLE_TIZEN_GESTURE=0'"
137 if opt in ('--dry-run', '-n'):
139 if opt in ('--repository', '-r'):
140 if var not in repositories:
141 print "## ! Error : repository should be %s or %s" % repositories
145 buildRepository = var
146 if opt in ('--machine', '-m'):
147 if var not in machines:
148 print "## ! Error : machine should be %s or %s" % machines
153 if opt in ('--online', '-o'):
154 optionsOnline = "--online"
161 if opt == '--makeargs':
162 print "make args" + var
167 if __name__ == "__main__":