initial import
This commit is contained in:
743
icedove-uxp/0001-Restore-risky-system-libraries.patch
Normal file
743
icedove-uxp/0001-Restore-risky-system-libraries.patch
Normal file
@@ -0,0 +1,743 @@
|
||||
From 4a192ea19e118a6b8c982b4a8a14fd4523c287b8 Mon Sep 17 00:00:00 2001
|
||||
From: Gaming4JC <g4jc@hyperbola.info>
|
||||
Date: Sun, 24 May 2020 00:07:41 -0400
|
||||
Subject: [PATCH 01/12] Restore risky system libraries
|
||||
|
||||
WARNING: Not recommended and entirely unsupported upstream.
|
||||
|
||||
libevent - known incompatibilities causing crashes with certain version/application combinations.
|
||||
ICU - system ICU will break JS Intl.
|
||||
sqlite - at the core of our profile manipulation, places, and many functions. If the lib API ever deviates in the slightest it will kill us.
|
||||
libpng for APNG and misc fixes
|
||||
libvpx for strict compat
|
||||
---
|
||||
build/autoconf/icu.m4 | 16 +-
|
||||
build/directive4.py | 3 +
|
||||
build/moz.configure/old.configure | 5 +
|
||||
config/Makefile.in | 4 +
|
||||
config/external/icu/moz.build | 22 +-
|
||||
config/external/moz.build | 6 +-
|
||||
config/external/nss/Makefile.in | 2 +
|
||||
config/moz.build | 3 +
|
||||
config/system-headers | 32 ++
|
||||
db/sqlite3/src/moz.build | 10 +-
|
||||
ipc/chromium/moz.build | 4 +-
|
||||
.../src/third_party/libeventcommon.mozbuild | 2 +-
|
||||
ipc/chromium/src/third_party/moz.build | 3 +
|
||||
media/webrtc/signaling/test/common.build | 3 +
|
||||
old-configure.in | 284 ++++++++++++++++++
|
||||
storage/SQLiteMutex.h | 2 +-
|
||||
storage/moz.build | 4 +
|
||||
toolkit/library/moz.build | 9 +
|
||||
18 files changed, 393 insertions(+), 21 deletions(-)
|
||||
|
||||
diff --git a/build/autoconf/icu.m4 b/build/autoconf/icu.m4
|
||||
index 090d6c0a2..d76c98c29 100644
|
||||
--- a/build/autoconf/icu.m4
|
||||
+++ b/build/autoconf/icu.m4
|
||||
@@ -9,6 +9,18 @@ AC_DEFUN([MOZ_CONFIG_ICU], [
|
||||
|
||||
ICU_LIB_NAMES=
|
||||
|
||||
+MOZ_SYSTEM_ICU=
|
||||
+MOZ_ARG_WITH_BOOL(system-icu,
|
||||
+[ --with-system-icu
|
||||
+ Use system ICU (located with pkgconfig)],
|
||||
+ MOZ_SYSTEM_ICU=1)
|
||||
+if test -n "$MOZ_SYSTEM_ICU"; then
|
||||
+ PKG_CHECK_MODULES(MOZ_ICU, icu-i18n >= 58.1)
|
||||
+ CFLAGS="$CFLAGS $MOZ_ICU_CFLAGS"
|
||||
+ CXXFLAGS="$CXXFLAGS $MOZ_ICU_CFLAGS"
|
||||
+fi
|
||||
+AC_SUBST(MOZ_SYSTEM_ICU)
|
||||
+
|
||||
dnl We always use ICU.
|
||||
USE_ICU=1
|
||||
|
||||
@@ -38,7 +50,7 @@ if test -n "$USE_ICU"; then
|
||||
dnl We also don't do it on Windows because sometimes the file goes
|
||||
dnl missing -- possibly due to overzealous antivirus software? --
|
||||
dnl which prevents the browser from starting up :(
|
||||
- if test -z "$JS_STANDALONE"; then
|
||||
+ if test -z "$JS_STANDALONE" -a -z "$MOZ_SYSTEM_ICU"; then
|
||||
MOZ_ICU_DATA_ARCHIVE=1
|
||||
else
|
||||
MOZ_ICU_DATA_ARCHIVE=
|
||||
@@ -51,7 +63,7 @@ AC_SUBST(USE_ICU)
|
||||
AC_SUBST(ICU_DATA_FILE)
|
||||
AC_SUBST(MOZ_ICU_DATA_ARCHIVE)
|
||||
|
||||
-if test -n "$USE_ICU"; then
|
||||
+if test -n "$USE_ICU" -a -z "$MOZ_SYSTEM_ICU"; then
|
||||
if test -z "$YASM" -a -z "$GNU_AS" -a "$COMPILE_ENVIRONMENT"; then
|
||||
AC_MSG_ERROR([Building ICU requires either yasm or a GNU assembler. If you do not have either of those available for this platform you must use --without-intl-api])
|
||||
fi
|
||||
diff --git a/build/directive4.py b/build/directive4.py
|
||||
index 650349d68..38465628b 100644
|
||||
--- a/build/directive4.py
|
||||
+++ b/build/directive4.py
|
||||
@@ -36,6 +36,9 @@ if ('MOZ_OFFICIAL_BRANDING' in listConfig) or (strBrandingDirectory.endswith("br
|
||||
'MOZ_SYSTEM_JPEG',
|
||||
'MOZ_SYSTEM_ZLIB',
|
||||
'MOZ_SYSTEM_BZ2',
|
||||
+ 'MOZ_SYSTEM_PNG',
|
||||
+ 'MOZ_SYSTEM_LIBVPX',
|
||||
+ 'MOZ_SYSTEM_SQLITE',
|
||||
'MOZ_SYSTEM_JEMALLOC'
|
||||
]
|
||||
|
||||
diff --git a/build/moz.configure/old.configure b/build/moz.configure/old.configure
|
||||
index aba1edf85..9568b4c88 100644
|
||||
--- a/build/moz.configure/old.configure
|
||||
+++ b/build/moz.configure/old.configure
|
||||
@@ -236,6 +236,7 @@ def old_configure_options(*options):
|
||||
'--enable-system-cairo',
|
||||
'--enable-system-extension-dirs',
|
||||
'--enable-system-pixman',
|
||||
+ '--enable-system-sqlite',
|
||||
'--enable-tasktracer',
|
||||
'--enable-tests',
|
||||
'--enable-thread-sanitizer',
|
||||
@@ -289,7 +290,11 @@ def old_configure_options(*options):
|
||||
'--with-sixgill',
|
||||
'--with-soft-float',
|
||||
'--with-system-bz2',
|
||||
+ '--with-system-icu',
|
||||
'--with-system-jpeg',
|
||||
+ '--with-system-libevent',
|
||||
+ '--with-system-libvpx',
|
||||
+ '--with-system-png',
|
||||
'--with-system-zlib',
|
||||
'--with-thumb',
|
||||
'--with-thumb-interwork',
|
||||
diff --git a/config/Makefile.in b/config/Makefile.in
|
||||
index c9cc3592c..10807cfb9 100644
|
||||
--- a/config/Makefile.in
|
||||
+++ b/config/Makefile.in
|
||||
@@ -44,7 +44,11 @@ export:: $(export-preqs)
|
||||
-DMOZ_SYSTEM_HUNSPELL=$(MOZ_SYSTEM_HUNSPELL) \
|
||||
-DMOZ_SYSTEM_BZ2=$(MOZ_SYSTEM_BZ2) \
|
||||
-DMOZ_SYSTEM_ZLIB=$(MOZ_SYSTEM_ZLIB) \
|
||||
+ -DMOZ_SYSTEM_PNG=$(MOZ_SYSTEM_PNG) \
|
||||
-DMOZ_SYSTEM_JPEG=$(MOZ_SYSTEM_JPEG) \
|
||||
+ -DMOZ_SYSTEM_LIBEVENT=$(MOZ_SYSTEM_LIBEVENT) \
|
||||
+ -DMOZ_SYSTEM_LIBVPX=$(MOZ_SYSTEM_LIBVPX) \
|
||||
+ -DMOZ_SYSTEM_ICU=$(MOZ_SYSTEM_ICU) \
|
||||
$(srcdir)/system-headers $(srcdir)/stl-headers | $(PERL) $(topsrcdir)/nsprpub/config/make-system-wrappers.pl system_wrappers
|
||||
$(INSTALL) system_wrappers $(DIST)
|
||||
|
||||
diff --git a/config/external/icu/moz.build b/config/external/icu/moz.build
|
||||
index 488a02159..248652a85 100644
|
||||
--- a/config/external/icu/moz.build
|
||||
+++ b/config/external/icu/moz.build
|
||||
@@ -6,14 +6,16 @@
|
||||
|
||||
Library('icu')
|
||||
|
||||
-DIRS += [
|
||||
- 'common',
|
||||
- 'data',
|
||||
- 'i18n',
|
||||
-]
|
||||
-
|
||||
-if CONFIG['MOZ_ICU_DATA_ARCHIVE']:
|
||||
- DIRS += ['stubdata']
|
||||
- USE_LIBS += ['icustubdata']
|
||||
+if CONFIG['MOZ_SYSTEM_ICU']:
|
||||
+ OS_LIBS += CONFIG['MOZ_ICU_LIBS']
|
||||
else:
|
||||
- USE_LIBS += ['icudata']
|
||||
+ DIRS += [
|
||||
+ 'common',
|
||||
+ 'data',
|
||||
+ 'i18n',
|
||||
+ ]
|
||||
+ if CONFIG['MOZ_ICU_DATA_ARCHIVE']:
|
||||
+ DIRS += ['stubdata']
|
||||
+ USE_LIBS += ['icustubdata']
|
||||
+ else:
|
||||
+ USE_LIBS += ['icudata']
|
||||
diff --git a/config/external/moz.build b/config/external/moz.build
|
||||
index 1234016fa..cedef8a31 100644
|
||||
--- a/config/external/moz.build
|
||||
+++ b/config/external/moz.build
|
||||
@@ -28,12 +28,14 @@ if CONFIG['MOZ_TREMOR']:
|
||||
if CONFIG['MOZ_WEBM_ENCODER']:
|
||||
external_dirs += ['media/libmkv']
|
||||
|
||||
-external_dirs += ['media/libvpx']
|
||||
+if not CONFIG['MOZ_SYSTEM_LIBVPX']:
|
||||
+ external_dirs += ['media/libvpx']
|
||||
|
||||
if CONFIG['MOZ_AV1']:
|
||||
external_dirs += ['media/libaom']
|
||||
|
||||
-external_dirs += ['media/libpng']
|
||||
+if not CONFIG['MOZ_SYSTEM_PNG']:
|
||||
+ external_dirs += ['media/libpng']
|
||||
|
||||
external_dirs += ['media/libwebp']
|
||||
|
||||
diff --git a/config/external/nss/Makefile.in b/config/external/nss/Makefile.in
|
||||
index 7289e57f4..14eed9712 100644
|
||||
--- a/config/external/nss/Makefile.in
|
||||
+++ b/config/external/nss/Makefile.in
|
||||
@@ -119,9 +119,11 @@ DEFAULT_GMAKE_FLAGS += NSS_ENABLE_TLS_1_3=1
|
||||
ifeq ($(OS_ARCH)_$(GNU_CC),WINNT_1)
|
||||
DEFAULT_GMAKE_FLAGS += OS_DLLFLAGS='-static-libgcc' NSPR31_LIB_PREFIX=lib
|
||||
endif
|
||||
+ifndef MOZ_SYSTEM_SQLITE
|
||||
DEFAULT_GMAKE_FLAGS += SQLITE_LIB_NAME=mozsqlite3
|
||||
DEFAULT_GMAKE_FLAGS += SQLITE_LIB_DIR=$(ABS_DIST)/../db/sqlite3/src
|
||||
DEFAULT_GMAKE_FLAGS += SQLITE_INCLUDE_DIR=$(ABS_DIST)/include
|
||||
+endif
|
||||
ifdef NSS_DISABLE_DBM
|
||||
DEFAULT_GMAKE_FLAGS += NSS_DISABLE_DBM=1
|
||||
endif
|
||||
diff --git a/config/moz.build b/config/moz.build
|
||||
index c512bd07d..7bcac7992 100644
|
||||
--- a/config/moz.build
|
||||
+++ b/config/moz.build
|
||||
@@ -29,6 +29,9 @@ if CONFIG['HOST_OS_ARCH'] != 'WINNT':
|
||||
# while the program here is in C.
|
||||
HostProgram('nsinstall_real', c_only=True)
|
||||
|
||||
+if CONFIG['MOZ_SYSTEM_ICU']:
|
||||
+ DEFINES['MOZ_SYSTEM_ICU'] = True
|
||||
+
|
||||
PYTHON_UNIT_TESTS += [
|
||||
'tests/test_mozbuild_reading.py',
|
||||
'tests/unit-expandlibs.py',
|
||||
diff --git a/config/system-headers b/config/system-headers
|
||||
index 3685d6d1c..b10324f0f 100644
|
||||
--- a/config/system-headers
|
||||
+++ b/config/system-headers
|
||||
@@ -1253,6 +1253,9 @@ soundtouch/SoundTouchFactory.h
|
||||
#if MOZ_LIBAV_FFT==1
|
||||
libavcodec/avfft.h
|
||||
#endif
|
||||
+#if MOZ_SYSTEM_PNG==1
|
||||
+png.h
|
||||
+#endif
|
||||
#if MOZ_SYSTEM_ZLIB==1
|
||||
zlib.h
|
||||
#endif
|
||||
@@ -1273,7 +1276,11 @@ bzlib.h
|
||||
#ifdef MOZ_ENABLE_GIO
|
||||
gio/gio.h
|
||||
#endif
|
||||
+#if MOZ_SYSTEM_LIBEVENT==1
|
||||
+event.h
|
||||
+#else
|
||||
sys/event.h
|
||||
+#endif
|
||||
#ifdef MOZ_ENABLE_LIBPROXY
|
||||
proxy.h
|
||||
#endif
|
||||
@@ -1288,6 +1295,15 @@ QtSparql/qsparqlresult.h
|
||||
#if MOZ_TREE_PIXMAN!=1
|
||||
pixman.h
|
||||
#endif
|
||||
+#if MOZ_SYSTEM_LIBVPX==1
|
||||
+vpx/svc_context.h
|
||||
+vpx/vpx_codec.h
|
||||
+vpx/vpx_decoder.h
|
||||
+vpx/vpx_encoder.h
|
||||
+vpx/vp8cx.h
|
||||
+vpx/vp8dx.h
|
||||
+vpx_mem/vpx_mem.h
|
||||
+#endif
|
||||
gst/gst.h
|
||||
gst/app/gstappsink.h
|
||||
gst/app/gstappsrc.h
|
||||
@@ -1300,6 +1316,22 @@ kvm.h
|
||||
spawn.h
|
||||
err.h
|
||||
xlocale.h
|
||||
+#ifdef MOZ_SYSTEM_ICU
|
||||
+unicode/locid.h
|
||||
+unicode/numsys.h
|
||||
+unicode/timezone.h
|
||||
+unicode/ucal.h
|
||||
+unicode/uchar.h
|
||||
+unicode/uclean.h
|
||||
+unicode/ucol.h
|
||||
+unicode/udat.h
|
||||
+unicode/udatpg.h
|
||||
+unicode/uenum.h
|
||||
+unicode/unorm.h
|
||||
+unicode/unum.h
|
||||
+unicode/ustring.h
|
||||
+unicode/utypes.h
|
||||
+#endif
|
||||
libutil.h
|
||||
unwind.h
|
||||
fenv.h
|
||||
diff --git a/db/sqlite3/src/moz.build b/db/sqlite3/src/moz.build
|
||||
index eba8633b5..d8cec85ff 100644
|
||||
--- a/db/sqlite3/src/moz.build
|
||||
+++ b/db/sqlite3/src/moz.build
|
||||
@@ -9,9 +9,13 @@ NO_VISIBILITY_FLAGS = True
|
||||
# We allow warnings for third-party code that can be updated from upstream.
|
||||
ALLOW_COMPILER_WARNINGS = True
|
||||
|
||||
-GeckoSharedLibrary('sqlite', linkage=None, mozglue='library')
|
||||
-SHARED_LIBRARY_NAME = 'mozsqlite3'
|
||||
-SYMBOLS_FILE = 'sqlite.symbols'
|
||||
+if CONFIG['MOZ_SYSTEM_SQLITE']:
|
||||
+ Library('sqlite')
|
||||
+ OS_LIBS += CONFIG['SQLITE_LIBS']
|
||||
+else:
|
||||
+ GeckoSharedLibrary('sqlite', linkage=None, mozglue='library')
|
||||
+ SHARED_LIBRARY_NAME = 'mozsqlite3'
|
||||
+ SYMBOLS_FILE = 'sqlite.symbols'
|
||||
|
||||
EXPORTS += ['sqlite3.h']
|
||||
SOURCES += ['sqlite3.c']
|
||||
diff --git a/ipc/chromium/moz.build b/ipc/chromium/moz.build
|
||||
index b386134f9..085e65c96 100644
|
||||
--- a/ipc/chromium/moz.build
|
||||
+++ b/ipc/chromium/moz.build
|
||||
@@ -58,7 +58,7 @@ if os_win:
|
||||
'src/chrome/common/process_watcher_win.cc',
|
||||
'src/chrome/common/transport_dib_win.cc',
|
||||
]
|
||||
-else:
|
||||
+elif not CONFIG['MOZ_SYSTEM_LIBEVENT']:
|
||||
DIRS += ['src/third_party']
|
||||
|
||||
if os_posix:
|
||||
@@ -145,7 +145,7 @@ if os_solaris:
|
||||
'src/base/time_posix.cc',
|
||||
]
|
||||
|
||||
-else:
|
||||
+elif not CONFIG['MOZ_SYSTEM_LIBEVENT']:
|
||||
LOCAL_INCLUDES += ['src/third_party/libevent/linux']
|
||||
|
||||
ost = CONFIG['OS_TEST']
|
||||
diff --git a/ipc/chromium/src/third_party/libeventcommon.mozbuild b/ipc/chromium/src/third_party/libeventcommon.mozbuild
|
||||
index 33482c661..2b45ecb19 100644
|
||||
--- a/ipc/chromium/src/third_party/libeventcommon.mozbuild
|
||||
+++ b/ipc/chromium/src/third_party/libeventcommon.mozbuild
|
||||
@@ -32,7 +32,7 @@ else:
|
||||
else:
|
||||
libevent_include_suffix = 'linux'
|
||||
|
||||
-if os_posix:
|
||||
+if os_posix and not CONFIG['MOZ_SYSTEM_LIBEVENT']:
|
||||
DEFINES['HAVE_CONFIG_H'] = True
|
||||
LOCAL_INCLUDES += sorted([
|
||||
'libevent',
|
||||
diff --git a/ipc/chromium/src/third_party/moz.build b/ipc/chromium/src/third_party/moz.build
|
||||
index 20a5043fb..2b99e53b3 100644
|
||||
--- a/ipc/chromium/src/third_party/moz.build
|
||||
+++ b/ipc/chromium/src/third_party/moz.build
|
||||
@@ -10,6 +10,9 @@ include(libevent_path_prefix + '/libeventcommon.mozbuild')
|
||||
if os_win:
|
||||
error('should not reach here on Windows')
|
||||
|
||||
+if CONFIG['MOZ_SYSTEM_LIBEVENT']:
|
||||
+ error('should not reach here if we are using a native libevent')
|
||||
+
|
||||
UNIFIED_SOURCES += [
|
||||
'libevent/buffer.c',
|
||||
'libevent/bufferevent.c',
|
||||
diff --git a/media/webrtc/signaling/test/common.build b/media/webrtc/signaling/test/common.build
|
||||
index 2d9a57139..3e5450f5d 100644
|
||||
--- a/media/webrtc/signaling/test/common.build
|
||||
+++ b/media/webrtc/signaling/test/common.build
|
||||
@@ -105,6 +105,9 @@ if CONFIG['MOZ_ALSA']:
|
||||
if CONFIG['MOZ_SYSTEM_JPEG']:
|
||||
OS_LIBS += CONFIG['MOZ_JPEG_LIBS']
|
||||
|
||||
+if CONFIG['MOZ_SYSTEM_LIBVPX']:
|
||||
+ OS_LIBS += CONFIG['MOZ_LIBVPX_LIBS']
|
||||
+
|
||||
if not CONFIG['MOZ_TREE_PIXMAN']:
|
||||
OS_LIBS += CONFIG['MOZ_PIXMAN_LIBS']
|
||||
|
||||
diff --git a/old-configure.in b/old-configure.in
|
||||
index 2965f60b7..b3ac8c2f1 100644
|
||||
--- a/old-configure.in
|
||||
+++ b/old-configure.in
|
||||
@@ -2005,6 +2005,44 @@ esac
|
||||
|
||||
MOZ_CONFIG_NSPR()
|
||||
|
||||
+dnl ========================================================
|
||||
+dnl system libevent Support
|
||||
+dnl ========================================================
|
||||
+MOZ_ARG_WITH_STRING(system-libevent,
|
||||
+[ --with-system-libevent[=PFX]
|
||||
+ Use system libevent [installed at prefix PFX]],
|
||||
+ LIBEVENT_DIR=$withval)
|
||||
+
|
||||
+_SAVE_CFLAGS=$CFLAGS
|
||||
+_SAVE_LDFLAGS=$LDFLAGS
|
||||
+_SAVE_LIBS=$LIBS
|
||||
+if test "$LIBEVENT_DIR" = yes; then
|
||||
+ PKG_CHECK_MODULES(MOZ_LIBEVENT, libevent,
|
||||
+ MOZ_SYSTEM_LIBEVENT=1,
|
||||
+ LIBEVENT_DIR=/usr)
|
||||
+fi
|
||||
+if test -z "$LIBEVENT_DIR" -o "$LIBEVENT_DIR" = no; then
|
||||
+ MOZ_SYSTEM_LIBEVENT=
|
||||
+elif test -z "$MOZ_SYSTEM_LIBEVENT"; then
|
||||
+ CFLAGS="-I${LIBEVENT_DIR}/include $CFLAGS"
|
||||
+ LDFLAGS="-L${LIBEVENT_DIR}/lib $LDFLAGS"
|
||||
+ MOZ_CHECK_HEADER(event.h,
|
||||
+ [if test ! -f "${LIBEVENT_DIR}/include/event.h"; then
|
||||
+ AC_MSG_ERROR([event.h found, but is not in ${LIBEVENT_DIR}/include])
|
||||
+ fi],
|
||||
+ AC_MSG_ERROR([--with-system-libevent requested but event.h not found]))
|
||||
+ AC_CHECK_LIB(event, event_init,
|
||||
+ [MOZ_SYSTEM_LIBEVENT=1
|
||||
+ MOZ_LIBEVENT_CFLAGS="-I${LIBEVENT_DIR}/include"
|
||||
+ MOZ_LIBEVENT_LIBS="-L${LIBEVENT_DIR}/lib -levent"],
|
||||
+ [MOZ_SYSTEM_LIBEVENT= MOZ_LIBEVENT_CFLAGS= MOZ_LIBEVENT_LIBS=])
|
||||
+fi
|
||||
+CFLAGS=$_SAVE_CFLAGS
|
||||
+LDFLAGS=$_SAVE_LDFLAGS
|
||||
+LIBS=$_SAVE_LIBS
|
||||
+
|
||||
+AC_SUBST(MOZ_SYSTEM_LIBEVENT)
|
||||
+
|
||||
# TODO: We need to find a better place to define this include
|
||||
NSS_CFLAGS="-I${DIST}/include/nss"
|
||||
AC_SUBST(NSS_CFLAGS)
|
||||
@@ -2092,6 +2130,51 @@ if test "${BZ2_DIR}" -a -d "${BZ2_DIR}" -a "$MOZ_SYSTEM_BZ2" = 1; then
|
||||
MOZ_BZ2_LIBS="-L${BZ2_DIR}/lib ${MOZ_BZ2_LIBS}"
|
||||
fi
|
||||
|
||||
+dnl ========================================================
|
||||
+dnl system PNG Support
|
||||
+dnl ========================================================
|
||||
+MOZ_ARG_WITH_STRING(system-png,
|
||||
+[ --with-system-png[=PFX]
|
||||
+ Use system libpng [installed at prefix PFX]],
|
||||
+ PNG_DIR=$withval)
|
||||
+
|
||||
+_SAVE_CFLAGS=$CFLAGS
|
||||
+_SAVE_LDFLAGS=$LDFLAGS
|
||||
+_SAVE_LIBS=$LIBS
|
||||
+if test -n "${PNG_DIR}" -a "${PNG_DIR}" != "yes"; then
|
||||
+ CFLAGS="-I${PNG_DIR}/include $CFLAGS"
|
||||
+ LDFLAGS="-L${PNG_DIR}/lib $LDFLAGS"
|
||||
+fi
|
||||
+if test -z "$PNG_DIR" -o "$PNG_DIR" = no; then
|
||||
+ MOZ_SYSTEM_PNG=
|
||||
+else
|
||||
+ AC_CHECK_LIB(png, png_get_valid, [MOZ_SYSTEM_PNG=1 MOZ_PNG_LIBS="-lpng"],
|
||||
+ AC_MSG_ERROR([--with-system-png requested but no working libpng found]))
|
||||
+ AC_CHECK_LIB(png, png_get_acTL, ,
|
||||
+ AC_MSG_ERROR([--with-system-png won't work because the system's libpng doesn't have APNG support]))
|
||||
+fi
|
||||
+if test "$MOZ_SYSTEM_PNG" = 1; then
|
||||
+ AC_TRY_COMPILE([ #include <stdio.h>
|
||||
+ #include <sys/types.h>
|
||||
+ #include <png.h> ],
|
||||
+ [ #if PNG_LIBPNG_VER < $MOZPNG
|
||||
+ #error "Insufficient libpng version ($MOZPNG required)."
|
||||
+ #endif
|
||||
+ #ifndef PNG_UINT_31_MAX
|
||||
+ #error "Insufficient libpng version."
|
||||
+ #endif ],
|
||||
+ MOZ_SYSTEM_PNG=1,
|
||||
+ AC_MSG_ERROR([--with-system-png requested but no working libpng found]))
|
||||
+fi
|
||||
+CFLAGS=$_SAVE_CFLAGS
|
||||
+LDFLAGS=$_SAVE_LDFLAGS
|
||||
+LIBS=$_SAVE_LIBS
|
||||
+
|
||||
+if test "${PNG_DIR}" -a -d "${PNG_DIR}" -a "$MOZ_SYSTEM_PNG" = 1; then
|
||||
+ MOZ_PNG_CFLAGS="-I${PNG_DIR}/include"
|
||||
+ MOZ_PNG_LIBS="-L${PNG_DIR}/lib ${MOZ_PNG_LIBS}"
|
||||
+fi
|
||||
+
|
||||
fi # SKIP_LIBRARY_CHECKS
|
||||
|
||||
dnl ========================================================
|
||||
@@ -2962,6 +3045,13 @@ fi
|
||||
|
||||
AC_SUBST(MOZ_EME)
|
||||
|
||||
+dnl ========================================================
|
||||
+dnl system libvpx Support
|
||||
+dnl ========================================================
|
||||
+MOZ_ARG_WITH_BOOL(system-libvpx,
|
||||
+[ --with-system-libvpx Use system libvpx (located with pkgconfig)],
|
||||
+ MOZ_SYSTEM_LIBVPX=1)
|
||||
+
|
||||
MOZ_LIBVPX_CFLAGS=
|
||||
MOZ_LIBVPX_LIBS=
|
||||
|
||||
@@ -2969,6 +3059,35 @@ if test -n "$MOZ_VPX_ERROR_CONCEALMENT" ; then
|
||||
AC_DEFINE(MOZ_VPX_ERROR_CONCEALMENT)
|
||||
fi
|
||||
|
||||
+_SAVE_CFLAGS=$CFLAGS
|
||||
+_SAVE_LIBS=$LIBS
|
||||
+if test -n "$MOZ_SYSTEM_LIBVPX"; then
|
||||
+ dnl ============================
|
||||
+ dnl === libvpx Version check ===
|
||||
+ dnl ============================
|
||||
+ dnl Check to see if we have a system libvpx package.
|
||||
+ PKG_CHECK_MODULES(MOZ_LIBVPX, vpx >= 1.5.0)
|
||||
+
|
||||
+ CFLAGS="$CFLAGS $MOZ_LIBVPX_CFLAGS"
|
||||
+ LIBS="$LIBS $MOZ_LIBVPX_LIBS"
|
||||
+
|
||||
+ MOZ_CHECK_HEADER([vpx/vpx_decoder.h], [],
|
||||
+ [AC_MSG_ERROR([Couldn't find vpx/vpx_decoder.h which is required for build with system libvpx. Use --without-system-libvpx to build with in-tree libvpx.])])
|
||||
+
|
||||
+ AC_CHECK_LIB(vpx, vpx_codec_dec_init_ver, [],
|
||||
+ [AC_MSG_ERROR([--with-system-libvpx requested but symbol vpx_codec_dec_init_ver not found])])
|
||||
+
|
||||
+ MOZ_CHECK_HEADER([vpx_mem/vpx_mem.h],
|
||||
+ [AC_CHECK_FUNC(vpx_mem_set_functions)])
|
||||
+ if test "$ac_cv_header_vpx_mem_vpx_mem_h" = no -o \
|
||||
+ "$ac_cv_func_vpx_mem_set_functions" = no; then
|
||||
+ AC_DEFINE(MOZ_VPX_NO_MEM_REPORTING)
|
||||
+ fi
|
||||
+fi
|
||||
+CFLAGS=$_SAVE_CFLAGS
|
||||
+LIBS=$_SAVE_LIBS
|
||||
+
|
||||
+AC_SUBST(MOZ_SYSTEM_LIBVPX)
|
||||
AC_SUBST_LIST(MOZ_LIBVPX_CFLAGS)
|
||||
AC_SUBST_LIST(MOZ_LIBVPX_LIBS)
|
||||
|
||||
@@ -3723,6 +3842,170 @@ else
|
||||
fi
|
||||
fi
|
||||
|
||||
+dnl ========================================================
|
||||
+dnl Check for sqlite
|
||||
+dnl ========================================================
|
||||
+
|
||||
+MOZ_SYSTEM_SQLITE=
|
||||
+MOZ_ARG_ENABLE_BOOL(system-sqlite,
|
||||
+[ --enable-system-sqlite Use system sqlite (located with pkgconfig)],
|
||||
+MOZ_SYSTEM_SQLITE=1,
|
||||
+MOZ_SYSTEM_SQLITE= )
|
||||
+
|
||||
+if test -n "$MOZ_SYSTEM_SQLITE"
|
||||
+then
|
||||
+ dnl ============================
|
||||
+ dnl === SQLite Version check ===
|
||||
+ dnl ============================
|
||||
+ dnl Check to see if the system SQLite package is new enough.
|
||||
+ PKG_CHECK_MODULES(SQLITE, sqlite3 >= $SQLITE_VERSION)
|
||||
+
|
||||
+ dnl ==================================
|
||||
+ dnl === SQLITE_SECURE_DELETE check ===
|
||||
+ dnl ==================================
|
||||
+ dnl Check to see if the system SQLite package is compiled with
|
||||
+ dnl SQLITE_SECURE_DELETE enabled.
|
||||
+ AC_MSG_CHECKING(for SQLITE_SECURE_DELETE support in system SQLite)
|
||||
+ _SAVE_CFLAGS="$CFLAGS"
|
||||
+ CFLAGS="$CFLAGS $SQLITE_CFLAGS"
|
||||
+ _SAVE_LIBS="$LIBS"
|
||||
+ LIBS="$LIBS $SQLITE_LIBS"
|
||||
+ AC_CACHE_VAL(ac_cv_sqlite_secure_delete,[
|
||||
+ AC_TRY_RUN([
|
||||
+ #include "sqlite3.h"
|
||||
+ int main(int argc, char **argv){
|
||||
+ return !sqlite3_compileoption_used("SQLITE_SECURE_DELETE");
|
||||
+ }],
|
||||
+ ac_cv_sqlite_secure_delete=yes,
|
||||
+ ac_cv_sqlite_secure_delete=no,
|
||||
+ ac_cv_sqlite_secure_delete=no
|
||||
+ )
|
||||
+ ])
|
||||
+ AC_MSG_RESULT($ac_cv_sqlite_secure_delete)
|
||||
+ CFLAGS="$_SAVE_CFLAGS"
|
||||
+ LIBS="$_SAVE_LIBS"
|
||||
+ if test "x$ac_cv_sqlite_secure_delete" = "xno"; then
|
||||
+ AC_MSG_ERROR([System SQLite library is not compiled with SQLITE_SECURE_DELETE.])
|
||||
+ fi
|
||||
+
|
||||
+ dnl ===============================
|
||||
+ dnl === SQLITE_THREADSAFE check ===
|
||||
+ dnl ===============================
|
||||
+ dnl Check to see if the system SQLite package is compiled with
|
||||
+ dnl SQLITE_THREADSAFE enabled.
|
||||
+ AC_MSG_CHECKING(for SQLITE_THREADSAFE support in system SQLite)
|
||||
+ _SAVE_CFLAGS="$CFLAGS"
|
||||
+ CFLAGS="$CFLAGS $SQLITE_CFLAGS"
|
||||
+ _SAVE_LIBS="$LIBS"
|
||||
+ LIBS="$LIBS $SQLITE_LIBS"
|
||||
+ AC_CACHE_VAL(ac_cv_sqlite_threadsafe,[
|
||||
+ AC_TRY_RUN([
|
||||
+ #include "sqlite3.h"
|
||||
+ int main(int argc, char **argv){
|
||||
+ return !sqlite3_compileoption_used("SQLITE_THREADSAFE=1");
|
||||
+ }],
|
||||
+ ac_cv_sqlite_threadsafe=yes,
|
||||
+ ac_cv_sqlite_threadsafe=no,
|
||||
+ ac_cv_sqlite_threadsafe=no
|
||||
+ )
|
||||
+ ])
|
||||
+ AC_MSG_RESULT($ac_cv_sqlite_threadsafe)
|
||||
+ CFLAGS="$_SAVE_CFLAGS"
|
||||
+ LIBS="$_SAVE_LIBS"
|
||||
+ if test "x$ac_cv_sqlite_threadsafe" = "xno"; then
|
||||
+ AC_MSG_ERROR([System SQLite library is not compiled with SQLITE_THREADSAFE.])
|
||||
+ fi
|
||||
+
|
||||
+ dnl ================================
|
||||
+ dnl === SQLITE_ENABLE_FTS3 check ===
|
||||
+ dnl ================================
|
||||
+ dnl check to see if the system SQLite package is compiled with
|
||||
+ dnl SQLITE_ENABLE_FTS3 enabled.
|
||||
+ AC_MSG_CHECKING(for SQLITE_ENABLE_FTS3 support in system SQLite)
|
||||
+ _SAVE_CFLAGS="$CFLAGS"
|
||||
+ CFLAGS="$CFLAGS $SQLITE_CFLAGS"
|
||||
+ _SAVE_LIBS="$LIBS"
|
||||
+ LIBS="$LIBS $SQLITE_LIBS"
|
||||
+ AC_CACHE_VAL(ac_cv_sqlite_enable_fts3,[
|
||||
+ AC_TRY_RUN([
|
||||
+ #include "sqlite3.h"
|
||||
+ int main(int argc, char **argv){
|
||||
+ return !sqlite3_compileoption_used("SQLITE_ENABLE_FTS3");
|
||||
+ }],
|
||||
+ ac_cv_sqlite_enable_fts3=yes,
|
||||
+ ac_cv_sqlite_enable_fts3=no,
|
||||
+ ac_cv_sqlite_enable_fts3=no
|
||||
+ )
|
||||
+ ])
|
||||
+ AC_MSG_RESULT($ac_cv_sqlite_enable_fts3)
|
||||
+ CFLAGS="$_SAVE_CFLAGS"
|
||||
+ LIBS="$_SAVE_LIBS"
|
||||
+ if test "x$ac_cv_sqlite_enable_fts3" = "xno"; then
|
||||
+ AC_MSG_ERROR([System SQLite library is not compiled with SQLITE_ENABLE_FTS3.])
|
||||
+ fi
|
||||
+
|
||||
+ dnl =========================================
|
||||
+ dnl === SQLITE_ENABLE_UNLOCK_NOTIFY check ===
|
||||
+ dnl =========================================
|
||||
+ dnl check to see if the system SQLite package is compiled with
|
||||
+ dnl SQLITE_ENABLE_UNLOCK_NOTIFY enabled.
|
||||
+ AC_MSG_CHECKING(for SQLITE_ENABLE_UNLOCK_NOTIFY support in system SQLite)
|
||||
+ _SAVE_CFLAGS="$CFLAGS"
|
||||
+ CFLAGS="$CFLAGS $SQLITE_CFLAGS"
|
||||
+ _SAVE_LIBS="$LIBS"
|
||||
+ LIBS="$LIBS $SQLITE_LIBS"
|
||||
+ AC_CACHE_VAL(ac_cv_sqlite_enable_unlock_notify,[
|
||||
+ AC_TRY_RUN([
|
||||
+ #include "sqlite3.h"
|
||||
+ int main(int argc, char **argv){
|
||||
+ return !sqlite3_compileoption_used("SQLITE_ENABLE_UNLOCK_NOTIFY");
|
||||
+ }],
|
||||
+ ac_cv_sqlite_enable_unlock_notify=yes,
|
||||
+ ac_cv_sqlite_enable_unlock_notify=no,
|
||||
+ ac_cv_sqlite_enable_unlock_notify=no
|
||||
+ )
|
||||
+ ])
|
||||
+ AC_MSG_RESULT($ac_cv_sqlite_enable_unlock_notify)
|
||||
+ CFLAGS="$_SAVE_CFLAGS"
|
||||
+ LIBS="$_SAVE_LIBS"
|
||||
+ if test "x$ac_cv_sqlite_enable_unlock_notify" = "xno"; then
|
||||
+ AC_MSG_ERROR([System SQLite library is not compiled with SQLITE_ENABLE_UNLOCK_NOTIFY.])
|
||||
+ fi
|
||||
+
|
||||
+ dnl =========================================
|
||||
+ dnl === SQLITE_ENABLE_DBSTAT_VTAB check ===
|
||||
+ dnl =========================================
|
||||
+ dnl check to see if the system SQLite package is compiled with
|
||||
+ dnl SQLITE_ENABLE_DBSTAT_VTAB.
|
||||
+ AC_MSG_CHECKING(for SQLITE_ENABLE_DBSTAT_VTAB support in system SQLite)
|
||||
+ _SAVE_CFLAGS="$CFLAGS"
|
||||
+ CFLAGS="$CFLAGS $SQLITE_CFLAGS"
|
||||
+ _SAVE_LIBS="$LIBS"
|
||||
+ LIBS="$LIBS $SQLITE_LIBS"
|
||||
+ AC_CACHE_VAL(ac_cv_sqlite_dbstat_vtab,[
|
||||
+ AC_TRY_RUN([
|
||||
+ #include "sqlite3.h"
|
||||
+ int main(int argc, char **argv){
|
||||
+ return !sqlite3_compileoption_used("SQLITE_ENABLE_DBSTAT_VTAB");
|
||||
+ }],
|
||||
+ ac_cv_sqlite_dbstat_vtab=yes,
|
||||
+ ac_cv_sqlite_dbstat_vtab=no,
|
||||
+ ac_cv_sqlite_dbstat_vtab=no
|
||||
+ )
|
||||
+ ])
|
||||
+ AC_MSG_RESULT($ac_cv_sqlite_dbstat_vtab)
|
||||
+ CFLAGS="$_SAVE_CFLAGS"
|
||||
+ LIBS="$_SAVE_LIBS"
|
||||
+ if test "x$ac_cv_sqlite_dbstat_vtab" = "xno"; then
|
||||
+ AC_MSG_ERROR([System SQLite library is not compiled with SQLITE_ENABLE_DBSTAT_VTAB.])
|
||||
+ fi
|
||||
+fi
|
||||
+
|
||||
+if test -n "$MOZ_SYSTEM_SQLITE"; then
|
||||
+ AC_DEFINE(MOZ_SYSTEM_SQLITE)
|
||||
+fi
|
||||
+AC_SUBST(MOZ_SYSTEM_SQLITE)
|
||||
+
|
||||
dnl ========================================================
|
||||
dnl = Enable Google safe browsing (anti-phishing)
|
||||
dnl ========================================================
|
||||
@@ -5349,6 +5632,7 @@ MC_BASILISK=$MC_BASILISK
|
||||
MC_PALEMOON=$MC_PALEMOON
|
||||
MOZ_EME=$MOZ_EME
|
||||
MOZ_WEBRTC=$MOZ_WEBRTC
|
||||
+MOZ_SYSTEM_LIBEVENT=$MOZ_SYSTEM_LIBEVENT
|
||||
MOZ_SYSTEM_JPEG=$MOZ_SYSTEM_JPEG
|
||||
MOZ_SYSTEM_ZLIB=$MOZ_SYSTEM_ZLIB
|
||||
MOZ_SYSTEM_BZ2=$MOZ_SYSTEM_BZ2
|
||||
diff --git a/storage/SQLiteMutex.h b/storage/SQLiteMutex.h
|
||||
index eaa69eab1..a38525fd6 100644
|
||||
--- a/storage/SQLiteMutex.h
|
||||
+++ b/storage/SQLiteMutex.h
|
||||
@@ -50,7 +50,7 @@ public:
|
||||
mMutex = aMutex;
|
||||
}
|
||||
|
||||
-#if !defined(DEBUG)
|
||||
+#if !defined(DEBUG) || defined(MOZ_SYSTEM_SQLITE)
|
||||
/**
|
||||
* Acquires the mutex.
|
||||
*/
|
||||
diff --git a/storage/moz.build b/storage/moz.build
|
||||
index f0e754bdc..606c93001 100644
|
||||
--- a/storage/moz.build
|
||||
+++ b/storage/moz.build
|
||||
@@ -99,6 +99,10 @@ if CONFIG['MOZ_MEMORY']:
|
||||
DEFINES['SQLITE_MAX_LIKE_PATTERN_LENGTH'] = 50000
|
||||
|
||||
# See Sqlite moz.build for reasoning about TEMP_STORE.
|
||||
+# For system sqlite we cannot use the compile time option, so we use a pragma.
|
||||
+if CONFIG['MOZ_SYSTEM_SQLITE'] and (CONFIG['OS_TARGET'] == 'Android'
|
||||
+ or CONFIG['HAVE_64BIT_BUILD']):
|
||||
+ DEFINES['MOZ_MEMORY_TEMP_STORE_PRAGMA'] = True
|
||||
|
||||
LOCAL_INCLUDES += [
|
||||
'/db/sqlite3/src',
|
||||
diff --git a/toolkit/library/moz.build b/toolkit/library/moz.build
|
||||
index d9b167547..acfd83aa3 100644
|
||||
--- a/toolkit/library/moz.build
|
||||
+++ b/toolkit/library/moz.build
|
||||
@@ -195,9 +195,18 @@ if CONFIG['SERVO_TARGET_DIR']:
|
||||
if CONFIG['MOZ_SYSTEM_JPEG']:
|
||||
OS_LIBS += CONFIG['MOZ_JPEG_LIBS']
|
||||
|
||||
+if CONFIG['MOZ_SYSTEM_PNG']:
|
||||
+ OS_LIBS += CONFIG['MOZ_PNG_LIBS']
|
||||
+
|
||||
if CONFIG['MOZ_SYSTEM_HUNSPELL']:
|
||||
OS_LIBS += CONFIG['MOZ_HUNSPELL_LIBS']
|
||||
|
||||
+if CONFIG['MOZ_SYSTEM_LIBEVENT']:
|
||||
+ OS_LIBS += CONFIG['MOZ_LIBEVENT_LIBS']
|
||||
+
|
||||
+if CONFIG['MOZ_SYSTEM_LIBVPX']:
|
||||
+ OS_LIBS += CONFIG['MOZ_LIBVPX_LIBS']
|
||||
+
|
||||
if not CONFIG['MOZ_TREE_PIXMAN']:
|
||||
OS_LIBS += CONFIG['MOZ_PIXMAN_LIBS']
|
||||
|
||||
--
|
||||
2.25.2
|
||||
|
||||
Reference in New Issue
Block a user