summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorThomas Groman <tgroman@nuegia.net>2020-08-23 17:15:35 -0700
committerThomas Groman <tgroman@nuegia.net>2020-08-23 18:10:05 -0700
commite8dada8eff0b36a98b514af6adc039d2920a2109 (patch)
tree4afe7a19db71a0ab714faac45ced87a457c36c77
parentaaeaf52308b698084c978636b4f56f87d0603f49 (diff)
downloadUXP-e8dada8eff0b36a98b514af6adc039d2920a2109.tar
UXP-e8dada8eff0b36a98b514af6adc039d2920a2109.tar.gz
UXP-e8dada8eff0b36a98b514af6adc039d2920a2109.tar.lz
UXP-e8dada8eff0b36a98b514af6adc039d2920a2109.tar.xz
UXP-e8dada8eff0b36a98b514af6adc039d2920a2109.zip
Dick, YOU'RE FIRED!
Revert "Issue #1342 - Remove support for system libevent" This reverts commit 90c5288fef22004d6e4d441b3ae10b9cd1836103.
-rw-r--r--build/directive4.py60
-rw-r--r--build/moz.configure/old.configure3
-rw-r--r--config/Makefile.in1
-rw-r--r--config/system-headers4
-rw-r--r--ipc/chromium/moz.build6
-rw-r--r--ipc/chromium/src/third_party/libeventcommon.mozbuild2
-rw-r--r--ipc/chromium/src/third_party/moz.build3
-rw-r--r--old-configure.in92
-rw-r--r--toolkit/library/moz.build3
9 files changed, 76 insertions, 98 deletions
diff --git a/build/directive4.py b/build/directive4.py
deleted file mode 100644
index 009009bf0..000000000
--- a/build/directive4.py
+++ /dev/null
@@ -1,60 +0,0 @@
-# This Source Code Form is subject to the terms of the Mozilla Public
-# License, v. 2.0. If a copy of the MPL was not distributed with this
-# file, You can obtain one at http://mozilla.org/MPL/2.0/.
-
-# Imports
-from __future__ import print_function, unicode_literals
-
-import os
-import sys
-
-# Sanity check
-if not len(sys.argv) > 1:
- print("Incorrect number of arguments")
- sys.exit(1)
-
-# Vars
-listConfigure = sys.argv[1:]
-listConfig = []
-strBrandingDirectory = ""
-listViolations = []
-
-# Build a list of set configure variables
-for _value in listConfigure:
- _splitString = _value.split("=")
-
- if _splitString[1] == "1":
- listConfig += [ _splitString[0] ]
- elif _splitString[0] == "MOZ_BRANDING_DIRECTORY":
- strBrandingDirectory = _splitString[1]
-
-# Only applies if using Official Branding or specific branding directories
-if ('MOZ_OFFICIAL_BRANDING' in listConfig) or (strBrandingDirectory.endswith("branding/official")) or (strBrandingDirectory.endswith("branding/unstable")):
- # Applies to Pale Moon and Basilisk
- if ('MC_BASILISK' in listConfig) or ('MC_PALEMOON' in listConfig):
- listViolations += [
- 'MOZ_SYSTEM_JPEG',
- 'MOZ_SYSTEM_ZLIB',
- 'MOZ_SYSTEM_BZ2',
- 'MOZ_SYSTEM_LIBVPX',
- 'MOZ_SYSTEM_SQLITE',
- 'MOZ_SYSTEM_JEMALLOC'
- ]
-
- # Applies to Pale Moon Only
- if 'MC_PALEMOON' in listConfig:
- listViolations += [
- 'MOZ_EME',
- 'MOZ_WEBRTC'
- ]
-
- # Iterate through enabled violations and output 1 to DIRECTIVE4 if any are found
- for _value in listViolations:
- if _value in listConfig:
- sys.stdout.write("1")
- sys.exit(1)
-
-# Exit outputting nothing to DIRECTIVE4 being empty because there are no violations
-sys.exit(0)
-
-
diff --git a/build/moz.configure/old.configure b/build/moz.configure/old.configure
index c416c18d2..499f668d7 100644
--- a/build/moz.configure/old.configure
+++ b/build/moz.configure/old.configure
@@ -291,7 +291,10 @@ def old_configure_options(*options):
'--with-soft-float',
'--with-system-bz2',
'--with-system-jpeg',
+ '--with-system-libevent',
'--with-system-libvpx',
+ '--with-system-nspr',
+ '--with-system-nss',
'--with-system-zlib',
'--with-thumb',
'--with-thumb-interwork',
diff --git a/config/Makefile.in b/config/Makefile.in
index 93ad5a80c..cc4ab9df7 100644
--- a/config/Makefile.in
+++ b/config/Makefile.in
@@ -45,6 +45,7 @@ export:: $(export-preqs)
-DMOZ_SYSTEM_BZ2=$(MOZ_SYSTEM_BZ2) \
-DMOZ_SYSTEM_ZLIB=$(MOZ_SYSTEM_ZLIB) \
-DMOZ_SYSTEM_JPEG=$(MOZ_SYSTEM_JPEG) \
+ -DMOZ_SYSTEM_LIBEVENT=$(MOZ_SYSTEM_LIBEVENT) \
-DMOZ_SYSTEM_LIBVPX=$(MOZ_SYSTEM_LIBVPX) \
$(srcdir)/system-headers $(srcdir)/stl-headers | $(PERL) $(topsrcdir)/nsprpub/config/make-system-wrappers.pl system_wrappers
$(INSTALL) system_wrappers $(DIST)
diff --git a/config/system-headers b/config/system-headers
index 9dd33bc76..dbc95f6a2 100644
--- a/config/system-headers
+++ b/config/system-headers
@@ -1273,7 +1273,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
diff --git a/ipc/chromium/moz.build b/ipc/chromium/moz.build
index b386134f9..dc5b4dca4 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:
@@ -143,9 +143,9 @@ if os_solaris:
'src/base/atomicops_internals_x86_gcc.cc',
'src/base/process_util_linux.cc',
'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/old-configure.in b/old-configure.in
index 68fc4c7f3..6f4fef93a 100644
--- a/old-configure.in
+++ b/old-configure.in
@@ -2005,9 +2005,64 @@ esac
MOZ_CONFIG_NSPR()
-# TODO: We need to find a better place to define this include
-NSS_CFLAGS="-I${DIST}/include/nss"
-AC_SUBST(NSS_CFLAGS)
+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)
+
+dnl ========================================================
+dnl = If NSS was not detected in the system,
+dnl = use the one in the source tree (mozilla/security/nss)
+dnl ========================================================
+
+MOZ_ARG_WITH_BOOL(system-nss,
+[ --with-system-nss Use system installed NSS],
+ _USE_SYSTEM_NSS=1 )
+
+if test -n "$_USE_SYSTEM_NSS"; then
+ AC_MSG_ERROR([Building with system NSS is currently not supported.])
+fi
+
+if test -n "$_USE_SYSTEM_NSS"; then
+ AM_PATH_NSS(3.41, [MOZ_SYSTEM_NSS=1], [AC_MSG_ERROR([you don't have NSS installed or your version is too old])])
+fi
+
+if test -z "$MOZ_SYSTEM_NSS"; then
+ NSS_CFLAGS="-I${DIST}/include/nss"
+fi
if test -z "$SKIP_LIBRARY_CHECKS"; then
dnl system JPEG support
@@ -5543,37 +5598,6 @@ fi
AC_SUBST(MOZILLA_VERSION)
-dnl ========================================================
-dnl Directive 4
-dnl ========================================================
-
-DIRECTIVE4_LIST="
-MOZ_OFFICIAL_BRANDING=$MOZ_OFFICIAL_BRANDING
-MOZ_BRANDING_DIRECTORY=$MOZ_BRANDING_DIRECTORY
-MC_BASILISK=$MC_BASILISK
-MC_PALEMOON=$MC_PALEMOON
-MOZ_EME=$MOZ_EME
-MOZ_WEBRTC=$MOZ_WEBRTC
-MOZ_SYSTEM_JPEG=$MOZ_SYSTEM_JPEG
-MOZ_SYSTEM_ZLIB=$MOZ_SYSTEM_ZLIB
-MOZ_SYSTEM_BZ2=$MOZ_SYSTEM_BZ2
-MOZ_SYSTEM_PNG=$MOZ_SYSTEM_PNG
-MOZ_SYSTEM_LIBVPX=$MOZ_SYSTEM_LIBVPX
-MOZ_SYSTEM_SQLITE=$MOZ_SYSTEM_SQLITE
-MOZ_SYSTEM_JEMALLOC=$MOZ_SYSTEM_JEMALLOC"
-
-DIRECTIVE4=`$PYTHON $_topsrcdir/build/directive4.py $DIRECTIVE4_LIST`
-
-if test -n "$DIRECTIVE4"; then
- if test -n "$MC_PRIVATE_BUILD"; then
- AC_MSG_WARN([Private Build - The configuration you have chosen to use with official branding deviates from official build configuration. Your build is thus for personal and private use only and must not be (re)distributed - Please see: http://www.palemoon.org/redist.shtml])
- else
- AC_MSG_ERROR([Branding Violation - Please see: http://www.palemoon.org/redist.shtml])
- fi
-fi
-
-AC_SUBST(DIRECTIVE4)
-
dnl Spit out some output
dnl ========================================================
diff --git a/toolkit/library/moz.build b/toolkit/library/moz.build
index a620e81a0..43e0b87c5 100644
--- a/toolkit/library/moz.build
+++ b/toolkit/library/moz.build
@@ -198,6 +198,9 @@ if CONFIG['MOZ_SYSTEM_JPEG']:
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']