-
Notifications
You must be signed in to change notification settings - Fork 3
/
run-gyp
executable file
·97 lines (80 loc) · 4.54 KB
/
run-gyp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
#!/bin/sh
#
# This is a script to generate the Chrome project.
# Run it from the root of the Chromium source tree, e.g.:
# [SOAAP/chromium/chromium-32.0.1700.107]$ ../run-gyp
#
# with some environment variables set:
# LLVM_BUILD_DIR SOAAP-LLVM build directory
# SOAAP_BUILD_DIR SOAAP build directory
# SOAAP_CHROMIUM_ROOT (optional) root of ${SOAAP}/chromium
# CHROMIUM_VERSION (optional) patch version to use ("v32", "v42"...)
#
if [ "$LLVM_BUILD_DIR" == "" ]; then
echo "LLVM_BUILD_DIR not set"
exit 1
fi
if [ "$SOAAP_BUILD_DIR" == "" ]; then
echo "SOAAP_BUILD_DIR not set"
exit 1
fi
: ${SOAAP_CHROMIUM_ROOT:="`realpath ..`"}
CHROMIUM_VERSION=$1
if [ "${CHROMIUM_VERSION}" == "" ]; then
case "${PWD}" in
*v32)
CHROMIUM_VERSION=v32
;;
*v42)
CHROMIUM_VERSION=v42
;;
*)
echo "Unknown Chromium version: '${PWD}'"
exit 1
;;
esac
fi
echo "Configuring SOAAP-modified Chromium with:"
echo " root $SOAAP_CHROMIUM_ROOT"
echo " version $CHROMIUM_VERSION"
echo " LLVM $LLVM_BUILD_DIR"
echo " SOAAP $SOAAP_BUILD_DIR"
echo ""
# First, set up the environment using values taken from the FreeBSD
# www/chromium port.
case ${CHROMIUM_VERSION} in
v32)
export CC=cc CXX=c++ GYP_GENERATORS=ninja GYP_DEFINES="use_cups=1 use_system_protobuf=1 use_system_yasm=1 use_system_libxml=1 use_system_ffmpeg=0 use_system_libusb=1 use_system_libevent=1 use_system_libvpx=0 linux_breakpad=0 linux_strip_binary=1 linux_use_tcmalloc=0 linux_use_heapchecker=0 test_isolation_mode=noop clang_use_chrome_plugins=0 disable_nacl=1 enable_webrtc=1 enable_openmax=1 enable_one_click_signin=1 werror= no_gc_sections=1 os_ver=1000510 prefix_dir=/usr/local python_ver=2.7 google_api_key=AIzaSyBsp9n41JLW8jCokwn7vhoaMejDFRd1mp8 google_default_client_id=996322985003.apps.googleusercontent.com google_default_client_secret=IR1za9-1VK0zZ0f_O8MVFicn ffmpeg_branding=Chrome proprietary_codecs=1 use_pulseaudio=0 buildtype=Official clang=1" CFLAGS="-O2 -pipe -fno-stack-protector -Wno-unknown-warning-option -fno-strict-aliasing" CPPFLAGS="" CXXFLAGS="-O2 -pipe -fno-stack-protector -Wno-unknown-warning-option -fno-strict-aliasing" LDFLAGS="" PYTHON="/usr/local/bin/python2.7" PKG_CONFIG=pkgconf AR=/usr/bin/ar SHELL=/bin/sh CONFIG_SHELL=/bin/sh
;;
v42)
export \
AR=/usr/bin/ar \
CC="cc" \
CXX="c++" \
CFLAGS="-O2 -pipe -isystem/usr/local/include -Wno-unknown-warning-option -fstack-protector -fno-strict-aliasing" \
CPPFLAGS="" \
CXXFLAGS="-O2 -pipe -isystem/usr/local/include -Wno-unknown-warning-option -fstack-protector -fno-strict-aliasing " \
LDFLAGS=" -fstack-protector" \
GYP_GENERATORS=ninja \
ac_cv_path_PERL=/usr/local/bin/perl \
ac_cv_path_PERL_PATH=/usr/local/bin/perl \
PKG_CONFIG=pkgconf \
PYTHON="/usr/local/bin/python2.7" \
SHELL=/bin/sh \
CONFIG_SHELL=/bin/sh
export GYP_DEFINES="clang_use_chrome_plugins=0 linux_breakpad=0 linux_use_heapchecker=0 linux_strip_binary=1 test_isolation_mode=noop disable_nacl=1 enable_extensions=1 enable_one_click_signin=1 enable_openmax=1 enable_webrtc=1 werror= no_gc_sections=1 os_ver=1001000 prefix_dir=/usr/local python_ver=2.7 use_allocator=none use_cups=1 linux_link_gsettings=1 linux_link_libpci=1 linux_link_libspeechd=1 libspeechd_h_prefix=speech-dispatcher/ usb_ids_path=/usr/local/share/usbids/usb.ids want_separate_host_toolset=0 use_system_bzip2=1 use_system_flac=1 use_system_harfbuzz=1 use_system_icu=1 use_system_jsoncpp=1 use_system_libevent=1 use_system_libexif=1 use_system_libjpeg=1 use_system_libpng=1 use_system_libusb=1 use_system_libwebp=1 use_system_libxml=1 use_system_libxslt=1 use_system_nspr=1 use_system_protobuf=0 use_system_re2=1 use_system_snappy=1 use_system_speex=1 use_system_xdg_utils=1 use_system_yasm=1 v8_use_external_startup_data=0 flapper_version_h_file='../../flapper_version.h' google_api_key=AIzaSyBsp9n41JLW8jCokwn7vhoaMejDFRd1mp8 google_default_client_id=996322985003.apps.googleusercontent.com google_default_client_secret=IR1za9-1VK0zZ0f_O8MVFicn ffmpeg_branding=Chrome proprietary_codecs=1 use_gconf=1 use_pulseaudio=0 clang=1"
;;
*)
echo "Unknown Chromium version: ${CHROMIUM_VERSION}"
exit 1
;;
esac
# Modern Clang produces a *lot* of warnings on Chromium v32.
export CXXFLAGS="${CXXFLAGS} -Wno-unused-local-typedef"
export CXXFLAGS="${CXXFLAGS} -Wno-tautological-undefined-compare"
# Then, run Gyp!
./build/gyp_chromium --depth . || exit 1
if [ "$NOPATCH" == "" ]; then
export SOAAP_CHROMIUM_ROOT
../patch-ninja-file out/Release/build.ninja ${CHROMIUM_VERSION} || exit 1
fi