74
73
# See https://bugs.chromium.org/p/v8/issues/detail?id=3782
75
74
export CFLAGS+=-fno-delete-null-pointer-checks
77
# treat all warnings as errors
80
# build with gcc instead of clang
82
defines+=clang_use_chrome_plugins=
84
76
# disabled features
85
defines+=use_ozone=0 \
91
linux_use_gold_flags=0 \
92
linux_use_bundled_gold=0 \
93
linux_use_bundled_binutils=0 \
97
enable_remoting_host=0 \
98
enable_prod_wallet_service=0 \
101
defines+=enable_hidpi=1 \
106
use_gnome_keyring=1 \
107
linux_link_libpci=1 \
108
linux_link_gsettings=1 \
109
linux_link_libspeechd=1 \
110
linux_link_gnome_keyring=1 \
77
defines+=enable_browser_cdms=true \
78
enable_clipboard_aurax11=true \
79
enable_google_now=false \
80
enable_hangout_services_extension=true \
81
enable_hotwording=false \
85
enable_widevine=true \
86
is_component_build=true \
87
is_component_ffmpeg=true \
89
is_desktop_linux=true \
90
remove_webcore_debug_symbols=true \
92
treat_warnings_as_errors=false \
93
use_allocator="none" \
103
use_pulseaudio=true \
105
use_system_harfbuzz=false \
106
use_system_libjpeg=true \
107
use_system_sqlite=false \
108
clang_use_chrome_plugins=false \
112
ffmpeg_std_defines += proprietary_codecs=false
113
ffmpeg_extra_defines += proprietary_codecs=true ffmpeg_branding=Chrome
112
115
# system libraries to use
113
defines+=use_system_re2=1 \
119
use_system_libpng=1 \
120
use_system_libxml=0 \
121
use_system_libjpeg=1 \
122
use_system_libwebp=0 \
123
use_system_libxslt=0 \
124
use_system_libsrtp=0 \
125
use_system_jsoncpp=0 \
126
use_system_libevent=0 \
127
use_system_harfbuzz=0 \
128
use_system_xdg_utils=1 \
130
browser_defines+=proprietary_codecs=1
134
release_extra_cflags=-g \
136
ffmpeg_std_defines := $(NULL)
137
ffmpeg_extra_defines := ffmpeg_branding=Chrome
139
# use embedded protobuf for now (bug #764911)
140
# https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=764911
141
defines+=use_system_protobuf=0 \
144
defines+=use_system_icu=0 \
145
#icu_use_data_file_flag=0 \
146
#want_separate_host_toolset=0 \
148
# reduce the size of debugging symbols
149
defines+=remove_webcore_debug_symbols=1
151
# some notes about embedded libraries
152
# use_system_libusb=0 requires modified source that exposes libusb_interrupt_handle_event api
153
# use_system_libvpx=0 need to run unbundler
154
# use_system_sqlite=0 build fails
155
# can't use system nss since net/third_party/nss is heavily patched
156
# can't use system ots (open text *summarizer*) since that's not google's ots (open text *sanitizer*)
158
# make gyp a little more informative
162
defines += dont_embed_build_metadata=0
164
# do not use third_party/gold as the linker.
165
defines += linux_use_gold_binary=0 linux_use_gold_flags=0 linux_use_bundled_gold=0
167
# enable features that we want.
168
defines += enable_mdns=1
169
defines += use_nss_verifier=1
170
defines += enable_touch_ui=1
171
defines += enable_hangout_services_extension=1
172
# add support and stubbed implementation of widevine (needed for EME)
173
defines += enable_widevine=1 enable_pepper_cdms=1
175
#defines += use_ozone=1 ozone_auto_platforms=0 ozone_platform_mir=1 ozone_platform_wayland=0
176
#defines += use_ozone=1
177
#defines += ozone_platform_mir=1
179
# Intentional configuration, not bug work-arounds.
180
ifeq (arm,$(DEB_HOST_ARCH_CPU))
187
ifeq (armel,$(DEB_HOST_ARCH))
189
v8_use_arm_eabi_hardfloat=false \
195
ifeq (armhf,$(DEB_HOST_ARCH))
196
gyp_params += -DUSE_EABI_HARDFLOAT
197
# ARN Neon optional flag is off because it causes build errors, AND testing
198
# /proc/cpuinfo contents can't work with a sandbox anyway.
200
arm_neon_optional=0 \
201
v8_use_arm_eabi_hardfloat=true \
210
ifeq (amd64,$(DEB_HOST_ARCH))
211
defines += target_arch=x64
213
ifeq (i386,$(DEB_HOST_ARCH))
214
defines += target_arch=ia32
215
# SEGV on component builds, 2013-05
216
defines += use_allocator=none
217
# Some mobile CPUs don't support SSE instructions. SIGILL. 2014-08
218
defines += disable_sse2=1
220
ifeq (armhf,$(DEB_HOST_ARCH))
221
# SEGV on armhf, 2016-06
222
GYP_DEFINES += use_allocator=none
224
ifeq (arm64,$(DEB_HOST_ARCH))
225
defines += target_arch=arm64
228
ifeq (1,$(COMPONENT_SHARED_LIB_BUILD))
229
browser_defines += component=shared_library
230
ffmpeg_defines += component=shared_library
233
# Webkit library is enormous. Exclude for now.
234
defines += remove_webcore_debug_symbols=1
236
BUILD_TYPE := Release
238
defines += linux_dump_symbols=1
239
defines += logging_like_official_build=1
242
ifeq (1,$(COMPONENT_SHARED_LIB_BUILD))
243
defines += library=shared_library
116
use_system_libraries := #yasm libwebp libevent
119
# Build the launchpad translations (already landed upstream)
120
#!#GYP_DEFINES += use_third_party_translations=1
121
$(warning gn translations)
124
#!#GN_DEF += enable_hidpi=true
126
#!#GYP_DEFINES += enable_touch_ui=1
127
$(warning gn touch ui)
130
## Debian got this name wrong. DEB_HOST is not the hosting machine of
131
## compilation, but the destination of the resulting compiled programs.
132
## DEB_HOST = target. DEB_BUILD = hosting machine. Someone forgot what
133
## "to host" means, and thought of "host" as "computery thing".
135
ifeq (armel,$(DEB_HOST_ARCH))
136
defines += target_cpu="arm"
137
defines += arm_neon=false use_cups=true
138
defines += v8_use_arm_eabi_hardfloat=false arm_float_abi="soft" arm_thumb=false
139
else ifeq (armhf,$(DEB_HOST_ARCH))
140
defines += target_cpu="arm"
141
defines += arm_neon=false use_cups=true
142
defines += arm_neon_optional=false v8_use_arm_eabi_hardfloat=true arm_fpu="vfpv3-d16"
143
else ifeq (arm64,$(DEB_HOST_ARCH))
144
defines += target_cpu="arm64"
145
else ifeq (i386,$(DEB_HOST_ARCH))
146
defines += target_cpu="x86"
147
defines += disable_sse2=true
148
else ifeq (amd64,$(DEB_HOST_ARCH))
149
defines += target_cpu="x64"
150
else ifeq ($(DEB_HOST_ARCH),mipsel)
151
defines += target_cpu="mipsel"
152
else ifeq ($(DEB_HOST_ARCH),)
154
$(warning unanticipated arch $(DEB_HOST_ARCH))
155
defines += target_arch="$(DEB_HOST_ARCH)"
159
ifeq (1,$(COMPONENT_SHARED_LIB_BUILD))
160
defines += is_component_build=true
161
defines += is_component_ffmpeg=true
339
246
ifeq (1,$(COMPONENT_SHARED_LIB_BUILD))
340
mkdir -p $(CURDIR)/debian/tmp-std/$(LIB_DIR)/libs
341
mv -v $(SRC_DIR)/out/$(BUILD_TYPE)-chromium/lib/libffmpeg.so $(CURDIR)/debian/tmp-std/$(LIB_DIR)/libs
247
mkdir -p $(CURDIR)/debian/tmp-std/$(LIB_DIR)
248
mv -v $(SRC_DIR)/out/chromium/libffmpeg.so $(CURDIR)/debian/tmp-std/$(LIB_DIR)
343
mkdir -p $(CURDIR)/debian/tmp-extra/$(LIB_DIR)/libs
344
mv -v $(SRC_DIR)/out/$(BUILD_TYPE)-ffmpeg-extra/lib/libffmpeg.so $(CURDIR)/debian/tmp-extra/$(LIB_DIR)/libs
250
mkdir -p $(CURDIR)/debian/tmp-extra/$(LIB_DIR)
251
mv -v $(SRC_DIR)/out/ffmpeg-extra/libffmpeg.so $(CURDIR)/debian/tmp-extra/$(LIB_DIR)
347
254
mkdir -p $(CURDIR)/debian/tmp/$(LIB_DIR)
348
(cd $(SRC_DIR)/out/$(BUILD_TYPE)-chromium && tar --remove-files $(foreach excl,$(TRASH),--exclude=$(excl) ) --dereference -cf - .;) | (cd debian/tmp/$(LIB_DIR) && tar xvf -;)
349
(cd $(SRC_DIR)/out/$(BUILD_TYPE)-chromium && tar --remove-files -cf - $$(find *locales -type f -name en-US.pak) --dereference;) | (cd debian/tmp/$(LIB_DIR) && tar xvf -;)
350
ifeq (1,$(COMPONENT_SHARED_LIB_BUILD))
351
mkdir -p debian/tmp/$(LIB_DIR)/libs
352
cp $(SRC_DIR)/out/$(BUILD_TYPE)-chromium/lib/*.so debian/tmp/$(LIB_DIR)/libs/
255
(cd $(SRC_DIR)/out/chromium && tar --remove-files $(foreach excl,$(TRASH),--exclude=$(excl) ) --dereference -cf - .;) | (cd debian/tmp/$(LIB_DIR) && tar xvf -;)
256
(cd $(SRC_DIR)/out/chromium && tar --remove-files -cf - $$(find *locales -type f -name en-US.pak) --dereference;) | (cd debian/tmp/$(LIB_DIR) && tar xvf -;)
355
# NaCL may be blacklisted, so only include it when it's been built
356
ifeq (,$(filter disable_nacl=1,$(defines)))
357
cp -a $(SRC_DIR)/out/$(BUILD_TYPE)-chromium/libppGoogleNaClPluginChrome.so debian/chromium-browser/$(LIB_DIR)/
358
cp -a $(SRC_DIR)/out/$(BUILD_TYPE)-chromium/nacl_irt_* debian/chromium-browser/$(LIB_DIR)/
258
# NaCL may be blacklisted.
259
cp -a $(SRC_DIR)/out/chromium/libppGoogleNaClPluginChrome.so debian/chromium-browser/$(LIB_DIR)/ || echo No NaCl. That is okay.
260
cp -a $(SRC_DIR)/out/chromium/nacl_irt_* debian/chromium-browser/$(LIB_DIR)/ || echo No NaCl. That is okay.
362
263
cp -a $(DEB_TAR_SRCDIR)/chrome/app/theme/chromium/product_logo_48.png debian/chromium-browser/usr/share/pixmaps/chromium-browser.png
516
411
-e 's/@UPSTREAM_VERSION@/$(DEBIAN_UPSTREAM_VERSION)/g' \
519
debian/appstream.yaml: debian/appstream.yaml.in
520
sed -e 's/VERSION/$(DEBIAN_DIST_VERSION)/g' \
521
-e 's/DATE/$(shell date --iso-8601=minutes --utc)/g' \
414
$(SRC_DIR)/out/Release/gn:
415
cd $(SRC_DIR) && tools/gn/bootstrap/bootstrap.py --verbose --no-rebuild --gn-gen-args '$(defines)'
524
418
# This is really configure+build in one step. b depends on c.
525
build-stamp: gyp_env := GYP_GENERATORS=ninja GYP_DEFINES="$(defines) $(browser_defines)"
526
build-stamp: BUILD_ARGS := -v -C $(DEB_TAR_SRCDIR)/out/$(BUILD_TYPE)
527
build-stamp: debian/chromium-browser.sh
419
build-stamp: BUILD_ARGS := -v -C $(DEB_TAR_SRCDIR)/out/chromium
420
build-stamp: debian/chromium-browser.sh $(SRC_DIR)/out/Release/gn
529
test ! -e $(SRC_DIR)/out/$(BUILD_TYPE)-chromium
423
test ! -e $(SRC_DIR)/out/chromium
530
425
# Upstream changes often. Fail when they introduce a config flag we don't know about.
531
-diff --ignore-case --suppress-common-lines --unified=0 debian/known_gyp_flags <(sed -e "/: *'<(/{ s,.*'<(,,g; s,).*,,; p; }" -e d build/common.gypi | LC_ALL=C sort -u |grep -v '^\(win_\|mac_\|android_\|.san\|..san\|msvs_\|ios_\|goma_\|windows_\|wix_\|directx_\)') || echo This seems bad.
533
cd $(SRC_DIR) && $(gyp_env) $(CROSS_BUILD) build/gyp_chromium build/all.gyp $(gyp_params)
426
$(SRC_DIR)/out/Release/gn gen out/argtest --args='$(defines)'
427
-diff --ignore-case --suppress-common-lines --unified=0 debian/known_gn_gen_args <($(SRC_DIR)/out/Release/gn args out/argtest --list --short) || echo This seems bad.
429
out/Release/gn gen --args='$(defines) $(browser_defines) $(ffmpeg_std_defines)' out/chromium
430
test ! "$(use_system_libraries)" || python2 build/linux/unbundle/replace_gn_files.py --system-libraries $(use_system_libraries)
536
while sleep 1200; do echo "# I ATEN'T DEAD"; done& $(BUILD_DEFINES) $(NINJA) $(BUILD_ARGS) $(BUILD_TARGETS) && { kill \%1; sleep 1; echo; true; } || { kill \%1; exit 1; sleep 2; echo; false; }
537
mv -v $(DEB_TAR_SRCDIR)/out/$(BUILD_TYPE) $(DEB_TAR_SRCDIR)/out/$(BUILD_TYPE)-chromium
434
while sleep 1200; do echo "# I ATEN'T DEAD"; done& ninja $(BUILD_ARGS) $(BUILD_TARGETS) && { kill \%1; sleep 1; echo; true; } || { kill \%1; exit 1; sleep 2; echo; false; }
540
build-stamp-ffmpeg-%: gyp_env := GYP_GENERATORS=ninja GYP_DEFINES="$(defines) $(ffmpeg_extra_defines) $(ffmpeg_defines)"
541
build-stamp-ffmpeg-%: BUILD_ARGS := -v -C $(DEB_TAR_SRCDIR)/out/$(BUILD_TYPE)
542
build-stamp-ffmpeg-%: TARGET := lib/libffmpeg.so
437
build-stamp-ffmpeg-%: all_gn_defines := $(defines) $(ffmpeg_%_defines) $(ffmpeg_defines)
543
438
build-stamp-ffmpeg-%:
546
test ! -e $(SRC_DIR)/out/$(BUILD_TYPE)-ffmpeg-$*
547
cd $(SRC_DIR) && $(gyp_env) $(CROSS_BUILD) build/gyp_chromium build/all.gyp $(gyp_params)
441
test ! -e $(SRC_DIR)/out/ffmpeg-$*
443
cd $(SRC_DIR) && out/Release/gn gen --args='$(all_gn_defines)' out/ffmpeg-$*
550
$(NINJA) $(BUILD_ARGS) $(TARGET)
446
ninja -v -C $(DEB_TAR_SRCDIR)/out/ffmpeg-$* libffmpeg.so
551
447
mkdir -p debian/tmp-$*/$(LIB_DIR)
552
mv -v $(DEB_TAR_SRCDIR)/out/$(BUILD_TYPE) $(DEB_TAR_SRCDIR)/out/$(BUILD_TYPE)-ffmpeg-$*