diff options
Diffstat (limited to 'www/libxul/files')
45 files changed, 1495 insertions, 2556 deletions
diff --git a/www/libxul/files/patch-bug1013675 b/www/libxul/files/patch-bug1013675 index cb1b4d0f5ea7..eac435acf3d0 100644 --- a/www/libxul/files/patch-bug1013675 +++ b/www/libxul/files/patch-bug1013675 @@ -2,7 +2,7 @@ diff --git xpcom/base/nsDebugImpl.cpp xpcom/base/nsDebugImpl.cpp index 13a286f..293bd73 100644 --- xpcom/base/nsDebugImpl.cpp +++ xpcom/base/nsDebugImpl.cpp -@@ -45,13 +45,44 @@ +@@ -45,12 +45,43 @@ #endif #endif @@ -10,7 +10,6 @@ index 13a286f..293bd73 100644 +#if defined(XP_MACOSX) || defined(__DragonFly__) || defined(__FreeBSD__) \ + || defined(__NetBSD__) || defined(__OpenBSD__) #include <stdbool.h> - #include <sys/types.h> #include <unistd.h> +#include <sys/param.h> #include <sys/sysctl.h> diff --git a/www/libxul/files/patch-bug1013882 b/www/libxul/files/patch-bug1013882 new file mode 100644 index 000000000000..86dc379fe50f --- /dev/null +++ b/www/libxul/files/patch-bug1013882 @@ -0,0 +1,69 @@ +diff --git b2g/installer/Makefile.in b2g/installer/Makefile.in +index 754312a..c69904c 100644 +--- b2g/installer/Makefile.in ++++ b2g/installer/Makefile.in +@@ -63,6 +63,10 @@ ifneq (,$(filter rtsp,$(NECKO_PROTOCOLS))) + DEFINES += -DMOZ_RTSP + endif + ++ifdef MOZ_DEBUG ++DEFINES += -DMOZ_DEBUG=1 ++endif ++ + ifdef GKMEDIAS_SHARED_LIBRARY + DEFINES += -DGKMEDIAS_SHARED_LIBRARY + endif +diff --git b2g/installer/package-manifest.in b2g/installer/package-manifest.in +index 17d433c..0416187 100644 +--- b2g/installer/package-manifest.in ++++ b2g/installer/package-manifest.in +@@ -576,7 +576,7 @@ + @BINPATH@/components/MozKeyboard.js + @BINPATH@/components/InputMethod.manifest + +-#ifdef MOZ_DEBUG ++#if defined(ENABLE_TESTS) && defined(MOZ_DEBUG) + @BINPATH@/components/TestInterfaceJS.js + @BINPATH@/components/TestInterfaceJS.manifest + #endif +diff --git browser/installer/package-manifest.in browser/installer/package-manifest.in +index b509fd4..195345c 100644 +--- browser/installer/package-manifest.in ++++ browser/installer/package-manifest.in +@@ -583,7 +583,7 @@ + @BINPATH@/components/MozKeyboard.js + @BINPATH@/components/InputMethod.manifest + +-#ifdef MOZ_DEBUG ++#if defined(ENABLE_TESTS) && defined(MOZ_DEBUG) + @BINPATH@/components/TestInterfaceJS.js + @BINPATH@/components/TestInterfaceJS.manifest + #endif +diff --git mobile/android/installer/Makefile.in mobile/android/installer/Makefile.in +index 96dceab..3528ad6 100644 +--- mobile/android/installer/Makefile.in ++++ mobile/android/installer/Makefile.in +@@ -41,6 +41,10 @@ BINPATH = bin + endif + DEFINES += -DBINPATH=$(BINPATH) + ++ifdef MOZ_DEBUG ++DEFINES += -DMOZ_DEBUG=1 ++endif ++ + ifdef ENABLE_MARIONETTE + DEFINES += -DENABLE_MARIONETTE=1 + endif +diff --git mobile/android/installer/package-manifest.in mobile/android/installer/package-manifest.in +index 994580b..cf142df 100644 +--- mobile/android/installer/package-manifest.in ++++ mobile/android/installer/package-manifest.in +@@ -440,7 +440,7 @@ + @BINPATH@/components/dom_webspeechsynth.xpt + #endif + +-#ifdef MOZ_DEBUG ++#if defined(ENABLE_TESTS) && defined(MOZ_DEBUG) + @BINPATH@/components/TestInterfaceJS.js + @BINPATH@/components/TestInterfaceJS.manifest + #endif diff --git a/www/libxul/files/patch-bug1015547 b/www/libxul/files/patch-bug1015547 index df963e0de88c..ecb488c36e7f 100644 --- a/www/libxul/files/patch-bug1015547 +++ b/www/libxul/files/patch-bug1015547 @@ -2,11 +2,12 @@ diff --git configure.in configure.in index 7bed45f..053de17 100644 --- configure.in +++ configure.in -@@ -3166,6 +3166,7 @@ AC_CHECK_FUNCS(random strerror lchown fc - AC_CHECK_FUNCS(statvfs64 statvfs statfs64 statfs) - AC_CHECK_FUNCS(flockfile getpagesize) - AC_CHECK_FUNCS(localtime_r strtok_r) -+AC_CHECK_FUNCS(arc4random arc4random_buf) +@@ -2950,7 +2950,7 @@ dnl Checks for library functions. + dnl ======================================================== + AC_PROG_GCC_TRADITIONAL + AC_FUNC_MEMCMP +-AC_CHECK_FUNCS(stat64 lstat64 truncate64 statvfs64 statvfs statfs64 statfs getpagesize localtime_r) ++AC_CHECK_FUNCS(stat64 lstat64 truncate64 statvfs64 statvfs statfs64 statfs getpagesize localtime_r arc4random arc4random_buf) dnl check for clock_gettime(), the CLOCK_MONOTONIC clock AC_CACHE_CHECK(for clock_gettime(CLOCK_MONOTONIC), diff --git a/www/libxul/files/patch-bug1021761 b/www/libxul/files/patch-bug1021761 new file mode 100644 index 000000000000..bd0a689f12c7 --- /dev/null +++ b/www/libxul/files/patch-bug1021761 @@ -0,0 +1,1092 @@ +diff --git configure.in configure.in +index 48e60c0..ec08417 100644 +--- configure.in ++++ configure.in +@@ -5438,6 +5438,60 @@ fi + AC_SUBST(MOZ_WEBM_ENCODER) + + dnl ================================== ++dnl = Check OSS availability ++dnl ================================== ++ ++dnl If using Linux, Solaris or BSDs, ensure that OSS is available ++case "$OS_TARGET" in ++Linux|SunOS|DragonFly|FreeBSD|NetBSD|GNU/kFreeBSD) ++ MOZ_OSS=1 ++ ;; ++esac ++ ++MOZ_ARG_DISABLE_BOOL(oss, ++[ --disable-oss Disable OpenSoundSystem support], ++ MOZ_OSS=, ++ MOZ_OSS=1) ++ ++_SAVE_CFLAGS=$CFLAGS ++_SAVE_LIBS=$LIBS ++if test -n "$MOZ_OSS"; then ++ dnl Prefer 4Front implementation ++ AC_MSG_CHECKING([MOZ_OSS_CFLAGS]) ++ if test -z "$MOZ_OSS_CFLAGS"; then ++ for oss_conf in /etc/oss.conf /usr/local/etc/oss.conf; do ++ if test -e "$oss_conf"; then ++ . "$oss_conf" ++ fi ++ done ++ if test -d "$OSSLIBDIR"; then ++ MOZ_OSS_CFLAGS="-I$OSSLIBDIR/include" ++ fi ++ fi ++ AC_MSG_RESULT([$MOZ_OSS_CFLAGS]) ++ ++ CFLAGS="$CFLAGS $MOZ_OSS_CFLAGS" ++ MOZ_CHECK_HEADERS(sys/soundcard.h linux/soundcard.h soundcard.h) ++ ++ if test "$ac_cv_header_sys_soundcard_h" != "yes" -a \ ++ "$ac_cv_header_linux_soundcard_h" != "yes" -a \ ++ "$ac_cv_header_soundcard_h" != "yes"; then ++ AC_MSG_ERROR([Need OSS for Ogg, Wave or WebM decoding on $OS_TARGET. Disable with --disable-ogg --disable-wave --disable-webm.]) ++ fi ++ ++ dnl Assume NetBSD implementation over SunAudio ++ AC_CHECK_LIB(ossaudio, _oss_ioctl, ++ [AC_DEFINE_UNQUOTED(CUBEB_OSS_DEFAULT_OUTPUT, "/dev/sound") ++ MOZ_OSS_LIBS="-lossaudio"]) ++fi ++CFLAGS=$_SAVE_CFLAGS ++LIBS=$_SAVE_LIBS ++ ++AC_SUBST(MOZ_OSS) ++AC_SUBST_LIST(MOZ_OSS_CFLAGS) ++AC_SUBST_LIST(MOZ_OSS_LIBS) ++ ++dnl ================================== + dnl = Check alsa availability on Linux + dnl ================================== + +@@ -5451,12 +5505,23 @@ MOZ_ARG_ENABLE_BOOL(alsa, + MOZ_ALSA=1, + MOZ_ALSA=) + ++MOZ_ARG_DISABLE_BOOL(alsa-dlopen, ++[ --disable-alsa-dlopen Disable runtime linking of libasound.so], ++ DISABLE_LIBASOUND_DLOPEN=1, ++ DISABLE_LIBASOUND_DLOPEN=) ++ + if test -n "$MOZ_ALSA"; then + PKG_CHECK_MODULES(MOZ_ALSA, alsa, , + [echo "$MOZ_ALSA_PKG_ERRORS" + AC_MSG_ERROR([Need alsa for Ogg, Wave or WebM decoding on Linux. Disable with --disable-ogg --disable-wave --disable-webm. (On Ubuntu, you might try installing the package libasound2-dev.)])]) + fi + ++if test -n "$DISABLE_LIBASOUND_DLOPEN"; then ++ AC_DEFINE(DISABLE_LIBASOUND_DLOPEN) ++else ++ MOZ_ALSA_LIBS= ++fi ++ + AC_SUBST(MOZ_ALSA) + + dnl ======================================================== +diff --git media/libcubeb/AUTHORS media/libcubeb/AUTHORS +index b441e8a..950d9e5 100644 +--- media/libcubeb/AUTHORS ++++ media/libcubeb/AUTHORS +@@ -4,3 +4,4 @@ Michael Wu <mwu@mozilla.com> + Paul Adenot <paul@paul.cx> + David Richards <drichards@mozilla.com> + Sebastien Alaiwan <sebastien.alaiwan@gmail.com> ++Evgeniy Vodolazskiy <waterlaz@gmail.com> +diff --git media/libcubeb/src/cubeb.c media/libcubeb/src/cubeb.c +index 9c3adcc..45d765b 100644 +--- media/libcubeb/src/cubeb.c ++++ media/libcubeb/src/cubeb.c +@@ -54,6 +54,9 @@ int opensl_init(cubeb ** context, char const * context_name); + #if defined(USE_AUDIOTRACK) + int audiotrack_init(cubeb ** context, char const * context_name); + #endif ++#if defined(USE_OSS) ++int oss_init(cubeb ** context, char const * context_name); ++#endif + + int + validate_stream_params(cubeb_stream_params stream_params) +@@ -120,6 +123,9 @@ cubeb_init(cubeb ** context, char const * context_name) + #if defined(USE_AUDIOTRACK) + audiotrack_init, + #endif ++#if defined(USE_OSS) ++ oss_init, ++#endif + }; + int i; + +diff --git media/libcubeb/src/cubeb_alsa.c media/libcubeb/src/cubeb_alsa.c +index a962553..1f780f4 100644 +--- media/libcubeb/src/cubeb_alsa.c ++++ media/libcubeb/src/cubeb_alsa.c +@@ -11,6 +11,7 @@ + #include <sys/time.h> + #include <assert.h> + #include <limits.h> ++#include <dlfcn.h> + #include <poll.h> + #include <unistd.h> + #include <alsa/asoundlib.h> +@@ -24,6 +25,50 @@ + + #define ALSA_PA_PLUGIN "ALSA <-> PulseAudio PCM I/O Plugin" + ++#ifdef DISABLE_LIBASOUND_DLOPEN ++#define WRAP(x) x ++#else ++#define WRAP(x) cubeb_##x ++#define MAKE_TYPEDEF(x) static typeof(x) * cubeb_##x ++MAKE_TYPEDEF(snd_config); ++MAKE_TYPEDEF(snd_config_add); ++MAKE_TYPEDEF(snd_config_copy); ++MAKE_TYPEDEF(snd_config_delete); ++MAKE_TYPEDEF(snd_config_get_id); ++MAKE_TYPEDEF(snd_config_get_string); ++MAKE_TYPEDEF(snd_config_imake_integer); ++MAKE_TYPEDEF(snd_config_search); ++MAKE_TYPEDEF(snd_config_search_definition); ++MAKE_TYPEDEF(snd_lib_error_set_handler); ++MAKE_TYPEDEF(snd_pcm_avail_update); ++MAKE_TYPEDEF(snd_pcm_close); ++MAKE_TYPEDEF(snd_pcm_delay); ++MAKE_TYPEDEF(snd_pcm_drain); ++MAKE_TYPEDEF(snd_pcm_frames_to_bytes); ++MAKE_TYPEDEF(snd_pcm_get_params); ++/* snd_pcm_hw_params_alloca is actually a macro */ ++/* MAKE_TYPEDEF(snd_pcm_hw_params_alloca); */ ++MAKE_TYPEDEF(snd_pcm_hw_params_sizeof); ++#define snd_pcm_hw_params_sizeof cubeb_snd_pcm_hw_params_sizeof ++MAKE_TYPEDEF(snd_pcm_hw_params_any); ++MAKE_TYPEDEF(snd_pcm_hw_params_get_channels_max); ++MAKE_TYPEDEF(snd_pcm_hw_params_get_rate); ++MAKE_TYPEDEF(snd_pcm_hw_params_set_rate_near); ++MAKE_TYPEDEF(snd_pcm_nonblock); ++MAKE_TYPEDEF(snd_pcm_open); ++MAKE_TYPEDEF(snd_pcm_open_lconf); ++MAKE_TYPEDEF(snd_pcm_pause); ++MAKE_TYPEDEF(snd_pcm_poll_descriptors); ++MAKE_TYPEDEF(snd_pcm_poll_descriptors_count); ++MAKE_TYPEDEF(snd_pcm_poll_descriptors_revents); ++MAKE_TYPEDEF(snd_pcm_recover); ++MAKE_TYPEDEF(snd_pcm_set_params); ++MAKE_TYPEDEF(snd_pcm_state); ++MAKE_TYPEDEF(snd_pcm_writei); ++ ++#undef MAKE_TYPEDEF ++#endif ++ + /* ALSA is not thread-safe. snd_pcm_t instances are individually protected + by the owning cubeb_stream's mutex. snd_pcm_t creation and destruction + is not thread-safe until ALSA 1.0.24 (see alsa-lib.git commit 91c9c8f1), +@@ -64,6 +109,8 @@ struct cubeb { + workaround is not required. */ + snd_config_t * local_config; + int is_pa; ++ ++ void * libasound; + }; + + enum stream_state { +@@ -262,7 +309,7 @@ alsa_refill_stream(cubeb_stream * stm) + + pthread_mutex_lock(&stm->mutex); + +- r = snd_pcm_poll_descriptors_revents(stm->pcm, stm->fds, stm->nfds, &revents); ++ r = WRAP(snd_pcm_poll_descriptors_revents)(stm->pcm, stm->fds, stm->nfds, &revents); + if (r < 0 || revents != POLLOUT) { + /* This should be a stream error; it makes no sense for poll(2) to wake + for this stream and then have the stream report that it's not ready. +@@ -271,10 +318,10 @@ alsa_refill_stream(cubeb_stream * stm) + return RUNNING; + } + +- avail = snd_pcm_avail_update(stm->pcm); ++ avail = WRAP(snd_pcm_avail_update)(stm->pcm); + if (avail == -EPIPE) { +- snd_pcm_recover(stm->pcm, avail, 1); +- avail = snd_pcm_avail_update(stm->pcm); ++ WRAP(snd_pcm_recover)(stm->pcm, avail, 1); ++ avail = WRAP(snd_pcm_avail_update)(stm->pcm); + } + + /* Failed to recover from an xrun, this stream must be broken. */ +@@ -293,8 +340,8 @@ alsa_refill_stream(cubeb_stream * stm) + available to write. If avail is still zero here, the stream must be in + a funky state, so recover and try again. */ + if (avail == 0) { +- snd_pcm_recover(stm->pcm, -EPIPE, 1); +- avail = snd_pcm_avail_update(stm->pcm); ++ WRAP(snd_pcm_recover)(stm->pcm, -EPIPE, 1); ++ avail = WRAP(snd_pcm_avail_update)(stm->pcm); + if (avail <= 0) { + pthread_mutex_unlock(&stm->mutex); + stm->state_callback(stm, stm->user_ptr, CUBEB_STATE_ERROR); +@@ -302,7 +349,7 @@ alsa_refill_stream(cubeb_stream * stm) + } + } + +- p = calloc(1, snd_pcm_frames_to_bytes(stm->pcm, avail)); ++ p = calloc(1, WRAP(snd_pcm_frames_to_bytes)(stm->pcm, avail)); + assert(p); + + pthread_mutex_unlock(&stm->mutex); +@@ -313,10 +360,10 @@ alsa_refill_stream(cubeb_stream * stm) + return ERROR; + } + if (got > 0) { +- snd_pcm_sframes_t wrote = snd_pcm_writei(stm->pcm, p, got); ++ snd_pcm_sframes_t wrote = WRAP(snd_pcm_writei)(stm->pcm, p, got); + if (wrote == -EPIPE) { +- snd_pcm_recover(stm->pcm, wrote, 1); +- wrote = snd_pcm_writei(stm->pcm, p, got); ++ WRAP(snd_pcm_recover)(stm->pcm, wrote, 1); ++ wrote = WRAP(snd_pcm_writei)(stm->pcm, p, got); + } + assert(wrote >= 0 && wrote == got); + stm->write_position += wrote; +@@ -342,7 +389,7 @@ alsa_refill_stream(cubeb_stream * stm) + + /* Fill the remaining buffer with silence to guarantee one full period + has been written. */ +- snd_pcm_writei(stm->pcm, (char *) p + got, avail - got); ++ WRAP(snd_pcm_writei)(stm->pcm, (char *) p + got, avail - got); + + set_timeout(&stm->drain_timeout, buffer_time * 1000); + +@@ -453,26 +500,26 @@ get_slave_pcm_node(snd_config_t * lconf, snd_config_t * root_pcm) + + slave_def = NULL; + +- r = snd_config_search(root_pcm, "slave", &slave_pcm); ++ r = WRAP(snd_config_search)(root_pcm, "slave", &slave_pcm); + if (r < 0) { + return NULL; + } + +- r = snd_config_get_string(slave_pcm, &string); ++ r = WRAP(snd_config_get_string)(slave_pcm, &string); + if (r >= 0) { +- r = snd_config_search_definition(lconf, "pcm_slave", string, &slave_def); ++ r = WRAP(snd_config_search_definition)(lconf, "pcm_slave", string, &slave_def); + if (r < 0) { + return NULL; + } + } + + do { +- r = snd_config_search(slave_def ? slave_def : slave_pcm, "pcm", &pcm); ++ r = WRAP(snd_config_search)(slave_def ? slave_def : slave_pcm, "pcm", &pcm); + if (r < 0) { + break; + } + +- r = snd_config_get_string(slave_def ? slave_def : slave_pcm, &string); ++ r = WRAP(snd_config_get_string)(slave_def ? slave_def : slave_pcm, &string); + if (r < 0) { + break; + } +@@ -481,7 +528,7 @@ get_slave_pcm_node(snd_config_t * lconf, snd_config_t * root_pcm) + if (r < 0 || r > (int) sizeof(node_name)) { + break; + } +- r = snd_config_search(lconf, node_name, &pcm); ++ r = WRAP(snd_config_search)(lconf, node_name, &pcm); + if (r < 0) { + break; + } +@@ -490,7 +537,7 @@ get_slave_pcm_node(snd_config_t * lconf, snd_config_t * root_pcm) + } while (0); + + if (slave_def) { +- snd_config_delete(slave_def); ++ WRAP(snd_config_delete)(slave_def); + } + + return NULL; +@@ -513,22 +560,22 @@ init_local_config_with_workaround(char const * pcm_name) + + lconf = NULL; + +- if (snd_config == NULL) { ++ if (*WRAP(snd_config) == NULL) { + return NULL; + } + +- r = snd_config_copy(&lconf, snd_config); ++ r = WRAP(snd_config_copy)(&lconf, *WRAP(snd_config)); + if (r < 0) { + return NULL; + } + + do { +- r = snd_config_search_definition(lconf, "pcm", pcm_name, &pcm_node); ++ r = WRAP(snd_config_search_definition)(lconf, "pcm", pcm_name, &pcm_node); + if (r < 0) { + break; + } + +- r = snd_config_get_id(pcm_node, &string); ++ r = WRAP(snd_config_get_id)(pcm_node, &string); + if (r < 0) { + break; + } +@@ -537,7 +584,7 @@ init_local_config_with_workaround(char const * pcm_name) + if (r < 0 || r > (int) sizeof(node_name)) { + break; + } +- r = snd_config_search(lconf, node_name, &pcm_node); ++ r = WRAP(snd_config_search)(lconf, node_name, &pcm_node); + if (r < 0) { + break; + } +@@ -548,12 +595,12 @@ init_local_config_with_workaround(char const * pcm_name) + } + + /* Fetch the PCM node's type, and bail out if it's not the PulseAudio plugin. */ +- r = snd_config_search(pcm_node, "type", &node); ++ r = WRAP(snd_config_search)(pcm_node, "type", &node); + if (r < 0) { + break; + } + +- r = snd_config_get_string(node, &string); ++ r = WRAP(snd_config_get_string)(node, &string); + if (r < 0) { + break; + } +@@ -564,18 +611,18 @@ init_local_config_with_workaround(char const * pcm_name) + + /* Don't clobber an explicit existing handle_underrun value, set it only + if it doesn't already exist. */ +- r = snd_config_search(pcm_node, "handle_underrun", &node); ++ r = WRAP(snd_config_search)(pcm_node, "handle_underrun", &node); + if (r != -ENOENT) { + break; + } + + /* Disable pcm_pulse's asynchronous underrun handling. */ +- r = snd_config_imake_integer(&node, "handle_underrun", 0); ++ r = WRAP(snd_config_imake_integer)(&node, "handle_underrun", 0); + if (r < 0) { + break; + } + +- r = snd_config_add(pcm_node, node); ++ r = WRAP(snd_config_add)(pcm_node, node); + if (r < 0) { + break; + } +@@ -583,7 +630,7 @@ init_local_config_with_workaround(char const * pcm_name) + return lconf; + } while (0); + +- snd_config_delete(lconf); ++ WRAP(snd_config_delete)(lconf); + + return NULL; + } +@@ -595,9 +642,9 @@ alsa_locked_pcm_open(snd_pcm_t ** pcm, snd_pcm_stream_t stream, snd_config_t * l + + pthread_mutex_lock(&cubeb_alsa_mutex); + if (local_config) { +- r = snd_pcm_open_lconf(pcm, CUBEB_ALSA_PCM_NAME, stream, SND_PCM_NONBLOCK, local_config); ++ r = WRAP(snd_pcm_open_lconf)(pcm, CUBEB_ALSA_PCM_NAME, stream, SND_PCM_NONBLOCK, local_config); + } else { +- r = snd_pcm_open(pcm, CUBEB_ALSA_PCM_NAME, stream, SND_PCM_NONBLOCK); ++ r = WRAP(snd_pcm_open)(pcm, CUBEB_ALSA_PCM_NAME, stream, SND_PCM_NONBLOCK); + } + pthread_mutex_unlock(&cubeb_alsa_mutex); + +@@ -610,7 +657,7 @@ alsa_locked_pcm_close(snd_pcm_t * pcm) + int r; + + pthread_mutex_lock(&cubeb_alsa_mutex); +- r = snd_pcm_close(pcm); ++ r = WRAP(snd_pcm_close)(pcm); + pthread_mutex_unlock(&cubeb_alsa_mutex); + + return r; +@@ -667,12 +714,65 @@ alsa_init(cubeb ** context, char const * context_name) + pthread_attr_t attr; + snd_pcm_t * dummy; + ++ void * libasound = NULL; ++ ++#ifndef DISABLE_LIBASOUND_DLOPEN ++ libasound = dlopen("libasound.so", RTLD_LAZY); ++ if (!libasound) { ++ return CUBEB_ERROR; ++ } ++ ++#define LOAD(x) do { \ ++ cubeb_##x = dlsym(libasound, #x); \ ++ if (!cubeb_##x) { \ ++ dlclose(libasound); \ ++ return CUBEB_ERROR; \ ++ } \ ++ } while(0) ++ ++ LOAD(snd_config); ++ LOAD(snd_config_add); ++ LOAD(snd_config_copy); ++ LOAD(snd_config_delete); ++ LOAD(snd_config_get_id); ++ LOAD(snd_config_get_string); ++ LOAD(snd_config_imake_integer); ++ LOAD(snd_config_search); ++ LOAD(snd_config_search_definition); ++ LOAD(snd_lib_error_set_handler); ++ LOAD(snd_pcm_avail_update); ++ LOAD(snd_pcm_close); ++ LOAD(snd_pcm_delay); ++ LOAD(snd_pcm_drain); ++ LOAD(snd_pcm_frames_to_bytes); ++ LOAD(snd_pcm_get_params); ++ /* snd_pcm_hw_params_alloca is actually a macro */ ++ /* LOAD(snd_pcm_hw_params_alloca); */ ++ LOAD(snd_pcm_hw_params_sizeof); ++ LOAD(snd_pcm_hw_params_any); ++ LOAD(snd_pcm_hw_params_get_channels_max); ++ LOAD(snd_pcm_hw_params_get_rate); ++ LOAD(snd_pcm_hw_params_set_rate_near); ++ LOAD(snd_pcm_nonblock); ++ LOAD(snd_pcm_open); ++ LOAD(snd_pcm_open_lconf); ++ LOAD(snd_pcm_pause); ++ LOAD(snd_pcm_poll_descriptors); ++ LOAD(snd_pcm_poll_descriptors_count); ++ LOAD(snd_pcm_poll_descriptors_revents); ++ LOAD(snd_pcm_recover); ++ LOAD(snd_pcm_set_params); ++ LOAD(snd_pcm_state); ++ LOAD(snd_pcm_writei); ++ ++#undef LOAD ++#endif + assert(context); + *context = NULL; + + pthread_mutex_lock(&cubeb_alsa_mutex); + if (!cubeb_alsa_error_handler_set) { +- snd_lib_error_set_handler(silent_error_handler); ++ WRAP(snd_lib_error_set_handler)(silent_error_handler); + cubeb_alsa_error_handler_set = 1; + } + pthread_mutex_unlock(&cubeb_alsa_mutex); +@@ -680,6 +780,8 @@ alsa_init(cubeb ** context, char const * context_name) + ctx = calloc(1, sizeof(*ctx)); + assert(ctx); + ++ ctx->libasound = libasound; ++ + ctx->ops = &alsa_ops; + + r = pthread_mutex_init(&ctx->mutex, NULL); +@@ -729,7 +831,7 @@ alsa_init(cubeb ** context, char const * context_name) + config fails with EINVAL, the PA PCM is too old for this workaround. */ + if (r == -EINVAL) { + pthread_mutex_lock(&cubeb_alsa_mutex); +- snd_config_delete(ctx->local_config); ++ WRAP(snd_config_delete)(ctx->local_config); + pthread_mutex_unlock(&cubeb_alsa_mutex); + ctx->local_config = NULL; + } else if (r >= 0) { +@@ -768,9 +870,13 @@ alsa_destroy(cubeb * ctx) + pthread_mutex_destroy(&ctx->mutex); + free(ctx->fds); + ++ if (ctx->libasound) { ++ dlclose(ctx->libasound); ++ } ++ + if (ctx->local_config) { + pthread_mutex_lock(&cubeb_alsa_mutex); +- snd_config_delete(ctx->local_config); ++ WRAP(snd_config_delete)(ctx->local_config); + pthread_mutex_unlock(&cubeb_alsa_mutex); + } + +@@ -838,7 +944,7 @@ alsa_stream_init(cubeb * ctx, cubeb_stream ** stream, char const * stream_name, + return CUBEB_ERROR; + } + +- r = snd_pcm_nonblock(stm->pcm, 1); ++ r = WRAP(snd_pcm_nonblock)(stm->pcm, 1); + assert(r == 0); + + /* Ugly hack: the PA ALSA plugin allows buffer configurations that can't +@@ -848,23 +954,23 @@ alsa_stream_init(cubeb * ctx, cubeb_stream ** stream, char const * stream_name, + latency = latency < 500 ? 500 : latency; + } + +- r = snd_pcm_set_params(stm->pcm, format, SND_PCM_ACCESS_RW_INTERLEAVED, +- stm->params.channels, stm->params.rate, 1, +- latency * 1000); ++ r = WRAP(snd_pcm_set_params)(stm->pcm, format, SND_PCM_ACCESS_RW_INTERLEAVED, ++ stm->params.channels, stm->params.rate, 1, ++ latency * 1000); + if (r < 0) { + alsa_stream_destroy(stm); + return CUBEB_ERROR_INVALID_FORMAT; + } + +- r = snd_pcm_get_params(stm->pcm, &stm->buffer_size, &stm->period_size); ++ r = WRAP(snd_pcm_get_params)(stm->pcm, &stm->buffer_size, &stm->period_size); + assert(r == 0); + +- stm->nfds = snd_pcm_poll_descriptors_count(stm->pcm); ++ stm->nfds = WRAP(snd_pcm_poll_descriptors_count)(stm->pcm); + assert(stm->nfds > 0); + + stm->saved_fds = calloc(stm->nfds, sizeof(struct pollfd)); + assert(stm->saved_fds); +- r = snd_pcm_poll_descriptors(stm->pcm, stm->saved_fds, stm->nfds); ++ r = WRAP(snd_pcm_poll_descriptors)(stm->pcm, stm->saved_fds, stm->nfds); + assert((nfds_t) r == stm->nfds); + + r = pthread_cond_init(&stm->cond, NULL); +@@ -937,12 +1043,12 @@ alsa_get_max_channel_count(cubeb * ctx, uint32_t * max_channels) + return CUBEB_ERROR; + } + +- rv = snd_pcm_hw_params_any(stm->pcm, hw_params); ++ rv = WRAP(snd_pcm_hw_params_any)(stm->pcm, hw_params); + if (rv < 0) { + return CUBEB_ERROR; + } + +- rv = snd_pcm_hw_params_get_channels_max(hw_params, max_channels); ++ rv = WRAP(snd_pcm_hw_params_get_channels_max)(hw_params, max_channels); + if (rv < 0) { + return CUBEB_ERROR; + } +@@ -962,34 +1068,34 @@ alsa_get_preferred_sample_rate(cubeb * ctx, uint32_t * rate) { + + /* get a pcm, disabling resampling, so we get a rate the + * hardware/dmix/pulse/etc. supports. */ +- rv = snd_pcm_open(&pcm, "", SND_PCM_STREAM_PLAYBACK | SND_PCM_NO_AUTO_RESAMPLE, 0); ++ rv = WRAP(snd_pcm_open)(&pcm, "", SND_PCM_STREAM_PLAYBACK | SND_PCM_NO_AUTO_RESAMPLE, 0); + if (rv < 0) { + return CUBEB_ERROR; + } + +- rv = snd_pcm_hw_params_any(pcm, hw_params); ++ rv = WRAP(snd_pcm_hw_params_any)(pcm, hw_params); + if (rv < 0) { +- snd_pcm_close(pcm); ++ WRAP(snd_pcm_close)(pcm); + return CUBEB_ERROR; + } + +- rv = snd_pcm_hw_params_get_rate(hw_params, rate, &dir); ++ rv = WRAP(snd_pcm_hw_params_get_rate)(hw_params, rate, &dir); + if (rv >= 0) { + /* There is a default rate: use it. */ +- snd_pcm_close(pcm); ++ WRAP(snd_pcm_close)(pcm); + return CUBEB_OK; + } + + /* Use a common rate, alsa may adjust it based on hw/etc. capabilities. */ + *rate = 44100; + +- rv = snd_pcm_hw_params_set_rate_near(pcm, hw_params, rate, NULL); ++ rv = WRAP(snd_pcm_hw_params_set_rate_near)(pcm, hw_params, rate, NULL); + if (rv < 0) { +- snd_pcm_close(pcm); ++ WRAP(snd_pcm_close)(pcm); + return CUBEB_ERROR; + } + +- snd_pcm_close(pcm); ++ WRAP(snd_pcm_close)(pcm); + + return CUBEB_OK; + } +@@ -1013,7 +1119,7 @@ alsa_stream_start(cubeb_stream * stm) + ctx = stm->context; + + pthread_mutex_lock(&stm->mutex); +- snd_pcm_pause(stm->pcm, 0); ++ WRAP(snd_pcm_pause)(stm->pcm, 0); + gettimeofday(&stm->last_activity, NULL); + pthread_mutex_unlock(&stm->mutex); + +@@ -1047,7 +1153,7 @@ alsa_stream_stop(cubeb_stream * stm) + pthread_mutex_unlock(&ctx->mutex); + + pthread_mutex_lock(&stm->mutex); +- snd_pcm_pause(stm->pcm, 1); ++ WRAP(snd_pcm_pause)(stm->pcm, 1); + pthread_mutex_unlock(&stm->mutex); + + return CUBEB_OK; +@@ -1063,8 +1169,8 @@ alsa_stream_get_position(cubeb_stream * stm, uint64_t * position) + pthread_mutex_lock(&stm->mutex); + + delay = -1; +- if (snd_pcm_state(stm->pcm) != SND_PCM_STATE_RUNNING || +- snd_pcm_delay(stm->pcm, &delay) != 0) { ++ if (WRAP(snd_pcm_state)(stm->pcm) != SND_PCM_STATE_RUNNING || ++ WRAP(snd_pcm_delay)(stm->pcm, &delay) != 0) { + *position = stm->last_position; + pthread_mutex_unlock(&stm->mutex); + return CUBEB_OK; +@@ -1089,7 +1195,7 @@ alsa_stream_get_latency(cubeb_stream * stm, uint32_t * latency) + snd_pcm_sframes_t delay; + /* This function returns the delay in frames until a frame written using + snd_pcm_writei is sent to the DAC. The DAC delay should be < 1ms anyways. */ +- if (snd_pcm_delay(stm->pcm, &delay)) { ++ if (WRAP(snd_pcm_delay)(stm->pcm, &delay)) { + return CUBEB_ERROR; + } + +diff --git media/libcubeb/src/cubeb_oss.c media/libcubeb/src/cubeb_oss.c +new file mode 100644 +index 0000000..5e38e27 +--- /dev/null ++++ media/libcubeb/src/cubeb_oss.c +@@ -0,0 +1,399 @@ ++/* ++ * Copyright © 2014 Mozilla Foundation ++ * ++ * This program is made available under an ISC-style license. See the ++ * accompanying file LICENSE for details. ++ */ ++#if defined(HAVE_SYS_SOUNDCARD_H) ++#include <sys/soundcard.h> ++#elif defined(HAVE_LINUX_SOUNDCARD_H) ++#include <linux/soundcard.h> ++#else ++#include <soundcard.h> ++#endif ++#include <unistd.h> ++#include <stdlib.h> ++#include <sys/types.h> ++#include <sys/stat.h> ++#include <fcntl.h> ++#include <sys/ioctl.h> ++#include <errno.h> ++#include <pthread.h> ++#include <stdio.h> ++ ++#include "cubeb/cubeb.h" ++#include "cubeb-internal.h" ++ ++#ifndef CUBEB_OSS_DEFAULT_OUTPUT ++#define CUBEB_OSS_DEFAULT_OUTPUT "/dev/dsp" ++#endif ++ ++#define OSS_BUFFER_SIZE 1024 ++ ++struct cubeb { ++ struct cubeb_ops const * ops; ++}; ++ ++struct cubeb_stream { ++ cubeb * context; ++ ++ cubeb_data_callback data_callback; ++ cubeb_state_callback state_callback; ++ void * user_ptr; ++ float volume; ++ float panning; ++ ++ pthread_mutex_t state_mutex; ++ pthread_cond_t state_cond; ++ ++ int running; ++ int stopped; ++ int floating; ++ ++ /* These two vars are needed to support old versions of OSS */ ++ unsigned int position_bytes; ++ unsigned int last_position_bytes; ++ ++ uint64_t written_frags; /* The number of fragments written to /dev/dsp */ ++ uint64_t missed_frags; /* fragments output with stopped stream */ ++ ++ cubeb_stream_params params; ++ int fd; ++ pthread_t th; ++}; ++ ++static struct cubeb_ops const oss_ops; ++ ++int oss_init(cubeb ** context, char const * context_name) ++{ ++ cubeb* ctx = (cubeb*)malloc(sizeof(cubeb)); ++ ctx->ops = &oss_ops; ++ *context = ctx; ++ return CUBEB_OK; ++} ++ ++static void oss_destroy(cubeb *ctx) ++{ ++ free(ctx); ++} ++ ++static char const * oss_get_backend_id(cubeb * context) ++{ ++ static char oss_name[] = "oss"; ++ return oss_name; ++} ++ ++static int oss_get_max_channel_count(cubeb * ctx, uint32_t * max_channels) ++{ ++ *max_channels = 2; /* Let's support only stereo for now */ ++ return CUBEB_OK; ++} ++ ++static int oss_get_min_latency(cubeb * context, cubeb_stream_params params, ++ uint32_t * latency_ms) ++{ ++ /* 40ms is a big enough number to work ok */ ++ *latency_ms = 40; ++ return CUBEB_OK; ++} ++ ++static int oss_get_preferred_sample_rate(cubeb *context, uint32_t * rate) ++{ ++ /* 48000 seems a prefered choice for most audio devices ++ * and a good choice for OSS */ ++ *rate = 48000; ++ return CUBEB_OK; ++} ++ ++static void run_state_callback(cubeb_stream *stream, cubeb_state state) ++{ ++ if (stream->state_callback) { ++ stream->state_callback(stream, stream->user_ptr, state); ++ } ++} ++ ++static long run_data_callback(cubeb_stream *stream, void *buffer, long nframes) ++{ ++ long got = 0; ++ pthread_mutex_lock(&stream->state_mutex); ++ if (stream->data_callback && stream->running && !stream->stopped) { ++ pthread_mutex_unlock(&stream->state_mutex); ++ got = stream->data_callback(stream, stream->user_ptr, buffer, nframes); ++ } else { ++ pthread_mutex_unlock(&stream->state_mutex); ++ } ++ return got; ++} ++ ++static void apply_volume(int16_t* buffer, unsigned int n, ++ float volume, float panning) ++{ ++ float left = volume; ++ float right = volume; ++ unsigned int i; ++ int pan[2]; ++ if (panning<0) { ++ right *= (1+panning); ++ } else { ++ left *= (1-panning); ++ } ++ pan[0] = 128.0*left; ++ pan[1] = 128.0*right; ++ for(i=0; i<n; i++){ ++ buffer[i] = ((int)buffer[i])*pan[i%2]/128; ++ } ++} ++ ++static void *writer(void *stm) ++{ ++ cubeb_stream* stream = (cubeb_stream*)stm; ++ int16_t buffer[OSS_BUFFER_SIZE]; ++ float f_buffer[OSS_BUFFER_SIZE]; ++ int got; ++ unsigned long i; ++ while (stream->running) { ++ pthread_mutex_lock(&stream->state_mutex); ++ if (stream->stopped) { ++ pthread_mutex_unlock(&stream->state_mutex); ++ run_state_callback(stream, CUBEB_STATE_STOPPED); ++ pthread_mutex_lock(&stream->state_mutex); ++ while (stream->stopped) { ++ pthread_cond_wait(&stream->state_cond, &stream->state_mutex); ++ } ++ pthread_mutex_unlock(&stream->state_mutex); ++ run_state_callback(stream, CUBEB_STATE_STARTED); ++ continue; ++ } ++ pthread_mutex_unlock(&stream->state_mutex); ++ if (stream->floating) { ++ got = run_data_callback(stream, f_buffer, ++ OSS_BUFFER_SIZE/stream->params.channels); ++ for (i=0; i<((unsigned long)got)*stream->params.channels; i++) { ++ buffer[i] = f_buffer[i]*32767.0; ++ } ++ } else { ++ got = run_data_callback(stream, buffer, ++ OSS_BUFFER_SIZE/stream->params.channels); ++ } ++ apply_volume(buffer, got*stream->params.channels, ++ stream->volume, stream->panning); ++ if (got<0) { ++ run_state_callback(stream, CUBEB_STATE_ERROR); ++ break; ++ } ++ if (!got) { ++ run_state_callback(stream, CUBEB_STATE_DRAINED); ++ } ++ if (got) { ++ size_t i = 0; ++ size_t s = got*stream->params.channels*sizeof(int16_t); ++ while (i < s) { ++ ssize_t n = write(stream->fd, ((char*)buffer) + i, s - i); ++ if (n<=0) { ++ run_state_callback(stream, CUBEB_STATE_ERROR); ++ break; ++ } ++ i+=n; ++ } ++ stream->written_frags+=got; ++ } ++ } ++ return NULL; ++} ++ ++static void oss_try_set_latency(cubeb_stream* stream, unsigned int latency) ++{ ++ unsigned int latency_bytes, n_frag; ++ int frag; ++ /* fragment size of 1024 is a good choice with good chances to be accepted */ ++ unsigned int frag_size=1024; ++ unsigned int frag_log=10; /* 2^frag_log = frag_size */ ++ latency_bytes = ++ latency*stream->params.rate*stream->params.channels*sizeof(uint16_t)/1000; ++ n_frag = latency_bytes>>frag_log; ++ frag = (n_frag<<16) | frag_log; ++ /* Even if this fails we wish to continue, not checking for errors */ ++ ioctl(stream->fd, SNDCTL_DSP_SETFRAGMENT, &frag); ++} ++ ++static int oss_stream_init(cubeb * context, cubeb_stream ** stm, ++ char const * stream_name, ++ cubeb_stream_params stream_params, ++ unsigned int latency, ++ cubeb_data_callback data_callback, ++ cubeb_state_callback state_callback, void * user_ptr) ++{ ++ cubeb_stream* stream = (cubeb_stream*)malloc(sizeof(cubeb_stream)); ++ stream->context = context; ++ stream->data_callback = data_callback; ++ stream->state_callback = state_callback; ++ stream->user_ptr = user_ptr; ++ ++ if ((stream->fd = open(CUBEB_OSS_DEFAULT_OUTPUT, O_WRONLY)) == -1) { ++ free(stream); ++ return CUBEB_ERROR; ++ } ++#define SET(what, to) do { unsigned int i = to; \ ++ int j = ioctl(stream->fd, what, &i); \ ++ if (j == -1 || i != to) { \ ++ close(stream->fd); \ ++ free(stream); \ ++ return CUBEB_ERROR_INVALID_FORMAT; } } while (0) ++ ++ stream->params = stream_params; ++ stream->volume = 1.0; ++ stream->panning = 0.0; ++ ++ oss_try_set_latency(stream, latency); ++ ++ stream->floating = 0; ++ SET(SNDCTL_DSP_CHANNELS, stream_params.channels); ++ SET(SNDCTL_DSP_SPEED, stream_params.rate); ++ switch (stream_params.format) { ++ case CUBEB_SAMPLE_S16LE: ++ SET(SNDCTL_DSP_SETFMT, AFMT_S16_LE); ++ break; ++ case CUBEB_SAMPLE_S16BE: ++ SET(SNDCTL_DSP_SETFMT, AFMT_S16_BE); ++ break; ++ case CUBEB_SAMPLE_FLOAT32LE: ++ SET(SNDCTL_DSP_SETFMT, AFMT_S16_NE); ++ stream->floating = 1; ++ break; ++ default: ++ close(stream->fd); ++ free(stream); ++ return CUBEB_ERROR; ++ } ++ ++ ++ pthread_mutex_init(&stream->state_mutex, NULL); ++ pthread_cond_init(&stream->state_cond, NULL); ++ ++ stream->running = 1; ++ stream->stopped = 1; ++ stream->position_bytes = 0; ++ stream->last_position_bytes = 0; ++ stream->written_frags = 0; ++ stream->missed_frags = 0; ++ ++ pthread_create(&stream->th, NULL, writer, (void*)stream); ++ ++ *stm = stream; ++ ++ return CUBEB_OK; ++} ++ ++static void oss_stream_destroy(cubeb_stream * stream) ++{ ++ pthread_mutex_lock(&stream->state_mutex); ++ ++ stream->running = 0; ++ stream->stopped = 0; ++ pthread_cond_signal(&stream->state_cond); ++ ++ pthread_mutex_unlock(&stream->state_mutex); ++ ++ pthread_join(stream->th, NULL); ++ ++ pthread_mutex_destroy(&stream->state_mutex); ++ pthread_cond_destroy(&stream->state_cond); ++ close(stream->fd); ++ free(stream); ++} ++ ++static int oss_stream_get_latency(cubeb_stream * stream, uint32_t * latency) ++{ ++ if (ioctl(stream->fd, SNDCTL_DSP_GETODELAY, latency)==-1) { ++ return CUBEB_ERROR; ++ } ++ /* Convert latency from bytes to frames */ ++ *latency /= stream->params.channels*sizeof(int16_t); ++ return CUBEB_OK; ++} ++ ++ ++static int oss_stream_current_optr(cubeb_stream * stream, uint64_t * position) ++{ ++ count_info ci; ++ /* Unfortunately, this ioctl is only available in OSS 4.x */ ++#ifdef SNDCTL_DSP_CURRENT_OPTR ++ oss_count_t count; ++ if (ioctl(stream->fd, SNDCTL_DSP_CURRENT_OPTR, &count) != -1) { ++ *position = count.samples;// + count.fifo_samples; ++ return CUBEB_OK; ++ } ++#endif ++ /* Fall back to this ioctl in case the previous one fails */ ++ if (ioctl(stream->fd, SNDCTL_DSP_GETOPTR, &ci) == -1) { ++ return CUBEB_ERROR; ++ } ++ /* ci.bytes is only 32 bit and will start to wrap after arithmetic overflow */ ++ stream->position_bytes += ci.bytes - stream->last_position_bytes; ++ stream->last_position_bytes = ci.bytes; ++ *position = stream->position_bytes/stream->params.channels/sizeof(int16_t); ++ return CUBEB_OK; ++} ++ ++static int oss_stream_get_position(cubeb_stream * stream, uint64_t * position) ++{ ++ if ( oss_stream_current_optr(stream, position) == CUBEB_OK ){ ++ *position -= stream->missed_frags; ++ return CUBEB_OK; ++ } ++ /* If no correct method to get position works we resort to this */ ++ *position = stream->written_frags; ++ return CUBEB_OK; ++} ++ ++ ++static int oss_stream_start(cubeb_stream * stream) ++{ ++ pthread_mutex_lock(&stream->state_mutex); ++ if (stream->stopped) { ++ uint64_t ptr; ++ oss_stream_current_optr(stream, &ptr); ++ stream->missed_frags = ptr - stream->written_frags; ++ stream->stopped = 0; ++ pthread_cond_signal(&stream->state_cond); ++ } ++ pthread_mutex_unlock(&stream->state_mutex); ++ return CUBEB_OK; ++} ++ ++static int oss_stream_stop(cubeb_stream * stream) ++{ ++ pthread_mutex_lock(&stream->state_mutex); ++ stream->stopped = 1; ++ pthread_mutex_unlock(&stream->state_mutex); ++ return CUBEB_OK; ++} ++ ++int oss_stream_set_panning(cubeb_stream * stream, float panning) ++{ ++ if (stream->params.channels == 2) { ++ stream->panning=panning; ++ } ++ return CUBEB_OK; ++} ++ ++int oss_stream_set_volume(cubeb_stream * stream, float volume) ++{ ++ stream->volume=volume; ++ return CUBEB_OK; ++} ++ ++static struct cubeb_ops const oss_ops = { ++ .init = oss_init, ++ .get_backend_id = oss_get_backend_id, ++ .get_max_channel_count = oss_get_max_channel_count, ++ .get_min_latency = oss_get_min_latency, ++ .get_preferred_sample_rate = oss_get_preferred_sample_rate, ++ .destroy = oss_destroy, ++ .stream_init = oss_stream_init, ++ .stream_destroy = oss_stream_destroy, ++ .stream_start = oss_stream_start, ++ .stream_stop = oss_stream_stop, ++ .stream_get_position = oss_stream_get_position, ++ .stream_get_latency = oss_stream_get_latency ++}; +diff --git media/libcubeb/src/moz.build media/libcubeb/src/moz.build +index 8b7a0dd..31212ce 100644 +--- media/libcubeb/src/moz.build ++++ media/libcubeb/src/moz.build +@@ -17,6 +17,12 @@ if CONFIG['MOZ_ALSA']: + ] + DEFINES['USE_ALSA'] = True + ++if CONFIG['MOZ_OSS']: ++ SOURCES += [ ++ 'cubeb_oss.c', ++ ] ++ DEFINES['USE_OSS'] = True ++ + if CONFIG['MOZ_PULSEAUDIO']: + SOURCES += [ + 'cubeb_pulse.c', +@@ -75,5 +81,6 @@ if CONFIG['MOZ_WIDGET_TOOLKIT'] == 'gonk': + + FAIL_ON_WARNINGS = True + ++CFLAGS += CONFIG['MOZ_OSS_CFLAGS'] + CFLAGS += CONFIG['MOZ_ALSA_CFLAGS'] + CFLAGS += CONFIG['MOZ_PULSEAUDIO_CFLAGS'] +diff --git toolkit/library/libxul.mk toolkit/library/libxul.mk +index e191f13..4fb268a 100644 +--- toolkit/library/libxul.mk ++++ toolkit/library/libxul.mk +@@ -146,6 +146,10 @@ OS_LIBS += $(call EXPAND_LIBNAME,secur32 + endif + endif + ++ifdef MOZ_OSS ++EXTRA_DSO_LDOPTS += $(MOZ_OSS_LIBS) ++endif ++ + ifdef MOZ_ALSA + EXTRA_DSO_LDOPTS += $(MOZ_ALSA_LIBS) + endif diff --git a/www/libxul/files/patch-bug1026828 b/www/libxul/files/patch-bug1026828 new file mode 100644 index 000000000000..69e79f5ac560 --- /dev/null +++ b/www/libxul/files/patch-bug1026828 @@ -0,0 +1,20 @@ +diff --git storage/src/moz.build storage/src/moz.build +index 4cd2551..5c40536 100644 +--- storage/src/moz.build ++++ storage/src/moz.build +@@ -50,11 +50,14 @@ FINAL_LIBRARY = 'storagecomps' + # (such as NSS) might trigger an initialization of sqlite and allocation + # of memory using the default allocator, prior to the storage service + # registering its allocator, causing memory management failures (bug 938730). ++# However, this is not an issue if both the jemalloc allocator and the default ++# allocator are the same thing. + # + # Note: On Windows our sqlite build assumes we use jemalloc. If you disable + # MOZ_STORAGE_MEMORY on Windows, you will also need to change the "ifdef + # MOZ_MEMORY" options in db/sqlite3/src/Makefile.in. +-if CONFIG['MOZ_MEMORY'] and not CONFIG['MOZ_NATIVE_SQLITE']: ++if CONFIG['MOZ_MEMORY'] and (not CONFIG['MOZ_NATIVE_SQLITE'] ++ or CONFIG['MOZ_NATIVE_JEMALLOC']): + if CONFIG['OS_TARGET'] != 'Android': + DEFINES['MOZ_STORAGE_MEMORY'] = True + diff --git a/www/libxul/files/patch-bug1041381 b/www/libxul/files/patch-bug1041381 new file mode 100644 index 000000000000..ef90b7b00c3f --- /dev/null +++ b/www/libxul/files/patch-bug1041381 @@ -0,0 +1,12 @@ +diff --git config/rules.mk config/rules.mk +index 1dee8c3..4d67eda 100644 +--- config/rules.mk ++++ config/rules.mk +@@ -822,6 +822,7 @@ endif + ifdef DTRACE_PROBE_OBJ + EXTRA_DEPS += $(DTRACE_PROBE_OBJ) + OBJS += $(DTRACE_PROBE_OBJ) ++EXCLUDED_OBJS += $(DTRACE_PROBE_OBJ) + endif + + $(filter %.$(LIB_SUFFIX),$(LIBRARY)): $(OBJS) $(EXTRA_DEPS) $(GLOBAL_DEPS) diff --git a/www/libxul/files/patch-bug1041795 b/www/libxul/files/patch-bug1041795 index ba567f83dcac..3e92884412fb 100644 --- a/www/libxul/files/patch-bug1041795 +++ b/www/libxul/files/patch-bug1041795 @@ -20,28 +20,6 @@ index 4d67eda..783942f 100644 endif $(EXPAND_MKSHLIB) $(SHLIB_LDSTARTFILE) $(OBJS) $(SUB_SHLOBJS) $(DTRACE_PROBE_OBJ) $(MOZILLA_PROBE_LIBS) $(RESFILE) $(LDFLAGS) $(WRAP_LDFLAGS) $(SHARED_LIBRARY_LIBS) $(EXTRA_DSO_LDOPTS) $(MOZ_GLUE_LDFLAGS) $(OS_LIBS) $(EXTRA_LIBS) $(DEF_FILE) $(SHLIB_LDENDFILE) $(if $(LIB_IS_C_ONLY),,$(STLPORT_LIBS)) @$(RM) $(DTRACE_PROBE_OBJ) -diff --git js/src/config/rules.mk js/src/config/rules.mk -index 4d67eda..783942f 100644 ---- js/src/config/rules.mk -+++ js/src/config/rules.mk -@@ -858,7 +858,7 @@ ifdef DTRACE_PROBE_OBJ - ifndef DTRACE_LIB_DEPENDENT - NON_DTRACE_OBJS := $(filter-out $(DTRACE_PROBE_OBJ),$(OBJS)) - $(DTRACE_PROBE_OBJ): $(NON_DTRACE_OBJS) -- dtrace -G -C -s $(MOZILLA_DTRACE_SRC) -o $(DTRACE_PROBE_OBJ) $(NON_DTRACE_OBJS) -+ dtrace -x nolibs -G -C -s $(MOZILLA_DTRACE_SRC) -o $(DTRACE_PROBE_OBJ) $(NON_DTRACE_OBJS) - endif - endif - endif -@@ -876,7 +876,7 @@ ifndef INCREMENTAL_LINKER - endif - ifdef DTRACE_LIB_DEPENDENT - ifndef XP_MACOSX -- dtrace -G -C -s $(MOZILLA_DTRACE_SRC) -o $(DTRACE_PROBE_OBJ) $(shell $(EXPAND_LIBS) $(MOZILLA_PROBE_LIBS)) -+ dtrace -x nolibs -G -C -s $(MOZILLA_DTRACE_SRC) -o $(DTRACE_PROBE_OBJ) $(shell $(EXPAND_LIBS) $(MOZILLA_PROBE_LIBS)) - endif - $(EXPAND_MKSHLIB) $(SHLIB_LDSTARTFILE) $(OBJS) $(SUB_SHLOBJS) $(DTRACE_PROBE_OBJ) $(MOZILLA_PROBE_LIBS) $(RESFILE) $(LDFLAGS) $(WRAP_LDFLAGS) $(SHARED_LIBRARY_LIBS) $(EXTRA_DSO_LDOPTS) $(MOZ_GLUE_LDFLAGS) $(OS_LIBS) $(EXTRA_LIBS) $(DEF_FILE) $(SHLIB_LDENDFILE) $(if $(LIB_IS_C_ONLY),,$(STLPORT_LIBS)) - @$(RM) $(DTRACE_PROBE_OBJ) diff --git js/src/Makefile.in js/src/Makefile.in index 28ca5e8..96793d7 100644 --- js/src/Makefile.in diff --git a/www/libxul/files/patch-bug1073709 b/www/libxul/files/patch-bug1073709 new file mode 100644 index 000000000000..f011d7438ad0 --- /dev/null +++ b/www/libxul/files/patch-bug1073709 @@ -0,0 +1,18 @@ +diff --git mfbt/Atomics.h mfbt/Atomics.h +index 495a9d3..c7f7601 100644 +--- mfbt/Atomics.h ++++ mfbt/Atomics.h +@@ -34,10 +34,12 @@ + * loose typing of the atomic builtins. GCC 4.5 and 4.6 lacks inline + * definitions for unspecialized std::atomic and causes linking errors. + * Therefore, we require at least 4.7.0 for using libstdc++. ++ * ++ * libc++ <atomic> is only functional with clang. + */ + # if MOZ_USING_LIBSTDCXX && MOZ_LIBSTDCXX_VERSION_AT_LEAST(4, 7, 0) + # define MOZ_HAVE_CXX11_ATOMICS +-# elif MOZ_USING_LIBCXX ++# elif MOZ_USING_LIBCXX && defined(__clang__) + # define MOZ_HAVE_CXX11_ATOMICS + # endif + /* diff --git a/www/libxul/files/patch-bug1076983 b/www/libxul/files/patch-bug1076983 new file mode 100644 index 000000000000..182aadf58bf5 --- /dev/null +++ b/www/libxul/files/patch-bug1076983 @@ -0,0 +1,45 @@ +commit e10ee74 +Author: Martin Thomson <martin.thomson@gmail.com> +Date: Tue Oct 14 17:17:35 2014 -0700 + + Bug 1076983 - Disabling SSL 3.0 with pref +--- + netwerk/base/public/security-prefs.js | 2 +- + security/manager/ssl/src/nsNSSComponent.cpp | 7 +++---- + 2 files changed, 4 insertions(+), 5 deletions(-) + +diff --git netwerk/base/public/security-prefs.js netwerk/base/public/security-prefs.js +index 352552e..c12731b 100644 +--- netwerk/base/public/security-prefs.js ++++ netwerk/base/public/security-prefs.js +@@ -2,7 +2,7 @@ + * 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/. */ + +-pref("security.tls.version.min", 0); ++pref("security.tls.version.min", 1); + pref("security.tls.version.max", 3); + + pref("security.ssl.allow_unrestricted_renego_everywhere__temporarily_available_pref", false); +diff --git security/manager/ssl/src/nsNSSComponent.cpp security/manager/ssl/src/nsNSSComponent.cpp +index 8cab67b..772959d 100644 +--- security/manager/ssl/src/nsNSSComponent.cpp ++++ security/manager/ssl/src/nsNSSComponent.cpp +@@ -829,14 +829,13 @@ void nsNSSComponent::setValidationOptions(bool isInitialSetting, + mDefaultCertVerifier = new SharedCertVerifier(odc, osc, ogc, pinningMode); + } + +-// Enable the TLS versions given in the prefs, defaulting to SSL 3.0 (min +-// version) and TLS 1.2 (max version) when the prefs aren't set or set to +-// invalid values. ++// Enable the TLS versions given in the prefs, defaulting to TLS 1.0 (min) and ++// TLS 1.2 (max) when the prefs aren't set or set to invalid values. + nsresult + nsNSSComponent::setEnabledTLSVersions() + { + // keep these values in sync with security-prefs.js +- static const int32_t PSM_DEFAULT_MIN_TLS_VERSION = 0; ++ static const int32_t PSM_DEFAULT_MIN_TLS_VERSION = 1; + static const int32_t PSM_DEFAULT_MAX_TLS_VERSION = 3; + + int32_t minVersion = Preferences::GetInt("security.tls.version.min", diff --git a/www/libxul/files/patch-bug702179 b/www/libxul/files/patch-bug702179 index 5754b607ad57..d7b90a082519 100644 --- a/www/libxul/files/patch-bug702179 +++ b/www/libxul/files/patch-bug702179 @@ -25,11 +25,12 @@ diff --git js/src/Makefile.in js/src/Makefile.in index e28160a..28ca5e8 100644 --- js/src/Makefile.in +++ js/src/Makefile.in -@@ -35,7 +35,6 @@ ifdef JS_SHARED_LIBRARY - FORCE_SHARED_LIB = 1 - endif - FORCE_STATIC_LIB = 1 --DIST_INSTALL = 1 +@@ -18,8 +18,6 @@ run_for_side_effects := $(shell echo 'MAKE: $(MAKE)') + STATIC_LIBRARY_NAME = js_static + LIBS = $(NSPR_LIBS) - ############################################### - # BEGIN include sources for low-level code shared with mfbt +-DIST_INSTALL = 1 +- + ifdef JS_STANDALONE + SHARED_LIBRARY_LIBS += $(call EXPAND_LIBNAME_PATH,mfbt,$(DEPTH)/mfbt) + ifndef MOZ_NATIVE_ZLIB diff --git a/www/libxul/files/patch-bug779713 b/www/libxul/files/patch-bug779713 index 1398d36f6a15..e4643f4422cb 100644 --- a/www/libxul/files/patch-bug779713 +++ b/www/libxul/files/patch-bug779713 @@ -1,8 +1,15 @@ -diff --git mfbt/Util.h mfbt/Util.h +diff --git mfbt/Alignment.h mfbt/Alignment.h index e0843ca..353ec36 100644 ---- mfbt/Util.h -+++ mfbt/Util.h -@@ -19,6 +19,13 @@ +--- mfbt/Alignment.h ++++ mfbt/Alignment.h +@@ -9,11 +9,20 @@ + #ifndef mozilla_Alignment_h + #define mozilla_Alignment_h + ++#include "mozilla/Attributes.h" ++ + #include <stddef.h> + #include <stdint.h> namespace mozilla { @@ -14,9 +21,9 @@ index e0843ca..353ec36 100644 +#define MOZ_ALIGNOF(T) __alignof(T) +#else /* - * This class, and the corresponding macro MOZ_ALIGNOF, figure out how many + * This class, and the corresponding macro MOZ_ALIGNOF, figures out how many * bytes of alignment a given type needs. -@@ -37,6 +44,7 @@ class AlignmentFinder +@@ -32,6 +41,7 @@ public: }; #define MOZ_ALIGNOF(T) mozilla::AlignmentFinder<T>::alignment @@ -24,7 +31,7 @@ index e0843ca..353ec36 100644 /* * Declare the MOZ_ALIGNED_DECL macro for declaring aligned types. -@@ -48,7 +56,10 @@ class AlignmentFinder +@@ -43,7 +53,10 @@ public: * will declare a two-character array |arr| aligned to 8 bytes. */ @@ -40,7 +47,7 @@ diff --git mfbt/Attributes.h mfbt/Attributes.h index d317766..ddb13da 100644 --- mfbt/Attributes.h +++ mfbt/Attributes.h -@@ -67,6 +67,9 @@ +@@ -54,6 +54,9 @@ # ifndef __has_extension # define __has_extension __has_feature /* compatibility, for older versions of clang */ # endif @@ -50,7 +57,7 @@ index d317766..ddb13da 100644 # if __has_extension(cxx_constexpr) # define MOZ_HAVE_CXX11_CONSTEXPR # endif -@@ -85,6 +88,9 @@ +@@ -75,6 +78,9 @@ # endif #elif defined(__GNUC__) # if defined(__GXX_EXPERIMENTAL_CXX0X__) || __cplusplus >= 201103L @@ -60,13 +67,11 @@ index d317766..ddb13da 100644 # if MOZ_GCC_VERSION_AT_LEAST(4, 7, 0) # define MOZ_HAVE_CXX11_OVERRIDE # define MOZ_HAVE_CXX11_FINAL final -@@ -102,6 +108,9 @@ - # define MOZ_HAVE_NEVER_INLINE __attribute__((noinline)) +@@ -96,6 +102,7 @@ # define MOZ_HAVE_NORETURN __attribute__((noreturn)) #elif defined(_MSC_VER) -+# if _MSC_VER >= 1800 + # if _MSC_VER >= 1800 +# define MOZ_HAVE_CXX11_ALIGNAS -+# endif + # define MOZ_HAVE_CXX11_DELETE + # endif # if _MSC_VER >= 1700 - # define MOZ_HAVE_CXX11_FINAL final - # else diff --git a/www/libxul/files/patch-bug783463 b/www/libxul/files/patch-bug783463 deleted file mode 100644 index dedbb7003927..000000000000 --- a/www/libxul/files/patch-bug783463 +++ /dev/null @@ -1,14 +0,0 @@ ---- gfx/skia/moz.build~ -+++ gfx/skia/moz.build -@@ -188,10 +188,9 @@ elif CONFIG['MOZ_WIDGET_TOOLKIT'] == 'qt - 'SkMMapStream.cpp', - 'SkOSFile.cpp', - ] -- if CONFIG['OS_TARGET'] == 'Linux': -+ if CONFIG['MOZ_X11'] == 1 or CONFIG['OS_TARGET'] == 'Linux': - CPP_SOURCES += [ - 'SkFontHost_linux.cpp', -- 'SkFontHost_tables.cpp', - 'SkThread_pthread.cpp', - 'SkTime_Unix.cpp', - ] diff --git a/www/libxul/files/patch-bug803480 b/www/libxul/files/patch-bug803480 deleted file mode 100644 index 5f5b4fe7f392..000000000000 --- a/www/libxul/files/patch-bug803480 +++ /dev/null @@ -1,102 +0,0 @@ -diff --git configure.in configure.in -index a0575dc..be327fd 100644 ---- configure.in -+++ configure.in -@@ -4306,7 +4306,6 @@ NS_PRINTING=1 - MOZ_PDF_PRINTING= - MOZ_DISABLE_CRYPTOLEGACY= - NSS_DISABLE_DBM= --NECKO_WIFI=1 - NECKO_COOKIES=1 - NECKO_PROTOCOLS_DEFAULT="about data file ftp http res viewsource websocket wyciwyg device" - USE_ARM_KUSER= -@@ -4336,11 +4335,6 @@ case "${target}" in - fi - - NSS_DISABLE_DBM=1 -- if test -z "$gonkdir"; then -- NECKO_WIFI= -- else -- NECKO_WIFI=1 -- fi - MOZ_THEME_FASTSTRIPE=1 - MOZ_TREE_FREETYPE=1 - MOZ_MEMORY=1 -@@ -8485,28 +8479,39 @@ done - dnl - dnl option to disable necko's wifi scanner - dnl -+ -+case "$OS_TARGET" in -+ OS2) -+ dnl OS/2 implementation of Necko-WiFi support will be added in bug 506566 -+ ;; -+ Android) -+ if test -n "$gonkdir"; then -+ NECKO_WIFI=1 -+ fi -+ ;; -+ Darwin|SunOS|WINNT) -+ NECKO_WIFI=1 -+ ;; -+ Linux) -+ if test -z "$MOZ_ENABLE_DBUS"; then -+ AC_MSG_ERROR([Necko WiFi scanning needs DBus on your platform, remove --disable-dbus or use --disable-necko-wifi]) -+ fi -+ NECKO_WIFI=1 -+ NECKO_WIFI_DBUS=1 -+ ;; -+esac -+ - MOZ_ARG_DISABLE_BOOL(necko-wifi, - [ --disable-necko-wifi Disable necko wifi scanner], - NECKO_WIFI=, - NECKO_WIFI=1) - --if test "$OS_ARCH" = "OS2"; then -- dnl OS/2 implementation of Necko-WiFi support will be added in bug 506566 -- NECKO_WIFI= --fi --if test "$NECKO_WIFI" -a \ -- "$OS_ARCH" != "Linux" -a \ -- "$OS_ARCH" != "Darwin" -a \ -- "$OS_ARCH" != "SunOS" -a \ -- "$OS_ARCH" != "WINNT"; then -- AC_MSG_ERROR([Necko WiFi scanning not supported on your platform, use --disable-necko-wifi]) --fi -- - if test "$NECKO_WIFI"; then - AC_DEFINE(NECKO_WIFI) - _NON_GLOBAL_ACDEFINES="$_NON_GLOBAL_ACDEFINES NECKO_WIFI" - fi - AC_SUBST(NECKO_WIFI) -+AC_SUBST(NECKO_WIFI_DBUS) - - dnl - dnl option to disable cookies -diff --git netwerk/wifi/Makefile.in netwerk/wifi/Makefile.in -index 26dbd79..4cbf912 100644 ---- netwerk/wifi/Makefile.in -+++ netwerk/wifi/Makefile.in -@@ -20,7 +20,7 @@ ifeq ($(OS_ARCH),SunOS) - OS_INCLUDES += $(GLIB_CFLAGS) - endif - --ifdef MOZ_ENABLE_DBUS -+ifdef NECKO_WIFI_DBUS - OS_INCLUDES += $(MOZ_DBUS_GLIB_CFLAGS) - endif - -diff --git netwerk/wifi/moz.build netwerk/wifi/moz.build -index 5e70211..07b01de 100644 ---- netwerk/wifi/moz.build -+++ netwerk/wifi/moz.build -@@ -43,7 +43,7 @@ elif CONFIG['OS_ARCH'] == 'SunOS': - 'nsWifiScannerSolaris.cpp', - ] - --if CONFIG['MOZ_ENABLE_DBUS']: -+if CONFIG['NECKO_WIFI_DBUS']: - CPP_SOURCES += [ - 'nsWifiScannerDBus.cpp', - ] diff --git a/www/libxul/files/patch-bug807492 b/www/libxul/files/patch-bug807492 deleted file mode 100644 index 3b39766e0492..000000000000 --- a/www/libxul/files/patch-bug807492 +++ /dev/null @@ -1,628 +0,0 @@ -JJdiff --git configure.in configure.in -index c167461..8346c11 100644 ---- configure.in -+++ configure.in -@@ -5246,17 +5246,17 @@ if test "$NS_PRINTING"; then - AC_DEFINE(NS_PRINT_PREVIEW) - fi - - dnl Turn off webrtc for OS's we don't handle yet, but allow - dnl --enable-webrtc to override. Can disable for everything in - dnl the master list above. - if test -n "$MOZ_WEBRTC"; then - case "$target" in -- *-linux*|*-mingw*|*-darwin*|*-android*|*-linuxandroid*) -+ *-linux*|*-mingw*|*-darwin*|*-android*|*-linuxandroid*|*-dragonfly*|*-freebsd*|*-netbsd*|*-openbsd*) - dnl Leave enabled - ;; - *) - dnl default to disabled for all others - MOZ_WEBRTC= - ;; - esac - fi -diff --git media/mtransport/objs.mk media/mtransport/objs.mk -index f1fc85f..141e8ca 100644 ---- media/mtransport/objs.mk -+++ media/mtransport/objs.mk -@@ -18,22 +18,26 @@ LOCAL_INCLUDES += \ - -I$(topsrcdir)/media/mtransport/third_party/nrappkit/src/util/libekr \ - -I$(topsrcdir)/media/mtransport/third_party/nrappkit/src/log \ - -I$(topsrcdir)/media/mtransport/third_party/nrappkit/src/registry \ - -I$(topsrcdir)/media/mtransport/third_party/nrappkit/src/stats \ - -I$(topsrcdir)/media/mtransport/third_party/nrappkit/src/plugin \ - -I$(topsrcdir)/media/mtransport/third_party/nrappkit/src/event \ - $(NULL) - --ifeq ($(OS_TARGET), Darwin) -+ifneq (,$(filter Darwin DragonFly FreeBSD NetBSD OpenBSD,$(OS_TARGET))) - LOCAL_INCLUDES += \ - -I$(topsrcdir)/media/mtransport/third_party/nrappkit/src/port/darwin/include \ - -I$(topsrcdir)/media/mtransport/third_party/nrappkit/src/port/generic/include \ - $(NULL) -+ifeq ($(OS_TARGET), Darwin) - DEFINES += -DDARWIN -+else -+DEFINES += -DBSD -+endif - endif - - ifeq ($(OS_TARGET), Linux) - LOCAL_INCLUDES += \ - -I$(topsrcdir)/media/mtransport/third_party/nrappkit/src/port/linux/include \ - -I$(topsrcdir)/media/mtransport/third_party/nrappkit/src/port/generic/include \ - $(NULL) - DEFINES += -DLINUX -diff --git media/mtransport/test/Makefile.in media/mtransport/test/Makefile.in -index c1d5bf4..2ecf2c7 100644 ---- media/mtransport/test/Makefile.in -+++ media/mtransport/test/Makefile.in -@@ -73,22 +73,24 @@ DEFINES += -D__Userspace_os_FreeBSD=1 - else - #default_fallback; probably doesn't work - DEFINES += -D__Userspace_os_$(OS_TARGET)=1 - endif - endif - endif - endif - --ifeq ($(OS_TARGET), Darwin) -+ifneq (,$(filter Darwin DragonFly FreeBSD NetBSD OpenBSD,$(OS_TARGET))) - LOCAL_INCLUDES += -I$(topsrcdir)/media/mtransport/third_party/nrappkit/src/port/darwin/include -+ifeq ($(OS_TARGET), Darwin) - DEFINES += \ - -DGTEST_USE_OWN_TR1_TUPLE=1 \ - $(NULL) - endif -+endif - - ifeq ($(OS_TARGET), Linux) - LOCAL_INCLUDES += -I$(topsrcdir)/media/mtransport/third_party/nrappkit/src/port/linux/include - endif - - ifeq ($(OS_TARGET), Android) - LOCAL_INCLUDES += -I$(topsrcdir)/media/mtransport/third_party/nrappkit/src/port/android/include - -diff --git media/mtransport/third_party/nICEr/nicer.gyp media/mtransport/third_party/nICEr/nicer.gyp -index 0e1f8b4..9a4b995 100644 ---- media/mtransport/third_party/nICEr/nicer.gyp -+++ media/mtransport/third_party/nICEr/nicer.gyp -@@ -126,26 +126,36 @@ - 'R_DEFINED_UINT2=uint16_t', - 'R_DEFINED_INT4=int32_t', - 'R_DEFINED_UINT4=uint32_t', - 'R_DEFINED_INT8=int64_t', - 'R_DEFINED_UINT8=uint64_t', - ], - - 'conditions' : [ -- ## Mac -+ ## Mac and BSDs - [ 'OS == "mac"', { -+ 'defines' : [ -+ 'DARWIN', -+ 'HAVE_XLOCALE', -+ ], -+ }], -+ [ 'os_bsd == 1', { -+ 'defines' : [ -+ 'BSD', -+ ], -+ }], -+ [ 'OS == "mac" or os_bsd == 1', { - 'cflags_mozilla': [ - '-Wall', - '-Wno-parentheses', - '-Wno-strict-prototypes', - '-Wmissing-prototypes', - ], - 'defines' : [ -- 'DARWIN', - 'HAVE_LIBM=1', - 'HAVE_STRDUP=1', - 'HAVE_STRLCPY=1', - 'HAVE_SYS_TIME_H=1', - 'HAVE_VFPRINTF=1', - 'NEW_STDIO' - 'RETSIGTYPE=void', - 'TIME_WITH_SYS_TIME_H=1', -diff --git media/mtransport/third_party/nICEr/src/stun/addrs.c media/mtransport/third_party/nICEr/src/stun/addrs.c -index b0b66b2..04fea94 100644 ---- media/mtransport/third_party/nICEr/src/stun/addrs.c -+++ media/mtransport/third_party/nICEr/src/stun/addrs.c -@@ -50,17 +50,19 @@ static char *RCSSTRING __UNUSED__="$Id: addrs.c,v 1.2 2008/04/28 18:21:30 ekr Ex - #else - #include <syslog.h> - /* Work around an Android NDK < r8c bug */ - #undef __unused - #include <linux/sysctl.h> - #endif - #include <net/if.h> - #ifndef LINUX -+#if !defined(__OpenBSD__) && !defined(__NetBSD__) - #include <net/if_var.h> -+#endif - #include <net/if_dl.h> - #include <net/if_types.h> - #include <sys/sockio.h> - #else - #include <linux/if.h> - #endif - #include <net/route.h> - -@@ -75,17 +77,17 @@ static char *RCSSTRING __UNUSED__="$Id: addrs.c,v 1.2 2008/04/28 18:21:30 ekr Ex - #include <netdb.h> - #endif /* UNIX */ - - #include "stun.h" - #include "addrs.h" - - - --#ifdef DARWIN -+#if defined(BSD) || defined(DARWIN) - /* - * Copyright (c) 1983, 1993 - * The Regents of the University of California. All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright -@@ -685,17 +687,17 @@ nr_stun_remove_duplicate_addrs(nr_transport_addr addrs[], int remove_loopback, i - } - - int - nr_stun_get_addrs(nr_transport_addr addrs[], int maxaddrs, int drop_loopback, int *count) - { - int _status=0; - int i; - --#ifdef DARWIN -+#if defined(BSD) || defined(DARWIN) - _status = stun_get_mib_addrs(addrs, maxaddrs, count); - #elif defined(WIN32) - _status = stun_get_win32_addrs(addrs, maxaddrs, count); - #elif defined(__sparc__) - _status = stun_get_sparc_addrs(addrs, maxaddrs, count); - #else - _status = stun_get_siocgifconf_addrs(addrs, maxaddrs, count); - #endif -diff --git media/mtransport/third_party/nICEr/src/stun/stun.h media/mtransport/third_party/nICEr/src/stun/stun.h -index a3c51f9..eb65ac8 100644 ---- media/mtransport/third_party/nICEr/src/stun/stun.h -+++ media/mtransport/third_party/nICEr/src/stun/stun.h -@@ -36,21 +36,25 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - - #ifdef WIN32 - #include <winsock2.h> - #else - #include <sys/param.h> - #include <sys/socket.h> - #include <net/if.h> - #ifndef LINUX -+#if !defined(__OpenBSD__) && !defined(__NetBSD__) - #include <net/if_var.h> -+#endif - #include <net/if_dl.h> - #include <net/if_types.h> - #endif -+#ifndef BSD - #include <net/route.h> -+#endif - #include <netinet/in.h> - #ifndef LINUX - #include <netinet/in_var.h> - #endif - #include <arpa/inet.h> - #include <netdb.h> - #endif - #include <time.h> -diff --git media/mtransport/third_party/nICEr/src/util/mbslen.c media/mtransport/third_party/nICEr/src/util/mbslen.c -index cc260b7..66af2d7 100644 ---- media/mtransport/third_party/nICEr/src/util/mbslen.c -+++ media/mtransport/third_party/nICEr/src/util/mbslen.c -@@ -38,50 +38,58 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - - #include <errno.h> - #include <csi_platform.h> - - #include <assert.h> - #include <locale.h> - #include <stdlib.h> - #include <wchar.h> --#ifdef DARWIN -+ -+#ifdef __FreeBSD__ -+#include <osreldate.h> -+# if __FreeBSD_version > 900505 -+# define HAVE_XLOCALE -+# endif -+#endif -+ -+#ifdef HAVE_XLOCALE - #include <xlocale.h> --#endif /* DARWIN */ -+#endif /* HAVE_XLOCALE */ - - #include "nr_api.h" - #include "mbslen.h" - - /* get number of characters in a mult-byte character string */ - int - mbslen(const char *s, size_t *ncharsp) - { --#ifdef DARWIN -+#ifdef HAVE_XLOCALE - static locale_t loc = 0; - static int initialized = 0; --#endif /* DARWIN */ -+#endif /* HAVE_XLOCALE */ - #ifdef WIN32 - char *my_locale=0; - unsigned int i; - #endif /* WIN32 */ - int _status; - size_t nbytes; - int nchars; - mbstate_t mbs; - --#ifdef DARWIN -+#ifdef HAVE_XLOCALE - if (! initialized) { - initialized = 1; - loc = newlocale(LC_CTYPE_MASK, "UTF-8", LC_GLOBAL_LOCALE); - } - - if (loc == 0) { - /* unable to create the UTF-8 locale */ - assert(loc != 0); /* should never happen */ --#endif /* DARWIN */ -+#endif /* HAVE_XLOCALE */ - - #ifdef WIN32 - if (!setlocale(LC_CTYPE, 0)) - ABORT(R_INTERNAL); - - if (!(my_locale = r_strdup(setlocale(LC_CTYPE, 0)))) - ABORT(R_NO_MEMORY); - -@@ -94,28 +102,28 @@ mbslen(const char *s, size_t *ncharsp) - /* can't count UTF-8 characters with mbrlen if the locale isn't UTF-8 */ - /* null-checking setlocale is required because Android */ - char *locale = setlocale(LC_CTYPE, 0); - /* some systems use "utf8" instead of "UTF-8" like Fedora 17 */ - if (!locale || (!strcasestr(locale, "UTF-8") && !strcasestr(locale, "UTF8"))) - ABORT(R_NOT_FOUND); - #endif - --#ifdef DARWIN -+#ifdef HAVE_XLOCALE - } --#endif /* DARWIN */ -+#endif /* HAVE_XLOCALE */ - - memset(&mbs, 0, sizeof(mbs)); - nchars = 0; - --#ifdef DARWIN -+#ifdef HAVE_XLOCALE - while (*s != '\0' && (nbytes = mbrlen_l(s, strlen(s), &mbs, loc)) != 0) - #else - while (*s != '\0' && (nbytes = mbrlen(s, strlen(s), &mbs)) != 0) --#endif /* DARWIN */ -+#endif /* HAVE_XLOCALE */ - { - if (nbytes == (size_t)-1) /* should never happen */ { - ABORT(R_INTERNAL); - } - if (nbytes == (size_t)-2) /* encoding error */ { - ABORT(R_BAD_DATA); - } - -diff --git media/mtransport/third_party/nrappkit/nrappkit.gyp media/mtransport/third_party/nrappkit/nrappkit.gyp -index 3cc8e1c..74016c6 100644 ---- media/mtransport/third_party/nrappkit/nrappkit.gyp -+++ media/mtransport/third_party/nrappkit/nrappkit.gyp -@@ -142,26 +142,35 @@ - 'R_DEFINED_UINT2=uint16_t', - 'R_DEFINED_INT4=int32_t', - 'R_DEFINED_UINT4=uint32_t', - 'R_DEFINED_INT8=int64_t', - 'R_DEFINED_UINT8=uint64_t', - ], - - 'conditions' : [ -- ## Mac -+ ## Mac and BSDs - [ 'OS == "mac"', { -+ 'defines' : [ -+ 'DARWIN', -+ ], -+ }], -+ [ 'os_bsd == 1', { -+ 'defines' : [ -+ 'BSD', -+ ], -+ }], -+ [ 'OS == "mac" or os_bsd == 1', { - 'cflags_mozilla': [ - '-Wall', - '-Wno-parentheses', - '-Wno-strict-prototypes', - '-Wmissing-prototypes', - ], - 'defines' : [ -- 'DARWIN', - 'HAVE_LIBM=1', - 'HAVE_STRDUP=1', - 'HAVE_STRLCPY=1', - 'HAVE_SYS_TIME_H=1', - 'HAVE_VFPRINTF=1', - 'NEW_STDIO' - 'RETSIGTYPE=void', - 'TIME_WITH_SYS_TIME_H=1', -diff --git media/mtransport/third_party/nrappkit/src/log/r_log.c media/mtransport/third_party/nrappkit/src/log/r_log.c -index efb7ef2..aebf578 100644 ---- media/mtransport/third_party/nrappkit/src/log/r_log.c -+++ media/mtransport/third_party/nrappkit/src/log/r_log.c -@@ -43,16 +43,17 @@ static char *RCSSTRING __UNUSED__ ="$Id: r_log.c,v 1.10 2008/11/25 22:25:18 adam - #ifdef LINUX - #define _BSD_SOURCE - #endif - - #include "r_log.h" - #include "hex.h" - - #include <string.h> -+#include <errno.h> - #ifndef _MSC_VER - #include <strings.h> - #include <syslog.h> - #endif - #include <registry.h> - #include <time.h> - - -diff --git media/mtransport/third_party/nrappkit/src/port/generic/include/sys/queue.h media/mtransport/third_party/nrappkit/src/port/generic/include/sys/queue.h -index bcb1ec0..bb73591 100644 ---- media/mtransport/third_party/nrappkit/src/port/generic/include/sys/queue.h -+++ media/mtransport/third_party/nrappkit/src/port/generic/include/sys/queue.h -@@ -33,7 +33,7 @@ - #ifndef _SYS_QUEUE_H_ - #define _SYS_QUEUE_H_ - --#ifndef DARWIN -+#if !defined(__FreeBSD__) && !defined(DARWIN) - #include <stddef.h> - #define __offsetof offsetof - #endif -diff --git media/mtransport/third_party/nrappkit/src/util/util.c media/mtransport/third_party/nrappkit/src/util/util.c -index a7d4ff1..ff11a60 100644 ---- media/mtransport/third_party/nrappkit/src/util/util.c -+++ media/mtransport/third_party/nrappkit/src/util/util.c -@@ -40,16 +40,17 @@ - static char *RCSSTRING __UNUSED__ ="$Id: util.c,v 1.5 2007/11/21 00:09:13 adamcain Exp $"; - - #ifndef WIN32 - #include <sys/uio.h> - #include <pwd.h> - #include <dirent.h> - #endif - #include <string.h> -+#include <errno.h> - #include <ctype.h> - #include <sys/stat.h> - #ifdef OPENSSL - #include <openssl/evp.h> - #endif - #include "nr_common.h" - #include "r_common.h" - #include "registry.h" -diff --git media/webrtc/signaling/signaling.gyp media/webrtc/signaling/signaling.gyp -index 2a91e3d..31de641 100644 ---- media/webrtc/signaling/signaling.gyp -+++ media/webrtc/signaling/signaling.gyp -@@ -212,16 +212,29 @@ - 'SIPCC_BUILD', - 'HAVE_WINSOCK2_H', - 'CPR_STDINT_INCLUDE=\\"mozilla/StandardInteger.h\\"' - ], - - 'cflags_mozilla': [ - ], - }], -+ ['os_bsd==1', { -+ 'include_dirs': [ -+ ], -+ 'defines': [ -+ # avoiding pointless ifdef churn -+ 'SIP_OS_OSX', -+ 'OSX', -+ 'SECLIB_OPENSSL', -+ ], -+ -+ 'cflags_mozilla': [ -+ ], -+ }], - ['OS=="mac"', { - 'include_dirs': [ - ], - 'defines': [ - 'SIP_OS_OSX', - 'OSX', - '_FORTIFY_SOURCE=2', - ], -@@ -747,17 +760,17 @@ - 'EXTERNAL_TICK_REQUIRED', - 'GIPS_VER=3480', - ], - - 'cflags_mozilla': [ - ], - - }], -- ['OS=="mac"', { -+ ['OS=="mac" or os_bsd==1', { - - 'include_dirs': [ - ], - - 'sources': [ - # SIPSTACK - './src/sipcc/core/sipstack/sip_platform_task.c', - -@@ -792,24 +805,23 @@ - './src/sipcc/cpr/darwin/cpr_darwin_timers_using_select.c', - './src/sipcc/cpr/darwin/cpr_darwin_tst.h', - './src/sipcc/cpr/darwin/cpr_darwin_types.h', - ], - - - 'defines' : [ - 'SIP_OS_OSX', -- '_POSIX_SOURCE', -+ # using BSD extensions, leave _POSIX_SOURCE undefined - 'CPR_MEMORY_LITTLE_ENDIAN', - 'NO_SOCKET_POLLING', - 'USE_TIMER_SELECT_BASED', - 'FULL_BUILD', - 'STUBBED_OUT', - 'USE_PRINTF', -- '_DARWIN_C_SOURCE', - 'NO_NSPR_10_SUPPORT', - ], - - 'cflags_mozilla': [ - ], - }], - ], - -diff --git media/webrtc/signaling/src/sipcc/cpr/darwin/cpr_darwin_ipc.c media/webrtc/signaling/src/sipcc/cpr/darwin/cpr_darwin_ipc.c -index a7c47e1..4f191de 100644 ---- media/webrtc/signaling/src/sipcc/cpr/darwin/cpr_darwin_ipc.c -+++ media/webrtc/signaling/src/sipcc/cpr/darwin/cpr_darwin_ipc.c -@@ -317,21 +317,25 @@ cprGetMessage (cprMsgQueue_t msgQueue, boolean waitForever, void **ppUserData) - { - static const char fname[] = "cprGetMessage"; - - void *buffer = 0; - cpr_msg_queue_t *msgq; - cpr_msgq_node_t *node; - struct timespec timeout; - struct timeval tv; -+#ifndef __APPLE__ -+ struct timezone tz; -+#else - // On the iPhone, there is a DarwinAlias problem with "timezone" - struct _timezone { - int tz_minuteswest; /* of Greenwich */ - int tz_dsttime; /* type of dst correction to apply */ - } tz; -+#endif - - /* Initialize ppUserData */ - if (ppUserData) { - *ppUserData = NULL; - } - - msgq = (cpr_msg_queue_t *) msgQueue; - if (msgq == NULL) { -diff --git media/webrtc/signaling/test/Makefile.in media/webrtc/signaling/test/Makefile.in -index a30e330..cfbd8a3 100644 ---- media/webrtc/signaling/test/Makefile.in -+++ media/webrtc/signaling/test/Makefile.in -@@ -81,17 +81,17 @@ endif - ifeq (qt,$(MOZ_WIDGET_TOOLKIT)) - LIBS += \ - $(XLIBS) \ - $(TK_LIBS) \ - $(MOZ_PANGO_LIBS) \ - $(NULL) - endif - --ifeq ($(OS_TARGET),Linux) -+ifneq (,$(filter Linux DragonFly FreeBSD NetBSD OpenBSD,$(OS_TARGET))) - LIBS += \ - $(MOZ_CAIRO_OSLIBS) \ - $(NULL) - endif - - ifeq ($(OS_TARGET),Darwin) - LIBS += \ - -framework AudioToolbox \ -diff --git media/webrtc/trunk/tools/gyp/pylib/gyp/generator/mozmake.py media/webrtc/trunk/tools/gyp/pylib/gyp/generator/mozmake.py -index 338d0b7..2241d41 100644 ---- media/webrtc/trunk/tools/gyp/pylib/gyp/generator/mozmake.py -+++ media/webrtc/trunk/tools/gyp/pylib/gyp/generator/mozmake.py -@@ -1,16 +1,17 @@ - # Copyright (c) 2012 Mozilla Foundation. All rights reserved. - # Use of this source code is governed by a BSD-style license that can be - # found in the LICENSE file. - - import collections - import gyp - import gyp.common - import sys -+import platform - import os - import re - import shlex - - generator_wants_sorted_dependencies = True - - generator_default_variables = { - } -@@ -107,30 +108,44 @@ endif - - def ensure_directory_exists(path): - dir = os.path.dirname(path) - if dir and not os.path.exists(dir): - os.makedirs(dir) - - def GetFlavor(params): - """Returns |params.flavor| if it's set, the system's default flavor else.""" -+ system = platform.system().lower() - flavors = { -- 'win32': 'win', -- 'darwin': 'mac', -- 'sunos5': 'solaris', -- 'freebsd7': 'freebsd', -- 'freebsd8': 'freebsd', -+ 'microsoft': 'win', -+ 'windows' : 'win', -+ 'darwin' : 'mac', -+ 'sunos' : 'solaris', -+ 'dragonfly': 'bsd', -+ 'freebsd' : 'bsd', -+ 'netbsd' : 'bsd', -+ 'openbsd' : 'bsd', - } -- flavor = flavors.get(sys.platform, 'linux') -- return params.get('flavor', flavor) -+ -+ if 'flavor' in params: -+ return params['flavor'] -+ if system.startswith('cygwin'): -+ return 'win' -+ if system in flavors: -+ return flavors[system] -+ -+ return 'linux' - - - def CalculateVariables(default_variables, params): -+ flavor = GetFlavor(params) -+ if flavor == 'bsd': -+ flavor = platform.system().lower() - generator_flags = params.get('generator_flags', {}) -- default_variables['OS'] = generator_flags.get('os', GetFlavor(params)) -+ default_variables['OS'] = generator_flags.get('os', flavor) - - - def CalculateGeneratorInputInfo(params): - """Calculate the generator specific info that gets fed to input (called by - gyp).""" - generator_flags = params.get('generator_flags', {}) - if generator_flags.get('adjust_static_libraries', False): - global generator_wants_static_library_dependencies_adjusted diff --git a/www/libxul/files/patch-bug810716 b/www/libxul/files/patch-bug810716 deleted file mode 100644 index 8c08e9a66986..000000000000 --- a/www/libxul/files/patch-bug810716 +++ /dev/null @@ -1,68 +0,0 @@ -diff --git configure.in configure.in -index 2084be9..eb6eeb2 100644 ---- configure.in -+++ configure.in -@@ -3369,14 +3369,19 @@ fi - AC_CACHE_CHECK( - [for res_ninit()], - ac_cv_func_res_ninit, -- [AC_TRY_LINK([ -+ [AC_TRY_RUN([ - #ifdef linux - #define _BSD_SOURCE 1 - #endif -+ #include <sys/types.h> -+ #include <netinet/in.h> -+ #include <arpa/nameser.h> - #include <resolv.h> -- ], -- [int foo = res_ninit(&_res);], -+ int main(int argc, char **argv){ -+ int foo = res_ninit(&_res); -+ }], - [ac_cv_func_res_ninit=yes], -+ [ac_cv_func_res_ninit=no], - [ac_cv_func_res_ninit=no]) - ]) - -diff --git extensions/auth/nsAuthGSSAPI.cpp extensions/auth/nsAuthGSSAPI.cpp -index e828beb..6444246 100644 ---- extensions/auth/nsAuthGSSAPI.cpp -+++ extensions/auth/nsAuthGSSAPI.cpp -@@ -39,6 +39,9 @@ typedef KLStatus (*KLCacheHasValidTickets_type)( - #endif - - #if defined(HAVE_RES_NINIT) -+#include <sys/types.h> -+#include <netinet/in.h> -+#include <arpa/nameser.h> - #include <resolv.h> - #endif - -diff --git js/src/configure.in js/src/configure.in -index e25f569..b9722f9 100644 ---- js/src/configure.in -+++ js/src/configure.in -@@ -2797,14 +2797,19 @@ fi - AC_CACHE_CHECK( - [for res_ninit()], - ac_cv_func_res_ninit, -- [AC_TRY_LINK([ -+ [AC_TRY_RUN([ - #ifdef linux - #define _BSD_SOURCE 1 - #endif -+ #include <sys/types.h> -+ #include <netinet/in.h> -+ #include <arpa/nameser.h> - #include <resolv.h> -- ], -- [int foo = res_ninit(&_res);], -+ int main(int argc, char **argv){ -+ int foo = res_ninit(&_res); -+ }], - [ac_cv_func_res_ninit=yes], -+ [ac_cv_func_res_ninit=no], - [ac_cv_func_res_ninit=no]) - ]) - diff --git a/www/libxul/files/patch-bug826985 b/www/libxul/files/patch-bug826985 index fe55ff667281..b8eee831f66d 100644 --- a/www/libxul/files/patch-bug826985 +++ b/www/libxul/files/patch-bug826985 @@ -26,22 +26,23 @@ index 55e4cd1..76567b3 100644 dnl enable once Signaling lands MOZ_WEBRTC_SIGNALING=1 AC_DEFINE(MOZ_WEBRTC_SIGNALING) -@@ -8981,6 +8984,10 @@ elif test "${OS_TARGET}" = "Android"; then - fi - fi - -+if test -n "$MOZ_LIBV4L2_LIBS"; then -+ EXTRA_GYP_DEFINES="$EXTRA_GYP_DEFINES -D use_libv4l2=1" -+fi -+ - if test -n "$MOZ_WEBRTC"; then - AC_MSG_RESULT("generating WebRTC Makefiles...") - +diff --git build/gyp.mozbuild build/gyp.mozbuild +index b483cd1..f1dd1f0 100644 +--- build/gyp.mozbuild ++++ build/gyp.mozbuild +@@ -11,6 +11,7 @@ gyp_vars = { + 'have_ethtool_cmd_speed_hi': 1 if CONFIG['MOZ_WEBRTC_HAVE_ETHTOOL_SPEED_HI'] else 0, + 'include_alsa_audio': 1 if CONFIG['MOZ_ALSA'] else 0, + 'include_pulse_audio': 1 if CONFIG['MOZ_PULSEAUDIO'] else 0, ++ 'use_libv4l2': 1 if CONFIG['MOZ_LIBV4L2_LIBS'] else 0, + # basic stuff for everything + 'include_internal_video_render': 0, + 'clang_use_chrome_plugins': 0, diff --git media/webrtc/signaling/test/Makefile.in media/webrtc/signaling/test/Makefile.in index b483cd1..f1dd1f0 100644 --- media/webrtc/signaling/test/Makefile.in +++ media/webrtc/signaling/test/Makefile.in -@@ -17,6 +17,7 @@ LIBS = \ +@@ -7,6 +7,7 @@ LIBS = \ $(NSPR_LIBS) \ $(NSS_LIBS) \ $(REALTIME_LIBS) \ @@ -53,7 +54,7 @@ diff --git media/webrtc/trunk/webrtc/modules/video_capture/linux/device_info_lin index 239a292..bab496c 100644 --- media/webrtc/trunk/webrtc/modules/video_capture/linux/device_info_linux.cc +++ media/webrtc/trunk/webrtc/modules/video_capture/linux/device_info_linux.cc -@@ -26,11 +26,23 @@ +@@ -25,10 +25,21 @@ #else #include <linux/videodev2.h> #endif @@ -61,9 +62,8 @@ index 239a292..bab496c 100644 +#include <libv4l2.h> +#endif - #include "ref_count.h" - #include "trace.h" - + #include "webrtc/system_wrappers/interface/ref_count.h" + #include "webrtc/system_wrappers/interface/trace.h" +#ifdef HAVE_LIBV4L2 +#define open v4l2_open @@ -73,10 +73,9 @@ index 239a292..bab496c 100644 +#define mmap v4l2_mmap +#define munmap v4l2_munmap +#endif -+ + namespace webrtc { - namespace videocapturemodule @@ -130,6 +142,11 @@ WebRtc_Word32 DeviceInfoLinux::GetDeviceName( memset(deviceNameUTF8, 0, deviceNameLength); memcpy(cameraName, cap.card, sizeof(cap.card)); @@ -152,13 +151,16 @@ index d46b5aa..e452223 100644 ], diff --git toolkit/library/Makefile.in toolkit/library/Makefile.in index 9c16ffa..1db3794 100644 ---- toolkit/library/Makefile.in -+++ toolkit/library/Makefile.in -@@ -405,6 +405,7 @@ endif +--- toolkit/library/libxul.mk ++++ toolkit/library/libxul.mk +@@ -182,6 +182,10 @@ endif + EXTRA_DSO_LDOPTS += $(call EXPAND_LIBNAME_PATH,gkmedias,$(DIST)/lib) - ifdef MOZ_WEBRTC ++ifdef MOZ_LIBV4L2_LIBS +EXTRA_DSO_LDOPTS += $(MOZ_LIBV4L2_LIBS) - ifdef MOZ_PEERCONNECTION - COMPONENT_LIBS += peerconnection - endif ++endif ++ + ifdef MOZ_WEBRTC + ifeq (WINNT,$(OS_TARGET)) + EXTRA_DSO_LDOPTS += \ diff --git a/www/libxul/files/patch-z-bug847568 b/www/libxul/files/patch-bug847568 index 9c8105691ab2..1504654a4341 100644 --- a/www/libxul/files/patch-z-bug847568 +++ b/www/libxul/files/patch-bug847568 @@ -33,7 +33,7 @@ diff --git configure.in configure.in index ac38f40..87536b7 100644 --- configure.in +++ configure.in -@@ -8032,6 +8032,56 @@ if test "$USE_FC_FREETYPE"; then +@@ -8032,6 +8032,52 @@ if test "$USE_FC_FREETYPE"; then fi dnl ======================================================== @@ -46,9 +46,7 @@ index ac38f40..87536b7 100644 +MOZ_NATIVE_HARFBUZZ=) + +if test -n "$MOZ_NATIVE_HARFBUZZ"; then -+ PKG_CHECK_MODULES(MOZ_HARFBUZZ, harfbuzz >= 0.9.16) -+else -+ MOZ_HARFBUZZ_LIBS='$(DEPTH)/gfx/harfbuzz/src/$(LIB_PREFIX)mozharfbuzz.$(LIB_SUFFIX)' ++ PKG_CHECK_MODULES(MOZ_HARFBUZZ, harfbuzz >= 0.9.25) +fi + +AC_SUBST(MOZ_NATIVE_HARFBUZZ) @@ -64,7 +62,7 @@ index ac38f40..87536b7 100644 +MOZ_NATIVE_GRAPHITE2=) + +if test -n "$MOZ_NATIVE_GRAPHITE2"; then -+ PKG_CHECK_MODULES(MOZ_GRAPHITE, graphite2) ++ PKG_CHECK_MODULES(MOZ_GRAPHITE2, graphite2) + + dnl graphite2.pc has bogus version, check manually + AC_TRY_COMPILE([ #include <graphite2/Font.h> @@ -73,57 +71,35 @@ index ac38f40..87536b7 100644 + * 100 + GR2_VERSION_BUGFIX >= \ + (major) * 10000 + (minor) * 100 + (bugfix) ) + ], [ -+ #if !GR2_VERSION_REQUIRE(1,2,3) ++ #if !GR2_VERSION_REQUIRE(1,2,4) + #error "Insufficient graphite2 version." + #endif + ], [], + [AC_MSG_ERROR([--with-system-graphite2 requested but no working libgraphite2 found])]) -++else -++ MOZ_GRAPHITE_LIBS='$(DEPTH)/gfx/graphite2/src/$(LIB_PREFIX)mozgraphite2.$(LIB_SUFFIX)' +fi + +AC_SUBST(MOZ_NATIVE_GRAPHITE2) -+AC_SUBST(MOZ_GRAPHITE_CFLAGS) -+AC_SUBST(MOZ_GRAPHITE_LIBS) ++AC_SUBST(MOZ_GRAPHITE2_CFLAGS) ++AC_SUBST(MOZ_GRAPHITE2_LIBS) + +dnl ======================================================== dnl Check for pixman and cairo dnl ======================================================== -@@ -8379,18 +8412,6 @@ QCMS_LIBS='$(DEPTH)/gfx/qcms/$(LIB_PREFI - AC_SUBST(QCMS_LIBS) +diff --git content/base/src/moz.build content/base/src/moz.build +index d4f6380..0ee55df 100644 +--- content/base/src/moz.build ++++ content/base/src/moz.build +@@ -179,6 +179,9 @@ SOURCES += [ + 'nsObjectLoadingContent.cpp', + ] - dnl ======================================================== --dnl HarfBuzz --dnl ======================================================== --MOZ_HARFBUZZ_LIBS='$(DEPTH)/gfx/harfbuzz/src/$(LIB_PREFIX)mozharfbuzz.$(LIB_SUFFIX)' --AC_SUBST(MOZ_HARFBUZZ_LIBS) -- --dnl ======================================================== --dnl SIL Graphite --dnl ======================================================== --MOZ_GRAPHITE_LIBS='$(DEPTH)/gfx/graphite2/src/$(LIB_PREFIX)mozgraphite2.$(LIB_SUFFIX)' --AC_SUBST(MOZ_GRAPHITE_LIBS) -- --dnl ======================================================== - dnl OTS - dnl ======================================================== - MOZ_OTS_LIBS='$(DEPTH)/gfx/ots/src/$(LIB_PREFIX)mozots.$(LIB_SUFFIX)' -diff --git content/base/src/Makefile.in content/base/src/Makefile.in -index a618096..596901a 100644 ---- content/base/src/Makefile.in -+++ content/base/src/Makefile.in -@@ -5,6 +5,10 @@ - - include $(topsrcdir)/config/rules.mk - -+ifdef MOZ_NATIVE_HARFBUZZ -+nsContentUtils.$(OBJ_SUFFIX): CXXFLAGS+=$(MOZ_HARFBUZZ_CFLAGS) -+endif ++if CONFIG['MOZ_NATIVE_HARFBUZZ']: ++ SOURCES['nsContentUtils.cpp'].flags += [CONFIG['MOZ_HARFBUZZ_CFLAGS']] + - # gcc requires -msse2 for this file since it uses SSE2 intrinsics. (See bug - # 585538 comment 12.) - ifneq (,$(INTEL_ARCHITECTURE)) + EXTRA_COMPONENTS += [ + 'contentAreaDropListener.js', + 'contentAreaDropListener.manifest', diff --git gfx/moz.build gfx/moz.build index 519aa46..6929751 100644 --- gfx/moz.build @@ -174,7 +150,7 @@ index 45c36ae..79d32cf 100644 CFLAGS += $(MOZ_CAIRO_CFLAGS) $(TK_CFLAGS) +ifdef MOZ_NATIVE_GRAPHITE2 -+CXXFLAGS += $(MOZ_GRAPHITE_CFLAGS) ++CXXFLAGS += $(MOZ_GRAPHITE2_CFLAGS) +endif + +ifdef MOZ_NATIVE_HARFBUZZ @@ -196,29 +172,6 @@ index f6b9f7c..60863f4 100644 +ifdef MOZ_NATIVE_HARFBUZZ +CXXFLAGS += $(MOZ_HARFBUZZ_CFLAGS) +endif -diff --git layout/media/Makefile.in layout/media/Makefile.in -index 1cacbd7..a8cd156 100644 ---- layout/media/Makefile.in -+++ layout/media/Makefile.in -@@ -18,10 +18,16 @@ endif - SHARED_LIBRARY_LIBS = \ - $(MOZ_OTS_LIBS) \ - $(QCMS_LIBS) \ -- $(MOZ_GRAPHITE_LIBS) \ -- $(MOZ_HARFBUZZ_LIBS) \ - $(NULL) - -+ifndef MOZ_NATIVE_GRAPHITE2 -+SHARED_LIBRARY_LIBS += $(MOZ_GRAPHITE_LIBS) -+endif -+ -+ifndef MOZ_NATIVE_HARFBUZZ -+SHARED_LIBRARY_LIBS += $(MOZ_HARFBUZZ_LIBS) -+endif -+ - ifdef MOZ_TREE_CAIRO - SHARED_LIBRARY_LIBS += $(MOZ_CAIRO_LIBS) - endif diff --git netwerk/dns/Makefile.in netwerk/dns/Makefile.in index 1cacbd7..f5d72bb 100644 --- netwerk/dns/Makefile.in @@ -234,16 +187,16 @@ index 1cacbd7..f5d72bb 100644 # Generate the include file containing compact, static definitions # for effective TLD data. etld_data.inc: $(srcdir)/prepare_tlds.py $(srcdir)/effective_tld_names.dat -diff --git toolkit/library/Makefile.in toolkit/library/Makefile.in +diff --git toolkit/library/libxul.mk toolkit/library/libxul.mk index 67f0db9..d42137a 100644 ---- toolkit/library/Makefile.in -+++ toolkit/library/Makefile.in +--- toolkit/library/libxul.mk ++++ toolkit/library/libxul.mk @@ -89,6 +89,14 @@ ifndef MOZ_TREE_PIXMAN EXTRA_DSO_LDOPTS += $(MOZ_PIXMAN_LIBS) endif +ifdef MOZ_NATIVE_GRAPHITE2 -+EXTRA_DSO_LDOPTS += $(MOZ_GRAPHITE_LIBS) ++EXTRA_DSO_LDOPTS += $(MOZ_GRAPHITE2_LIBS) +endif + +ifdef MOZ_NATIVE_HARFBUZZ diff --git a/www/libxul/files/patch-bug851992 b/www/libxul/files/patch-bug851992 deleted file mode 100644 index 4c322188c47c..000000000000 --- a/www/libxul/files/patch-bug851992 +++ /dev/null @@ -1,339 +0,0 @@ -diff --git a/config/Makefile.in b/config/Makefile.in ---- config/Makefile.in -+++ config/Makefile.in -@@ -97,16 +97,17 @@ export:: $(export-preqs) - -DMOZ_TREE_PIXMAN=$(MOZ_TREE_PIXMAN) \ - -DMOZ_NATIVE_HUNSPELL=$(MOZ_NATIVE_HUNSPELL) \ - -DMOZ_NATIVE_BZ2=$(MOZ_NATIVE_BZ2) \ - -DMOZ_NATIVE_ZLIB=$(MOZ_NATIVE_ZLIB) \ - -DMOZ_NATIVE_PNG=$(MOZ_NATIVE_PNG) \ - -DMOZ_NATIVE_JPEG=$(MOZ_NATIVE_JPEG) \ - -DMOZ_NATIVE_LIBEVENT=$(MOZ_NATIVE_LIBEVENT) \ - -DMOZ_NATIVE_LIBVPX=$(MOZ_NATIVE_LIBVPX) \ -+ -DMOZ_NATIVE_ICU=$(MOZ_NATIVE_ICU) \ - $(srcdir)/system-headers | $(PERL) $(topsrcdir)/nsprpub/config/make-system-wrappers.pl system_wrappers - $(INSTALL) system_wrappers $(DIST) - - GARBAGE_DIRS += system_wrappers - endif - - ifdef WRAP_STL_INCLUDES - ifdef GNU_CXX -diff --git a/config/system-headers b/config/system-headers ---- config/system-headers -+++ config/system-headers -@@ -1125,8 +1125,19 @@ gst/video/video.h - sys/msg.h - sys/ipc.h - sys/thr.h - sys/user.h - kvm.h - spawn.h - err.h - xlocale.h -+#if MOZ_NATIVE_ICU==1 -+unicode/locid.h -+unicode/numsys.h -+unicode/ucal.h -+unicode/ucol.h -+unicode/udat.h -+unicode/udatpg.h -+unicode/uenum.h -+unicode/unum.h -+unicode/ustring.h -+#endif -diff --git a/configure.in b/configure.in ---- configure.in -+++ configure.in -@@ -4134,16 +4134,32 @@ if test -n "$MOZ_NATIVE_FFI"; then - PKG_CHECK_MODULES(MOZ_FFI, libffi > 3.0.9) - else - PKG_CHECK_MODULES(MOZ_FFI, libffi >= 3.0.9) - fi - MOZ_JS_STATIC_LIBS="$MOZ_JS_STATIC_LIBS $MOZ_FFI_LIBS" - fi - - dnl ======================================================== -+dnl system icu support -+dnl ======================================================== -+MOZ_NATIVE_ICU= -+MOZ_ARG_WITH_BOOL(system-icu, -+[ --with-system-icu -+ Use system icu (located with pkgconfig)], -+ MOZ_NATIVE_ICU=1) -+ -+if test -n "$MOZ_NATIVE_ICU"; then -+ PKG_CHECK_MODULES(MOZ_ICU, icu-i18n >= 50.1) -+ MOZ_JS_STATIC_LIBS="$MOZ_JS_STATIC_LIBS $MOZ_ICU_LIBS" -+fi -+ -+AC_SUBST(MOZ_NATIVE_ICU) -+ -+dnl ======================================================== - dnl Java SDK support - dnl ======================================================== - - JAVA_BIN_PATH= - MOZ_ARG_WITH_STRING(java-bin-path, - [ --with-java-bin-path=dir - Location of Java binaries (java, javac, jar)], - JAVA_BIN_PATH=$withval) -diff --git a/js/src/Makefile.in b/js/src/Makefile.in ---- js/src/Makefile.in.orig 2013-10-22 08:19:02.000000000 +0200 -+++ js/src/Makefile.in 2013-10-29 10:11:58.272605098 +0100 -@@ -237,10 +237,14 @@ - # ICU headers need to be available whether we build with the complete - # Internationalization API or not - ICU stubs rely on them. - -+ifdef MOZ_NATIVE_ICU -+LOCAL_INCLUDES += $(MOZ_ICU_CFLAGS) -+else - LOCAL_INCLUDES += \ - -I$(topsrcdir)/../../intl/icu/source/common \ - -I$(topsrcdir)/../../intl/icu/source/i18n \ - $(NULL) -+endif - - ifdef ENABLE_INTL_API - -@@ -260,6 +264,7 @@ - ICU_MAKE = $(MAKE) - endif - -+ifndef MOZ_NATIVE_ICU - # - Build ICU as part of the "export" target, so things get built - # in the right order. - # - ICU requires GNU make according to its readme.html. pymake can't be used -@@ -276,6 +281,7 @@ - $(call SUBMAKE,$@,intl/icu) - - endif -+endif - - # - # END ECMAScript Internationalization API -@@ -413,7 +419,11 @@ - DEFINES += -DUSE_ZLIB - endif - --SHARED_LIBRARY_LIBS += $(ICU_LIBS) -+ifdef MOZ_NATIVE_ICU -+EXTRA_DSO_LDOPTS += $(MOZ_ICU_LIBS) -+else -+SHARED_LIBRARY_LIBS += $(MOZ_ICU_LIBS) -+endif - - # Prevent floating point errors caused by VC++ optimizations - ifdef _MSC_VER -diff --git a/js/src/config/Makefile.in b/js/src/config/Makefile.in ---- js/src/config/Makefile.in -+++ js/src/config/Makefile.in -@@ -54,16 +54,17 @@ include $(topsrcdir)/config/rules.mk - - HOST_CFLAGS += -DUNICODE -D_UNICODE - - ifdef WRAP_SYSTEM_INCLUDES - export:: \ - $(call mkdir_deps,system_wrappers_js) \ - $(NULL) - $(PYTHON) $(srcdir)/Preprocessor.py $(DEFINES) $(ACDEFINES) \ -+ -DMOZ_NATIVE_ICU=$(MOZ_NATIVE_ICU) \ - $(srcdir)/system-headers | $(PERL) $(srcdir)/make-system-wrappers.pl system_wrappers_js - $(INSTALL) system_wrappers_js $(DIST) - - GARBAGE_DIRS += system_wrappers_js - endif - - GARBAGE += $(srcdir)/*.pyc *.pyc - -diff --git a/js/src/config/system-headers b/js/src/config/system-headers ---- js/src/config/system-headers -+++ js/src/config/system-headers -@@ -1125,8 +1125,19 @@ gst/video/video.h - sys/msg.h - sys/ipc.h - sys/thr.h - sys/user.h - kvm.h - spawn.h - err.h - xlocale.h -+#if MOZ_NATIVE_ICU==1 -+unicode/locid.h -+unicode/numsys.h -+unicode/ucal.h -+unicode/ucol.h -+unicode/udat.h -+unicode/udatpg.h -+unicode/uenum.h -+unicode/unum.h -+unicode/ustring.h -+#endif -diff --git a/js/src/configure.in b/js/src/configure.in ---- js/src/configure.in -+++ js/src/configure.in -@@ -4406,59 +4406,68 @@ if test "$ACCESSIBILITY" -a "$MOZ_ENABLE - AC_DEFINE_UNQUOTED(ATK_MINOR_VERSION, $ATK_MINOR_VERSION) - AC_DEFINE_UNQUOTED(ATK_REV_VERSION, $ATK_REV_VERSION) - fi - - - dnl ======================================================== - dnl ECMAScript Internationalization API Support (uses ICU) - dnl ======================================================== -+ICU_LIB_NAMES= -+MOZ_NATIVE_ICU= -+MOZ_ARG_WITH_BOOL(system-icu, -+[ --with-system-icu -+ Use system icu (located with pkgconfig)], -+ MOZ_NATIVE_ICU=1) -+ -+if test -n "$MOZ_NATIVE_ICU"; then -+ PKG_CHECK_MODULES(MOZ_ICU, icu-i18n >= 50.1) -+fi - - if test -n "$JS_STANDALONE"; then - ENABLE_INTL_API=1 - fi - MOZ_ARG_ENABLE_BOOL(intl-api, - [ --enable-intl-api Enable ECMAScript Internationalization API (default=yes for standalone JS)], - ENABLE_INTL_API=1, - ENABLE_INTL_API= ) - - dnl Settings for the implementation of the ECMAScript Internationalization API - if test -n "$ENABLE_INTL_API"; then - AC_DEFINE(ENABLE_INTL_API) -- # We build ICU as a static library. -- AC_DEFINE(U_STATIC_IMPLEMENTATION) -- -- case "$OS_TARGET" in -- WINNT) -- ICU_LIB_NAMES="icuin icuuc icudt" -- ;; -- Darwin|Linux) -- ICU_LIB_NAMES="icui18n icuuc icudata" -- ;; -- *) -- AC_MSG_ERROR([ECMAScript Internationalization API is not yet supported on this platform]) -- esac -- -- ICU_LIBS='$(call EXPAND_LIBNAME_PATH,$(ICU_LIB_NAMES),$(DEPTH)/intl/icu/lib)' --else -- ICU_LIB_NAMES= -- ICU_LIBS= -+ -+ if test -z "$MOZ_NATIVE_ICU"; then -+ case "$OS_TARGET" in -+ WINNT) -+ ICU_LIB_NAMES="icuin icuuc icudt" -+ ;; -+ Darwin|Linux) -+ ICU_LIB_NAMES="icui18n icuuc icudata" -+ ;; -+ *) -+ AC_MSG_ERROR([ECMAScript Internationalization API is not yet supported on this platform]) -+ esac -+ MOZ_ICU_LIBS='$(call EXPAND_LIBNAME_PATH,$(ICU_LIB_NAMES),$(DEPTH)/intl/icu/lib)' -+ fi - fi - - AC_SUBST(ENABLE_INTL_API) - AC_SUBST(ICU_LIB_NAMES) --AC_SUBST(ICU_LIBS) -- --dnl Source files that use ICU should have control over which parts of the ICU --dnl namespace they want to use. --AC_DEFINE(U_USING_ICU_NAMESPACE,0) -- -+AC_SUBST(MOZ_ICU_LIBS) -+AC_SUBST(MOZ_NATIVE_ICU) - - dnl Settings for ICU --if test -n "$ENABLE_INTL_API" ; then -+if test -n "$ENABLE_INTL_API" -a -z "$MOZ_NATIVE_ICU"; then -+ dnl We build ICU as a static library. -+ AC_DEFINE(U_STATIC_IMPLEMENTATION) -+ -+ dnl Source files that use ICU should have control over which parts of the ICU -+ dnl namespace they want to use. -+ AC_DEFINE(U_USING_ICU_NAMESPACE,0) -+ - # Set ICU compile options - ICU_CPPFLAGS="" - # don't use icu namespace automatically in client code - ICU_CPPFLAGS="$ICU_CPPFLAGS -DU_USING_ICU_NAMESPACE=0" - # don't include obsolete header files - ICU_CPPFLAGS="$ICU_CPPFLAGS -DU_NO_DEFAULT_INCLUDE_UTF_HEADERS=1" - # remove chunks of the library that we don't need (yet) - ICU_CPPFLAGS="$ICU_CPPFLAGS -DUCONFIG_NO_LEGACY_CONVERSION" -diff --git a/js/src/gdb/Makefile.in b/js/src/gdb/Makefile.in ---- js/src/gdb/Makefile.in -+++ js/src/gdb/Makefile.in -@@ -14,16 +14,20 @@ include $(DEPTH)/config/autoconf.mk - # Building against js_static requires that we declare mfbt sybols "exported" - # on its behalf. - DEFINES += -DEXPORT_JS_API -DIMPL_MFBT - - LIBS = $(DEPTH)/$(LIB_PREFIX)js_static.$(LIB_SUFFIX) $(NSPR_LIBS) $(MOZ_ZLIB_LIBS) - - LOCAL_INCLUDES += -I$(topsrcdir) -I.. - -+ifdef MOZ_NATIVE_ICU -+EXTRA_LIBS += $(MOZ_ICU_LIBS) -+endif -+ - EXTRA_LIBS += $(MOZ_FFI_LIBS) - - # Place a GDB Python auto-load file next to the gdb-tests executable, both - # in the build directory and in the dist/bin directory. - PP_TARGETS += GDB_AUTOLOAD - GDB_AUTOLOAD := gdb-tests-gdb.py.in - GDB_AUTOLOAD_FLAGS := -Dtopsrcdir=$(abspath $(topsrcdir)) - -diff --git a/js/src/jsapi-tests/Makefile.in b/js/src/jsapi-tests/Makefile.in ---- js/src/jsapi-tests/Makefile.in -+++ js/src/jsapi-tests/Makefile.in -@@ -15,16 +15,20 @@ DEFINES += -DEXPORT_JS_API - # Building against js_static requires that we declare mfbt sybols "exported" - # on its behalf. - DEFINES += -DIMPL_MFBT - - LIBS = $(DEPTH)/$(LIB_PREFIX)js_static.$(LIB_SUFFIX) $(NSPR_LIBS) $(MOZ_ZLIB_LIBS) - - LOCAL_INCLUDES += -I$(topsrcdir) -I.. - -+ifdef MOZ_NATIVE_ICU -+EXTRA_LIBS += $(MOZ_ICU_LIBS) -+endif -+ - EXTRA_LIBS += $(MOZ_FFI_LIBS) - - ifdef QEMU_EXE - MOZ_POST_PROGRAM_COMMAND = $(topsrcdir)/build/qemu-wrap --qemu $(QEMU_EXE) --libdir $(CROSS_LIB) - endif - - # Place a GDB Python auto-load file next to the jsapi-tests executable in - # the build directory. -diff --git a/js/src/shell/Makefile.in b/js/src/shell/Makefile.in ---- js/src/shell/Makefile.in -+++ js/src/shell/Makefile.in -@@ -22,16 +22,19 @@ DEFINES += -DEXPORT_JS_API - # Building against js_static requires that we declare mfbt sybols "exported" - # on its behalf. - DEFINES += -DIMPL_MFBT - - LIBS = $(NSPR_LIBS) $(EDITLINE_LIBS) $(DEPTH)/$(LIB_PREFIX)js_static.$(LIB_SUFFIX) $(MOZ_ZLIB_LIBS) - ifdef MOZ_NATIVE_FFI - EXTRA_LIBS += $(MOZ_FFI_LIBS) - endif -+ifdef MOZ_NATIVE_ICU -+EXTRA_LIBS += $(MOZ_ICU_LIBS) -+endif - - LOCAL_INCLUDES += -I$(topsrcdir) -I.. - - ifeq ($(OS_ARCH),Darwin) - ifeq ($(TARGET_CPU),x86_64) - DARWIN_EXE_LDFLAGS += -pagezero_size 10000 -image_base 100000000 - endif - endif diff --git a/www/libxul/files/patch-bug876156 b/www/libxul/files/patch-bug876156 deleted file mode 100644 index 84ecf6170671..000000000000 --- a/www/libxul/files/patch-bug876156 +++ /dev/null @@ -1,13 +0,0 @@ -diff --git mfbt/Atomics.h mfbt/Atomics.h -index d79af6c..40b9336 100644 ---- mfbt/Atomics.h -+++ mfbt/Atomics.h -@@ -35,7 +35,7 @@ - */ - # if !defined(__linux__) && !defined(__OpenBSD__) && \ - (__cplusplus >= 201103L || defined(__GXX_EXPERIMENTAL_CXX0X__)) && \ -- __has_include(<atomic>) -+ __has_include_next(<atomic>) - # define MOZ_HAVE_CXX11_ATOMICS - # endif - /* diff --git a/www/libxul/files/patch-bug878791 b/www/libxul/files/patch-bug878791 deleted file mode 100644 index d8a3612e1702..000000000000 --- a/www/libxul/files/patch-bug878791 +++ /dev/null @@ -1,11 +0,0 @@ ---- toolkit/components/osfile/osfile_unix_allthreads.jsm.orig 2013-05-11 21:19:53.000000000 +0200 -+++ toolkit/components/osfile/osfile_unix_allthreads.jsm 2013-06-02 17:15:05.000000000 +0200 -@@ -40,7 +40,7 @@ if (typeof Components != "undefined") { - // Open libc - let libc; - let libc_candidates = [ "libSystem.B.dylib", -- "libc.so.6", -+ "libc.so.7", - "libc.so" ]; - for (let i = 0; i < libc_candidates.length; ++i) { - try { diff --git a/www/libxul/files/patch-bug886181 b/www/libxul/files/patch-bug886181 deleted file mode 100644 index ed1c4df8348b..000000000000 --- a/www/libxul/files/patch-bug886181 +++ /dev/null @@ -1,11 +0,0 @@ ---- modules/libpref/src/init/all.js~ -+++ modules/libpref/src/init/all.js -@@ -193,7 +193,7 @@ pref("media.webm.enabled", true); - pref("media.dash.enabled", false); - #endif - #ifdef MOZ_GSTREAMER --pref("media.gstreamer.enabled", false); -+pref("media.gstreamer.enabled", true); - #endif - #ifdef MOZ_WEBRTC - pref("media.navigator.enabled", true); diff --git a/www/libxul/files/patch-bug889699 b/www/libxul/files/patch-bug889699 deleted file mode 100644 index fef97da4ac50..000000000000 --- a/www/libxul/files/patch-bug889699 +++ /dev/null @@ -1,175 +0,0 @@ -commit 7eb5827 -Author: Edwin Flores <eflores@mozilla.com> -Date: Sat Jul 20 12:03:08 2013 +1200 - - Bug 889699 - Make gstreamer backend return more accurate results for canPlayType() r=alessandro.d ---- - content/media/gstreamer/GStreamerFormatHelper.cpp | 90 +++++++++++++++++------ - 1 file changed, 66 insertions(+), 24 deletions(-) - -diff --git content/media/gstreamer/GStreamerFormatHelper.cpp content/media/gstreamer/GStreamerFormatHelper.cpp -index f05ff8f..39f1fdf 100644 ---- content/media/gstreamer/GStreamerFormatHelper.cpp -+++ content/media/gstreamer/GStreamerFormatHelper.cpp -@@ -6,7 +6,7 @@ - - #include "GStreamerFormatHelper.h" - #include "nsCharSeparatedTokenizer.h" --#include "nsXPCOMStrings.h" -+#include "nsString.h" - #include "GStreamerLoader.h" - - #define ENTRY_FORMAT(entry) entry[0] -@@ -36,7 +36,7 @@ void GStreamerFormatHelper::Shutdown() { - } - } - --char const *const GStreamerFormatHelper::mContainers[6][2] = { -+static char const *const sContainers[6][2] = { - {"video/mp4", "video/quicktime"}, - {"video/quicktime", "video/quicktime"}, - {"audio/mp4", "audio/x-m4a"}, -@@ -45,7 +45,7 @@ char const *const GStreamerFormatHelper::mContainers[6][2] = { - {"audio/mp3", "audio/mpeg, mpegversion=(int)1"}, - }; - --char const *const GStreamerFormatHelper::mCodecs[9][2] = { -+static char const *const sCodecs[9][2] = { - {"avc1.42E01E", "video/x-h264"}, - {"avc1.42001E", "video/x-h264"}, - {"avc1.58A01E", "video/x-h264"}, -@@ -57,6 +57,15 @@ char const *const GStreamerFormatHelper::mCodecs[9][2] = { - {"mp3", "audio/mpeg, mpegversion=(int)1"}, - }; - -+static char const * const sDefaultCodecCaps[][2] = { -+ {"video/mp4", "video/x-h264"}, -+ {"video/quicktime", "video/x-h264"}, -+ {"audio/mp4", "audio/mpeg, mpegversion=(int)4"}, -+ {"audio/x-m4a", "audio/mpeg, mpegversion=(int)4"}, -+ {"audio/mp3", "audio/mpeg, layer=(int)3"}, -+ {"audio/mpeg", "audio/mpeg, layer=(int)3"} -+}; -+ - GStreamerFormatHelper::GStreamerFormatHelper() - : mFactories(nullptr), - mCookie(static_cast<uint32_t>(-1)) -@@ -66,15 +75,15 @@ GStreamerFormatHelper::GStreamerFormatHelper() - } - - mSupportedContainerCaps = gst_caps_new_empty(); -- for (unsigned int i = 0; i < G_N_ELEMENTS(mContainers); i++) { -- const char* capsString = mContainers[i][1]; -+ for (unsigned int i = 0; i < G_N_ELEMENTS(sContainers); i++) { -+ const char* capsString = sContainers[i][1]; - GstCaps* caps = gst_caps_from_string(capsString); - gst_caps_append(mSupportedContainerCaps, caps); - } - - mSupportedCodecCaps = gst_caps_new_empty(); -- for (unsigned int i = 0; i < G_N_ELEMENTS(mCodecs); i++) { -- const char* capsString = mCodecs[i][1]; -+ for (unsigned int i = 0; i < G_N_ELEMENTS(sCodecs); i++) { -+ const char* capsString = sCodecs[i][1]; - GstCaps* caps = gst_caps_from_string(capsString); - gst_caps_append(mSupportedCodecCaps, caps); - } -@@ -92,6 +101,41 @@ GStreamerFormatHelper::~GStreamerFormatHelper() { - g_list_free(mFactories); - } - -+static GstCaps * -+GetContainerCapsFromMIMEType(const char *aType) { -+ /* convert aMIMEType to gst container caps */ -+ const char* capsString = nullptr; -+ for (uint32_t i = 0; i < G_N_ELEMENTS(sContainers); i++) { -+ if (!strcmp(ENTRY_FORMAT(sContainers[i]), aType)) { -+ capsString = ENTRY_CAPS(sContainers[i]); -+ break; -+ } -+ } -+ -+ if (!capsString) { -+ /* we couldn't find any matching caps */ -+ return nullptr; -+ } -+ -+ return gst_caps_from_string(capsString); -+} -+ -+static GstCaps * -+GetDefaultCapsFromMIMEType(const char *aType) { -+ GstCaps *caps = GetContainerCapsFromMIMEType(aType); -+ -+ for (uint32_t i = 0; i < G_N_ELEMENTS(sDefaultCodecCaps); i++) { -+ if (!strcmp(sDefaultCodecCaps[i][0], aType)) { -+ GstCaps *tmp = gst_caps_from_string(sDefaultCodecCaps[i][1]); -+ -+ gst_caps_append(caps, tmp); -+ return caps; -+ } -+ } -+ -+ return nullptr; -+} -+ - bool GStreamerFormatHelper::CanHandleMediaType(const nsACString& aMIMEType, - const nsAString* aCodecs) { - if (!sLoadOK) { -@@ -101,7 +145,15 @@ bool GStreamerFormatHelper::CanHandleMediaType(const nsACString& aMIMEType, - const char *type; - NS_CStringGetData(aMIMEType, &type, NULL); - -- GstCaps* caps = ConvertFormatsToCaps(type, aCodecs); -+ GstCaps *caps; -+ if (aCodecs && !aCodecs->IsEmpty()) { -+ caps = ConvertFormatsToCaps(type, aCodecs); -+ } else { -+ // Get a minimal set of codec caps for this MIME type we should support so -+ // that we don't overreport MIME types we are able to play. -+ caps = GetDefaultCapsFromMIMEType(type); -+ } -+ - if (!caps) { - return false; - } -@@ -118,21 +170,11 @@ GstCaps* GStreamerFormatHelper::ConvertFormatsToCaps(const char* aMIMEType, - - unsigned int i; - -- /* convert aMIMEType to gst container caps */ -- const char* capsString = nullptr; -- for (i = 0; i < G_N_ELEMENTS(mContainers); i++) { -- if (!strcmp(ENTRY_FORMAT(mContainers[i]), aMIMEType)) { -- capsString = ENTRY_CAPS(mContainers[i]); -- break; -- } -- } -- -- if (!capsString) { -- /* we couldn't find any matching caps */ -+ GstCaps *caps = GetContainerCapsFromMIMEType(aMIMEType); -+ if (!caps) { - return nullptr; - } - -- GstCaps* caps = gst_caps_from_string(capsString); - /* container only */ - if (!aCodecs) { - return caps; -@@ -141,11 +183,11 @@ GstCaps* GStreamerFormatHelper::ConvertFormatsToCaps(const char* aMIMEType, - nsCharSeparatedTokenizer tokenizer(*aCodecs, ','); - while (tokenizer.hasMoreTokens()) { - const nsSubstring& codec = tokenizer.nextToken(); -- capsString = nullptr; -+ const char *capsString = nullptr; - -- for (i = 0; i < G_N_ELEMENTS(mCodecs); i++) { -- if (codec.EqualsASCII(ENTRY_FORMAT(mCodecs[i]))) { -- capsString = ENTRY_CAPS(mCodecs[i]); -+ for (i = 0; i < G_N_ELEMENTS(sCodecs); i++) { -+ if (codec.EqualsASCII(ENTRY_FORMAT(sCodecs[i]))) { -+ capsString = ENTRY_CAPS(sCodecs[i]); - break; - } - } diff --git a/www/libxul/files/patch-bug893397 b/www/libxul/files/patch-bug893397 deleted file mode 100644 index 906f712d58dd..000000000000 --- a/www/libxul/files/patch-bug893397 +++ /dev/null @@ -1,201 +0,0 @@ -diff --git configure.in configure.in -index 549ad06..2878d9f 100644 ---- configure.in -+++ configure.in -@@ -8091,7 +8091,7 @@ case "$OS_TARGET" in - NECKO_WIFI=1 - fi - ;; -- Darwin|SunOS|WINNT) -+ Darwin|FreeBSD|SunOS|WINNT) - NECKO_WIFI=1 - ;; - Linux) -diff --git netwerk/wifi/moz.build netwerk/wifi/moz.build -index 07b01de..11706af 100644 ---- netwerk/wifi/moz.build -+++ netwerk/wifi/moz.build -@@ -31,6 +31,10 @@ if CONFIG['OS_ARCH'] == 'Darwin': - CPP_SOURCES += [ - 'nsWifiScannerMac.cpp', - ] -+elif CONFIG['OS_ARCH'] == 'FreeBSD': -+ CPP_SOURCES += [ -+ 'nsWifiScannerFreeBSD.cpp', -+ ] - elif CONFIG['OS_ARCH'] == 'WINNT': - CPP_SOURCES += [ - 'nsWifiScannerWin.cpp', -diff --git netwerk/wifi/nsWifiScannerFreeBSD.cpp netwerk/wifi/nsWifiScannerFreeBSD.cpp -new file mode 100644 -index 0000000..80d4cb6 ---- /dev/null -+++ netwerk/wifi/nsWifiScannerFreeBSD.cpp -@@ -0,0 +1,167 @@ -+/* 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/. */ -+ -+// Developed by J.R. Oldroyd <fbsd@opal.com>, December 2012. -+ -+// For FreeBSD we use the getifaddrs(3) to obtain the list of interfaces -+// and then check for those with an 802.11 media type and able to return -+// a list of stations. This is similar to ifconfig(8). -+ -+#include <sys/types.h> -+#include <sys/ioctl.h> -+#include <sys/socket.h> -+#include <net/if.h> -+#include <net/if_media.h> -+#include <net80211/ieee80211_ioctl.h> -+ -+#include <ifaddrs.h> -+#include <string.h> -+#include <unistd.h> -+ -+#include "nsWifiAccessPoint.h" -+ -+using namespace mozilla; -+ -+static nsresult -+FreeBSDGetAccessPointData(nsCOMArray<nsWifiAccessPoint> &accessPoints) -+{ -+ // get list of interfaces -+ struct ifaddrs *ifal; -+ if (getifaddrs(&ifal) < 0) { -+ return NS_ERROR_FAILURE; -+ } -+ -+ accessPoints.Clear(); -+ -+ // loop through the interfaces -+ nsresult rv = NS_ERROR_FAILURE; -+ struct ifaddrs *ifa; -+ for (ifa = ifal; ifa; ifa = ifa->ifa_next) { -+ // limit to one interface per address -+ if (ifa->ifa_addr->sa_family != AF_LINK) { -+ continue; -+ } -+ -+ // store interface name in socket structure -+ struct ifreq ifr; -+ memset(&ifr, 0, sizeof(ifr)); -+ strncpy(ifr.ifr_name, ifa->ifa_name, sizeof(ifr.ifr_name)); -+ ifr.ifr_addr.sa_family = AF_LOCAL; -+ -+ // open socket to interface -+ int s = socket(ifr.ifr_addr.sa_family, SOCK_DGRAM, 0); -+ if (s < 0) { -+ continue; -+ } -+ -+ // clear interface media structure -+ struct ifmediareq ifmr; -+ memset(&ifmr, 0, sizeof(ifmr)); -+ strncpy(ifmr.ifm_name, ifa->ifa_name, sizeof(ifmr.ifm_name)); -+ -+ // get interface media information -+ if (ioctl(s, SIOCGIFMEDIA, (caddr_t)&ifmr) < 0) { -+ close(s); -+ continue; -+ } -+ -+ // check interface is a WiFi interface -+ if (IFM_TYPE(ifmr.ifm_active) != IFM_IEEE80211) { -+ close(s); -+ continue; -+ } -+ -+ // perform WiFi scan -+ struct ieee80211req i802r; -+ char iscanbuf[32*1024]; -+ memset(&i802r, 0, sizeof(i802r)); -+ strncpy(i802r.i_name, ifa->ifa_name, sizeof(i802r.i_name)); -+ i802r.i_type = IEEE80211_IOC_SCAN_RESULTS; -+ i802r.i_data = iscanbuf; -+ i802r.i_len = sizeof(iscanbuf); -+ if (ioctl(s, SIOCG80211, &i802r) < 0) { -+ close(s); -+ continue; -+ } -+ -+ // close socket -+ close(s); -+ -+ // loop through WiFi networks and build geoloc-lookup structure -+ char *vsr = (char *) i802r.i_data; -+ unsigned len = i802r.i_len; -+ while (len >= sizeof(struct ieee80211req_scan_result)) { -+ struct ieee80211req_scan_result *isr = -+ (struct ieee80211req_scan_result *) vsr; -+ -+ // determine size of this entry -+ char *id; -+ int idlen; -+ if (isr->isr_meshid_len) { -+ id = vsr + isr->isr_ie_off + isr->isr_ssid_len; -+ idlen = isr->isr_meshid_len; -+ } else { -+ id = vsr + isr->isr_ie_off; -+ idlen = isr->isr_ssid_len; -+ } -+ -+ // copy network data -+ char ssid[IEEE80211_NWID_LEN+1]; -+ strncpy(ssid, id, idlen); -+ ssid[idlen] = '\0'; -+ nsWifiAccessPoint *ap = new nsWifiAccessPoint(); -+ ap->setSSID(ssid, strlen(ssid)); -+ ap->setMac(isr->isr_bssid); -+ ap->setSignal(isr->isr_rssi); -+ accessPoints.AppendObject(ap); -+ rv = NS_OK; -+ -+ // log the data -+ LOG(( "FreeBSD access point: " -+ "SSID: %s, MAC: %02x-%02x-%02x-%02x-%02x-%02x, " -+ "Strength: %d, Channel: %dMHz\n", -+ ssid, isr->isr_bssid[0], isr->isr_bssid[1], isr->isr_bssid[2], -+ isr->isr_bssid[3], isr->isr_bssid[4], isr->isr_bssid[5], -+ isr->isr_rssi, isr->isr_freq)); -+ -+ // increment pointers -+ len -= isr->isr_len; -+ vsr += isr->isr_len; -+ } -+ } -+ -+ freeifaddrs(ifal); -+ -+ return rv; -+} -+ -+nsresult -+nsWifiMonitor::DoScan() -+{ -+ // Regularly get the access point data. -+ -+ nsCOMArray<nsWifiAccessPoint> lastAccessPoints; -+ nsCOMArray<nsWifiAccessPoint> accessPoints; -+ -+ do { -+ nsresult rv = FreeBSDGetAccessPointData(accessPoints); -+ if (NS_FAILED(rv)) -+ return rv; -+ -+ bool accessPointsChanged = !AccessPointsEqual(accessPoints, lastAccessPoints); -+ ReplaceArray(lastAccessPoints, accessPoints); -+ -+ rv = CallWifiListeners(lastAccessPoints, accessPointsChanged); -+ NS_ENSURE_SUCCESS(rv, rv); -+ -+ // wait for some reasonable amount of time. pref? -+ LOG(("waiting on monitor\n")); -+ -+ ReentrantMonitorAutoEnter mon(mReentrantMonitor); -+ mon.Wait(PR_SecondsToInterval(60)); -+ } -+ while (mKeepGoing); -+ -+ return NS_OK; -+} diff --git a/www/libxul/files/patch-bug910875 b/www/libxul/files/patch-bug910875 deleted file mode 100644 index 4f1d5a521e84..000000000000 --- a/www/libxul/files/patch-bug910875 +++ /dev/null @@ -1,102 +0,0 @@ -diff --git media/webrtc/trunk/webrtc/modules/audio_device/audio_device_impl.cc media/webrtc/trunk/webrtc/modules/audio_device/audio_device_impl.cc -index f231b1e..6087696 100644 ---- media/webrtc/trunk/webrtc/modules/audio_device/audio_device_impl.cc -+++ media/webrtc/trunk/webrtc/modules/audio_device/audio_device_impl.cc -@@ -16,7 +16,9 @@ - #include <assert.h> - #include <string.h> - --#if defined(_WIN32) -+#if defined(WEBRTC_DUMMY_AUDIO_BUILD) -+// do not include platform specific headers -+#elif defined(_WIN32) - #include "audio_device_utility_win.h" - #include "audio_device_wave_win.h" - #if defined(WEBRTC_WINDOWS_CORE_AUDIO_BUILD) -@@ -32,14 +34,8 @@ - #include <stdlib.h> - #include "audio_device_utility_android.h" - #include "audio_device_jni_android.h" --#elif defined(WEBRTC_LINUX) -+#elif defined(WEBRTC_LINUX) || defined(WEBRTC_BSD) - #include "audio_device_utility_linux.h" -- #if defined(LINUX_ALSA) -- #include "audio_device_alsa_linux.h" -- #endif -- #if defined(LINUX_PULSE) -- #include "audio_device_pulse_linux.h" -- #endif - #elif defined(WEBRTC_IOS) - #include "audio_device_utility_ios.h" - #include "audio_device_ios.h" -@@ -47,6 +43,12 @@ - #include "audio_device_utility_mac.h" - #include "audio_device_mac.h" - #endif -+#if defined(LINUX_ALSA) -+ #include "audio_device_alsa_linux.h" -+#endif -+#if defined(LINUX_PULSE) -+ #include "audio_device_pulse_linux.h" -+#endif - #include "audio_device_dummy.h" - #include "audio_device_utility_dummy.h" - #include "critical_section_wrapper.h" -@@ -161,7 +163,7 @@ WebRtc_Word32 AudioDeviceModuleImpl::Che - #elif defined(WEBRTC_ANDROID) - platform = kPlatformAndroid; - WEBRTC_TRACE(kTraceInfo, kTraceAudioDevice, _id, "current platform is ANDROID"); --#elif defined(WEBRTC_LINUX) -+#elif defined(WEBRTC_LINUX) || defined(WEBRTC_BSD) - platform = kPlatformLinux; - WEBRTC_TRACE(kTraceInfo, kTraceAudioDevice, _id, "current platform is LINUX"); - #elif defined(WEBRTC_IOS) -@@ -309,7 +311,7 @@ int32_t AudioDeviceModuleImpl::CreatePlatformSpecificObjects() - - // Create the *Linux* implementation of the Audio Device - // --#elif defined(WEBRTC_LINUX) -+#elif defined(WEBRTC_LINUX) || defined(WEBRTC_BSD) - if ((audioLayer == kLinuxPulseAudio) || (audioLayer == kPlatformDefaultAudio)) - { - #if defined(LINUX_PULSE) -@@ -355,7 +357,7 @@ int32_t AudioDeviceModuleImpl::CreatePlatformSpecificObjects() - // - ptrAudioDeviceUtility = new AudioDeviceUtilityLinux(Id()); - } --#endif // #if defined(WEBRTC_LINUX) -+#endif // #if defined(WEBRTC_LINUX) || defined(WEBRTC_BSD) - - // Create the *iPhone* implementation of the Audio Device - // -diff --git media/webrtc/trunk/webrtc/modules/audio_device/test/audio_device_test_api.cc media/webrtc/trunk/webrtc/modules/audio_device/test/audio_device_test_api.cc -index defd7f8..906c4a2 100644 ---- media/webrtc/trunk/webrtc/modules/audio_device/test/audio_device_test_api.cc -+++ media/webrtc/trunk/webrtc/modules/audio_device/test/audio_device_test_api.cc -@@ -197,7 +197,7 @@ class AudioDeviceAPITest: public testing::Test { - // Create default implementation instance - EXPECT_TRUE((audio_device_ = AudioDeviceModuleImpl::Create( - kId, AudioDeviceModule::kPlatformDefaultAudio)) != NULL); --#elif defined(WEBRTC_LINUX) -+#elif defined(WEBRTC_LINUX) || defined(WEBRTC_BSD) - EXPECT_TRUE((audio_device_ = AudioDeviceModuleImpl::Create( - kId, AudioDeviceModule::kWindowsWaveAudio)) == NULL); - EXPECT_TRUE((audio_device_ = AudioDeviceModuleImpl::Create( -@@ -1690,7 +1690,7 @@ TEST_F(AudioDeviceAPITest, CPULoad) { - - // TODO(kjellander): Fix flakiness causing failures on Windows. - // TODO(phoglund): Fix flakiness causing failures on Linux. --#if !defined(_WIN32) && !defined(WEBRTC_LINUX) -+#if !defined(_WIN32) && !defined(WEBRTC_LINUX) && !defined(WEBRTC_BSD) - TEST_F(AudioDeviceAPITest, StartAndStopRawOutputFileRecording) { - // NOTE: this API is better tested in a functional test - CheckInitialPlayoutStates(); -@@ -1759,7 +1759,7 @@ TEST_F(AudioDeviceAPITest, StartAndStopRawInputFileRecording) { - // - size of raw_input_not_recording.pcm shall be 0 - // - size of raw_input_not_recording.pcm shall be > 0 - } --#endif // !WIN32 && !WEBRTC_LINUX -+#endif // !WIN32 && !WEBRTC_LINUX && !defined(WEBRTC_BSD) - - TEST_F(AudioDeviceAPITest, RecordingSampleRate) { - uint32_t sampleRate(0); diff --git a/www/libxul/files/patch-bug916216 b/www/libxul/files/patch-bug916216 deleted file mode 100644 index ca82967fa78c..000000000000 --- a/www/libxul/files/patch-bug916216 +++ /dev/null @@ -1,39 +0,0 @@ ---- media/webrtc/trunk/build/build_config.h~ -+++ media/webrtc/trunk/build/build_config.h -@@ -37,9 +37,15 @@ - #elif defined(_WIN32) - #define OS_WIN 1 - #define TOOLKIT_VIEWS 1 --#elif defined(__FreeBSD__) -+#elif defined(__DragonFly__) -+#define OS_DRAGONFLY 1 -+#define TOOLKIT_GTK -+#elif defined(__FreeBSD__) || defined(__FreeBSD_kernel__) - #define OS_FREEBSD 1 - #define TOOLKIT_GTK -+#elif defined(__NetBSD__) -+#define OS_NETBSD 1 -+#define TOOLKIT_GTK - #elif defined(__OpenBSD__) - #define OS_OPENBSD 1 - #define TOOLKIT_GTK -@@ -56,15 +62,15 @@ - - // For access to standard BSD features, use OS_BSD instead of a - // more specific macro. --#if defined(OS_FREEBSD) || defined(OS_OPENBSD) -+#if defined(OS_DRAGONFLY) || defined(OS_FREEBSD) \ -+ || defined(OS_NETBSD) || defined(OS_OPENBSD) - #define OS_BSD 1 - #endif - - // For access to standard POSIXish features, use OS_POSIX instead of a - // more specific macro. --#if defined(OS_MACOSX) || defined(OS_LINUX) || defined(OS_FREEBSD) || \ -- defined(OS_OPENBSD) || defined(OS_SOLARIS) || defined(OS_ANDROID) || \ -- defined(OS_NACL) -+#if defined(OS_MACOSX) || defined(OS_LINUX) || defined(OS_BSD) || \ -+ defined(OS_SOLARIS) || defined(OS_ANDROID) || defined(OS_NACL) - #define OS_POSIX 1 - #endif - diff --git a/www/libxul/files/patch-bug916589 b/www/libxul/files/patch-bug916589 deleted file mode 100644 index c6c6c58c9175..000000000000 --- a/www/libxul/files/patch-bug916589 +++ /dev/null @@ -1,35 +0,0 @@ -diff --git media/mtransport/third_party/nrappkit/src/port/generic/include/sys/queue.h media/mtransport/third_party/nrappkit/src/port/generic/include/sys/queue.h -index 5b50785..7cf47d5 100644 ---- media/mtransport/third_party/nrappkit/src/port/generic/include/sys/queue.h -+++ media/mtransport/third_party/nrappkit/src/port/generic/include/sys/queue.h -@@ -33,9 +33,10 @@ - #ifndef _SYS_QUEUE_H_ - #define _SYS_QUEUE_H_ - --#if !defined(__FreeBSD__) && !defined(DARWIN) - #include <stddef.h> --#define __offsetof offsetof -+ -+#ifndef offsetof -+#define offsetof(type, field) ((size_t)(&((type *)0)->field)) - #endif - - #define STAILQ_FOREACH_SAFE(var, head, field, tvar) \ -@@ -43,8 +44,6 @@ - (var) && ((tvar) = STAILQ_NEXT((var), field), 1); \ - (var) = (tvar)) - --// #define __offsetof(type, field) ((size_t)(&((type *)0)->field)) -- - /* - * This file defines four types of data structures: singly-linked lists, - * singly-linked tail queues, lists and tail queues. -@@ -285,7 +284,7 @@ struct { \ - (STAILQ_EMPTY((head)) ? \ - NULL : \ - ((struct type *) \ -- ((char *)((head)->stqh_last) - __offsetof(struct type, field)))) -+ ((char *)((head)->stqh_last) - offsetof(struct type, field)))) - - #define STAILQ_NEXT(elm, field) ((elm)->field.stqe_next) - diff --git a/www/libxul/files/patch-bug918177 b/www/libxul/files/patch-bug918177 deleted file mode 100644 index 76dd34ca040a..000000000000 --- a/www/libxul/files/patch-bug918177 +++ /dev/null @@ -1,36 +0,0 @@ -diff --git config/stl-headers config/stl-headers -index c057d8e..dc7f6f0 100644 ---- config/stl-headers -+++ config/stl-headers -@@ -21,6 +21,7 @@ algorithm - atomic - deque - ios -+iosfwd - iostream - iterator - limits -diff --git config/system-headers config/system-headers -index d31c94e..570c82a 100644 ---- config/system-headers -+++ config/system-headers -@@ -469,6 +469,7 @@ IOKit/IOMessage.h - IOKit/pwr_mgt/IOPMLib.h - iomanip - ios -+iosfwd - iostream - iostream.h - iterator -diff --git js/src/config/system-headers js/src/config/system-headers -index d31c94e..570c82a 100644 ---- js/src/config/system-headers -+++ js/src/config/system-headers -@@ -469,6 +469,7 @@ IOKit/IOMessage.h - IOKit/pwr_mgt/IOPMLib.h - iomanip - ios -+iosfwd - iostream - iostream.h - iterator diff --git a/www/libxul/files/patch-bug938730 b/www/libxul/files/patch-bug938730 deleted file mode 100644 index ac444b228ae6..000000000000 --- a/www/libxul/files/patch-bug938730 +++ /dev/null @@ -1,35 +0,0 @@ -commit 1961aa2 -Author: Kai Engert <kaie@kuix.de> -Date: Wed Nov 20 20:25:12 2013 +0100 - - Bug 938730 - avoid mix of memory allocators (crashes) when using system sqlite, r=asuth ---- - storage/src/Makefile.in | 7 +++++++ - 1 file changed, 7 insertions(+) - -diff --git storage/src/Makefile.in storage/src/Makefile.in -index 9418640..c7391ed 100644 ---- storage/src/Makefile.in -+++ storage/src/Makefile.in -@@ -6,14 +6,21 @@ - # Don't use the jemalloc allocator on Android, because we can't guarantee - # that Gecko will configure sqlite before it is first used (bug 730495). - # -+# Don't use the jemalloc allocator when using system sqlite. Linked in libraries -+# (such as NSS) might trigger an initialization of sqlite and allocation -+# of memory using the default allocator, prior to the storage service -+# registering its allocator, causing memory management failures (bug 938730). -+# - # Note: On Windows our sqlite build assumes we use jemalloc. If you disable - # MOZ_STORAGE_MEMORY on Windows, you will also need to change the "ifdef - # MOZ_MEMORY" options in db/sqlite3/src/Makefile.in. - ifdef MOZ_MEMORY -+ifndef MOZ_NATIVE_SQLITE - ifneq ($(OS_TARGET), Android) - DEFINES += -DMOZ_STORAGE_MEMORY - endif - endif -+endif - - # For nsDependentJSString - LOCAL_INCLUDES = \ diff --git a/www/libxul/files/patch-bug945046 b/www/libxul/files/patch-bug945046 deleted file mode 100644 index 2da32f78cd4c..000000000000 --- a/www/libxul/files/patch-bug945046 +++ /dev/null @@ -1,130 +0,0 @@ -diff --git config/system-headers config/system-headers -index 432cba6..18a9627 100644 ---- config/system-headers -+++ config/system-headers -@@ -1157,3 +1157,4 @@ unicode/uenum.h - unicode/unum.h - unicode/ustring.h - #endif -+libutil.h -diff --git js/src/config/system-headers js/src/config/system-headers -index 432cba6..18a9627 100644 ---- js/src/config/system-headers -+++ js/src/config/system-headers -@@ -1157,3 +1157,4 @@ unicode/uenum.h - unicode/unum.h - unicode/ustring.h - #endif -+libutil.h -diff --git toolkit/library/Makefile.in toolkit/library/Makefile.in -index 9975621..b4b037d 100644 ---- toolkit/library/Makefile.in -+++ toolkit/library/Makefile.in -@@ -289,6 +289,10 @@ OS_LIBS += $(call EXPAND_LIBNAME,kvm) - EXTRA_DSO_LDOPTS += -Wl,--warn-unresolved-symbols - endif - -+ifeq ($(OS_ARCH),FreeBSD) -+OS_LIBS += $(call EXPAND_LIBNAME,util) -+endif -+ - ifeq ($(OS_ARCH),WINNT) - OS_LIBS += $(call EXPAND_LIBNAME,shell32 ole32 version winspool comdlg32 imm32 msimg32 shlwapi psapi ws2_32 dbghelp rasapi32 rasdlg iphlpapi uxtheme setupapi secur32 sensorsapi portabledeviceguids windowscodecs wininet wbemuuid) - ifdef ACCESSIBILITY -diff --git xpcom/base/nsMemoryReporterManager.cpp xpcom/base/nsMemoryReporterManager.cpp -index b8147c8..0ffb34e 100644 ---- xpcom/base/nsMemoryReporterManager.cpp -+++ xpcom/base/nsMemoryReporterManager.cpp -@@ -153,6 +153,43 @@ static nsresult GetResidentFast(int64_t - return GetResident(n); - } - -+#ifdef __FreeBSD__ -+#include <libutil.h> -+ -+static nsresult -+GetKinfoVmentrySelf(int64_t* prss) -+{ -+ int cnt; -+ struct kinfo_vmentry *vmmap, *kve; -+ if ((vmmap = kinfo_getvmmap(getpid(), &cnt)) == NULL) -+ return NS_ERROR_FAILURE; -+ -+ if (prss) -+ *prss = 0; -+ -+ for (int i = 0; i < cnt; i++) { -+ kve = &vmmap[i]; -+ if (prss) -+ *prss += kve->kve_private_resident; -+ } -+ -+ free(vmmap); -+ return NS_OK; -+} -+ -+#define HAVE_PRIVATE_REPORTER -+static nsresult -+GetPrivate(int64_t* aN) -+{ -+ int64_t priv; -+ nsresult rv = GetKinfoVmentrySelf(&priv); -+ if (NS_SUCCEEDED(rv)) -+ *aN = priv * getpagesize(); -+ -+ return NS_OK; -+} -+#endif // FreeBSD -+ - #elif defined(SOLARIS) - - #include <procfs.h> -@@ -327,6 +364,24 @@ static nsresult GetResidentFast(int64_t - } - - #define HAVE_PRIVATE_REPORTER -+static nsresult -+GetPrivate(int64_t* aN) -+{ -+ PROCESS_MEMORY_COUNTERS_EX pmcex; -+ pmcex.cb = sizeof(PROCESS_MEMORY_COUNTERS_EX); -+ -+ if (!GetProcessMemoryInfo( -+ GetCurrentProcess(), -+ (PPROCESS_MEMORY_COUNTERS) &pmcex, sizeof(pmcex))) { -+ return NS_ERROR_FAILURE; -+ } -+ -+ *aN = pmcex.PrivateUsage; -+ return NS_OK; -+} -+#endif // XP_<PLATFORM> -+ -+#ifdef HAVE_PRIVATE_REPORTER - class PrivateReporter MOZ_FINAL : public MemoryReporterBase - { - public: -@@ -339,21 +394,10 @@ public: - - NS_IMETHOD GetAmount(int64_t *aAmount) - { -- PROCESS_MEMORY_COUNTERS_EX pmcex; -- pmcex.cb = sizeof(PROCESS_MEMORY_COUNTERS_EX); -- -- if (!GetProcessMemoryInfo( -- GetCurrentProcess(), -- (PPROCESS_MEMORY_COUNTERS) &pmcex, sizeof(pmcex))) { -- return NS_ERROR_FAILURE; -- } -- -- *aAmount = pmcex.PrivateUsage; -- return NS_OK; -+ return GetPrivate(aAmount); - } - }; -- --#endif // XP_<PLATFORM> -+#endif - - #ifdef HAVE_VSIZE_AND_RESIDENT_REPORTERS - class VsizeReporter MOZ_FINAL : public MemoryReporterBase diff --git a/www/libxul/files/patch-bug946560 b/www/libxul/files/patch-bug946560 deleted file mode 100644 index e2560bd0d0c3..000000000000 --- a/www/libxul/files/patch-bug946560 +++ /dev/null @@ -1,44 +0,0 @@ -diff --git xpcom/base/nsMemoryInfoDumper.cpp xpcom/base/nsMemoryInfoDumper.cpp -index 0b2f78c..d857374 100644 ---- xpcom/base/nsMemoryInfoDumper.cpp -+++ xpcom/base/nsMemoryInfoDumper.cpp -@@ -30,7 +30,7 @@ - #include <unistd.h> - #endif - --#ifdef XP_LINUX -+#if defined(XP_LINUX) || defined(__FreeBSD__) - #include <fcntl.h> - #include <sys/types.h> - #include <sys/stat.h> -@@ -109,7 +109,7 @@ private: - - } // anonymous namespace - --#ifdef XP_LINUX // { -+#if defined(XP_LINUX) || defined(__FreeBSD__) // { - namespace { - - /* -@@ -548,7 +548,7 @@ nsMemoryInfoDumper::~nsMemoryInfoDumper( - /* static */ void - nsMemoryInfoDumper::Initialize() - { --#ifdef XP_LINUX -+#if defined(XP_LINUX) || defined(__FreeBSD__) - SignalPipeWatcher::Create(); - FifoWatcher::MaybeCreate(); - #endif -diff --git xpcom/base/nsMemoryReporterManager.cpp xpcom/base/nsMemoryReporterManager.cpp -index 8c65665..8f6d0e9 100644 ---- xpcom/base/nsMemoryReporterManager.cpp -+++ xpcom/base/nsMemoryReporterManager.cpp -@@ -824,7 +824,7 @@ nsMemoryReporterManager::Init() - RegisterReporter(new mozilla::dmd::DMDReporter); - #endif - --#if defined(XP_LINUX) -+#if defined(XP_LINUX) || defined(__FreeBSD__) - nsMemoryInfoDumper::Initialize(); - #endif - diff --git a/www/libxul/files/patch-bug961264 b/www/libxul/files/patch-bug961264 index 85bc94d001ff..94fd84ce5cb6 100644 --- a/www/libxul/files/patch-bug961264 +++ b/www/libxul/files/patch-bug961264 @@ -142,9 +142,9 @@ diff --git js/src/configure.in js/src/configure.in index bddd46d..d4b522e 100644 --- js/src/configure.in +++ js/src/configure.in -@@ -2348,116 +2348,13 @@ fi +@@ -2077,116 +2077,13 @@ AC_LANG_CPLUSPLUS - AC_LANG_C + MOZ_CXX11 -dnl Check for .hidden assembler directive and visibility attribute. -dnl Borrowed from glibc configure.in @@ -249,7 +249,7 @@ index bddd46d..d4b522e 100644 - ]) - if test "$ac_cv_have_visibility_builtin_bug" = "no" -a \ - "$ac_cv_have_visibility_class_bug" = "no"; then -- VISIBILITY_FLAGS='-I$(DIST)/system_wrappers_js -include $(topsrcdir)/config/gcc_hidden.h' +- VISIBILITY_FLAGS='-I$(DIST)/system_wrappers -include $(topsrcdir)/config/gcc_hidden.h' - WRAP_SYSTEM_INCLUDES=1 - else - VISIBILITY_FLAGS='-fvisibility=hidden' @@ -259,7 +259,7 @@ index bddd46d..d4b522e 100644 - fi # have visibility(hidden) attribute + AC_DEFINE(HAVE_VISIBILITY_HIDDEN_ATTRIBUTE) + AC_DEFINE(HAVE_VISIBILITY_ATTRIBUTE) -+ VISIBILITY_FLAGS='-I$(DIST)/system_wrappers_js -include $(topsrcdir)/config/gcc_hidden.h' ++ VISIBILITY_FLAGS='-I$(DIST)/system_wrappers -include $(topsrcdir)/config/gcc_hidden.h' + WRAP_SYSTEM_INCLUDES=1 fi # GNU_CC diff --git a/www/libxul/files/patch-bug961816 b/www/libxul/files/patch-bug961816 deleted file mode 100644 index 322e73f952f6..000000000000 --- a/www/libxul/files/patch-bug961816 +++ /dev/null @@ -1,48 +0,0 @@ -diff --git config/system-headers config/system-headers -index 8803150..ae38d68 100644 ---- config/system-headers -+++ config/system-headers -@@ -1158,3 +1158,4 @@ unicode/unum.h - unicode/ustring.h - #endif - libutil.h -+unwind.h -diff --git configure.in configure.in -index f452a5e..a1ebbcc 100644 ---- configure.in -+++ configure.in -@@ -7455,7 +7455,10 @@ dnl ======================================================== - dnl = Support for gcc stack unwinding (from gcc 3.3) - dnl ======================================================== - if test -z "$SKIP_LIBRARY_CHECKS"; then -+ AC_LANG_SAVE -+ AC_LANG_CPLUSPLUS - MOZ_CHECK_HEADER(unwind.h, AC_CHECK_FUNCS(_Unwind_Backtrace)) -+ AC_LANG_RESTORE - fi - - dnl ======================================================== -diff --git config/system-headers config/system-headers -index 8803150..ae38d68 100644 ---- js/src/config/system-headers -+++ js/src/config/system-headers -@@ -1158,3 +1158,4 @@ unicode/unum.h - unicode/ustring.h - #endif - libutil.h -+unwind.h -diff --git configure.in configure.in -index f452a5e..a1ebbcc 100644 ---- js/src/configure.in -+++ js/src/configure.in -@@ -7455,7 +7455,10 @@ dnl ======================================================== - dnl = Support for gcc stack unwinding (from gcc 3.3) - dnl ======================================================== - if test -z "$SKIP_LIBRARY_CHECKS"; then -+ AC_LANG_SAVE -+ AC_LANG_CPLUSPLUS - MOZ_CHECK_HEADER(unwind.h, AC_CHECK_FUNCS(_Unwind_Backtrace)) -+ AC_LANG_RESTORE - fi - - dnl ======================================================== diff --git a/www/libxul/files/patch-bug962345 b/www/libxul/files/patch-bug962345 deleted file mode 100644 index a465c93a51d1..000000000000 --- a/www/libxul/files/patch-bug962345 +++ /dev/null @@ -1,18 +0,0 @@ -diff --git config/system-headers config/system-headers -index 8803150..ae38d68 100644 ---- config/system-headers -+++ config/system-headers -@@ -1159,3 +1159,4 @@ unicode/ustring.h - #endif - libutil.h - unwind.h -+cairo-qt.h -diff --git config/system-headers config/system-headers -index 8803150..ae38d68 100644 ---- js/src/config/system-headers -+++ js/src/config/system-headers -@@ -1159,3 +1159,4 @@ unicode/ustring.h - #endif - libutil.h - unwind.h -+cairo-qt.h diff --git a/www/libxul/files/patch-bug975634 b/www/libxul/files/patch-bug975634 deleted file mode 100644 index d41e69e83892..000000000000 --- a/www/libxul/files/patch-bug975634 +++ /dev/null @@ -1,63 +0,0 @@ -diff --git configure.in configure.in -index 0d9236a..0447104 100644 ---- configure.in -+++ configure.in -@@ -9034,6 +9034,20 @@ AC_SUBST(MOZ_FOLD_LIBS) - AC_SUBST(MOZ_ENABLE_SZIP) - AC_SUBST(MOZ_SZIP_FLAGS) - -+AC_MSG_CHECKING([for posix_fadvise]) -+AC_TRY_LINK([#define _XOPEN_SOURCE 600 -+ #include <fcntl.h>], -+ [posix_fadvise(0, 0, 0, 0);], -+ [ac_cv___posix_fadvise=true], -+ [ac_cv___posix_fadvise=false]) -+ -+if test "$ac_cv___posix_fadvise" = true ; then -+ AC_DEFINE(HAVE_POSIX_FADVISE) -+ AC_MSG_RESULT(yes) -+else -+ AC_MSG_RESULT(no) -+fi -+ - AC_MSG_CHECKING([for posix_fallocate]) - AC_TRY_LINK([#define _XOPEN_SOURCE 600 - #include <fcntl.h>], -diff --git js/src/configure.in js/src/configure.in -index da9767c..352ba14 100644 ---- js/src/configure.in -+++ js/src/configure.in -@@ -4025,6 +4025,20 @@ AC_SUBST(CXX_VERSION) - AC_SUBST(MSMANIFEST_TOOL) - AC_SUBST(MOZ_LINKER) - -+AC_MSG_CHECKING([for posix_fadvise]) -+AC_TRY_LINK([#define _XOPEN_SOURCE 600 -+ #include <fcntl.h>], -+ [posix_fadvise(0, 0, 0, 0);], -+ [ac_cv___posix_fadvise=true], -+ [ac_cv___posix_fadvise=false]) -+ -+if test "$ac_cv___posix_fadvise" = true ; then -+ AC_DEFINE(HAVE_POSIX_FADVISE) -+ AC_MSG_RESULT(yes) -+else -+ AC_MSG_RESULT(no) -+fi -+ - AC_MSG_CHECKING([for posix_fallocate]) - AC_TRY_LINK([#define _XOPEN_SOURCE 600 - #include <fcntl.h>], -diff --git xpcom/io/nsLocalFileUnix.cpp xpcom/io/nsLocalFileUnix.cpp -index bacf06c..0e46e4a 100644 ---- xpcom/io/nsLocalFileUnix.cpp -+++ xpcom/io/nsLocalFileUnix.cpp -@@ -382,7 +382,7 @@ nsLocalFile::OpenNSPRFileDesc(int32_t flags, int32_t mode, PRFileDesc **_retval) - PR_Delete(mPath.get()); - } - --#if defined(LINUX) && !defined(ANDROID) -+#if defined(HAVE_POSIX_FADVISE) - if (flags & OS_READAHEAD) { - posix_fadvise(PR_FileDesc2NativeHandle(*_retval), 0, 0, - POSIX_FADV_SEQUENTIAL); diff --git a/www/libxul/files/patch-bug977457 b/www/libxul/files/patch-bug977457 deleted file mode 100644 index cf57b6b1b809..000000000000 --- a/www/libxul/files/patch-bug977457 +++ /dev/null @@ -1,27 +0,0 @@ -diff --git xpcom/base/nsStackWalk.cpp xpcom/base/nsStackWalk.cpp -index bb0e15b..7641267 100644 ---- xpcom/base/nsStackWalk.cpp -+++ xpcom/base/nsStackWalk.cpp -@@ -23,6 +23,12 @@ struct CriticalAddress { - }; - static CriticalAddress gCriticalAddress; - -+// for _Unwind_Backtrace from libcxxrt or libunwind -+// cxxabi.h from libcxxrt implicitly includes unwind.h first -+#if defined(HAVE__UNWIND_BACKTRACE) && !defined(_GNU_SOURCE) -+#define _GNU_SOURCE -+#endif -+ - #if defined(HAVE_DLOPEN) || defined(XP_MACOSX) - #include <dlfcn.h> - #endif -@@ -1222,9 +1228,6 @@ NS_StackWalk(NS_WalkStackCallback aCallback, uint32_t aSkipFrames, - #elif defined(HAVE__UNWIND_BACKTRACE) - - // libgcc_s.so symbols _Unwind_Backtrace@@GCC_3.3 and _Unwind_GetIP@@GCC_3.0 --#ifndef _GNU_SOURCE --#define _GNU_SOURCE --#endif - #include <unwind.h> - - struct unwind_info { diff --git a/www/libxul/files/patch-bug981348 b/www/libxul/files/patch-bug981348 new file mode 100644 index 000000000000..6eb877b08fa8 --- /dev/null +++ b/www/libxul/files/patch-bug981348 @@ -0,0 +1,41 @@ +diff --git dom/system/OSFileConstants.cpp dom/system/OSFileConstants.cpp +index 4b21361..cb3be32 100644 +--- dom/system/OSFileConstants.cpp ++++ dom/system/OSFileConstants.cpp +@@ -596,7 +596,7 @@ static const dom::ConstantSpec gLibcProperties[] = + + { "OSFILE_SIZEOF_STATVFS", INT_TO_JSVAL(sizeof (struct statvfs)) }, + +- { "OSFILE_OFFSETOF_STATVFS_F_BSIZE", INT_TO_JSVAL(offsetof (struct statvfs, f_bsize)) }, ++ { "OSFILE_OFFSETOF_STATVFS_F_FRSIZE", INT_TO_JSVAL(offsetof (struct statvfs, f_frsize)) }, + { "OSFILE_OFFSETOF_STATVFS_F_BAVAIL", INT_TO_JSVAL(offsetof (struct statvfs, f_bavail)) }, + + #endif // defined(XP_UNIX) +diff --git toolkit/components/osfile/modules/osfile_unix_back.jsm toolkit/components/osfile/modules/osfile_unix_back.jsm +index b59fca4..0cf220b 100644 +--- toolkit/components/osfile/modules/osfile_unix_back.jsm ++++ toolkit/components/osfile/modules/osfile_unix_back.jsm +@@ -228,8 +228,8 @@ + let statvfs = new SharedAll.HollowStructure("statvfs", + Const.OSFILE_SIZEOF_STATVFS); + +- statvfs.add_field_at(Const.OSFILE_OFFSETOF_STATVFS_F_BSIZE, +- "f_bsize", Type.unsigned_long.implementation); ++ statvfs.add_field_at(Const.OSFILE_OFFSETOF_STATVFS_F_FRSIZE, ++ "f_frsize", Type.unsigned_long.implementation); + statvfs.add_field_at(Const.OSFILE_OFFSETOF_STATVFS_F_BAVAIL, + "f_bavail", Type.fsblkcnt_t.implementation); + +diff --git toolkit/components/osfile/modules/osfile_unix_front.jsm toolkit/components/osfile/modules/osfile_unix_front.jsm +index 99e5e9b..de642c5 100644 +--- toolkit/components/osfile/modules/osfile_unix_front.jsm ++++ toolkit/components/osfile/modules/osfile_unix_front.jsm +@@ -373,7 +373,7 @@ + throw_on_negative("statvfs", UnixFile.statvfs(sourcePath, fileSystemInfoPtr)); + + let bytes = new Type.uint64_t.implementation( +- fileSystemInfo.f_bsize * fileSystemInfo.f_bavail); ++ fileSystemInfo.f_frsize * fileSystemInfo.f_bavail); + + return bytes.value; + }; diff --git a/www/libxul/files/patch-bug985848 b/www/libxul/files/patch-bug985848 deleted file mode 100644 index c20c0e039827..000000000000 --- a/www/libxul/files/patch-bug985848 +++ /dev/null @@ -1,22 +0,0 @@ ---- media/webrtc/trunk/webrtc/modules/video_capture/linux/device_info_linux.cc -+++ media/webrtc/trunk/webrtc/modules/video_capture/linux/device_info_linux.cc -@@ -19,7 +19,7 @@ - #include <stdlib.h> - - //v4l includes --#if defined(__DragonFly__) || defined(__NetBSD__) || defined(__OpenBSD__) -+#if defined(__NetBSD__) || defined(__OpenBSD__) - #include <sys/videoio.h> - #elif defined(__sun) - #include <sys/videodev2.h> ---- media/webrtc/trunk/webrtc/modules/video_capture/linux/video_capture_linux.cc -+++ media/webrtc/trunk/webrtc/modules/video_capture/linux/video_capture_linux.cc -@@ -18,7 +18,7 @@ - #include <string.h> - - //v4l includes --#if defined(__DragonFly__) || defined(__NetBSD__) || defined(__OpenBSD__) -+#if defined(__NetBSD__) || defined(__OpenBSD__) - #include <sys/videoio.h> - #elif defined(__sun) - #include <sys/videodev2.h> diff --git a/www/libxul/files/patch-clang34-disable-stdcall b/www/libxul/files/patch-clang34-disable-stdcall deleted file mode 100644 index 8f4bb31b9ccd..000000000000 --- a/www/libxul/files/patch-clang34-disable-stdcall +++ /dev/null @@ -1,13 +0,0 @@ -# http://llvm.org/bugs/show_bug.cgi?id=19007 - ---- xpcom/base/nscore.h~ -+++ xpcom/base/nscore.h -@@ -110,7 +110,7 @@ - * NS_HIDDEN_(int) NS_FASTCALL func2(char *foo); - */ - --#if defined(__i386__) && defined(__GNUC__) && !defined(XP_OS2) -+#if defined(__i386__) && defined(__GNUC__) && !defined(XP_OS2) && !(defined(__clang__) && __clang_major__ == 3 && __clang_minor__ == 4 && __clang_patchlevel__ == 0) - #define NS_FASTCALL __attribute__ ((regparm (3), stdcall)) - #define NS_CONSTRUCTOR_FASTCALL __attribute__ ((regparm (3), stdcall)) - #elif defined(XP_WIN) && !defined(_WIN64) diff --git a/www/libxul/files/patch-config-baseconfig.mk b/www/libxul/files/patch-config-baseconfig.mk index e6fd78f35e7b..9db69516cbcc 100644 --- a/www/libxul/files/patch-config-baseconfig.mk +++ b/www/libxul/files/patch-config-baseconfig.mk @@ -1,8 +1,6 @@ --- config/baseconfig.mk~ +++ config/baseconfig.mk -@@ -1,9 +1,9 @@ - INCLUDED_AUTOCONF_MK = 1 - +@@ -1,7 +1,7 @@ -includedir := $(includedir)/$(MOZ_APP_NAME)-$(MOZ_APP_VERSION) -idldir = $(datadir)/idl/$(MOZ_APP_NAME)-$(MOZ_APP_VERSION) -installdir = $(libdir)/$(MOZ_APP_NAME)-$(MOZ_APP_VERSION) @@ -11,6 +9,6 @@ +idldir = $(datadir)/idl/%%MOZILLA%% +installdir = $(libdir)/%%MOZILLA%% +sdkdir = $(libdir)/%%MOZILLA%% - DIST = $(DEPTH)/dist - - # We do magic with OBJ_SUFFIX in config.mk, the following ensures we don't + ifndef TOP_DIST + TOP_DIST = dist + endif diff --git a/www/libxul/files/patch-toolkit_mozapps_installer_packager_mk b/www/libxul/files/patch-toolkit_mozapps_installer_packager_mk new file mode 100644 index 000000000000..75af88fbcb4a --- /dev/null +++ b/www/libxul/files/patch-toolkit_mozapps_installer_packager_mk @@ -0,0 +1,13 @@ +$OpenBSD: patch-toolkit_mozapps_installer_packager_mk,v 1.11 2012/06/11 15:29:56 landry Exp $ +install headers/idl/sdk libs only if xulrunner +--- toolkit/mozapps/installer/packager.mk.orig Fri Jun 1 14:04:20 2012 ++++ toolkit/mozapps/installer/packager.mk Tue Jun 5 07:55:51 2012 +@@ -886,7 +886,7 @@ endif + $(NSINSTALL) -D $(DESTDIR)$(bindir) + $(RM) -f $(DESTDIR)$(bindir)/$(MOZ_APP_NAME) + ln -s $(installdir)/$(MOZ_APP_NAME) $(DESTDIR)$(bindir) +-ifdef INSTALL_SDK # Here comes the hard part ++ifeq ($(MOZ_APP_NAME),xulrunner) + $(NSINSTALL) -D $(DESTDIR)$(includedir) + (cd $(DIST)/include && tar $(TAR_CREATE_FLAGS) - .) | \ + (cd $(DESTDIR)$(includedir) && tar -xf -) diff --git a/www/libxul/files/patch-toolkit_xre_Makefile.in b/www/libxul/files/patch-toolkit_xre_Makefile.in deleted file mode 100644 index 4a9c8533a2f8..000000000000 --- a/www/libxul/files/patch-toolkit_xre_Makefile.in +++ /dev/null @@ -1,8 +0,0 @@ ---- toolkit/xre/Makefile.in.orig 2007-09-10 10:31:53.000000000 -0400 -+++ toolkit/xre/Makefile.in 2007-09-10 10:35:00.000000000 -0400 -@@ -263,5 +263,3 @@ - libs:: platform.ini - $(INSTALL) $^ $(DIST)/bin - --install:: -- $(INSTALL) $(IFLAGS1) $^ $(DESTDIR)$(mozappdir) diff --git a/www/libxul/files/patch-z-bug1026828 b/www/libxul/files/patch-z-bug1026828 deleted file mode 100644 index 5d2020cd091f..000000000000 --- a/www/libxul/files/patch-z-bug1026828 +++ /dev/null @@ -1,13 +0,0 @@ -diff --git storage/src/Makefile.in storage/src/Makefile.in -index 4cd2551..5c40536 100644 ---- storage/src/Makefile.in -+++ storage/src/Makefile.in -@@ -31,7 +31,7 @@ endif - # MOZ_STORAGE_MEMORY on Windows, you will also need to change the "ifdef - # MOZ_MEMORY" options in db/sqlite3/src/Makefile.in. - ifdef MOZ_MEMORY --ifndef MOZ_NATIVE_SQLITE -+ifneq (,$(not $(MOZ_NATIVE_SQLITE))$(MOZ_NATIVE_JEMALLOC)) - ifneq ($(OS_TARGET), Android) - DEFINES += -DMOZ_STORAGE_MEMORY - endif diff --git a/www/libxul/files/patch-zz-bug517422 b/www/libxul/files/patch-z-bug517422 index 1c3d05480bc2..17432a29775c 100644 --- a/www/libxul/files/patch-zz-bug517422 +++ b/www/libxul/files/patch-z-bug517422 @@ -18,52 +18,53 @@ index 5383399..0410004 100644 $(srcdir)/system-headers | $(PERL) $(topsrcdir)/nsprpub/config/make-system-wrappers.pl system_wrappers $(INSTALL) system_wrappers $(DIST) -diff --git toolkit/toolkit.mozbuild toolkit/toolkit.mozbuild -index c22a36c..2febb45 100644 ---- toolkit/toolkit.mozbuild -+++ toolkit/toolkit.mozbuild -@@ -64,13 +64,13 @@ add_tier_dir('platform', 'rdf') - if CONFIG['MOZ_JSDEBUGGER']: - add_tier_dir('platform', 'js/jsd') +diff --git config/external/moz.build config/external/moz.build +index f67c5c7..eb909ce 100644 +--- config/external/moz.build ++++ config/external/moz.build +@@ -15,13 +15,19 @@ if CONFIG['MOZ_UPDATER']: + if not CONFIG['MOZ_NATIVE_BZ2']: + external_dirs += ['modules/libbz2'] -if CONFIG['MOZ_VORBIS']: ++if not CONFIG['MOZ_NATIVE_OGG']: ++ external_dirs += ['media/libogg'] ++ ++if not CONFIG['MOZ_NATIVE_THEORA']: ++ external_dirs += ['media/libtheora'] ++ +if CONFIG['MOZ_VORBIS'] and not CONFIG['MOZ_NATIVE_VORBIS']: - add_tier_dir('platform', 'media/libvorbis') + external_dirs += ['media/libvorbis'] -if CONFIG['MOZ_TREMOR']: +if CONFIG['MOZ_TREMOR'] and not CONFIG['MOZ_NATIVE_TREMOR']: - add_tier_dir('platform', 'media/libtremor') + external_dirs += ['media/libtremor'] -if CONFIG['MOZ_OPUS']: +if CONFIG['MOZ_OPUS'] and not CONFIG['MOZ_NATIVE_OPUS']: - add_tier_dir('platform', 'media/libopus') + external_dirs += ['media/libopus'] if CONFIG['MOZ_WEBM']: -@@ -82,7 +82,10 @@ if CONFIG['MOZ_VP8'] and not CONFIG['MOZ - add_tier_dir('platform', 'media/libvpx') - - if CONFIG['MOZ_OGG']: -- add_tier_dir('platform', ['media/libogg', 'media/libtheora']) -+ if not CONFIG['MOZ_NATIVE_OGG']: -+ add_tier_dir('platform', 'media/libogg') -+ if not CONFIG['MOZ_NATIVE_THEORA']: -+ add_tier_dir('platform', 'media/libtheora') - - if CONFIG['MOZ_WEBRTC']: - add_tier_dir('platform', [ -@@ -92,10 +95,10 @@ if CONFIG['MOZ_WEBRTC']: - 'media/mtransport/standalone', - ]) +@@ -36,13 +42,15 @@ if CONFIG['MOZ_VPX'] and not CONFIG['MOZ_NATIVE_LIBVPX']: + if not CONFIG['MOZ_NATIVE_PNG']: + external_dirs += ['media/libpng'] --if CONFIG['MOZ_SPEEX_RESAMPLER']: -+if CONFIG['MOZ_SPEEX_RESAMPLER'] and not CONFIG['MOZ_NATIVE_SPEEX']: - add_tier_dir('platform', 'media/libspeex_resampler') ++if not CONFIG['MOZ_NATIVE_SPEEX']: ++ external_dirs += ['media/libspeex_resampler'] ++ ++if not CONFIG['MOZ_NATIVE_SOUNDTOUCH']: ++ external_dirs += ['media/libsoundtouch'] ++ + external_dirs += [ + 'media/kiss_fft', + 'media/libcubeb', +- 'media/libogg', +- 'media/libtheora', +- 'media/libspeex_resampler', +- 'media/libsoundtouch', + ] --if CONFIG['MOZ_SOUNDTOUCH']: -+if CONFIG['MOZ_SOUNDTOUCH'] and not CONFIG['MOZ_NATIVE_SOUNDTOUCH']: - add_tier_dir('platform', 'media/libsoundtouch') - - if CONFIG['MOZ_CUBEB']: + PARALLEL_DIRS += ['../../' + i for i in external_dirs] diff --git config/system-headers config/system-headers index bef567c..9807c29 100644 --- config/system-headers @@ -120,7 +121,7 @@ diff --git configure.in configure.in index 87db361..7947626 100644 --- configure.in +++ configure.in -@@ -5211,6 +5211,57 @@ if test "${ac_cv_c_attribute_aligned}" != "0"; then +@@ -5211,6 +5211,63 @@ if test "${ac_cv_c_attribute_aligned}" != "0"; then fi dnl ======================================================== @@ -134,6 +135,12 @@ index 87db361..7947626 100644 + +if test -n "$MOZ_NATIVE_OGG"; then + PKG_CHECK_MODULES(MOZ_OGG, ogg >= 1.2.1) ++ ++ _SAVE_LIBS=$LIBS ++ LIBS="$LIBS $MOZ_OGG_LIBS" ++ AC_CHECK_FUNC(ogg_set_mem_functions, [], ++ [AC_DEFINE(MOZ_OGG_NO_MEM_REPORTING)]) ++ LIBS=$_SAVE_LIBS +fi + +AC_SUBST(MOZ_NATIVE_OGG) @@ -244,7 +251,7 @@ index 87db361..7947626 100644 +MOZ_NATIVE_SOUNDTOUCH=) + +if test -n "$MOZ_NATIVE_SOUNDTOUCH"; then -+ PKG_CHECK_MODULES(MOZ_SOUNDTOUCH, soundtouch >= 1.7.0) ++ PKG_CHECK_MODULES(MOZ_SOUNDTOUCH, soundtouch >= 1.8.0) + + AC_LANG_SAVE + AC_LANG_CPLUSPLUS @@ -276,15 +283,28 @@ index 87db361..7947626 100644 dnl = Disable VP8 decoder support dnl ======================================================== MOZ_ARG_DISABLE_BOOL(webm, +diff --git content/media/AudioStream.h content/media/AudioStream.h +index 085676d..00c54fb 100644 +--- content/media/AudioStream.h ++++ content/media/AudioStream.h +@@ -26,7 +26,7 @@ public: + }; + + namespace soundtouch { +-class SoundTouch; ++class MOZ_IMPORT_API SoundTouch; + } + + namespace mozilla { diff --git content/media/Makefile.in content/media/Makefile.in index fd34449..c6c42c8 100644 --- content/media/Makefile.in +++ content/media/Makefile.in -@@ -6,4 +6,31 @@ include $(topsrcdir)/config/rules.mk +@@ -6,3 +6,31 @@ include $(topsrcdir)/config/rules.mk CFLAGS += $(GSTREAMER_CFLAGS) CXXFLAGS += $(GSTREAMER_CFLAGS) - ++ +ifdef MOZ_NATIVE_OGG +CXXFLAGS += $(MOZ_OGG_CFLAGS) +endif @@ -324,98 +344,16 @@ index 4c14494..1cb98e2 100644 +ifdef MOZ_NATIVE_SPEEX +CFLAGS += $(MOZ_SPEEX_CFLAGS) +endif -+ - AudioNodeEngineNEON.$(OBJ_SUFFIX): CXXFLAGS += -mfpu=neon -diff --git layout/media/Makefile.in layout/media/Makefile.in -index 1cacbd7..a8cd156 100644 ---- layout/media/Makefile.in -+++ layout/media/Makefile.in -@@ -36,31 +36,45 @@ ifdef MOZ_TREE_PIXMAN - SHARED_LIBRARY_LIBS += $(MOZ_PIXMAN_LIBS) - endif - -+ifdef MOZ_OGG -+ifndef MOZ_NATIVE_OGG -+SHARED_LIBRARY_LIBS += \ -+ $(DEPTH)/media/libogg/src/$(LIB_PREFIX)ogg.$(LIB_SUFFIX) \ -+ $(NULL) -+endif -+endif -+ - ifdef MOZ_VORBIS -+ifndef MOZ_NATIVE_VORBIS - SHARED_LIBRARY_LIBS += \ - $(DEPTH)/media/libvorbis/lib/$(LIB_PREFIX)vorbis.$(LIB_SUFFIX) \ -- $(DEPTH)/media/libogg/src/$(LIB_PREFIX)ogg.$(LIB_SUFFIX) \ - $(NULL) - endif -+endif - - ifdef MOZ_TREMOR -+ifndef MOZ_NATIVE_TREMOR - SHARED_LIBRARY_LIBS += \ - $(DEPTH)/media/libtremor/lib/$(LIB_PREFIX)tremor.$(LIB_SUFFIX) \ -- $(DEPTH)/media/libogg/src/$(LIB_PREFIX)ogg.$(LIB_SUFFIX) \ - $(NULL) - endif -+endif - - ifdef MOZ_OGG -+ifndef MOZ_NATIVE_THEORA - SHARED_LIBRARY_LIBS += \ - $(DEPTH)/media/libtheora/lib/$(LIB_PREFIX)theora.$(LIB_SUFFIX) \ - $(NULL) - endif -+endif - - ifdef MOZ_OPUS -+ifndef MOZ_NATIVE_OPUS - SHARED_LIBRARY_LIBS += \ - $(DEPTH)/media/libopus/$(LIB_PREFIX)opus.$(LIB_SUFFIX) \ - $(NULL) - endif -+endif - - ifdef MOZ_WEBM - SHARED_LIBRARY_LIBS += \ -@@ -77,16 +91,20 @@ endif - endif - - ifdef MOZ_SPEEX_RESAMPLER -+ifndef MOZ_NATIVE_SPEEX - SHARED_LIBRARY_LIBS += \ - $(DEPTH)/media/libspeex_resampler/src/$(LIB_PREFIX)speex_resampler.$(LIB_SUFFIX) \ - $(NULL) - endif -+endif - - ifdef MOZ_SOUNDTOUCH -+ifndef MOZ_NATIVE_SOUNDTOUCH - SHARED_LIBRARY_LIBS += \ - $(DEPTH)/media/libsoundtouch/src/$(LIB_PREFIX)soundtouch.$(LIB_SUFFIX) \ - $(NULL) - endif -+endif - - ifdef MOZ_CUBEB - SHARED_LIBRARY_LIBS += \ diff --git media/libtheora/Makefile.in media/libtheora/Makefile.in new file mode 100644 index 0000000..1f02dc0 --- /dev/null +++ media/libtheora/Makefile.in -@@ -0,0 +1,16 @@ +@@ -0,0 +1,9 @@ +# 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/. + -+DEPTH = @DEPTH@ -+topsrcdir = @top_srcdir@ -+srcdir = @srcdir@ -+VPATH = @srcdir@ -+ -+include $(DEPTH)/config/autoconf.mk -+ +include $(topsrcdir)/config/rules.mk + +ifdef MOZ_NATIVE_OGG @@ -426,18 +364,11 @@ new file mode 100644 index 0000000..1f02dc0 --- /dev/null +++ media/libtremor/Makefile.in -@@ -0,0 +1,16 @@ +@@ -0,0 +1,9 @@ +# 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/. + -+DEPTH = @DEPTH@ -+topsrcdir = @top_srcdir@ -+srcdir = @srcdir@ -+VPATH = @srcdir@ -+ -+include $(DEPTH)/config/autoconf.mk -+ +include $(topsrcdir)/config/rules.mk + +ifdef MOZ_NATIVE_OGG @@ -448,18 +379,11 @@ new file mode 100644 index 0000000..1f02dc0 --- /dev/null +++ media/libvorbis/Makefile.in -@@ -0,0 +1,16 @@ +@@ -0,0 +1,9 @@ +# 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/. + -+DEPTH = @DEPTH@ -+topsrcdir = @top_srcdir@ -+srcdir = @srcdir@ -+VPATH = @srcdir@ -+ -+include $(DEPTH)/config/autoconf.mk -+ +include $(topsrcdir)/config/rules.mk + +ifdef MOZ_NATIVE_OGG @@ -491,7 +415,7 @@ index 00e77e7..55f48ab 100644 ['build_with_mozilla==1', { # Mozilla provides its own build of the opus library. - 'include_dirs': [ -- '$(DIST)/include/opus', +- '/media/libopus/include', - ] + 'cflags_mozilla': [ + '$(MOZ_OPUS_CFLAGS)', @@ -499,10 +423,10 @@ index 00e77e7..55f48ab 100644 }, { 'dependencies': [ '<(DEPTH)/third_party/opus/opus.gyp:opus' -diff --git toolkit/library/Makefile.in toolkit/library/Makefile.in +diff --git toolkit/library/libxul.mk toolkit/library/libxul.mk index d42137a..695e75a8 100644 ---- toolkit/library/Makefile.in -+++ toolkit/library/Makefile.in +--- toolkit/library/libxul.mk ++++ toolkit/library/libxul.mk @@ -77,6 +77,34 @@ ifdef MOZ_NATIVE_HUNSPELL EXTRA_DSO_LDOPTS += $(MOZ_HUNSPELL_LIBS) endif @@ -538,3 +462,31 @@ index d42137a..695e75a8 100644 ifdef MOZ_NATIVE_LIBEVENT EXTRA_DSO_LDOPTS += $(MOZ_LIBEVENT_LIBS) endif +diff --git xpcom/build/nsXPComInit.cpp xpcom/build/nsXPComInit.cpp +index 2cf281e..6d7af0e 100644 +--- xpcom/build/nsXPComInit.cpp ++++ xpcom/build/nsXPComInit.cpp +@@ -130,7 +130,9 @@ extern nsresult nsStringInputStreamConstructor(nsISupports *, REFNSIID, void **) + #include "mozilla/VisualEventTracer.h" + #endif + ++#ifndef MOZ_OGG_NO_MEM_REPORTING + #include "ogg/ogg.h" ++#endif + #if defined(MOZ_VPX) && !defined(MOZ_VPX_NO_MEM_REPORTING) + #include "vpx_mem/vpx_mem.h" + #endif +@@ -571,11 +573,13 @@ NS_InitXPCOM2(nsIServiceManager* *result, + // this oddness. + mozilla::SetICUMemoryFunctions(); + ++#ifndef MOZ_OGG_NO_MEM_REPORTING + // Do the same for libogg. + ogg_set_mem_functions(OggReporter::CountingMalloc, + OggReporter::CountingCalloc, + OggReporter::CountingRealloc, + OggReporter::CountingFree); ++#endif + + #if defined(MOZ_VPX) && !defined(MOZ_VPX_NO_MEM_REPORTING) + // And for VPX. diff --git a/www/libxul/files/pkg-deinstall.in b/www/libxul/files/pkg-deinstall.in deleted file mode 100644 index 2544ee4ed3a2..000000000000 --- a/www/libxul/files/pkg-deinstall.in +++ /dev/null @@ -1,28 +0,0 @@ -#!/bin/sh -# -# $MCom: ports/www/mozilla/pkg-deinstall.in,v 1.25 2008/07/26 19:07:07 ahze Exp $ -# -# Date created: Mon Nov 29, 2003 -# Whom: Thierry Thomas (<thierry@pompo.net>) -# Fix the chrome registry. - -umask 022 -PATH=/bin:/usr/bin - -[ "x$1" = "x" ] && exit 1 -[ "x$2" != "xDEINSTALL" ] && exit 0 - -MOZDIR=%%MOZDIR%% - -rm -rf ${MOZDIR}/chrome/overlayinfo -rm -f ${MOZDIR}/chrome/*.rdf -rm -f ${MOZDIR}/component.reg -rm -f ${MOZDIR}/components/*.dat -rm -f ${MOZDIR}/components.ini -rm -f ${MOZDIR}/defaults.ini -rm -f ${MOZDIR}/chrome/app-chrome.manifest -rm -rf ${MOZDIR}/updates -find %%MOZDIR%%/plugins/ -depth 1 -type l -delete > /dev/null 2>&1 -find %%MOZDIR%%/extensions/ -depth 1 -type l -delete > /dev/null 2>&1 - -exit 0 diff --git a/www/libxul/files/pkg-install.in b/www/libxul/files/pkg-install.in deleted file mode 100644 index 9feab2225a78..000000000000 --- a/www/libxul/files/pkg-install.in +++ /dev/null @@ -1,37 +0,0 @@ -#!/bin/sh -# -# $MCom: ports/www/mozilla/pkg-install.in,v 1.26 2008/08/04 16:58:03 mezz Exp $ -# -# Date created: Mon Nov 29, 2003 -# Whom: Thierry Thomas (<thierry@pompo.net>) -# Fix the chrome registry. - -umask 022 -PATH=/bin:/usr/bin - -[ "x$1" = "x" ] && exit 1 -[ "x$2" != "xPOST-INSTALL" ] && exit 0 - -MOZDIR=%%MOZDIR%% -MOZBIN=${MOZDIR}/%%MOZILLA_BIN%% -REGXPCOM=${MOZDIR}/regxpcom -REGCHROME=${MOZDIR}/regchrome - -rm -rf ${MOZDIR}/chrome/overlayinfo -rm -f ${MOZDIR}/chrome/*.rdf -mkdir -p ${MOZDIR}/chrome/overlayinfo -rm -f ${MOZDIR}/component.reg - -cd ${MOZDIR} || exit 1 -if [ -f ${REGXPCOM} ]; then - ./run-mozilla.sh ${REGXPCOM} || true -fi -if [ -f ${REGCHROME} ]; then - ./run-mozilla.sh ${REGCHROME} || true -fi -if [ -f ${MOZBIN} -a "${1%-*}" = "nvu" ]; then - ./run-mozilla.sh ${MOZBIN} -register > /dev/null 2>&1 -fi -cp -R %%LOCALBASE%%/lib/xpi/symlinks/%%MOZILLA%%/ %%MOZDIR%%/extensions/ > /dev/null 2>&1 - -exit 0 |
