Index: head/Mk/bsd.gecko.mk =================================================================== --- head/Mk/bsd.gecko.mk (revision 380781) +++ head/Mk/bsd.gecko.mk (revision 380782) @@ -1,595 +1,599 @@ #-*- tab-width: 4; -*- # ex:ts=4 # # Date created: 12 Nov 2005 # Whom: Michael Johnson # # $FreeBSD$ # # 4 column tabs prevent hair loss and tooth decay! # bsd.gecko.mk abstracts the selection of gecko-based backends. It allows users # and porters to support any available gecko backend without needing to build # many conditional tests. ${USE_GECKO} is the list of backends that your port # can handle, and ${GECKO} is set by bsd.gecko.mk to be the chosen backend. # Users set ${WITH_GECKO} to the list of gecko backends they want on their # system. .if defined(USE_GECKO) .if !defined(_POSTMKINCLUDED) && !defined(Gecko_Pre_Include) Gecko_Pre_Include= bsd.gecko.mk # This file contains some reusable components for mozilla ports. It's of # use primarily to apps from the mozilla project itself (such as Firefox, # Thunderbird, etc.), and probably won't be of use for gecko-based ports # like epiphany, galeon, etc. # # You need to make sure to add USE_GECKO=gecko to for your port can uses # one of these options below. # # Ports can use the following: # # USE_MOZILLA By default, it enables every system dependency # listed in '_ALL_DEPENDS'. If your port doesn't # need one of those then you can use '-' like # 'USE_MOZILLA= -png -vpx' to subtract the # dependencies. Experimental deps use '+' like # 'USE_MOZILLA= +speex +theora'. # # MOZILLA_PLIST_DIRS List of directories to descend into when installing # and creating the plist # # MOZ_PIS_SCRIPTS List of scripts residing in ${FILESDIR} to be # filtered through MOZCONFIG_SED and installed along # with our Pluggable Init Scripts (PIS) # # MOZ_SED_ARGS sed(1) commands through which MOZ_PIS_SCRIPTS are # filtered. There is a default set defined here, so # you probably want to add to MOZ_SED_ARGS rather # than clobber it # # MOZ_OPTIONS configure arguments (added to .mozconfig). If # NOMOZCONFIG is defined, you probably want to set # CONFIGURE_ARGS+=${MOZ_OPTIONS} # # MOZ_MK_OPTIONS The make(1) arguments (added to .mozconfig). If # NOMOZCONFIG is defined, you probably want to set # MAKE_ARGS+=${MOZ_MK_OPTIONS} # # MOZ_EXPORT Environment variables for the build process (added # to .mozconfig). If NOMOZCONFIG is defined, you # probably want to set MAKE_ENV+=${MOZ_EXPORT} # # MOZ_CHROME A variable for the --enable-chrome-format= in # CONFIGURE_ARGS. The default is omni. # # MOZ_TOOLKIT A variable for the --enable-default-toolkit= in # CONFIGURE_ARGS. The default is cairo-gtk2. # # MOZ_EXTENSIONS A list of extensions to build # # MOZ_PROTOCOLS A list of protocols to build (http, ftp, etc.) # # PORT_MOZCONFIG Defaults to ${FILESDIR}/mozconfig.in, but can be # set to a generic mozconfig included with the port # # NOMOZCONFIG Don't drop a customized .mozconfig into the build # directory. Options will have to be specified in # CONFIGURE_ARGS instead # MAINTAINER?= gecko@FreeBSD.org MOZILLA?= ${PORTNAME} MOZILLA_VER?= ${PORTVERSION} MOZILLA_BIN?= ${PORTNAME}-bin MOZILLA_EXEC_NAME?=${MOZILLA} MOZ_RPATH?= ${MOZILLA} USES+= cpe compiler:c++11-lang gmake iconv perl5 pkgconfig \ python:2.7,build desktop-file-utils CPE_VENDOR?=mozilla USE_PERL5= build USE_XORG= xext xrender xt .if ${MOZILLA} != "libxul" BUNDLE_LIBS= yes .endif MOZILLA_SUFX?= none MOZSRC?= ${WRKSRC} WRKSRC?= ${WRKDIR}/mozilla PLISTF?= ${WRKDIR}/plist_files MOZ_OBJDIR?= ${WRKSRC}/obj-${CONFIGURE_TARGET} MOZ_PIS_DIR?= lib/${MOZILLA}/init.d PORT_MOZCONFIG?= ${FILESDIR}/mozconfig.in MOZCONFIG?= ${WRKSRC}/.mozconfig # XXX Not ?= because fmake uses MAKEFILE internally MAKEFILE= ${WRKSRC}/client.mk MOZILLA_PLIST_DIRS?= bin lib share/pixmaps share/applications PKGINSTALL?= ${WRKDIR}/pkg-install PKGDEINSTALL?= ${WRKDIR}/pkg-deinstall PKGINSTALL_INC?= ${.CURDIR}/../../www/firefox/files/pkg-install.in PKGDEINSTALL_INC?= ${.CURDIR}/../../www/firefox/files/pkg-deinstall.in MOZ_PKGCONFIG_FILES?= ${MOZILLA}-gtkmozembed ${MOZILLA}-js \ ${MOZILLA}-xpcom ${MOZILLA}-plugin ALL_TARGET?= build CONFIGURE_TARGET:=${ARCH:C/amd64/x86_64/}-portbld-${OPSYS:tl}${OSREL} MOZ_EXPORT+= ${CONFIGURE_ENV} \ PERL="${PERL}" MOZ_OPTIONS+= ${CONFIGURE_TARGET} --prefix="${PREFIX}" MOZ_MK_OPTIONS+=MOZ_OBJDIR="${MOZ_OBJDIR}" CPPFLAGS+= -isystem${LOCALBASE}/include LDFLAGS+= -L${LOCALBASE}/lib -Wl,-rpath,${PREFIX}/lib/${MOZILLA} # use jemalloc 3.0.0 API for stats/tuning MOZ_EXPORT+= MOZ_JEMALLOC3=1 .if ${OSVERSION} < 1000012 || ${MOZILLA_VER:R:R} >= 37 MOZ_OPTIONS+= --enable-jemalloc .endif # Standard depends _ALL_DEPENDS= cairo event ffi graphite harfbuzz hunspell icu jpeg nspr nss opus png pixman soundtouch sqlite vorbis vpx cairo_LIB_DEPENDS= libcairo.so:${PORTSDIR}/graphics/cairo cairo_MOZ_OPTIONS= --enable-system-cairo event_LIB_DEPENDS= libevent.so:${PORTSDIR}/devel/libevent2 event_MOZ_OPTIONS= --with-system-libevent ffi_LIB_DEPENDS= libffi.so:${PORTSDIR}/devel/libffi ffi_MOZ_OPTIONS= --enable-system-ffi .if exists(${FILESDIR}/patch-bug847568) graphite_LIB_DEPENDS= libgraphite2.so:${PORTSDIR}/graphics/graphite2 graphite_MOZ_OPTIONS= --with-system-graphite2 harfbuzz_LIB_DEPENDS= libharfbuzz.so:${PORTSDIR}/print/harfbuzz harfbuzz_MOZ_OPTIONS= --with-system-harfbuzz .endif hunspell_LIB_DEPENDS= libhunspell-1.3.so:${PORTSDIR}/textproc/hunspell hunspell_MOZ_OPTIONS= --enable-system-hunspell icu_LIB_DEPENDS= libicui18n.so:${PORTSDIR}/devel/icu icu_MOZ_OPTIONS= --with-system-icu --with-intl-api -jpeg_BUILD_DEPENDS=yasm:${PORTSDIR}/devel/yasm # XXX depends on ports/180159 or package flavor support #jpeg_LIB_DEPENDS= libjpeg.so:${PORTSDIR}/graphics/libjpeg-turbo jpeg_LIB_DEPENDS= libjpeg.so:${PORTSDIR}/graphics/jpeg jpeg_MOZ_OPTIONS= --with-system-jpeg=${LOCALBASE} nspr_LIB_DEPENDS= libnspr4.so:${PORTSDIR}/devel/nspr nspr_MOZ_OPTIONS= --with-system-nspr nss_LIB_DEPENDS= libnss3.so:${PORTSDIR}/security/nss nss_MOZ_OPTIONS= --with-system-nss .if exists(${FILESDIR}/patch-z-bug517422) opus_LIB_DEPENDS= libopus.so:${PORTSDIR}/audio/opus opus_MOZ_OPTIONS= --with-system-opus .endif pixman_LIB_DEPENDS= libpixman-1.so:${PORTSDIR}/x11/pixman pixman_MOZ_OPTIONS= --enable-system-pixman png_LIB_DEPENDS= libpng.so:${PORTSDIR}/graphics/png png_MOZ_OPTIONS= --with-system-png=${LOCALBASE} .if exists(${FILESDIR}/patch-z-bug517422) soundtouch_LIB_DEPENDS= libSoundTouch.so:${PORTSDIR}/audio/soundtouch soundtouch_MOZ_OPTIONS= --with-system-soundtouch # XXX disabled: bug 913854 not yet upstreamed speex_LIB_DEPENDS= libspeexdsp.so:${PORTSDIR}/audio/speex speex_MOZ_OPTIONS= --with-system-speex .endif sqlite_LIB_DEPENDS= libsqlite3.so:${PORTSDIR}/databases/sqlite3 sqlite_MOZ_OPTIONS= --enable-system-sqlite .if exists(${FILESDIR}/patch-z-bug517422) # XXX disabled: update to 1.2.x or review backported fixes theora_LIB_DEPENDS= libtheora.so:${PORTSDIR}/multimedia/libtheora theora_MOZ_OPTIONS= --with-system-theora vorbis_LIB_DEPENDS= libvorbis.so:${PORTSDIR}/audio/libvorbis vorbis_MOZ_OPTIONS= --with-system-vorbis --with-system-ogg .endif -vpx_BUILD_DEPENDS= yasm:${PORTSDIR}/devel/yasm vpx_LIB_DEPENDS= libvpx.so:${PORTSDIR}/multimedia/libvpx vpx_MOZ_OPTIONS= --with-system-libvpx .for use in ${USE_MOZILLA} ${use:S/-/_WITHOUT_/}= ${TRUE} .endfor .for dep in ${_ALL_DEPENDS} ${USE_MOZILLA:M+*:S/+//} .if !defined(_WITHOUT_${dep}) BUILD_DEPENDS+= ${${dep}_BUILD_DEPENDS} LIB_DEPENDS+= ${${dep}_LIB_DEPENDS} RUN_DEPENDS+= ${${dep}_RUN_DEPENDS} MOZ_OPTIONS+= ${${dep}_MOZ_OPTIONS} .else BUILD_DEPENDS+= ${-${dep}_BUILD_DEPENDS} .endif .endfor # Standard options MOZ_CHROME?= omni MOZ_TOOLKIT?= cairo-gtk2 MOZ_OPTIONS+= \ --enable-chrome-format=${MOZ_CHROME} \ --enable-default-toolkit=${MOZ_TOOLKIT} \ --with-pthreads # Configure options for install .if !defined(MOZ_EXTENSIONS) MOZ_OPTIONS+= --enable-extensions=default .else MOZ_OPTIONS+= --enable-extensions=${MOZ_EXTENSIONS} .endif .if !defined(MOZ_PROTOCOLS) MOZ_OPTIONS+= --enable-necko-protocols=default .else MOZ_OPTIONS+= --enable-necko-protocols=${MOZ_PROTOCOLS} .endif # others MOZ_OPTIONS+= --with-system-zlib \ --with-system-bz2 \ --enable-unified-compilation \ --disable-debug-symbols \ --disable-glibtest \ --disable-gtktest \ --disable-freetypetest \ --disable-installer \ --disable-updater \ --disable-pedantic # XXX stolen from www/chromium MOZ_EXPORT+= MOZ_GOOGLE_API_KEY=AIzaSyBsp9n41JLW8jCokwn7vhoaMejDFRd1mp8 .if ${PORT_OPTIONS:MGTK3} MOZ_TOOLKIT= cairo-gtk3 .endif .if ${MOZ_TOOLKIT:Mcairo-qt} # don't use - transparent backgrounds (bug 521582), USE_MOZILLA+= -cairo # ports/169343 USE_DISPLAY=yes # install USE_GNOME+= pango USE_QT5+= qmake_build buildtools_build gui network quick printsupport MOZ_EXPORT+= HOST_QMAKE="${QMAKE}" HOST_MOC="${MOC}" HOST_RCC="${RCC}" .elif ${MOZ_TOOLKIT:Mcairo-gtk3} USE_GNOME+= gtk30 . if ${MOZILLA_VER:R:R} >= 32 USE_GNOME+= gtk20 # bug 624422 . endif .else # gtk2, cairo-gtk2 USE_GNOME+= gtk20 .endif .if ${PORT_OPTIONS:MOPTIMIZED_CFLAGS} CFLAGS+= -O3 MOZ_EXPORT+= MOZ_OPTIMIZE_FLAGS="${CFLAGS:M-O*}" MOZ_OPTIONS+= --enable-optimize .else MOZ_OPTIONS+= --disable-optimize .endif +.if ${PORT_OPTIONS:MCANBERRA} +RUN_DEPENDS+= libcanberra>0:${PORTSDIR}/audio/libcanberra +.endif + .if ${PORT_OPTIONS:MDBUS} BUILD_DEPENDS+= libnotify>0:${PORTSDIR}/devel/libnotify LIB_DEPENDS+= libdbus-glib-1.so:${PORTSDIR}/devel/dbus-glib \ libstartup-notification-1.so:${PORTSDIR}/x11/startup-notification MOZ_OPTIONS+= --enable-startup-notification .else MOZ_OPTIONS+= --disable-dbus --disable-libnotify .endif .if ${PORT_OPTIONS:MGSTREAMER} USE_GSTREAMER1?=good libav MOZ_OPTIONS+= --enable-gstreamer=1.0 .else MOZ_OPTIONS+= --disable-gstreamer .endif .if ${PORT_OPTIONS:MGCONF} BUILD_DEPENDS+= ${gconf2_DETECT}:${gconf2_LIB_DEPENDS:C/.*://} USE_GNOME+= gconf2:build MOZ_OPTIONS+= --enable-gconf .else MOZ_OPTIONS+= --disable-gconf .endif .if ${PORT_OPTIONS:MGIO} && ! ${MOZ_TOOLKIT:Mcairo-qt} MOZ_OPTIONS+= --enable-gio .else MOZ_OPTIONS+= --disable-gio .endif .if ${PORT_OPTIONS:MGNOMEUI} BUILD_DEPENDS+= ${libgnomeui_DETECT}:${libgnomeui_LIB_DEPENDS:C/.*://} USE_GNOME+= libgnomeui:build MOZ_OPTIONS+= --enable-gnomeui .else MOZ_OPTIONS+= --disable-gnomeui .endif .if ${PORT_OPTIONS:MLIBPROXY} LIB_DEPENDS+= libproxy.so:${PORTSDIR}/net/libproxy MOZ_OPTIONS+= --enable-libproxy .else MOZ_OPTIONS+= --disable-libproxy .endif .if ${PORT_OPTIONS:MPGO} USES:= compiler:gcc-c++11-lib ${USES:Ncompiler*c++11*} USE_DISPLAY=yes ALL_TARGET= profiledbuild MOZ_EXPORT+=MOZ_OPTIMIZE_FLAGS="-Os" MOZ_PGO_OPTIMIZE_FLAGS="${CFLAGS:M-O*}" .endif .if ${PORT_OPTIONS:MALSA} LIB_DEPENDS+= libasound.so:${PORTSDIR}/audio/alsa-lib RUN_DEPENDS+= ${LOCALBASE}/lib/alsa-lib/libasound_module_pcm_oss.so:${PORTSDIR}/audio/alsa-plugins MOZ_OPTIONS+= --enable-alsa .endif .if ${PORT_OPTIONS:MPULSEAUDIO} . if ${PORT_OPTIONS:MALSA} BUILD_DEPENDS+= pulseaudio>0:${PORTSDIR}/audio/pulseaudio . else # pull pulse package if we cannot fallback to another backend LIB_DEPENDS+= libpulse.so:${PORTSDIR}/audio/pulseaudio . endif MOZ_OPTIONS+= --enable-pulseaudio .else MOZ_OPTIONS+= --disable-pulseaudio .endif .if ${PORT_OPTIONS:MDEBUG} MOZ_OPTIONS+= --enable-debug --disable-release STRIP= # ports/184285 .else MOZ_OPTIONS+= --disable-debug --enable-release .endif .if ${PORT_OPTIONS:MDTRACE} . if ${OSVERSION} < 1000510 BROKEN= dtrace -G crashes with C++ object files . endif MOZ_OPTIONS+= --enable-dtrace LIBS+= -lelf STRIP= .else MOZ_OPTIONS+= --disable-dtrace .endif .if ${PORT_OPTIONS:MLOGGING} || ${PORT_OPTIONS:MDEBUG} MOZ_OPTIONS+= --enable-logging .else MOZ_OPTIONS+= --disable-logging .endif .if ${PORT_OPTIONS:MPROFILE} MOZ_OPTIONS+= --enable-profiling STRIP= .else MOZ_OPTIONS+= --disable-profiling .endif .if ${PORT_OPTIONS:MTEST} USE_XORG+= xscrnsaver MOZ_OPTIONS+= --enable-tests .else MOZ_OPTIONS+= --disable-tests .endif .if !defined(STRIP) || ${STRIP} == "" MOZ_OPTIONS+= --disable-strip --disable-install-strip .else MOZ_OPTIONS+= --enable-strip --enable-install-strip .endif # _MAKE_JOBS is only available after bsd.port.post.mk, thus cannot be # used in .mozconfig. And client.mk automatically uses -jN where N # is what multiprocessing.cpu_count() returns. .if defined(MAKE_JOBS_NUMBER) MOZ_MAKE_FLAGS+=-j${MAKE_JOBS_NUMBER} .endif .if defined(MOZ_MAKE_FLAGS) MOZ_MK_OPTIONS+=MOZ_MAKE_FLAGS="${MOZ_MAKE_FLAGS}" .endif MOZ_SED_ARGS+= -e's|@CPPFLAGS@|${CPPFLAGS}|g' \ -e 's|@CFLAGS@|${CFLAGS}|g' \ -e 's|@LDFLAGS@|${LDFLAGS}|g' \ -e 's|@LIBS@|${LIBS}|g' \ -e 's|@LOCALBASE@|${LOCALBASE}|g' \ -e 's|@PERL@|${PERL5}|g' \ -e 's|@MOZDIR@|${PREFIX}/lib/${MOZILLA}|g' \ -e 's|%%PREFIX%%|${PREFIX}|g' \ -e 's|%%CFLAGS%%|${CFLAGS}|g' \ -e 's|%%LDFLAGS%%|${LDFLAGS}|g' \ -e 's|%%LIBS%%|${LIBS}|g' \ -e 's|%%LOCALBASE%%|${LOCALBASE}|g' \ -e 's|%%PERL%%|${PERL5}|g' \ -e 's|%%MOZILLA%%|${MOZILLA}|g' \ -e 's|%%MOZILLA_BIN%%|${MOZILLA_BIN}|g' \ -e 's|%%MOZDIR%%|${PREFIX}/lib/${MOZILLA}|g' MOZCONFIG_SED?= ${SED} ${MOZ_SED_ARGS} .if ${ARCH} == amd64 . if ${USE_MOZILLA:M-nss} USE_BINUTILS= # intel-gcm.s CFLAGS+= -B${LOCALBASE}/bin LDFLAGS+= -B${LOCALBASE}/bin . if ${OSVERSION} < 1000041 && exists(/usr/lib/libcxxrt.so) && \ ${CXXFLAGS:M-stdlib=libc++} LIBS+= -lcxxrt . endif . endif .elif ${ARCH:Mpowerpc*} USES:= compiler:gcc-c++11-lib ${USES:Ncompiler*c++11*} CFLAGS+= -D__STDC_CONSTANT_MACROS . if ${ARCH} == "powerpc64" MOZ_EXPORT+= UNAME_m="${ARCH}" CFLAGS+= -mminimal-toc . endif .elif ${ARCH} == "sparc64" # Work around miscompilation/mislinkage of the sCanonicalVTable hacks. MOZ_OPTIONS+= --disable-v1-string-abi .endif .else # bsd.port.post.mk pre-extract: gecko-pre-extract gecko-pre-extract: .if ${PORT_OPTIONS:MPGO} @${ECHO} "*****************************************************************" @${ECHO} "**************************** attention **************************" @${ECHO} "*****************************************************************" @${ECHO} "To build ${MOZILLA} with PGO support you need a running X server and" @${ECHO} " build this port with an user who could access the X server! " @${ECHO} "" @${ECHO} "During the build a ${MOZILLA} instance will start and run some test." @${ECHO} " Do not interrupt or close ${MOZILLA} during this tests! " @${ECHO} "*****************************************************************" @sleep 10 .endif post-patch: gecko-post-patch gecko-moz-pis-patch gecko-post-patch: .if exists(${PKGINSTALL_INC}) @${MOZCONFIG_SED} < ${PKGINSTALL_INC} > ${PKGINSTALL} .endif .if exists(${PKGDEINSTALL_INC}) @${MOZCONFIG_SED} < ${PKGDEINSTALL_INC} > ${PKGDEINSTALL} .endif @${RM} -f ${MOZCONFIG} .if !defined(NOMOZCONFIG) @if [ -e ${PORT_MOZCONFIG} ] ; then \ ${MOZCONFIG_SED} < ${PORT_MOZCONFIG} >> ${MOZCONFIG} ; \ fi .for arg in ${MOZ_OPTIONS} @${ECHO_CMD} ac_add_options ${arg:Q} >> ${MOZCONFIG} .endfor .for arg in ${MOZ_MK_OPTIONS} @${ECHO_CMD} mk_add_options ${arg:Q} >> ${MOZCONFIG} .endfor .for var in ${MOZ_EXPORT} @${ECHO_CMD} export ${var:Q} >> ${MOZCONFIG} .endfor .endif # .if !defined(NOMOZCONFIG) .if exists(${MOZSRC}/build/unix/mozilla-config.in) @${REINPLACE_CMD} -e 's/%{idldir}/%idldir%/g ; \ s|"%FULL_NSPR_CFLAGS%"|`nspr-config --cflags`|g ; \ s|"%FULL_NSPR_LIBS%"|`nspr-config --libs`|g' \ ${MOZSRC}/build/unix/mozilla-config.in .endif .if ${USE_MOZILLA:M-nspr} @${ECHO_MSG} "===> Applying NSPR patches" @for i in ${.CURDIR}/../../devel/nspr/files/patch-*; do \ ${PATCH} ${PATCH_ARGS} -d ${MOZSRC}/nsprpub/build < $$i; \ done .endif .if ${USE_MOZILLA:M-nss} @${ECHO_MSG} "===> Applying NSS patches" @for i in ${.CURDIR}/../../security/nss/files/patch-*; do \ ${PATCH} ${PATCH_ARGS} -d ${MOZSRC}/security/nss < $$i; \ done .endif @for f in \ ${WRKSRC}/directory/c-sdk/config/FreeBSD.mk \ ${WRKSRC}/directory/c-sdk/configure \ ${MOZSRC}/security/coreconf/FreeBSD.mk \ ${MOZSRC}/js/src/Makefile.in \ ${MOZSRC}/js/src/configure \ ${MOZSRC}/configure \ ${WRKSRC}/configure; do \ if [ -f $$f ] ; then \ ${REINPLACE_CMD} -Ee 's|-lc_r|${PTHREAD_LIBS}|g ; \ s|-l?pthread|${PTHREAD_LIBS}|g ; \ s|echo aout|echo elf|g ; \ s|/usr/X11R6|${LOCALBASE}|g' \ $$f; \ fi; \ done @if [ -f ${WRKSRC}/config/baseconfig.mk ] ; then \ ${REINPLACE_CMD} -e 's|%%MOZILLA%%|${MOZILLA}|g' \ ${WRKSRC}/config/baseconfig.mk; \ fi @${REINPLACE_CMD} -e 's|%%MOZILLA%%|${MOZILLA}|g' \ ${MOZSRC}/config/baseconfig.mk @${REINPLACE_CMD} -e 's|%%PREFIX%%|${PREFIX}|g ; \ s|%%LOCALBASE%%|${LOCALBASE}|g' \ ${MOZSRC}/build/unix/run-mozilla.sh @${REINPLACE_CMD} -e 's|/usr/local/netscape|${LOCALBASE}|g ; \ s|/usr/local/lib/netscape|${LOCALBASE}/lib|g' \ ${MOZSRC}/xpcom/io/SpecialSystemDirectory.cpp @${REINPLACE_CMD} -e 's|/etc|${PREFIX}&|g' \ ${MOZSRC}/xpcom/build/nsXPCOMPrivate.h @${REINPLACE_CMD} -e 's|/usr/local|${LOCALBASE}|g' \ -e 's|mozilla/plugins|browser_plugins|g' \ -e 's|share/mozilla/extensions|lib/xpi|g' \ ${MOZSRC}/xpcom/io/nsAppFileLocationProvider.cpp \ ${MOZSRC}/toolkit/xre/nsXREDirProvider.cpp @${REINPLACE_CMD} -e 's|%%LOCALBASE%%|${LOCALBASE}|g' \ ${MOZSRC}/extensions/spellcheck/hunspell/src/mozHunspell.cpp # handles mozilla pis scripts. gecko-moz-pis-patch: .for moz in ${MOZ_PIS_SCRIPTS} @${MOZCONFIG_SED} < ${FILESDIR}/${moz} > ${WRKDIR}/${moz} .endfor do-configure: gecko-do-configure gecko-do-configure: @(if ! ${CONFIGURE_ENV} ${DO_MAKE_BUILD} configure; then \ ${ECHO_MSG} "===> Script \"${CONFIGURE_SCRIPT}\" failed unexpectedly."; \ (${ECHO_CMD} ${CONFIGURE_FAIL_MESSAGE}) | ${FMT} 75 79 ; \ ${FALSE}; \ fi) pre-install: gecko-moz-pis-pre-install post-install-script: gecko-create-plist gecko-create-plist: port-post-install .if !target(port-post-install) port-post-install: @${DO_NADA} .endif gecko-create-plist: # Create the plist ${RM} -f ${PLISTF} .for dir in ${MOZILLA_PLIST_DIRS} @cd ${STAGEDIR}${PREFIX}/${dir} && ${FIND} -H -s * ! -type d | \ ${SED} -e 's|^|${dir}/|' >> ${PLISTF} .endfor ${CAT} ${PLISTF} | ${SORT} >> ${TMPPLIST} gecko-moz-pis-pre-install: .if defined(MOZ_PIS_SCRIPTS) ${MKDIR} ${STAGEDIR}${PREFIX}/${MOZ_PIS_DIR} .for moz in ${MOZ_PIS_SCRIPTS} ${INSTALL_SCRIPT} ${WRKDIR}/${moz} ${STAGEDIR}${PREFIX}/${MOZ_PIS_DIR} .endfor .endif .endif .endif # HERE THERE BE TACOS -- adamw Index: head/mail/thunderbird/Makefile =================================================================== --- head/mail/thunderbird/Makefile (revision 380781) +++ head/mail/thunderbird/Makefile (revision 380782) @@ -1,178 +1,179 @@ # Created by: Joe Marcus Clarke # $FreeBSD$ PORTNAME= thunderbird DISTVERSION= 31.5.0 +PORTREVISION= 1 CATEGORIES= mail news net-im ipv6 MASTER_SITES= MOZILLA/${PORTNAME}/releases/${DISTVERSION}/source \ https://ftp.mozilla.org/pub/mozilla.org/${PORTNAME}/candidates/${DISTVERSION}-candidates/build1/source/ DISTFILES= ${PORTNAME}-${DISTVERSION}.source${EXTRACT_SUFX} EXTRACT_ONLY= ${PORTNAME}-${DISTVERSION}.source${EXTRACT_SUFX} MAINTAINER= gecko@FreeBSD.org COMMENT= Mozilla Thunderbird is standalone mail and news that stands above BUILD_DEPENDS= nspr>=4.10.6:${PORTSDIR}/devel/nspr \ nss>=3.16:${PORTSDIR}/security/nss \ libevent2>=2.0.21_2:${PORTSDIR}/devel/libevent2 \ cairo>=1.12.16_1,2:${PORTSDIR}/graphics/cairo \ soundtouch>=1.8.0:${PORTSDIR}/audio/soundtouch \ harfbuzz>=0.9.25:${PORTSDIR}/print/harfbuzz \ graphite2>=1.2.4:${PORTSDIR}/graphics/graphite2 \ - libvorbis>=1.3.4:${PORTSDIR}/audio/libvorbis \ + libvorbis>=1.3.5:${PORTSDIR}/audio/libvorbis \ opus>=1.1:${PORTSDIR}/audio/opus \ libvpx>=1.3.0:${PORTSDIR}/multimedia/libvpx \ sqlite3>=3.8.4.2:${PORTSDIR}/databases/sqlite3 \ ${PYTHON_PKGNAMEPREFIX}sqlite3>0:${PORTSDIR}/databases/py-sqlite3 \ v4l_compat>0:${PORTSDIR}/multimedia/v4l_compat \ autoconf-2.13:${PORTSDIR}/devel/autoconf213 \ zip:${PORTSDIR}/archivers/zip \ unzip:${PORTSDIR}/archivers/unzip LIB_DEPENDS= libv4l2.so:${PORTSDIR}/multimedia/libv4l EM_VERSION= 1.7.2 L_VERSION= 3.3.5 SSP_UNSAFE= yes USE_GECKO= gecko USE_MOZILLA= # empty USE_QT5= # empty QT_NONSTANDARD= yes USE_GL= gl USES= dos2unix tar:bzip2 DOS2UNIX_FILES= mozilla/media/webrtc/trunk/webrtc/system_wrappers/source/spreadsortlib/spreadsort.hpp MOZ_OPTIONS= --program-transform-name='s/thunderbird/${MOZILLA}/' \ --enable-single-profile --disable-profilesharing \ --enable-application=mail --enable-official-branding MOZ_MK_OPTIONS= MOZ_THUNDERBIRD=1 MAIL_PKG_SHARED=1 MOZ_EXPORT= MOZ_THUNDERBIRD=1 MAIL_PKG_SHARED=1 MOZ_PKGCONFIG_FILES= PORTNAME_ICON= ${MOZILLA}.png PORTNAME_ICON_SRC= ${PREFIX}/lib/${MOZILLA}/chrome/icons/default/default48.png SYSTEM_PREFS= ${FAKEDIR}/lib/${PORTNAME}/defaults/pref/${PORTNAME}.js MOZ_PIS_SCRIPTS=moz_pis_S50cleanhome OPTIONS_DEFINE= ENIGMAIL LIGHTNING -OPTIONS_DEFAULT=ENIGMAIL LIGHTNING +OPTIONS_DEFAULT=CANBERRA ENIGMAIL LIGHTNING .include "${.CURDIR}/../../www/firefox/Makefile.options" OPTIONS_DEFAULT:=${OPTIONS_DEFAULT:S/GSTREAMER//} .include WRKSRC= ${WRKDIR}/comm-esr31 MOZSRC:= ${WRKSRC}/mozilla XPI_LIBDIR= ${PREFIX}/lib/xpi .if ${PORTVERSION:R:R} < 33 CONFIGURE_TARGET:=${CONFIGURE_TARGET:S/portbld/unknown/} MOZ_OPTIONS:= ${MOZ_OPTIONS:S/${CONFIGURE_TARGET}//} .endif .if ${PORT_OPTIONS:MALSA} RUN_DEPENDS+= alsa-lib>=1.0.27.2_1:${PORTSDIR}/audio/alsa-lib .endif .if ${PORT_OPTIONS:MGSTREAMER} RUN_DEPENDS+= gstreamer1-libav>=1.2.4_1:${PORTSDIR}/multimedia/gstreamer1-libav .endif .if ${PORT_OPTIONS:MENIGMAIL} MASTER_SITES+= https://www.enigmail.net/download/source/:enigmail DISTFILES+= ${EM_DISTFILE}:enigmail RUN_DEPENDS+= gpg:${PORTSDIR}/security/gnupg EM_DISTNAME= enigmail-${EM_VERSION} EM_DISTFILE= ${EM_DISTNAME}.tar.gz EM_XPI_FILE= ${WRKSRC}/mailnews/extensions/enigmail/build/${EM_DISTNAME}-${OPSYS:tl}-${ARCH:S/amd64/x86_64/:S/i386/x86/}-gcc3.xpi EM_ORIG_ID= {847b3a00-7ab1-11d4-8f02-006008948af5} EM_ID= ${PORTNAME}@mozilla-enigmail.org EM_ID_RFILES= ${XPI_LIBDIR}/${EM_ID}/install.rdf \ ${XPI_LIBDIR}/${EM_ID}/components/enigmail.js \ ${XPI_LIBDIR}/${EM_ID}/modules/enigmailCommon.jsm .endif .if ${PORT_OPTIONS:MLIGHTNING} MOZ_OPTIONS+= --enable-calendar MOZ_MK_OPTIONS+= MOZ_CO_PROJECT=calendar LIGHTNING_DIR= share/lightning XPI_FILE= ${MOZ_OBJDIR}/mozilla/dist/xpi-stage/lightning-${L_VERSION}.en-US.${OPSYS:tl}${OSREL}-${ARCH:S/amd64/x86_64/}.xpi XPI_ORIG_ID= {e2fda1a4-762b-4020-b5ad-a41df1933103} XPI_ID= lightning@thunderbird.mozilla.org .else MOZ_OPTIONS+= --disable-calendar .endif post-extract: @${SED} -e 's|@PORTNAME_ICON@|${PORTNAME_ICON}|;s|@MOZILLA@|${MOZILLA}|' \ <${FILESDIR}/thunderbird.desktop.in >${WRKDIR}/${MOZILLA_EXEC_NAME}.desktop .if ${PORT_OPTIONS:MENIGMAIL} @${TAR} -xf ${_DISTDIR}/${EM_DISTFILE} \ -C ${WRKSRC}/mailnews/extensions .endif post-patch: @${REINPLACE_CMD} -e '/MOZPNG/s/=[0-9]*/=10511/' \ ${MOZSRC}/configure.in ${WRKSRC}/configure.in @${REINPLACE_CMD} -e 's|%%LOCALBASE%%|${LOCALBASE}|g' \ ${WRKSRC}/mail/app/nsMailApp.cpp .if ${PORT_OPTIONS:MENIGMAIL} @${REINPLACE_CMD} -e 's,/usr/bin/perl,${PERL},' \ ${WRKSRC}/mailnews/extensions/enigmail/util/fixlang.pl \ ${WRKSRC}/mailnews/extensions/enigmail/util/make-lang-xpi.pl @${REINPLACE_CMD} -e '/^xpi/s/$$/ all/' \ -e '/^all/s/ xpi//' \ -e '/^XPI_MODULE_VERS/s/= .*/= ${EM_VERSION}/' \ ${WRKSRC}/mailnews/extensions/enigmail/Makefile @${REINPLACE_CMD} -e '/em:version/s,>[^<]*<,>${EM_VERSION}<,' \ -e '/em:maxVersion/s/pre//' \ ${WRKSRC}/mailnews/extensions/enigmail/package/install.rdf .endif pre-configure: (cd ${WRKSRC} && ${LOCALBASE}/bin/autoconf-2.13) (cd ${MOZSRC} && ${LOCALBASE}/bin/autoconf-2.13) (cd ${MOZSRC}/js/src/ && ${LOCALBASE}/bin/autoconf-2.13) .if ${PORT_OPTIONS:MENIGMAIL} post-configure: cd ${WRKSRC}/mailnews/extensions/enigmail/ && \ ${SETENV} ${CONFIGURE_ENV} ${MAKE_ENV} ./configure post-build: ${DO_MAKE_BUILD:S/${MAKEFILE}/Makefile/} all xpi \ -C ${WRKSRC}/mailnews/extensions/enigmail .endif port-pre-install: ${MKDIR} ${STAGEDIR}${PREFIX}/lib/${PORTNAME}/defaults post-install: ${INSTALL_DATA} ${WRKDIR}/${MOZILLA_EXEC_NAME}.desktop ${STAGEDIR}${PREFIX}/share/applications ${LN} -sf ${PORTNAME_ICON_SRC} ${STAGEDIR}${PREFIX}/share/pixmaps/${PORTNAME_ICON} .if ${PORT_OPTIONS:MLIGHTNING} @${MKDIR} ${STAGEDIR}${XPI_LIBDIR}/${XPI_ID} ${STAGEDIR}${XPI_LIBDIR}/symlinks/thunderbird @(cd ${STAGEDIR}${XPI_LIBDIR}/${XPI_ID}; ${TAR} -xf ${XPI_FILE}) @${REINPLACE_CMD} -i "" "s/${XPI_ORIG_ID}/${XPI_ID}/" ${STAGEDIR}${XPI_LIBDIR}/${XPI_ID}/install.rdf @${CHMOD} -R a+rX,go-w ${STAGEDIR}${XPI_LIBDIR}/${XPI_ID} @${LN} -sf ${XPI_LIBDIR}/${XPI_ID} ${STAGEDIR}${XPI_LIBDIR}/symlinks/thunderbird 2>/dev/null || true @${ECHO_CMD} '@exec ${LN} -sf %D/lib/xpi/${XPI_ID} ${LOCALBASE}/lib/thunderbird/extensions 2>/dev/null || true' >> ${TMPPLIST} @${ECHO_CMD} '@unexec ${RM} -f ${LOCALBASE}/lib/thunderbird/extensions/${XPI_ID}' >> ${TMPPLIST} .endif .if ${PORT_OPTIONS:MENIGMAIL} @${MKDIR} ${STAGEDIR}${XPI_LIBDIR}/${EM_ID} ${STAGEDIR}${XPI_LIBDIR}/symlinks/${PORTNAME} @(cd ${STAGEDIR}${XPI_LIBDIR}/${EM_ID}; ${TAR} -xf ${EM_XPI_FILE}) @${REINPLACE_CMD} -i "" "s/${EM_ORIG_ID}/${EM_ID}/" ${EM_ID_RFILES:S/^/${STAGEDIR}/} @${CHMOD} -R a+rX,go-w ${STAGEDIR}${XPI_LIBDIR}/${EM_ID} @${LN} -sf ${XPI_LIBDIR}/${EM_ID} ${STAGEDIR}${XPI_LIBDIR}/symlinks/${PORTNAME} 2>/dev/null || true @${ECHO_CMD} '@exec ${LN} -sf %D/lib/xpi/${EM_ID} ${LOCALBASE}/lib/${PORTNAME}/extensions 2>/dev/null || true' >> ${TMPPLIST} @${ECHO_CMD} '@unexec ${RM} -f ${LOCALBASE}/lib/${PORTNAME}/extensions/${EM_ID}' >> ${TMPPLIST} .endif .include Index: head/mail/thunderbird/files/patch-z-bug517422 =================================================================== --- head/mail/thunderbird/files/patch-z-bug517422 (revision 380781) +++ head/mail/thunderbird/files/patch-z-bug517422 (revision 380782) @@ -1,492 +1,492 @@ # Allow more config/external/ libs built against system-wide version. diff --git config/Makefile.in config/Makefile.in index 5383399..0410004 100644 --- mozilla/config/Makefile.in +++ mozilla/config/Makefile.in @@ -79,6 +79,13 @@ export:: $(export-preqs) -DMOZ_NATIVE_ICU=$(MOZ_NATIVE_ICU) \ -DMOZ_NATIVE_GRAPHITE2=$(MOZ_NATIVE_GRAPHITE2) \ -DMOZ_NATIVE_HARFBUZZ=$(MOZ_NATIVE_HARFBUZZ) \ + -DMOZ_NATIVE_OGG=$(MOZ_NATIVE_OGG) \ + -DMOZ_NATIVE_THEORA=$(MOZ_NATIVE_THEORA) \ + -DMOZ_NATIVE_VORBIS=$(MOZ_NATIVE_VORBIS) \ + -DMOZ_NATIVE_TREMOR=$(MOZ_NATIVE_TREMOR) \ + -DMOZ_NATIVE_OPUS=$(MOZ_NATIVE_OPUS) \ + -DMOZ_NATIVE_SPEEX=$(MOZ_NATIVE_SPEEX) \ + -DMOZ_NATIVE_SOUNDTOUCH=$(MOZ_NATIVE_SOUNDTOUCH) \ $(srcdir)/system-headers | $(PERL) $(topsrcdir)/nsprpub/config/make-system-wrappers.pl system_wrappers $(INSTALL) system_wrappers $(DIST) diff --git config/external/moz.build config/external/moz.build index f67c5c7..eb909ce 100644 --- mozilla/config/external/moz.build +++ mozilla/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']: external_dirs += ['media/libvorbis'] -if CONFIG['MOZ_TREMOR']: +if CONFIG['MOZ_TREMOR'] and not CONFIG['MOZ_NATIVE_TREMOR']: external_dirs += ['media/libtremor'] -if CONFIG['MOZ_OPUS']: +if CONFIG['MOZ_OPUS'] and not CONFIG['MOZ_NATIVE_OPUS']: external_dirs += ['media/libopus'] if CONFIG['MOZ_WEBM']: @@ -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 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', ] PARALLEL_DIRS += ['../../' + i for i in external_dirs] diff --git config/system-headers config/system-headers index bef567c..9807c29 100644 --- mozilla/config/system-headers +++ mozilla/config/system-headers @@ -1050,8 +1050,6 @@ X11/Xutil.h xpt_struct.h xpt_xdr.h zmouse.h -speex/speex_resampler.h -soundtouch/SoundTouch.h #if MOZ_NATIVE_PNG==1 png.h #endif @@ -1119,6 +1117,8 @@ ogg/ogg.h ogg/os_types.h nestegg/nestegg.h cubeb/cubeb.h +speex/speex_resampler.h +soundtouch/SoundTouch.h #endif gst/gst.h gst/app/gstappsink.h @@ -1155,3 +1155,29 @@ graphite2/Segment.h harfbuzz/hb-ot.h harfbuzz/hb.h #endif +#if MOZ_NATIVE_OGG==1 +ogg/ogg.h +ogg/os_types.h +#endif +#if MOZ_NATIVE_THEORA==1 +theora/theoradec.h +#endif +#if MOZ_NATIVE_VORBIS==1 +vorbis/codec.h +vorbis/vorbisenc.h +#endif +#if MOZ_NATIVE_TREMOR==1 +tremor/ivorbiscodec.h +#endif +#if MOZ_NATIVE_OPUS==1 +opus.h +opus_multistream.h +opus/opus.h +opus/opus_multistream.h +#endif +#if MOZ_NATIVE_SPEEX==1 +speex/speex_resampler.h +#endif +#if MOZ_NATIVE_SOUNDTOUCH==1 +soundtouch/SoundTouch.h +#endif diff --git configure.in configure.in index 87db361..7947626 100644 --- mozilla/configure.in +++ mozilla/configure.in @@ -5211,6 +5211,63 @@ if test "${ac_cv_c_attribute_aligned}" != "0"; then fi dnl ======================================================== +dnl Check for libogg +dnl ======================================================== + +MOZ_ARG_WITH_BOOL(system-ogg, +[ --with-system-ogg Use system libogg (located with pkgconfig)], +MOZ_NATIVE_OGG=1, +MOZ_NATIVE_OGG=) + +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) +AC_SUBST(MOZ_OGG_CFLAGS) +AC_SUBST(MOZ_OGG_LIBS) + +dnl ======================================================== +dnl Check for libvorbis +dnl ======================================================== + +MOZ_ARG_WITH_BOOL(system-vorbis, +[ --with-system-vorbis Use system libvorbis (located with pkgconfig)], +MOZ_NATIVE_VORBIS=1, +MOZ_NATIVE_VORBIS=) + +if test -n "$MOZ_NATIVE_VORBIS"; then -+ PKG_CHECK_MODULES(MOZ_VORBIS, vorbis vorbisenc >= 1.3.4) ++ PKG_CHECK_MODULES(MOZ_VORBIS, vorbis vorbisenc >= 1.3.5) +fi + +AC_SUBST(MOZ_NATIVE_VORBIS) +AC_SUBST(MOZ_VORBIS_CFLAGS) +AC_SUBST(MOZ_VORBIS_LIBS) + +dnl ======================================================== +dnl Check for integer-only libvorbis aka tremor +dnl ======================================================== + +MOZ_ARG_WITH_BOOL(system-tremor, +[ --with-system-tremor Use system libtremor (located with pkgconfig)], +MOZ_NATIVE_TREMOR=1, +MOZ_NATIVE_TREMOR=) + +if test -n "$MOZ_NATIVE_TREMOR"; then + PKG_CHECK_MODULES(MOZ_TREMOR, vorbisidec >= 1.2.1) +fi + +AC_SUBST(MOZ_NATIVE_TREMOR) +AC_SUBST(MOZ_TREMOR_CFLAGS) +AC_SUBST(MOZ_TREMOR_LIBS) + +dnl ======================================================== dnl = Disable Opus audio codec support dnl ======================================================== MOZ_ARG_DISABLE_BOOL(opus, @@ -5219,6 +5274,97 @@ MOZ_ARG_DISABLE_BOOL(opus, MOZ_OPUS=1) dnl ======================================================== +dnl Check for libopus +dnl ======================================================== + +MOZ_ARG_WITH_BOOL(system-opus, +[ --with-system-opus Use system libopus (located with pkgconfig)], +MOZ_NATIVE_OPUS=1, +MOZ_NATIVE_OPUS=) + +if test -n "$MOZ_NATIVE_OPUS"; then + PKG_CHECK_MODULES(MOZ_OPUS, opus >= 1.1) +else + MOZ_OPUS_CFLAGS='-I$(topsrcdir)/media/libopus/include' +fi + +AC_SUBST(MOZ_NATIVE_OPUS) +AC_SUBST(MOZ_OPUS_CFLAGS) +AC_SUBST(MOZ_OPUS_LIBS) + +dnl ======================================================== +dnl Check for libtheora +dnl ======================================================== + +MOZ_ARG_WITH_BOOL(system-theora, +[ --with-system-theora Use system libtheora (located with pkgconfig)], +MOZ_NATIVE_THEORA=1, +MOZ_NATIVE_THEORA=) + +if test -n "$MOZ_NATIVE_THEORA"; then + PKG_CHECK_MODULES(MOZ_THEORA, theora >= 1.2) +fi + +AC_SUBST(MOZ_NATIVE_THEORA) +AC_SUBST(MOZ_THEORA_CFLAGS) +AC_SUBST(MOZ_THEORA_LIBS) + +dnl ======================================================== +dnl Check for libspeex resampler +dnl ======================================================== + +MOZ_ARG_WITH_BOOL(system-speex, +[ --with-system-speex Use system libspeex (located with pkgconfig)], +MOZ_NATIVE_SPEEX=1, +MOZ_NATIVE_SPEEX=) + +if test -n "$MOZ_NATIVE_SPEEX"; then + PKG_CHECK_MODULES(MOZ_SPEEX, speexdsp >= 1.2) +fi + +AC_SUBST(MOZ_NATIVE_SPEEX) +AC_SUBST(MOZ_SPEEX_CFLAGS) +AC_SUBST(MOZ_SPEEX_LIBS) + +dnl ======================================================== +dnl Check for libsoundtouch +dnl ======================================================== + +MOZ_ARG_WITH_BOOL(system-soundtouch, +[ --with-system-soundtouch Use system libsoundtouch (located with pkgconfig)], +MOZ_NATIVE_SOUNDTOUCH=1, +MOZ_NATIVE_SOUNDTOUCH=) + +if test -n "$MOZ_NATIVE_SOUNDTOUCH"; then + PKG_CHECK_MODULES(MOZ_SOUNDTOUCH, soundtouch >= 1.8.0) + + AC_LANG_SAVE + AC_LANG_CPLUSPLUS + _SAVE_CXXFLAGS=$CXXFLAGS + CXXFLAGS="$CXXFLAGS $MOZ_SOUNDTOUCH_CFLAGS" + AC_CACHE_CHECK(for soundtouch sample type, + ac_cv_soundtouch_sample_type, + [AC_TRY_COMPILE([#include + #ifndef SOUNDTOUCH_INTEGER_SAMPLES + #error soundtouch expects float samples + #endif], + [], + [ac_cv_soundtouch_sample_type=short], + [ac_cv_soundtouch_sample_type=float])]) + CXXFLAGS=$_SAVE_CXXFLAGS + AC_LANG_RESTORE + + if test \( -n "$MOZ_SAMPLE_TYPE_S16" -a "$ac_cv_soundtouch_sample_type" != short \) \ + -o \( -n "$MOZ_SAMPLE_TYPE_FLOAT32" -a "$ac_cv_soundtouch_sample_type" != float \) ; then + AC_MSG_ERROR([SoundTouch library is built with incompatible sample type. Either rebuild the library with/without --enable-integer-samples, chase default Mozilla sample type or remove --with-system-soundtouch.]) + fi +fi + +AC_SUBST(MOZ_NATIVE_SOUNDTOUCH) +AC_SUBST(MOZ_SOUNDTOUCH_CFLAGS) +AC_SUBST(MOZ_SOUNDTOUCH_LIBS) + +dnl ======================================================== 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 --- mozilla/content/media/AudioStream.h +++ mozilla/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 --- mozilla/content/media/Makefile.in +++ mozilla/content/media/Makefile.in @@ -6,3 +6,31 @@ include $(topsrcdir)/config/rules.mk CFLAGS += $(GSTREAMER_CFLAGS) CXXFLAGS += $(GSTREAMER_CFLAGS) + +ifdef MOZ_NATIVE_OGG +CXXFLAGS += $(MOZ_OGG_CFLAGS) +endif + +ifdef MOZ_NATIVE_THEORA +CXXFLAGS += $(MOZ_THEORA_CFLAGS) +endif + +ifdef MOZ_NATIVE_VORBIS +CXXFLAGS += $(MOZ_VORBIS_CFLAGS) +endif + +ifdef MOZ_NATIVE_TREMOR +CXXFLAGS += $(MOZ_TREMOR_CFLAGS) +endif + +ifdef MOZ_NATIVE_OPUS +CXXFLAGS += $(MOZ_OPUS_CFLAGS) +endif + +ifdef MOZ_NATIVE_SPEEX +CXXFLAGS += $(MOZ_SPEEX_CFLAGS) +endif + +ifdef MOZ_NATIVE_SOUNDTOUCH +CXXFLAGS += $(MOZ_SOUNDTOUCH_CFLAGS) +endif diff --git media/libcubeb/src/Makefile.in media/libcubeb/src/Makefile.in index 4c14494..1cb98e2 100644 --- mozilla/media/libcubeb/src/Makefile.in +++ mozilla/media/libcubeb/src/Makefile.in @@ -9,3 +9,7 @@ CFLAGS += \ $(MOZ_ALSA_CFLAGS) \ $(MOZ_PULSEAUDIO_CFLAGS) \ $(NULL) + +ifdef MOZ_NATIVE_SPEEX +CFLAGS += $(MOZ_SPEEX_CFLAGS) +endif diff --git media/libtheora/Makefile.in media/libtheora/Makefile.in new file mode 100644 index 0000000..1f02dc0 --- /dev/null +++ mozilla/media/libtheora/Makefile.in @@ -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/. + +include $(topsrcdir)/config/rules.mk + +ifdef MOZ_NATIVE_OGG +CFLAGS += $(MOZ_OGG_CFLAGS) +endif diff --git media/libtremor/Makefile.in media/libtremor/Makefile.in new file mode 100644 index 0000000..1f02dc0 --- /dev/null +++ mozilla/media/libtremor/Makefile.in @@ -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/. + +include $(topsrcdir)/config/rules.mk + +ifdef MOZ_NATIVE_OGG +CFLAGS += $(MOZ_OGG_CFLAGS) +endif diff --git media/libvorbis/Makefile.in media/libvorbis/Makefile.in new file mode 100644 index 0000000..1f02dc0 --- /dev/null +++ mozilla/media/libvorbis/Makefile.in @@ -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/. + +include $(topsrcdir)/config/rules.mk + +ifdef MOZ_NATIVE_OGG +CFLAGS += $(MOZ_OGG_CFLAGS) +endif diff --git media/webrtc/signaling/test/Makefile.in media/webrtc/signaling/test/Makefile.in index bbc971c..6ed7e41 100644 --- mozilla/media/webrtc/signaling/test/Makefile.in +++ mozilla/media/webrtc/signaling/test/Makefile.in @@ -48,6 +48,12 @@ LIBS += \ $(NULL) endif +ifdef MOZ_NATIVE_OPUS +LIBS += \ + $(MOZ_OPUS_LIBS) \ + $(NULL) +endif + ifdef MOZ_NATIVE_LIBVPX LIBS += \ $(MOZ_LIBVPX_LIBS) \ diff --git media/webrtc/trunk/webrtc/modules/audio_coding/codecs/opus/opus.gypi media/webrtc/trunk/webrtc/modules/audio_coding/codecs/opus/opus.gypi index 00e77e7..55f48ab 100644 --- mozilla/media/webrtc/trunk/webrtc/modules/audio_coding/codecs/opus/opus.gypi +++ mozilla/media/webrtc/trunk/webrtc/modules/audio_coding/codecs/opus/opus.gypi @@ -14,9 +14,9 @@ 'conditions': [ ['build_with_mozilla==1', { # Mozilla provides its own build of the opus library. - 'include_dirs': [ - '/media/libopus/include', - ] + 'cflags_mozilla': [ + '$(MOZ_OPUS_CFLAGS)', + ], }, { 'dependencies': [ '<(DEPTH)/third_party/opus/opus.gyp:opus' diff --git toolkit/library/libxul.mk toolkit/library/libxul.mk index d42137a..695e75a8 100644 --- mozilla/toolkit/library/libxul.mk +++ mozilla/toolkit/library/libxul.mk @@ -77,6 +77,34 @@ ifdef MOZ_NATIVE_HUNSPELL EXTRA_DSO_LDOPTS += $(MOZ_HUNSPELL_LIBS) endif +ifdef MOZ_NATIVE_OGG +EXTRA_DSO_LDOPTS += $(MOZ_OGG_LIBS) +endif + +ifdef MOZ_NATIVE_THEORA +EXTRA_DSO_LDOPTS += $(MOZ_THEORA_LIBS) +endif + +ifdef MOZ_NATIVE_VORBIS +EXTRA_DSO_LDOPTS += $(MOZ_VORBIS_LIBS) +endif + +ifdef MOZ_NATIVE_TREMOR +EXTRA_DSO_LDOPTS += $(MOZ_TREMOR_LIBS) +endif + +ifdef MOZ_NATIVE_OPUS +EXTRA_DSO_LDOPTS += $(MOZ_OPUS_LIBS) +endif + +ifdef MOZ_NATIVE_SPEEX +EXTRA_DSO_LDOPTS += $(MOZ_SPEEX_LIBS) +endif + +ifdef MOZ_NATIVE_SOUNDTOUCH +EXTRA_DSO_LDOPTS += $(MOZ_SOUNDTOUCH_LIBS) +endif + 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 --- mozilla/xpcom/build/nsXPComInit.cpp +++ mozilla/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. Index: head/www/firefox/Makefile =================================================================== --- head/www/firefox/Makefile (revision 380781) +++ head/www/firefox/Makefile (revision 380782) @@ -1,94 +1,94 @@ # Created by: Alan Eldridge # $FreeBSD$ PORTNAME= firefox DISTVERSION= 36.0.1 DISTVERSIONSUFFIX=.source PORTEPOCH= 1 CATEGORIES= www ipv6 MASTER_SITES= MOZILLA/${PORTNAME}/releases/${DISTVERSION}/source \ https://ftp.mozilla.org/pub/mozilla.org/${PORTNAME}/candidates/${DISTVERSION}-candidates/build2/source/ MAINTAINER= gecko@FreeBSD.org COMMENT= Web browser based on the browser portion of Mozilla BUILD_DEPENDS= nspr>=4.10.6:${PORTSDIR}/devel/nspr \ nss>=3.17.4:${PORTSDIR}/security/nss \ libevent2>=2.0.21_2:${PORTSDIR}/devel/libevent2 \ cairo>=1.12.16_1,2:${PORTSDIR}/graphics/cairo \ soundtouch>=1.8.0:${PORTSDIR}/audio/soundtouch \ - harfbuzz>=0.9.25:${PORTSDIR}/print/harfbuzz \ + harfbuzz>=0.9.34:${PORTSDIR}/print/harfbuzz \ graphite2>=1.2.4:${PORTSDIR}/graphics/graphite2 \ - libvorbis>=1.3.4:${PORTSDIR}/audio/libvorbis \ + libvorbis>=1.3.5:${PORTSDIR}/audio/libvorbis \ opus>=1.1:${PORTSDIR}/audio/opus \ libvpx>=1.3.0:${PORTSDIR}/multimedia/libvpx \ sqlite3>=3.8.7.4:${PORTSDIR}/databases/sqlite3 \ ${PYTHON_PKGNAMEPREFIX}sqlite3>0:${PORTSDIR}/databases/py-sqlite3 \ v4l_compat>0:${PORTSDIR}/multimedia/v4l_compat \ autoconf-2.13:${PORTSDIR}/devel/autoconf213 \ zip:${PORTSDIR}/archivers/zip \ unzip:${PORTSDIR}/archivers/unzip LIB_DEPENDS= libv4l2.so:${PORTSDIR}/multimedia/libv4l USE_GECKO= gecko CONFLICTS= firefox-esr-31.* firefox-esr-24.* firefox-esr-17.* MOZ_PKGCONFIG_FILES= # empty USE_MOZILLA= # empty MOZILLA_NAME= Firefox USE_QT5= # empty QT_NONSTANDARD= yes USE_GL= gl USES= dos2unix tar:bzip2 DOS2UNIX_FILES= media/webrtc/trunk/webrtc/system_wrappers/source/spreadsortlib/spreadsort.hpp FIREFOX_ICON= ${MOZILLA}.png FIREFOX_ICON_SRC= ${PREFIX}/lib/${MOZILLA}/browser/chrome/icons/default/default48.png MOZ_OPTIONS= --program-transform-name='s/firefox/${MOZILLA}/' \ --enable-application=browser \ --enable-official-branding OPTIONS_DEFAULT= GTK2 OPTIONS_SINGLE+= TOOLKIT OPTIONS_SINGLE_TOOLKIT= GTK2 GTK3 .include "${.CURDIR}/../../www/firefox/Makefile.options" .include WRKSRC:= ${WRKDIR}/mozilla-release .if ${PORT_OPTIONS:MALSA} RUN_DEPENDS+= alsa-lib>=1.0.27.2_1:${PORTSDIR}/audio/alsa-lib .endif .if ${PORT_OPTIONS:MGSTREAMER} RUN_DEPENDS+= gstreamer1-libav>=1.2.4_1:${PORTSDIR}/multimedia/gstreamer1-libav .endif .if ${PORT_OPTIONS:MGTK3} BUILD_DEPENDS+= gtk3>=3.14.6:${PORTSDIR}/x11-toolkits/gtk30 .endif post-extract: @${SED} -e 's|@FIREFOX_ICON@|${FIREFOX_ICON}|' -e 's|@MOZILLA@|${MOZILLA}|' \ -e 's|@MOZILLA_NAME@|${MOZILLA_NAME}|' \ <${FILESDIR}/firefox.desktop.in >${WRKDIR}/${MOZILLA}.desktop post-patch: @${REINPLACE_CMD} -e '/MOZPNG/s/=[0-9]*/=10511/' \ ${WRKSRC}/configure.in @${REINPLACE_CMD} -e 's|%%LOCALBASE%%|${LOCALBASE}|g' \ ${WRKSRC}/browser/app/nsBrowserApp.cpp pre-configure: (cd ${WRKSRC} && ${LOCALBASE}/bin/autoconf-2.13) (cd ${WRKSRC}/js/src/ && ${LOCALBASE}/bin/autoconf-2.13) post-install: ${MKDIR} ${STAGEDIR}${PREFIX}/share/pixmaps ${INSTALL_DATA} ${WRKDIR}/${MOZILLA}.desktop ${STAGEDIR}${PREFIX}/share/applications/ ${LN} -sf ${FIREFOX_ICON_SRC} ${STAGEDIR}${PREFIX}/share/pixmaps/${FIREFOX_ICON} .include Index: head/www/firefox/Makefile.options =================================================================== --- head/www/firefox/Makefile.options (revision 380781) +++ head/www/firefox/Makefile.options (revision 380782) @@ -1,14 +1,16 @@ # -*- makefile-bsdmake -*- -OPTIONS_DEFINE+= DBUS DEBUG DTRACE GCONF GIO GNOMEUI GSTREAMER \ - LIBPROXY LOGGING OPTIMIZED_CFLAGS PGO PROFILE TEST +OPTIONS_DEFINE+= CANBERRA DBUS DEBUG DTRACE GCONF GIO GNOMEUI \ + GSTREAMER LIBPROXY LOGGING OPTIMIZED_CFLAGS \ + PGO PROFILE TEST OPTIONS_DEFAULT+= ALSA DBUS GIO GSTREAMER LOGGING OPTIMIZED_CFLAGS OPTIONS_MULTI+= AUDIO OPTIONS_MULTI_AUDIO= ALSA PULSEAUDIO +CANBERRA_DESC?= Sound theme alerts ENIGMAIL_DESC?= Enigmail extension GNOMEUI_DESC?= libgnomeui support module LIBPROXY_DESC?= Proxy support via libproxy LIGHTNING_DESC?= Calendar extension LOGGING_DESC?= Additional log messages Index: head/www/firefox/files/patch-bug847568 =================================================================== --- head/www/firefox/files/patch-bug847568 (revision 380781) +++ head/www/firefox/files/patch-bug847568 (revision 380782) @@ -1,242 +1,242 @@ # Allow building against system-wide graphite2/harfbuzz. diff --git config/Makefile.in config/Makefile.in index 14bfc0d..5383399 100644 --- config/Makefile.in +++ config/Makefile.in @@ -75,6 +75,8 @@ export:: $(export-preqs) -DMOZ_NATIVE_LIBEVENT=$(MOZ_NATIVE_LIBEVENT) \ -DMOZ_NATIVE_LIBVPX=$(MOZ_NATIVE_LIBVPX) \ -DMOZ_NATIVE_ICU=$(MOZ_NATIVE_ICU) \ + -DMOZ_NATIVE_GRAPHITE2=$(MOZ_NATIVE_GRAPHITE2) \ + -DMOZ_NATIVE_HARFBUZZ=$(MOZ_NATIVE_HARFBUZZ) \ $(srcdir)/system-headers | $(PERL) $(topsrcdir)/nsprpub/config/make-system-wrappers.pl system_wrappers $(INSTALL) system_wrappers $(DIST) diff --git config/system-headers config/system-headers index 18e8703..bdc5f82 100644 --- config/system-headers +++ config/system-headers @@ -1357,3 +1357,11 @@ unicode/utypes.h #endif libutil.h unwind.h +#if MOZ_NATIVE_GRAPHITE2==1 +graphite2/Font.h +graphite2/Segment.h +#endif +#if MOZ_NATIVE_HARFBUZZ==1 +harfbuzz/hb-ot.h +harfbuzz/hb.h +#endif diff --git configure.in configure.in index ac38f40..87536b7 100644 --- configure.in +++ configure.in @@ -7986,6 +7986,49 @@ if test "$USE_FC_FREETYPE"; then fi dnl ======================================================== +dnl Check for harfbuzz +dnl ======================================================== + +MOZ_ARG_WITH_BOOL(system-harfbuzz, +[ --with-system-harfbuzz Use system harfbuzz (located with pkgconfig)], +MOZ_NATIVE_HARFBUZZ=1, +MOZ_NATIVE_HARFBUZZ=) + +if test -n "$MOZ_NATIVE_HARFBUZZ"; then -+ PKG_CHECK_MODULES(MOZ_HARFBUZZ, harfbuzz >= 0.9.25) ++ PKG_CHECK_MODULES(MOZ_HARFBUZZ, harfbuzz >= 0.9.34) +fi + +AC_SUBST(MOZ_NATIVE_HARFBUZZ) + +dnl ======================================================== +dnl Check for graphite2 +dnl ======================================================== + +MOZ_ARG_WITH_BOOL(system-graphite2, +[ --with-system-graphite2 Use system graphite2 (located with pkgconfig)], +MOZ_NATIVE_GRAPHITE2=1, +MOZ_NATIVE_GRAPHITE2=) + +if test -n "$MOZ_NATIVE_GRAPHITE2"; then + PKG_CHECK_MODULES(MOZ_GRAPHITE2, graphite2) + + dnl graphite2.pc has bogus version, check manually + AC_TRY_COMPILE([ #include + #define GR2_VERSION_REQUIRE(major,minor,bugfix) \ + ( GR2_VERSION_MAJOR * 10000 + GR2_VERSION_MINOR \ + * 100 + GR2_VERSION_BUGFIX >= \ + (major) * 10000 + (minor) * 100 + (bugfix) ) + ], [ + #if !GR2_VERSION_REQUIRE(1,2,4) + #error "Insufficient graphite2 version." + #endif + ], [], + [AC_MSG_ERROR([--with-system-graphite2 requested but no working libgraphite2 found])]) +fi + +AC_SUBST(MOZ_NATIVE_GRAPHITE2) + +dnl ======================================================== dnl Check for pixman and cairo dnl ======================================================== diff --git dom/base/moz.build dom/base/moz.build index a660ba4..6b2f602 100644 --- dom/base/moz.build +++ dom/base/moz.build @@ -196,6 +196,9 @@ SOURCES += [ 'nsObjectLoadingContent.cpp', ] +if CONFIG['MOZ_NATIVE_HARFBUZZ']: + SOURCES['nsContentUtils.cpp'].flags += CONFIG['MOZ_HARFBUZZ_CFLAGS'] + EXTRA_COMPONENTS += [ 'contentAreaDropListener.js', 'contentAreaDropListener.manifest', diff --git gfx/graphite2/moz-gr-update.sh gfx/graphite2/moz-gr-update.sh index f3d76ea..a9e7fb6 100644 --- gfx/graphite2/moz-gr-update.sh +++ gfx/graphite2/moz-gr-update.sh @@ -23,8 +23,14 @@ echo "\nSee" $0 "for update procedure.\n" >> gfx/graphite2/README.mozilla find gfx/graphite2/ -name "*.cpp" -exec perl -p -i -e "s///;s/Windows.h/windows.h/;" {} \; find gfx/graphite2/ -name "*.h" -exec perl -p -i -e "s///;s/Windows.h/windows.h/;" {} \; +# closest tag/release to require for system version +TAG=$(cd ../graphitedev/ && hg parents --template {latesttag}) + +perl -p -i -e "s/[0-9]+\,[0-9]+\,[0-9]+/$TAG/ and tr/./,/ \ + if /GR2_VERSION_REQUIRE/" configure.in + # summarize what's been touched -echo Updated to $CHANGESET. +echo Updated to $CHANGESET \($TAG for --with-system-graphite2\) echo Here is what changed in the gfx/graphite2 directory: echo diff --git gfx/harfbuzz/README-mozilla gfx/harfbuzz/README-mozilla index ca57d16..1ce21fe 100644 --- gfx/harfbuzz/README-mozilla +++ gfx/harfbuzz/README-mozilla @@ -21,3 +21,8 @@ In addition, the src/Makefile.in file here is NOT from upstream, nor is it generated from src/Makefile.am (the original harfbuzz version); it is a mozilla- specific makefile that is maintained by hand. It should only need updating when new source files or exported headers are added in harfbuzz. + +The in-tree copy may be omitted during build by --with-system-harfbuzz. +Make sure to keep pkg-config version check within configure.in in sync +with checkout version or increment latest tag by one if it's not based +on upstream release. diff --git gfx/moz.build gfx/moz.build index 519aa46..6929751 100644 --- gfx/moz.build +++ gfx/moz.build @@ -7,6 +7,12 @@ if CONFIG['MOZ_TREE_CAIRO']: DIRS += ['cairo'] +if not CONFIG['MOZ_NATIVE_GRAPHITE2']: + DIRS += ['graphite2/src' ] + +if not CONFIG['MOZ_NATIVE_HARFBUZZ']: + DIRS += ['harfbuzz/src'] + DIRS += [ '2d', 'ycbcr', @@ -15,8 +21,6 @@ DIRS += [ 'qcms', 'gl', 'layers', - 'graphite2/src', - 'harfbuzz/src', 'ots/src', 'thebes', 'ipc', diff --git gfx/skia/generate_mozbuild.py gfx/skia/generate_mozbuild.py index 28fa6b5..240dced 100755 --- gfx/skia/generate_mozbuild.py +++ gfx/skia/generate_mozbuild.py @@ -140,6 +140,9 @@ if CONFIG['GNU_CXX']: if not CONFIG['CLANG_CXX']: CXXFLAGS += ['-Wno-logical-op'] +if CONFIG['MOZ_NATIVE_HARFBUZZ']: + CXXFLAGS += CONFIG['MOZ_HARFBUZZ_CFLAGS'] + if CONFIG['MOZ_WIDGET_TOOLKIT'] in ('gtk2', 'gtk3', 'android', 'gonk', 'qt'): CXXFLAGS += CONFIG['MOZ_CAIRO_CFLAGS'] CXXFLAGS += CONFIG['CAIRO_FT_CFLAGS'] diff --git gfx/skia/moz.build gfx/skia/moz.build index 1d0c2f9..adb8941 100644 --- gfx/skia/moz.build +++ gfx/skia/moz.build @@ -968,6 +968,9 @@ if CONFIG['GNU_CXX']: if not CONFIG['CLANG_CXX']: CXXFLAGS += ['-Wno-logical-op'] +if CONFIG['MOZ_NATIVE_HARFBUZZ']: + CXXFLAGS += CONFIG['MOZ_HARFBUZZ_CFLAGS'] + if CONFIG['MOZ_WIDGET_TOOLKIT'] in ('gtk2', 'gtk3', 'android', 'gonk', 'qt'): CXXFLAGS += CONFIG['MOZ_CAIRO_CFLAGS'] CXXFLAGS += CONFIG['CAIRO_FT_CFLAGS'] diff --git gfx/thebes/moz.build gfx/thebes/moz.build index d5852fa..aeeab25 100644 --- gfx/thebes/moz.build +++ gfx/thebes/moz.build @@ -278,6 +278,12 @@ CXXFLAGS += CONFIG['TK_CFLAGS'] CFLAGS += CONFIG['MOZ_CAIRO_CFLAGS'] CFLAGS += CONFIG['TK_CFLAGS'] +if CONFIG['MOZ_NATIVE_HARFBUZZ']: + CXXFLAGS += CONFIG['MOZ_HARFBUZZ_CFLAGS'] + +if CONFIG['MOZ_NATIVE_GRAPHITE2']: + CXXFLAGS += CONFIG['MOZ_GRAPHITE2_CFLAGS'] + if CONFIG['MOZ_WIDGET_TOOLKIT'] in ('android', 'gonk', 'qt'): CXXFLAGS += CONFIG['CAIRO_FT_CFLAGS'] diff --git intl/unicharutil/util/moz.build intl/unicharutil/util/moz.build index d736943..41a931f 100644 --- intl/unicharutil/util/moz.build +++ intl/unicharutil/util/moz.build @@ -37,3 +37,6 @@ if CONFIG['_MSC_VER']: if CONFIG['ENABLE_INTL_API']: CXXFLAGS += CONFIG['MOZ_ICU_CFLAGS'] + +if CONFIG['MOZ_NATIVE_HARFBUZZ']: + CXXFLAGS += CONFIG['MOZ_HARFBUZZ_CFLAGS'] diff --git netwerk/dns/moz.build netwerk/dns/moz.build index 0b0717a..2e665c9 100644 --- netwerk/dns/moz.build +++ netwerk/dns/moz.build @@ -63,3 +63,6 @@ GENERATED_FILES = [ LOCAL_INCLUDES += [ '../base/src', ] + +if CONFIG['MOZ_NATIVE_HARFBUZZ']: + CXXFLAGS += CONFIG['MOZ_HARFBUZZ_CFLAGS'] diff --git toolkit/library/moz.build toolkit/library/moz.build index 67f0db9..d42137a 100644 --- toolkit/library/moz.build +++ toolkit/library/moz.build @@ -187,6 +187,12 @@ if CONFIG['MOZ_NATIVE_LIBVPX']: if not CONFIG['MOZ_TREE_PIXMAN']: OS_LIBS += CONFIG['MOZ_PIXMAN_LIBS'] +if CONFIG['MOZ_NATIVE_GRAPHITE2']: + OS_LIBS += CONFIG['MOZ_GRAPHITE2_LIBS'] + +if CONFIG['MOZ_NATIVE_HARFBUZZ']: + OS_LIBS += CONFIG['MOZ_HARFBUZZ_LIBS'] + if CONFIG['MOZ_OSS']: OS_LIBS += CONFIG['MOZ_OSS_LIBS'] Index: head/www/firefox/files/patch-z-bug517422 =================================================================== --- head/www/firefox/files/patch-z-bug517422 (revision 380781) +++ head/www/firefox/files/patch-z-bug517422 (revision 380782) @@ -1,524 +1,524 @@ # Allow more config/external/ libs built against system-wide version. diff --git config/Makefile.in config/Makefile.in index 5383399..0410004 100644 --- config/Makefile.in +++ config/Makefile.in @@ -77,6 +77,13 @@ export:: $(export-preqs) -DMOZ_NATIVE_ICU=$(MOZ_NATIVE_ICU) \ -DMOZ_NATIVE_GRAPHITE2=$(MOZ_NATIVE_GRAPHITE2) \ -DMOZ_NATIVE_HARFBUZZ=$(MOZ_NATIVE_HARFBUZZ) \ + -DMOZ_NATIVE_OGG=$(MOZ_NATIVE_OGG) \ + -DMOZ_NATIVE_THEORA=$(MOZ_NATIVE_THEORA) \ + -DMOZ_NATIVE_VORBIS=$(MOZ_NATIVE_VORBIS) \ + -DMOZ_NATIVE_TREMOR=$(MOZ_NATIVE_TREMOR) \ + -DMOZ_NATIVE_OPUS=$(MOZ_NATIVE_OPUS) \ + -DMOZ_NATIVE_SPEEX=$(MOZ_NATIVE_SPEEX) \ + -DMOZ_NATIVE_SOUNDTOUCH=$(MOZ_NATIVE_SOUNDTOUCH) \ $(srcdir)/system-headers | $(PERL) $(topsrcdir)/nsprpub/config/make-system-wrappers.pl system_wrappers $(INSTALL) system_wrappers $(DIST) diff --git config/external/moz.build config/external/moz.build index f67c5c7..eb909ce 100644 --- config/external/moz.build +++ config/external/moz.build @@ -16,13 +16,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']: external_dirs += ['media/libvorbis'] -if CONFIG['MOZ_TREMOR']: +if CONFIG['MOZ_TREMOR'] and not CONFIG['MOZ_NATIVE_TREMOR']: external_dirs += ['media/libtremor'] -if CONFIG['MOZ_OPUS']: +if CONFIG['MOZ_OPUS'] and not CONFIG['MOZ_NATIVE_OPUS']: external_dirs += ['media/libopus'] if CONFIG['MOZ_WEBM']: @@ -37,14 +43,16 @@ if CONFIG['MOZ_VPX'] and not CONFIG['MOZ_NATIVE_LIBVPX']: if not CONFIG['MOZ_NATIVE_PNG']: external_dirs += ['media/libpng'] +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/libstagefright', - 'media/libsoundtouch', ] DIRS += ['../../' + i for i in external_dirs] diff --git config/system-headers config/system-headers index bef567c..9807c29 100644 --- config/system-headers +++ config/system-headers @@ -1263,7 +1263,6 @@ X11/Xlocale.h X11/Xos.h X11/Xutil.h zmouse.h -soundtouch/SoundTouch.h #if MOZ_NATIVE_PNG==1 png.h #endif @@ -1325,6 +1324,7 @@ vorbis/codec.h theora/theoradec.h tremor/ivorbiscodec.h speex/speex_resampler.h +soundtouch/SoundTouch.h ogg/ogg.h ogg/os_types.h nestegg/nestegg.h @@ -1365,3 +1365,29 @@ graphite2/Segment.h harfbuzz/hb-ot.h harfbuzz/hb.h #endif +#if MOZ_NATIVE_OGG==1 +ogg/ogg.h +ogg/os_types.h +#endif +#if MOZ_NATIVE_THEORA==1 +theora/theoradec.h +#endif +#if MOZ_NATIVE_VORBIS==1 +vorbis/codec.h +vorbis/vorbisenc.h +#endif +#if MOZ_NATIVE_TREMOR==1 +tremor/ivorbiscodec.h +#endif +#if MOZ_NATIVE_OPUS==1 +opus.h +opus_multistream.h +opus/opus.h +opus/opus_multistream.h +#endif +#if MOZ_NATIVE_SPEEX==1 +speex/speex_resampler.h +#endif +#if MOZ_NATIVE_SOUNDTOUCH==1 +soundtouch/SoundTouch.h +#endif diff --git configure.in configure.in index 87db361..7947626 100644 --- configure.in +++ configure.in @@ -5056,6 +5056,57 @@ if test "${ac_cv_c_attribute_aligned}" != "0"; then fi dnl ======================================================== +dnl Check for libogg +dnl ======================================================== + +MOZ_ARG_WITH_BOOL(system-ogg, +[ --with-system-ogg Use system libogg (located with pkgconfig)], +MOZ_NATIVE_OGG=1, +MOZ_NATIVE_OGG=) + +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) + +dnl ======================================================== +dnl Check for libvorbis +dnl ======================================================== + +MOZ_ARG_WITH_BOOL(system-vorbis, +[ --with-system-vorbis Use system libvorbis (located with pkgconfig)], +MOZ_NATIVE_VORBIS=1, +MOZ_NATIVE_VORBIS=) + +if test -n "$MOZ_NATIVE_VORBIS"; then -+ PKG_CHECK_MODULES(MOZ_VORBIS, vorbis vorbisenc >= 1.3.4) ++ PKG_CHECK_MODULES(MOZ_VORBIS, vorbis vorbisenc >= 1.3.5) +fi + +AC_SUBST(MOZ_NATIVE_VORBIS) + +dnl ======================================================== +dnl Check for integer-only libvorbis aka tremor +dnl ======================================================== + +MOZ_ARG_WITH_BOOL(system-tremor, +[ --with-system-tremor Use system libtremor (located with pkgconfig)], +MOZ_NATIVE_TREMOR=1, +MOZ_NATIVE_TREMOR=) + +if test -n "$MOZ_NATIVE_TREMOR"; then + PKG_CHECK_MODULES(MOZ_TREMOR, vorbisidec >= 1.2.1) +fi + +AC_SUBST(MOZ_NATIVE_TREMOR) + +dnl ======================================================== dnl = Disable Opus audio codec support dnl ======================================================== MOZ_ARG_DISABLE_BOOL(opus, @@ -5064,6 +5115,89 @@ MOZ_ARG_DISABLE_BOOL(opus, MOZ_OPUS=1) dnl ======================================================== +dnl Check for libopus +dnl ======================================================== + +MOZ_ARG_WITH_BOOL(system-opus, +[ --with-system-opus Use system libopus (located with pkgconfig)], +MOZ_NATIVE_OPUS=1, +MOZ_NATIVE_OPUS=) + +if test -n "$MOZ_NATIVE_OPUS"; then + PKG_CHECK_MODULES(MOZ_OPUS, opus >= 1.1) +else + MOZ_OPUS_CFLAGS='-I$(topsrcdir)/media/libopus/include' +fi + +AC_SUBST(MOZ_NATIVE_OPUS) + +dnl ======================================================== +dnl Check for libtheora +dnl ======================================================== + +MOZ_ARG_WITH_BOOL(system-theora, +[ --with-system-theora Use system libtheora (located with pkgconfig)], +MOZ_NATIVE_THEORA=1, +MOZ_NATIVE_THEORA=) + +if test -n "$MOZ_NATIVE_THEORA"; then + PKG_CHECK_MODULES(MOZ_THEORA, theora >= 1.2) +fi + +AC_SUBST(MOZ_NATIVE_THEORA) + +dnl ======================================================== +dnl Check for libspeex resampler +dnl ======================================================== + +MOZ_ARG_WITH_BOOL(system-speex, +[ --with-system-speex Use system libspeex (located with pkgconfig)], +MOZ_NATIVE_SPEEX=1, +MOZ_NATIVE_SPEEX=) + +if test -n "$MOZ_NATIVE_SPEEX"; then + PKG_CHECK_MODULES(MOZ_SPEEX, speexdsp >= 1.2) +fi + +AC_SUBST(MOZ_NATIVE_SPEEX) + +dnl ======================================================== +dnl Check for libsoundtouch +dnl ======================================================== + +MOZ_ARG_WITH_BOOL(system-soundtouch, +[ --with-system-soundtouch Use system libsoundtouch (located with pkgconfig)], +MOZ_NATIVE_SOUNDTOUCH=1, +MOZ_NATIVE_SOUNDTOUCH=) + +if test -n "$MOZ_NATIVE_SOUNDTOUCH"; then + PKG_CHECK_MODULES(MOZ_SOUNDTOUCH, soundtouch >= 1.8.0) + + AC_LANG_SAVE + AC_LANG_CPLUSPLUS + _SAVE_CXXFLAGS=$CXXFLAGS + CXXFLAGS="$CXXFLAGS $MOZ_SOUNDTOUCH_CFLAGS" + AC_CACHE_CHECK(for soundtouch sample type, + ac_cv_soundtouch_sample_type, + [AC_TRY_COMPILE([#include + #ifndef SOUNDTOUCH_INTEGER_SAMPLES + #error soundtouch expects float samples + #endif], + [], + [ac_cv_soundtouch_sample_type=short], + [ac_cv_soundtouch_sample_type=float])]) + CXXFLAGS=$_SAVE_CXXFLAGS + AC_LANG_RESTORE + + if test \( -n "$MOZ_SAMPLE_TYPE_S16" -a "$ac_cv_soundtouch_sample_type" != short \) \ + -o \( -n "$MOZ_SAMPLE_TYPE_FLOAT32" -a "$ac_cv_soundtouch_sample_type" != float \) ; then + AC_MSG_ERROR([SoundTouch library is built with incompatible sample type. Either rebuild the library with/without --enable-integer-samples, chase default Mozilla sample type or remove --with-system-soundtouch.]) + fi +fi + +AC_SUBST(MOZ_NATIVE_SOUNDTOUCH) + +dnl ======================================================== dnl = Disable VP8 decoder support dnl ======================================================== MOZ_ARG_DISABLE_BOOL(webm, diff --git dom/media/AudioStream.h dom/media/AudioStream.h index 085676d..00c54fb 100644 --- dom/media/AudioStream.h +++ dom/media/AudioStream.h @@ -17,7 +17,7 @@ #include "CubebUtils.h" namespace soundtouch { -class SoundTouch; +class MOZ_IMPORT_API SoundTouch; } namespace mozilla { diff --git dom/media/moz.build dom/media/moz.build index 7526cff..e0a0ca0 100644 --- dom/media/moz.build +++ dom/media/moz.build @@ -212,3 +212,24 @@ if CONFIG['ANDROID_VERSION'] > '15': CFLAGS += CONFIG['GSTREAMER_CFLAGS'] CXXFLAGS += CONFIG['GSTREAMER_CFLAGS'] + +if CONFIG['MOZ_NATIVE_OGG']: + CXXFLAGS += CONFIG['MOZ_OGG_CFLAGS'] + +if CONFIG['MOZ_NATIVE_THEORA']: + CXXFLAGS += CONFIG['MOZ_THEORA_CFLAGS'] + +if CONFIG['MOZ_NATIVE_VORBIS']: + CXXFLAGS += CONFIG['MOZ_VORBIS_CFLAGS'] + +if CONFIG['MOZ_NATIVE_TREMOR']: + CXXFLAGS += CONFIG['MOZ_TREMOR_CFLAGS'] + +if CONFIG['MOZ_NATIVE_OPUS']: + CXXFLAGS += CONFIG['MOZ_OPUS_CFLAGS'] + +if CONFIG['MOZ_NATIVE_SPEEX']: + CXXFLAGS += CONFIG['MOZ_SPEEX_CFLAGS'] + +if CONFIG['MOZ_NATIVE_SOUNDTOUCH']: + CXXFLAGS += CONFIG['MOZ_SOUNDTOUCH_CFLAGS'] diff --git media/libcubeb/src/moz.build media/libcubeb/src/moz.build index 944744d..9a7c8c0 100644 --- media/libcubeb/src/moz.build +++ media/libcubeb/src/moz.build @@ -65,6 +65,9 @@ if CONFIG['GKMEDIAS_SHARED_LIBRARY']: FINAL_LIBRARY = 'gkmedias' +if CONFIG['MOZ_NATIVE_SPEEX']: + SOURCES['cubeb_resampler.cpp'].flags += CONFIG['MOZ_SPEEX_CFLAGS'] + if CONFIG['MOZ_WIDGET_TOOLKIT'] == 'gonk': CFLAGS += [ '-I%s/%s' % (CONFIG['ANDROID_SOURCE'], d) for d in [ diff --git media/libogg/README_MOZILLA media/libogg/README_MOZILLA index 0833e4d..7ece97b 100644 --- media/libogg/README_MOZILLA +++ media/libogg/README_MOZILLA @@ -6,3 +6,6 @@ The svn revision number used was r17287. The int-types.patch address a bug that config_types.h generated from Linux platform can't be used on OpenSolaris directly see Mozilla bug 449754 + +The in-tree copy may be omitted during build by --with-system-ogg. +Keep version in configure.in in sync on updates. diff --git media/libopus/README_MOZILLA media/libopus/README_MOZILLA index 2d85c9f..d3fb9f8 100644 --- media/libopus/README_MOZILLA +++ media/libopus/README_MOZILLA @@ -9,3 +9,6 @@ files after the copy step. The upstream repository is https://git.xiph.org/opus.git The git tag/revision used was v1.1. + +The in-tree copy may be omitted during build by --with-system-opus. +So, keep its pkg-config version check within configure.in in sync on updates. diff --git media/libsoundtouch/README_MOZILLA media/libsoundtouch/README_MOZILLA index bfd4b1a..15b158d 100644 --- media/libsoundtouch/README_MOZILLA +++ media/libsoundtouch/README_MOZILLA @@ -6,3 +6,5 @@ The whole library is not used, only the relevant files are imported in the tree, using the script `update.sh`. Some changes have been made to the files, using the patch `moz-libsoundtouch.patch`. We also use a custom soundtouch_config.h. +The in-tree copy may be omitted during build by --with-system-soundtouch. +Keep version in configure.in in sync on updates. diff --git media/libspeex_resampler/README_MOZILLA media/libspeex_resampler/README_MOZILLA index 7f6b1bb..e830300 100644 --- media/libspeex_resampler/README_MOZILLA +++ media/libspeex_resampler/README_MOZILLA @@ -3,3 +3,6 @@ This source is from the Speex DSP library It consists in the audio resampling code (resampler.c) and its header files dependancies, imported into the tree using the update.sh script. + +The in-tree copy may be omitted during build by --with-system-speex. +Keep version in configure.in in sync on updates. diff --git media/libtheora/README_MOZILLA media/libtheora/README_MOZILLA index d48dbfa..f08a2ed 100644 --- media/libtheora/README_MOZILLA +++ media/libtheora/README_MOZILLA @@ -3,3 +3,6 @@ using the update.sh script. The changes made were those applied by update.sh, the addition/update of Makefile.in files for the Mozilla build system. The subversion revision used was r17578. + +The in-tree copy may be omitted during build by --with-system-theora. +Keep version in configure.in in sync on updates. diff --git media/libtheora/moz.build media/libtheora/moz.build index 14265b1..3069e99 100644 --- media/libtheora/moz.build +++ media/libtheora/moz.build @@ -93,3 +93,5 @@ if CONFIG['GNU_AS']: if CONFIG['OS_TARGET'] == 'Android': DEFINES['__linux__'] = True +if CONFIG['MOZ_NATIVE_OGG']: + CFLAGS += CONFIG['MOZ_OGG_CFLAGS'] diff --git media/libtremor/README_MOZILLA media/libtremor/README_MOZILLA index ee67b53..3f34a09 100644 --- media/libtremor/README_MOZILLA +++ media/libtremor/README_MOZILLA @@ -5,3 +5,6 @@ Makefile.in files for the Mozilla build system. The upstream release used was http://svn.xiph.org/trunk/Tremor/ The subversion revision used was r17547. + +The in-tree copy may be omitted during build by --with-system-tremor. +Keep version in configure.in in sync on updates. diff --git media/libtremor/moz.build media/libtremor/moz.build index 31831ba..a03d576 100644 --- media/libtremor/moz.build +++ media/libtremor/moz.build @@ -6,3 +6,5 @@ DIRS += ['include/tremor', 'lib'] +if CONFIG['MOZ_NATIVE_OGG']: + CFLAGS += CONFIG['MOZ_OGG_CFLAGS'] diff --git media/libvorbis/README_MOZILLA media/libvorbis/README_MOZILLA index 7c7454c..55baedd 100644 --- media/libvorbis/README_MOZILLA +++ media/libvorbis/README_MOZILLA @@ -8,3 +8,6 @@ https://svn.xiph.org/tags/vorbis/libvorbis-1.3.4@19059 Some files are renamed during the copy to prevent clashes with object file names with other Mozilla libraries. + +The in-tree copy may be omitted during build by --with-system-vorbis. +Keep version in configure.in in sync on updates. diff --git media/libvorbis/moz.build media/libvorbis/moz.build index 919b99e..cc776f7 100644 --- media/libvorbis/moz.build +++ media/libvorbis/moz.build @@ -55,3 +55,6 @@ FINAL_LIBRARY = 'gkmedias' # Suppress warnings in third-party code. if CONFIG['GNU_CC']: CFLAGS += ['-Wno-uninitialized'] + +if CONFIG['MOZ_NATIVE_OGG']: + CFLAGS += CONFIG['MOZ_OGG_CFLAGS'] diff --git media/webrtc/signaling/test/moz.build media/webrtc/signaling/test/moz.build index bbc971c..6ed7e41 100644 --- media/webrtc/signaling/test/moz.build +++ media/webrtc/signaling/test/moz.build @@ -127,6 +127,9 @@ if CONFIG['MOZ_ALSA']: if CONFIG['MOZ_NATIVE_JPEG']: OS_LIBS += CONFIG['MOZ_JPEG_LIBS'] +if CONFIG['MOZ_NATIVE_OPUS']: + OS_LIBS += CONFIG['MOZ_OPUS_LIBS'] + if CONFIG['MOZ_NATIVE_LIBVPX']: OS_LIBS += CONFIG['MOZ_LIBVPX_LIBS'] diff --git media/webrtc/trunk/webrtc/modules/audio_coding/codecs/opus/opus.gypi media/webrtc/trunk/webrtc/modules/audio_coding/codecs/opus/opus.gypi index 00e77e7..55f48ab 100644 --- media/webrtc/trunk/webrtc/modules/audio_coding/codecs/opus/opus.gypi +++ media/webrtc/trunk/webrtc/modules/audio_coding/codecs/opus/opus.gypi @@ -17,9 +17,9 @@ 'conditions': [ ['build_with_mozilla==1', { # Mozilla provides its own build of the opus library. - 'include_dirs': [ - '/media/libopus/include', - ] + 'cflags_mozilla': [ + '$(MOZ_OPUS_CFLAGS)', + ], }, { 'dependencies': [ '<(DEPTH)/third_party/opus/opus.gyp:opus' diff --git toolkit/library/moz.build toolkit/library/moz.build index d42137a..695e75a8 100644 --- toolkit/library/moz.build +++ toolkit/library/moz.build @@ -178,6 +178,27 @@ if CONFIG['MOZ_NATIVE_PNG']: if CONFIG['MOZ_NATIVE_HUNSPELL']: OS_LIBS += CONFIG['MOZ_HUNSPELL_LIBS'] +if CONFIG['MOZ_NATIVE_OGG']: + OS_LIBS += CONFIG['MOZ_OGG_LIBS'] + +if CONFIG['MOZ_NATIVE_THEORA']: + OS_LIBS += CONFIG['MOZ_THEORA_LIBS'] + +if CONFIG['MOZ_NATIVE_VORBIS']: + OS_LIBS += CONFIG['MOZ_VORBIS_LIBS'] + +if CONFIG['MOZ_NATIVE_TREMOR']: + OS_LIBS += CONFIG['MOZ_TREMOR_LIBS'] + +if CONFIG['MOZ_NATIVE_OPUS']: + OS_LIBS += CONFIG['MOZ_OPUS_LIBS'] + +if CONFIG['MOZ_NATIVE_SPEEX']: + OS_LIBS += CONFIG['MOZ_SPEEX_LIBS'] + +if CONFIG['MOZ_NATIVE_SOUNDTOUCH']: + OS_LIBS += CONFIG['MOZ_SOUNDTOUCH_LIBS'] + if CONFIG['MOZ_NATIVE_LIBEVENT']: OS_LIBS += CONFIG['MOZ_LIBEVENT_LIBS'] diff --git xpcom/build/XPCOMInit.cpp xpcom/build/XPCOMInit.cpp index 2cf281e..6d7af0e 100644 --- xpcom/build/XPCOMInit.cpp +++ xpcom/build/XPCOMInit.cpp @@ -138,7 +138,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 @@ -651,11 +653,13 @@ NS_InitXPCOM2(nsIServiceManager** aResult, // 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. Index: head/www/firefox-esr/Makefile =================================================================== --- head/www/firefox-esr/Makefile (revision 380781) +++ head/www/firefox-esr/Makefile (revision 380782) @@ -1,86 +1,86 @@ # Created by: Alan Eldridge # $FreeBSD$ PORTNAME= firefox DISTVERSION= 31.5.0 DISTVERSIONSUFFIX=esr.source PORTEPOCH= 1 CATEGORIES= www ipv6 MASTER_SITES= MOZILLA/${PORTNAME}/releases/${DISTVERSION}esr/source PKGNAMESUFFIX= -esr MAINTAINER= gecko@FreeBSD.org COMMENT= Web browser based on the browser portion of Mozilla BUILD_DEPENDS= nspr>=4.10.6:${PORTSDIR}/devel/nspr \ nss>=3.16.2:${PORTSDIR}/security/nss \ libevent2>=2.0.21_2:${PORTSDIR}/devel/libevent2 \ cairo>=1.12.16_1,2:${PORTSDIR}/graphics/cairo \ soundtouch>=1.8.0:${PORTSDIR}/audio/soundtouch \ harfbuzz>=0.9.25:${PORTSDIR}/print/harfbuzz \ graphite2>=1.2.4:${PORTSDIR}/graphics/graphite2 \ - libvorbis>=1.3.4:${PORTSDIR}/audio/libvorbis \ + libvorbis>=1.3.5:${PORTSDIR}/audio/libvorbis \ opus>=1.1:${PORTSDIR}/audio/opus \ libvpx>=1.3.0:${PORTSDIR}/multimedia/libvpx \ sqlite3>=3.8.4.2:${PORTSDIR}/databases/sqlite3 \ ${PYTHON_PKGNAMEPREFIX}sqlite3>0:${PORTSDIR}/databases/py-sqlite3 \ v4l_compat>0:${PORTSDIR}/multimedia/v4l_compat \ autoconf-2.13:${PORTSDIR}/devel/autoconf213 \ zip:${PORTSDIR}/archivers/zip \ unzip:${PORTSDIR}/archivers/unzip LIB_DEPENDS= libv4l2.so:${PORTSDIR}/multimedia/libv4l USE_GECKO= gecko CPE_PRODUCT= ${PORTNAME}_esr CONFLICTS= firefox-3[02-9].* firefox-2[0-35-9].* MOZ_PKGCONFIG_FILES= # empty USE_MOZILLA= # empty MOZILLA_NAME= Firefox USE_QT5= # empty QT_NONSTANDARD= yes USE_GL= gl USES= dos2unix tar:bzip2 DOS2UNIX_FILES= media/webrtc/trunk/webrtc/system_wrappers/source/spreadsortlib/spreadsort.hpp FIREFOX_ICON= ${MOZILLA}.png FIREFOX_ICON_SRC= ${PREFIX}/lib/${MOZILLA}/browser/chrome/icons/default/default48.png MOZ_OPTIONS= --program-transform-name='s/firefox/${MOZILLA}/' \ --enable-application=browser \ --enable-official-branding .include "${.CURDIR}/../../www/firefox/Makefile.options" .include WRKSRC:= ${WRKDIR}/mozilla-esr31 .if ${PORT_OPTIONS:MALSA} RUN_DEPENDS+= alsa-lib>=1.0.27.2_1:${PORTSDIR}/audio/alsa-lib .endif .if ${PORT_OPTIONS:MGSTREAMER} RUN_DEPENDS+= gstreamer1-libav>=1.2.4_1:${PORTSDIR}/multimedia/gstreamer1-libav .endif post-extract: @${SED} -e 's|@FIREFOX_ICON@|${FIREFOX_ICON}|' -e 's|@MOZILLA@|${MOZILLA}|' \ -e 's|@MOZILLA_NAME@|${MOZILLA_NAME}|' \ <${FILESDIR}/firefox.desktop.in >${WRKDIR}/${MOZILLA}.desktop post-patch: @${REINPLACE_CMD} -e '/MOZPNG/s/=[0-9]*/=10511/' \ ${WRKSRC}/configure.in @${REINPLACE_CMD} -e 's|%%LOCALBASE%%|${LOCALBASE}|g' \ ${WRKSRC}/browser/app/nsBrowserApp.cpp pre-configure: (cd ${WRKSRC} && ${LOCALBASE}/bin/autoconf-2.13) (cd ${WRKSRC}/js/src/ && ${LOCALBASE}/bin/autoconf-2.13) post-install: ${MKDIR} ${STAGEDIR}${PREFIX}/share/pixmaps ${INSTALL_DATA} ${WRKDIR}/${MOZILLA}.desktop ${STAGEDIR}${PREFIX}/share/applications/ ${LN} -sf ${FIREFOX_ICON_SRC} ${STAGEDIR}${PREFIX}/share/pixmaps/${FIREFOX_ICON} .include Index: head/www/firefox-esr/files/patch-z-bug517422 =================================================================== --- head/www/firefox-esr/files/patch-z-bug517422 (revision 380781) +++ head/www/firefox-esr/files/patch-z-bug517422 (revision 380782) @@ -1,492 +1,492 @@ # Allow more config/external/ libs built against system-wide version. diff --git config/Makefile.in config/Makefile.in index 5383399..0410004 100644 --- config/Makefile.in +++ config/Makefile.in @@ -79,6 +79,13 @@ export:: $(export-preqs) -DMOZ_NATIVE_ICU=$(MOZ_NATIVE_ICU) \ -DMOZ_NATIVE_GRAPHITE2=$(MOZ_NATIVE_GRAPHITE2) \ -DMOZ_NATIVE_HARFBUZZ=$(MOZ_NATIVE_HARFBUZZ) \ + -DMOZ_NATIVE_OGG=$(MOZ_NATIVE_OGG) \ + -DMOZ_NATIVE_THEORA=$(MOZ_NATIVE_THEORA) \ + -DMOZ_NATIVE_VORBIS=$(MOZ_NATIVE_VORBIS) \ + -DMOZ_NATIVE_TREMOR=$(MOZ_NATIVE_TREMOR) \ + -DMOZ_NATIVE_OPUS=$(MOZ_NATIVE_OPUS) \ + -DMOZ_NATIVE_SPEEX=$(MOZ_NATIVE_SPEEX) \ + -DMOZ_NATIVE_SOUNDTOUCH=$(MOZ_NATIVE_SOUNDTOUCH) \ $(srcdir)/system-headers | $(PERL) $(topsrcdir)/nsprpub/config/make-system-wrappers.pl system_wrappers $(INSTALL) system_wrappers $(DIST) 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']: external_dirs += ['media/libvorbis'] -if CONFIG['MOZ_TREMOR']: +if CONFIG['MOZ_TREMOR'] and not CONFIG['MOZ_NATIVE_TREMOR']: external_dirs += ['media/libtremor'] -if CONFIG['MOZ_OPUS']: +if CONFIG['MOZ_OPUS'] and not CONFIG['MOZ_NATIVE_OPUS']: external_dirs += ['media/libopus'] if CONFIG['MOZ_WEBM']: @@ -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 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', ] PARALLEL_DIRS += ['../../' + i for i in external_dirs] diff --git config/system-headers config/system-headers index bef567c..9807c29 100644 --- config/system-headers +++ config/system-headers @@ -1050,8 +1050,6 @@ X11/Xutil.h xpt_struct.h xpt_xdr.h zmouse.h -speex/speex_resampler.h -soundtouch/SoundTouch.h #if MOZ_NATIVE_PNG==1 png.h #endif @@ -1119,6 +1117,8 @@ ogg/ogg.h ogg/os_types.h nestegg/nestegg.h cubeb/cubeb.h +speex/speex_resampler.h +soundtouch/SoundTouch.h #endif gst/gst.h gst/app/gstappsink.h @@ -1155,3 +1155,29 @@ graphite2/Segment.h harfbuzz/hb-ot.h harfbuzz/hb.h #endif +#if MOZ_NATIVE_OGG==1 +ogg/ogg.h +ogg/os_types.h +#endif +#if MOZ_NATIVE_THEORA==1 +theora/theoradec.h +#endif +#if MOZ_NATIVE_VORBIS==1 +vorbis/codec.h +vorbis/vorbisenc.h +#endif +#if MOZ_NATIVE_TREMOR==1 +tremor/ivorbiscodec.h +#endif +#if MOZ_NATIVE_OPUS==1 +opus.h +opus_multistream.h +opus/opus.h +opus/opus_multistream.h +#endif +#if MOZ_NATIVE_SPEEX==1 +speex/speex_resampler.h +#endif +#if MOZ_NATIVE_SOUNDTOUCH==1 +soundtouch/SoundTouch.h +#endif diff --git configure.in configure.in index 87db361..7947626 100644 --- configure.in +++ configure.in @@ -5211,6 +5211,63 @@ if test "${ac_cv_c_attribute_aligned}" != "0"; then fi dnl ======================================================== +dnl Check for libogg +dnl ======================================================== + +MOZ_ARG_WITH_BOOL(system-ogg, +[ --with-system-ogg Use system libogg (located with pkgconfig)], +MOZ_NATIVE_OGG=1, +MOZ_NATIVE_OGG=) + +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) +AC_SUBST(MOZ_OGG_CFLAGS) +AC_SUBST(MOZ_OGG_LIBS) + +dnl ======================================================== +dnl Check for libvorbis +dnl ======================================================== + +MOZ_ARG_WITH_BOOL(system-vorbis, +[ --with-system-vorbis Use system libvorbis (located with pkgconfig)], +MOZ_NATIVE_VORBIS=1, +MOZ_NATIVE_VORBIS=) + +if test -n "$MOZ_NATIVE_VORBIS"; then -+ PKG_CHECK_MODULES(MOZ_VORBIS, vorbis vorbisenc >= 1.3.4) ++ PKG_CHECK_MODULES(MOZ_VORBIS, vorbis vorbisenc >= 1.3.5) +fi + +AC_SUBST(MOZ_NATIVE_VORBIS) +AC_SUBST(MOZ_VORBIS_CFLAGS) +AC_SUBST(MOZ_VORBIS_LIBS) + +dnl ======================================================== +dnl Check for integer-only libvorbis aka tremor +dnl ======================================================== + +MOZ_ARG_WITH_BOOL(system-tremor, +[ --with-system-tremor Use system libtremor (located with pkgconfig)], +MOZ_NATIVE_TREMOR=1, +MOZ_NATIVE_TREMOR=) + +if test -n "$MOZ_NATIVE_TREMOR"; then + PKG_CHECK_MODULES(MOZ_TREMOR, vorbisidec >= 1.2.1) +fi + +AC_SUBST(MOZ_NATIVE_TREMOR) +AC_SUBST(MOZ_TREMOR_CFLAGS) +AC_SUBST(MOZ_TREMOR_LIBS) + +dnl ======================================================== dnl = Disable Opus audio codec support dnl ======================================================== MOZ_ARG_DISABLE_BOOL(opus, @@ -5219,6 +5274,97 @@ MOZ_ARG_DISABLE_BOOL(opus, MOZ_OPUS=1) dnl ======================================================== +dnl Check for libopus +dnl ======================================================== + +MOZ_ARG_WITH_BOOL(system-opus, +[ --with-system-opus Use system libopus (located with pkgconfig)], +MOZ_NATIVE_OPUS=1, +MOZ_NATIVE_OPUS=) + +if test -n "$MOZ_NATIVE_OPUS"; then + PKG_CHECK_MODULES(MOZ_OPUS, opus >= 1.1) +else + MOZ_OPUS_CFLAGS='-I$(topsrcdir)/media/libopus/include' +fi + +AC_SUBST(MOZ_NATIVE_OPUS) +AC_SUBST(MOZ_OPUS_CFLAGS) +AC_SUBST(MOZ_OPUS_LIBS) + +dnl ======================================================== +dnl Check for libtheora +dnl ======================================================== + +MOZ_ARG_WITH_BOOL(system-theora, +[ --with-system-theora Use system libtheora (located with pkgconfig)], +MOZ_NATIVE_THEORA=1, +MOZ_NATIVE_THEORA=) + +if test -n "$MOZ_NATIVE_THEORA"; then + PKG_CHECK_MODULES(MOZ_THEORA, theora >= 1.2) +fi + +AC_SUBST(MOZ_NATIVE_THEORA) +AC_SUBST(MOZ_THEORA_CFLAGS) +AC_SUBST(MOZ_THEORA_LIBS) + +dnl ======================================================== +dnl Check for libspeex resampler +dnl ======================================================== + +MOZ_ARG_WITH_BOOL(system-speex, +[ --with-system-speex Use system libspeex (located with pkgconfig)], +MOZ_NATIVE_SPEEX=1, +MOZ_NATIVE_SPEEX=) + +if test -n "$MOZ_NATIVE_SPEEX"; then + PKG_CHECK_MODULES(MOZ_SPEEX, speexdsp >= 1.2) +fi + +AC_SUBST(MOZ_NATIVE_SPEEX) +AC_SUBST(MOZ_SPEEX_CFLAGS) +AC_SUBST(MOZ_SPEEX_LIBS) + +dnl ======================================================== +dnl Check for libsoundtouch +dnl ======================================================== + +MOZ_ARG_WITH_BOOL(system-soundtouch, +[ --with-system-soundtouch Use system libsoundtouch (located with pkgconfig)], +MOZ_NATIVE_SOUNDTOUCH=1, +MOZ_NATIVE_SOUNDTOUCH=) + +if test -n "$MOZ_NATIVE_SOUNDTOUCH"; then + PKG_CHECK_MODULES(MOZ_SOUNDTOUCH, soundtouch >= 1.8.0) + + AC_LANG_SAVE + AC_LANG_CPLUSPLUS + _SAVE_CXXFLAGS=$CXXFLAGS + CXXFLAGS="$CXXFLAGS $MOZ_SOUNDTOUCH_CFLAGS" + AC_CACHE_CHECK(for soundtouch sample type, + ac_cv_soundtouch_sample_type, + [AC_TRY_COMPILE([#include + #ifndef SOUNDTOUCH_INTEGER_SAMPLES + #error soundtouch expects float samples + #endif], + [], + [ac_cv_soundtouch_sample_type=short], + [ac_cv_soundtouch_sample_type=float])]) + CXXFLAGS=$_SAVE_CXXFLAGS + AC_LANG_RESTORE + + if test \( -n "$MOZ_SAMPLE_TYPE_S16" -a "$ac_cv_soundtouch_sample_type" != short \) \ + -o \( -n "$MOZ_SAMPLE_TYPE_FLOAT32" -a "$ac_cv_soundtouch_sample_type" != float \) ; then + AC_MSG_ERROR([SoundTouch library is built with incompatible sample type. Either rebuild the library with/without --enable-integer-samples, chase default Mozilla sample type or remove --with-system-soundtouch.]) + fi +fi + +AC_SUBST(MOZ_NATIVE_SOUNDTOUCH) +AC_SUBST(MOZ_SOUNDTOUCH_CFLAGS) +AC_SUBST(MOZ_SOUNDTOUCH_LIBS) + +dnl ======================================================== 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,3 +6,31 @@ include $(topsrcdir)/config/rules.mk CFLAGS += $(GSTREAMER_CFLAGS) CXXFLAGS += $(GSTREAMER_CFLAGS) + +ifdef MOZ_NATIVE_OGG +CXXFLAGS += $(MOZ_OGG_CFLAGS) +endif + +ifdef MOZ_NATIVE_THEORA +CXXFLAGS += $(MOZ_THEORA_CFLAGS) +endif + +ifdef MOZ_NATIVE_VORBIS +CXXFLAGS += $(MOZ_VORBIS_CFLAGS) +endif + +ifdef MOZ_NATIVE_TREMOR +CXXFLAGS += $(MOZ_TREMOR_CFLAGS) +endif + +ifdef MOZ_NATIVE_OPUS +CXXFLAGS += $(MOZ_OPUS_CFLAGS) +endif + +ifdef MOZ_NATIVE_SPEEX +CXXFLAGS += $(MOZ_SPEEX_CFLAGS) +endif + +ifdef MOZ_NATIVE_SOUNDTOUCH +CXXFLAGS += $(MOZ_SOUNDTOUCH_CFLAGS) +endif diff --git media/libcubeb/src/Makefile.in media/libcubeb/src/Makefile.in index 4c14494..1cb98e2 100644 --- media/libcubeb/src/Makefile.in +++ media/libcubeb/src/Makefile.in @@ -9,3 +9,7 @@ CFLAGS += \ $(MOZ_ALSA_CFLAGS) \ $(MOZ_PULSEAUDIO_CFLAGS) \ $(NULL) + +ifdef MOZ_NATIVE_SPEEX +CFLAGS += $(MOZ_SPEEX_CFLAGS) +endif 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,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/. + +include $(topsrcdir)/config/rules.mk + +ifdef MOZ_NATIVE_OGG +CFLAGS += $(MOZ_OGG_CFLAGS) +endif diff --git media/libtremor/Makefile.in media/libtremor/Makefile.in new file mode 100644 index 0000000..1f02dc0 --- /dev/null +++ media/libtremor/Makefile.in @@ -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/. + +include $(topsrcdir)/config/rules.mk + +ifdef MOZ_NATIVE_OGG +CFLAGS += $(MOZ_OGG_CFLAGS) +endif diff --git media/libvorbis/Makefile.in media/libvorbis/Makefile.in new file mode 100644 index 0000000..1f02dc0 --- /dev/null +++ media/libvorbis/Makefile.in @@ -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/. + +include $(topsrcdir)/config/rules.mk + +ifdef MOZ_NATIVE_OGG +CFLAGS += $(MOZ_OGG_CFLAGS) +endif diff --git media/webrtc/signaling/test/Makefile.in media/webrtc/signaling/test/Makefile.in index bbc971c..6ed7e41 100644 --- media/webrtc/signaling/test/Makefile.in +++ media/webrtc/signaling/test/Makefile.in @@ -48,6 +48,12 @@ LIBS += \ $(NULL) endif +ifdef MOZ_NATIVE_OPUS +LIBS += \ + $(MOZ_OPUS_LIBS) \ + $(NULL) +endif + ifdef MOZ_NATIVE_LIBVPX LIBS += \ $(MOZ_LIBVPX_LIBS) \ diff --git media/webrtc/trunk/webrtc/modules/audio_coding/codecs/opus/opus.gypi media/webrtc/trunk/webrtc/modules/audio_coding/codecs/opus/opus.gypi index 00e77e7..55f48ab 100644 --- media/webrtc/trunk/webrtc/modules/audio_coding/codecs/opus/opus.gypi +++ media/webrtc/trunk/webrtc/modules/audio_coding/codecs/opus/opus.gypi @@ -14,9 +14,9 @@ 'conditions': [ ['build_with_mozilla==1', { # Mozilla provides its own build of the opus library. - 'include_dirs': [ - '/media/libopus/include', - ] + 'cflags_mozilla': [ + '$(MOZ_OPUS_CFLAGS)', + ], }, { 'dependencies': [ '<(DEPTH)/third_party/opus/opus.gyp:opus' diff --git toolkit/library/libxul.mk toolkit/library/libxul.mk index d42137a..695e75a8 100644 --- toolkit/library/libxul.mk +++ toolkit/library/libxul.mk @@ -77,6 +77,34 @@ ifdef MOZ_NATIVE_HUNSPELL EXTRA_DSO_LDOPTS += $(MOZ_HUNSPELL_LIBS) endif +ifdef MOZ_NATIVE_OGG +EXTRA_DSO_LDOPTS += $(MOZ_OGG_LIBS) +endif + +ifdef MOZ_NATIVE_THEORA +EXTRA_DSO_LDOPTS += $(MOZ_THEORA_LIBS) +endif + +ifdef MOZ_NATIVE_VORBIS +EXTRA_DSO_LDOPTS += $(MOZ_VORBIS_LIBS) +endif + +ifdef MOZ_NATIVE_TREMOR +EXTRA_DSO_LDOPTS += $(MOZ_TREMOR_LIBS) +endif + +ifdef MOZ_NATIVE_OPUS +EXTRA_DSO_LDOPTS += $(MOZ_OPUS_LIBS) +endif + +ifdef MOZ_NATIVE_SPEEX +EXTRA_DSO_LDOPTS += $(MOZ_SPEEX_LIBS) +endif + +ifdef MOZ_NATIVE_SOUNDTOUCH +EXTRA_DSO_LDOPTS += $(MOZ_SOUNDTOUCH_LIBS) +endif + 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. Index: head/www/libxul/Makefile =================================================================== --- head/www/libxul/Makefile (revision 380781) +++ head/www/libxul/Makefile (revision 380782) @@ -1,88 +1,88 @@ # Created by: Michael Johnson # $FreeBSD$ PORTNAME= libxul DISTVERSION= 31.5.0 CATEGORIES?= www devel MASTER_SITES= MOZILLA/firefox/releases/${DISTVERSION}esr/source DISTNAME= firefox-${DISTVERSION}esr.source MAINTAINER?= gecko@FreeBSD.org COMMENT?= Mozilla runtime package that can be used to bootstrap XUL+XPCOM apps BUILD_DEPENDS= nspr>=4.10.6:${PORTSDIR}/devel/nspr \ nss>=3.16.2:${PORTSDIR}/security/nss \ libevent2>=2.0.21_2:${PORTSDIR}/devel/libevent2 \ cairo>=1.12.16_1,2:${PORTSDIR}/graphics/cairo \ soundtouch>=1.8.0:${PORTSDIR}/audio/soundtouch \ harfbuzz>=0.9.25:${PORTSDIR}/print/harfbuzz \ graphite2>=1.2.4:${PORTSDIR}/graphics/graphite2 \ - libvorbis>=1.3.4:${PORTSDIR}/audio/libvorbis \ + libvorbis>=1.3.5:${PORTSDIR}/audio/libvorbis \ opus>=1.1:${PORTSDIR}/audio/opus \ libvpx>=1.3.0:${PORTSDIR}/multimedia/libvpx \ sqlite3>=3.8.4.2:${PORTSDIR}/databases/sqlite3 \ ${PYTHON_PKGNAMEPREFIX}sqlite3>0:${PORTSDIR}/databases/py-sqlite3 \ v4l_compat>0:${PORTSDIR}/multimedia/v4l_compat \ autoconf-2.13:${PORTSDIR}/devel/autoconf213 \ zip:${PORTSDIR}/archivers/zip \ unzip:${PORTSDIR}/archivers/unzip LIB_DEPENDS= libv4l2.so:${PORTSDIR}/multimedia/libv4l WRKSRC= ${WRKDIR}/mozilla-esr31 CONFLICTS= libxul-1.9.* USE_QT5= # empty QT_NONSTANDARD= yes USE_GL= gl USES= dos2unix pathfix tar:bzip2 DOS2UNIX_FILES= media/webrtc/trunk/webrtc/system_wrappers/source/spreadsortlib/spreadsort.hpp MAKE_ENV= SKIP_GRE_REGISTRATION=1 mozappdir=${PREFIX}/lib/${MOZILLA} LDFLAGS+= -Wl,-rpath,${PREFIX}/lib/${MOZ_RPATH} USE_LDCONFIG= ${PREFIX}/lib/${MOZILLA} MOZ_OPTIONS?= --enable-application=xulrunner USE_GECKO= gecko CPE_PRODUCT= firefox_esr MOZILLA_EXEC_NAME=xulrunner USE_MOZILLA= # empty MOZILLA_PLIST_DIRS= bin include lib share/idl libdata MOZ_PKGCONFIG_FILES= libxul-embedding libxul mozilla-js \ mozilla-plugin .include "${.CURDIR}/../../www/firefox/Makefile.options" .include .if ${USE_MOZILLA:M-nss} MOZ_PKGCONFIG_FILES+= mozilla-nss .endif .if ${PORT_OPTIONS:MALSA} RUN_DEPENDS+= alsa-lib>=1.0.27.2_1:${PORTSDIR}/audio/alsa-lib .endif .if ${PORT_OPTIONS:MGSTREAMER} RUN_DEPENDS+= gstreamer1-libav>=1.2.4_1:${PORTSDIR}/multimedia/gstreamer1-libav .endif .if ${PORT_OPTIONS:MTEST} BROKEN= stage-package fails with ValueError: no path specified .endif post-patch: @${REINPLACE_CMD} -e '/MOZPNG/s/=[0-9]*/=10511/' \ ${WRKSRC}/configure.in @${REINPLACE_CMD} -e 's|%%LOCALBASE%%|${LOCALBASE}|g' \ ${WRKSRC}/xulrunner/stub/nsXULStub.cpp pre-configure: (cd ${WRKSRC} && ${LOCALBASE}/bin/autoconf-2.13) (cd ${WRKSRC}/js/src/ && ${LOCALBASE}/bin/autoconf-2.13) post-build: @${REINPLACE_CMD} -e "s|\(Libs:.*\)\($$\)|\1 -Wl,-rpath,${PREFIX}/lib/${MOZ_RPATH}\2| ; \ s|%sdkdir%|%sdkdir%/sdk|g ; \ s|%%MOZ_LIBDIR%%|${PREFIX}/lib/${MOZILLA}|g" \ ${WRKSRC}/xulrunner/installer/*.pc.in || ${TRUE} .include Index: head/www/libxul/files/patch-z-bug517422 =================================================================== --- head/www/libxul/files/patch-z-bug517422 (revision 380781) +++ head/www/libxul/files/patch-z-bug517422 (revision 380782) @@ -1,492 +1,492 @@ # Allow more config/external/ libs built against system-wide version. diff --git config/Makefile.in config/Makefile.in index 5383399..0410004 100644 --- config/Makefile.in +++ config/Makefile.in @@ -79,6 +79,13 @@ export:: $(export-preqs) -DMOZ_NATIVE_ICU=$(MOZ_NATIVE_ICU) \ -DMOZ_NATIVE_GRAPHITE2=$(MOZ_NATIVE_GRAPHITE2) \ -DMOZ_NATIVE_HARFBUZZ=$(MOZ_NATIVE_HARFBUZZ) \ + -DMOZ_NATIVE_OGG=$(MOZ_NATIVE_OGG) \ + -DMOZ_NATIVE_THEORA=$(MOZ_NATIVE_THEORA) \ + -DMOZ_NATIVE_VORBIS=$(MOZ_NATIVE_VORBIS) \ + -DMOZ_NATIVE_TREMOR=$(MOZ_NATIVE_TREMOR) \ + -DMOZ_NATIVE_OPUS=$(MOZ_NATIVE_OPUS) \ + -DMOZ_NATIVE_SPEEX=$(MOZ_NATIVE_SPEEX) \ + -DMOZ_NATIVE_SOUNDTOUCH=$(MOZ_NATIVE_SOUNDTOUCH) \ $(srcdir)/system-headers | $(PERL) $(topsrcdir)/nsprpub/config/make-system-wrappers.pl system_wrappers $(INSTALL) system_wrappers $(DIST) 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']: external_dirs += ['media/libvorbis'] -if CONFIG['MOZ_TREMOR']: +if CONFIG['MOZ_TREMOR'] and not CONFIG['MOZ_NATIVE_TREMOR']: external_dirs += ['media/libtremor'] -if CONFIG['MOZ_OPUS']: +if CONFIG['MOZ_OPUS'] and not CONFIG['MOZ_NATIVE_OPUS']: external_dirs += ['media/libopus'] if CONFIG['MOZ_WEBM']: @@ -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 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', ] PARALLEL_DIRS += ['../../' + i for i in external_dirs] diff --git config/system-headers config/system-headers index bef567c..9807c29 100644 --- config/system-headers +++ config/system-headers @@ -1050,8 +1050,6 @@ X11/Xutil.h xpt_struct.h xpt_xdr.h zmouse.h -speex/speex_resampler.h -soundtouch/SoundTouch.h #if MOZ_NATIVE_PNG==1 png.h #endif @@ -1119,6 +1117,8 @@ ogg/ogg.h ogg/os_types.h nestegg/nestegg.h cubeb/cubeb.h +speex/speex_resampler.h +soundtouch/SoundTouch.h #endif gst/gst.h gst/app/gstappsink.h @@ -1155,3 +1155,29 @@ graphite2/Segment.h harfbuzz/hb-ot.h harfbuzz/hb.h #endif +#if MOZ_NATIVE_OGG==1 +ogg/ogg.h +ogg/os_types.h +#endif +#if MOZ_NATIVE_THEORA==1 +theora/theoradec.h +#endif +#if MOZ_NATIVE_VORBIS==1 +vorbis/codec.h +vorbis/vorbisenc.h +#endif +#if MOZ_NATIVE_TREMOR==1 +tremor/ivorbiscodec.h +#endif +#if MOZ_NATIVE_OPUS==1 +opus.h +opus_multistream.h +opus/opus.h +opus/opus_multistream.h +#endif +#if MOZ_NATIVE_SPEEX==1 +speex/speex_resampler.h +#endif +#if MOZ_NATIVE_SOUNDTOUCH==1 +soundtouch/SoundTouch.h +#endif diff --git configure.in configure.in index 87db361..7947626 100644 --- configure.in +++ configure.in @@ -5211,6 +5211,63 @@ if test "${ac_cv_c_attribute_aligned}" != "0"; then fi dnl ======================================================== +dnl Check for libogg +dnl ======================================================== + +MOZ_ARG_WITH_BOOL(system-ogg, +[ --with-system-ogg Use system libogg (located with pkgconfig)], +MOZ_NATIVE_OGG=1, +MOZ_NATIVE_OGG=) + +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) +AC_SUBST(MOZ_OGG_CFLAGS) +AC_SUBST(MOZ_OGG_LIBS) + +dnl ======================================================== +dnl Check for libvorbis +dnl ======================================================== + +MOZ_ARG_WITH_BOOL(system-vorbis, +[ --with-system-vorbis Use system libvorbis (located with pkgconfig)], +MOZ_NATIVE_VORBIS=1, +MOZ_NATIVE_VORBIS=) + +if test -n "$MOZ_NATIVE_VORBIS"; then -+ PKG_CHECK_MODULES(MOZ_VORBIS, vorbis vorbisenc >= 1.3.4) ++ PKG_CHECK_MODULES(MOZ_VORBIS, vorbis vorbisenc >= 1.3.5) +fi + +AC_SUBST(MOZ_NATIVE_VORBIS) +AC_SUBST(MOZ_VORBIS_CFLAGS) +AC_SUBST(MOZ_VORBIS_LIBS) + +dnl ======================================================== +dnl Check for integer-only libvorbis aka tremor +dnl ======================================================== + +MOZ_ARG_WITH_BOOL(system-tremor, +[ --with-system-tremor Use system libtremor (located with pkgconfig)], +MOZ_NATIVE_TREMOR=1, +MOZ_NATIVE_TREMOR=) + +if test -n "$MOZ_NATIVE_TREMOR"; then + PKG_CHECK_MODULES(MOZ_TREMOR, vorbisidec >= 1.2.1) +fi + +AC_SUBST(MOZ_NATIVE_TREMOR) +AC_SUBST(MOZ_TREMOR_CFLAGS) +AC_SUBST(MOZ_TREMOR_LIBS) + +dnl ======================================================== dnl = Disable Opus audio codec support dnl ======================================================== MOZ_ARG_DISABLE_BOOL(opus, @@ -5219,6 +5274,97 @@ MOZ_ARG_DISABLE_BOOL(opus, MOZ_OPUS=1) dnl ======================================================== +dnl Check for libopus +dnl ======================================================== + +MOZ_ARG_WITH_BOOL(system-opus, +[ --with-system-opus Use system libopus (located with pkgconfig)], +MOZ_NATIVE_OPUS=1, +MOZ_NATIVE_OPUS=) + +if test -n "$MOZ_NATIVE_OPUS"; then + PKG_CHECK_MODULES(MOZ_OPUS, opus >= 1.1) +else + MOZ_OPUS_CFLAGS='-I$(topsrcdir)/media/libopus/include' +fi + +AC_SUBST(MOZ_NATIVE_OPUS) +AC_SUBST(MOZ_OPUS_CFLAGS) +AC_SUBST(MOZ_OPUS_LIBS) + +dnl ======================================================== +dnl Check for libtheora +dnl ======================================================== + +MOZ_ARG_WITH_BOOL(system-theora, +[ --with-system-theora Use system libtheora (located with pkgconfig)], +MOZ_NATIVE_THEORA=1, +MOZ_NATIVE_THEORA=) + +if test -n "$MOZ_NATIVE_THEORA"; then + PKG_CHECK_MODULES(MOZ_THEORA, theora >= 1.2) +fi + +AC_SUBST(MOZ_NATIVE_THEORA) +AC_SUBST(MOZ_THEORA_CFLAGS) +AC_SUBST(MOZ_THEORA_LIBS) + +dnl ======================================================== +dnl Check for libspeex resampler +dnl ======================================================== + +MOZ_ARG_WITH_BOOL(system-speex, +[ --with-system-speex Use system libspeex (located with pkgconfig)], +MOZ_NATIVE_SPEEX=1, +MOZ_NATIVE_SPEEX=) + +if test -n "$MOZ_NATIVE_SPEEX"; then + PKG_CHECK_MODULES(MOZ_SPEEX, speexdsp >= 1.2) +fi + +AC_SUBST(MOZ_NATIVE_SPEEX) +AC_SUBST(MOZ_SPEEX_CFLAGS) +AC_SUBST(MOZ_SPEEX_LIBS) + +dnl ======================================================== +dnl Check for libsoundtouch +dnl ======================================================== + +MOZ_ARG_WITH_BOOL(system-soundtouch, +[ --with-system-soundtouch Use system libsoundtouch (located with pkgconfig)], +MOZ_NATIVE_SOUNDTOUCH=1, +MOZ_NATIVE_SOUNDTOUCH=) + +if test -n "$MOZ_NATIVE_SOUNDTOUCH"; then + PKG_CHECK_MODULES(MOZ_SOUNDTOUCH, soundtouch >= 1.8.0) + + AC_LANG_SAVE + AC_LANG_CPLUSPLUS + _SAVE_CXXFLAGS=$CXXFLAGS + CXXFLAGS="$CXXFLAGS $MOZ_SOUNDTOUCH_CFLAGS" + AC_CACHE_CHECK(for soundtouch sample type, + ac_cv_soundtouch_sample_type, + [AC_TRY_COMPILE([#include + #ifndef SOUNDTOUCH_INTEGER_SAMPLES + #error soundtouch expects float samples + #endif], + [], + [ac_cv_soundtouch_sample_type=short], + [ac_cv_soundtouch_sample_type=float])]) + CXXFLAGS=$_SAVE_CXXFLAGS + AC_LANG_RESTORE + + if test \( -n "$MOZ_SAMPLE_TYPE_S16" -a "$ac_cv_soundtouch_sample_type" != short \) \ + -o \( -n "$MOZ_SAMPLE_TYPE_FLOAT32" -a "$ac_cv_soundtouch_sample_type" != float \) ; then + AC_MSG_ERROR([SoundTouch library is built with incompatible sample type. Either rebuild the library with/without --enable-integer-samples, chase default Mozilla sample type or remove --with-system-soundtouch.]) + fi +fi + +AC_SUBST(MOZ_NATIVE_SOUNDTOUCH) +AC_SUBST(MOZ_SOUNDTOUCH_CFLAGS) +AC_SUBST(MOZ_SOUNDTOUCH_LIBS) + +dnl ======================================================== 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,3 +6,31 @@ include $(topsrcdir)/config/rules.mk CFLAGS += $(GSTREAMER_CFLAGS) CXXFLAGS += $(GSTREAMER_CFLAGS) + +ifdef MOZ_NATIVE_OGG +CXXFLAGS += $(MOZ_OGG_CFLAGS) +endif + +ifdef MOZ_NATIVE_THEORA +CXXFLAGS += $(MOZ_THEORA_CFLAGS) +endif + +ifdef MOZ_NATIVE_VORBIS +CXXFLAGS += $(MOZ_VORBIS_CFLAGS) +endif + +ifdef MOZ_NATIVE_TREMOR +CXXFLAGS += $(MOZ_TREMOR_CFLAGS) +endif + +ifdef MOZ_NATIVE_OPUS +CXXFLAGS += $(MOZ_OPUS_CFLAGS) +endif + +ifdef MOZ_NATIVE_SPEEX +CXXFLAGS += $(MOZ_SPEEX_CFLAGS) +endif + +ifdef MOZ_NATIVE_SOUNDTOUCH +CXXFLAGS += $(MOZ_SOUNDTOUCH_CFLAGS) +endif diff --git media/libcubeb/src/Makefile.in media/libcubeb/src/Makefile.in index 4c14494..1cb98e2 100644 --- media/libcubeb/src/Makefile.in +++ media/libcubeb/src/Makefile.in @@ -9,3 +9,7 @@ CFLAGS += \ $(MOZ_ALSA_CFLAGS) \ $(MOZ_PULSEAUDIO_CFLAGS) \ $(NULL) + +ifdef MOZ_NATIVE_SPEEX +CFLAGS += $(MOZ_SPEEX_CFLAGS) +endif 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,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/. + +include $(topsrcdir)/config/rules.mk + +ifdef MOZ_NATIVE_OGG +CFLAGS += $(MOZ_OGG_CFLAGS) +endif diff --git media/libtremor/Makefile.in media/libtremor/Makefile.in new file mode 100644 index 0000000..1f02dc0 --- /dev/null +++ media/libtremor/Makefile.in @@ -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/. + +include $(topsrcdir)/config/rules.mk + +ifdef MOZ_NATIVE_OGG +CFLAGS += $(MOZ_OGG_CFLAGS) +endif diff --git media/libvorbis/Makefile.in media/libvorbis/Makefile.in new file mode 100644 index 0000000..1f02dc0 --- /dev/null +++ media/libvorbis/Makefile.in @@ -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/. + +include $(topsrcdir)/config/rules.mk + +ifdef MOZ_NATIVE_OGG +CFLAGS += $(MOZ_OGG_CFLAGS) +endif diff --git media/webrtc/signaling/test/Makefile.in media/webrtc/signaling/test/Makefile.in index bbc971c..6ed7e41 100644 --- media/webrtc/signaling/test/Makefile.in +++ media/webrtc/signaling/test/Makefile.in @@ -48,6 +48,12 @@ LIBS += \ $(NULL) endif +ifdef MOZ_NATIVE_OPUS +LIBS += \ + $(MOZ_OPUS_LIBS) \ + $(NULL) +endif + ifdef MOZ_NATIVE_LIBVPX LIBS += \ $(MOZ_LIBVPX_LIBS) \ diff --git media/webrtc/trunk/webrtc/modules/audio_coding/codecs/opus/opus.gypi media/webrtc/trunk/webrtc/modules/audio_coding/codecs/opus/opus.gypi index 00e77e7..55f48ab 100644 --- media/webrtc/trunk/webrtc/modules/audio_coding/codecs/opus/opus.gypi +++ media/webrtc/trunk/webrtc/modules/audio_coding/codecs/opus/opus.gypi @@ -14,9 +14,9 @@ 'conditions': [ ['build_with_mozilla==1', { # Mozilla provides its own build of the opus library. - 'include_dirs': [ - '/media/libopus/include', - ] + 'cflags_mozilla': [ + '$(MOZ_OPUS_CFLAGS)', + ], }, { 'dependencies': [ '<(DEPTH)/third_party/opus/opus.gyp:opus' diff --git toolkit/library/libxul.mk toolkit/library/libxul.mk index d42137a..695e75a8 100644 --- toolkit/library/libxul.mk +++ toolkit/library/libxul.mk @@ -77,6 +77,34 @@ ifdef MOZ_NATIVE_HUNSPELL EXTRA_DSO_LDOPTS += $(MOZ_HUNSPELL_LIBS) endif +ifdef MOZ_NATIVE_OGG +EXTRA_DSO_LDOPTS += $(MOZ_OGG_LIBS) +endif + +ifdef MOZ_NATIVE_THEORA +EXTRA_DSO_LDOPTS += $(MOZ_THEORA_LIBS) +endif + +ifdef MOZ_NATIVE_VORBIS +EXTRA_DSO_LDOPTS += $(MOZ_VORBIS_LIBS) +endif + +ifdef MOZ_NATIVE_TREMOR +EXTRA_DSO_LDOPTS += $(MOZ_TREMOR_LIBS) +endif + +ifdef MOZ_NATIVE_OPUS +EXTRA_DSO_LDOPTS += $(MOZ_OPUS_LIBS) +endif + +ifdef MOZ_NATIVE_SPEEX +EXTRA_DSO_LDOPTS += $(MOZ_SPEEX_LIBS) +endif + +ifdef MOZ_NATIVE_SOUNDTOUCH +EXTRA_DSO_LDOPTS += $(MOZ_SOUNDTOUCH_LIBS) +endif + 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. Index: head/www/seamonkey/Makefile =================================================================== --- head/www/seamonkey/Makefile (revision 380781) +++ head/www/seamonkey/Makefile (revision 380782) @@ -1,193 +1,194 @@ # Created by: eivind/dima/jseger # $FreeBSD$ PORTNAME= seamonkey DISTVERSION= 2.32.1 +PORTREVISION= 1 CATEGORIES?= www mail news editors irc ipv6 MASTER_SITES= MOZILLA/${PORTNAME}/releases/${DISTVERSION}/source \ https://ftp.mozilla.org/pub/mozilla.org/${PORTNAME}/candidates/${DISTVERSION}-candidates/build1/source/ DISTFILES= ${PORTNAME}-${DISTVERSION}.source${EXTRACT_SUFX} EXTRACT_ONLY= ${PORTNAME}-${DISTVERSION}.source${EXTRACT_SUFX} MAINTAINER= gecko@FreeBSD.org COMMENT= The open source, standards compliant web browser BUILD_DEPENDS= nspr>=4.10.6:${PORTSDIR}/devel/nspr \ nss>=3.17.2:${PORTSDIR}/security/nss \ libevent2>=2.0.21_2:${PORTSDIR}/devel/libevent2 \ cairo>=1.12.16_1,2:${PORTSDIR}/graphics/cairo \ soundtouch>=1.8.0:${PORTSDIR}/audio/soundtouch \ - harfbuzz>=0.9.25:${PORTSDIR}/print/harfbuzz \ + harfbuzz>=0.9.34:${PORTSDIR}/print/harfbuzz \ graphite2>=1.2.4:${PORTSDIR}/graphics/graphite2 \ - libvorbis>=1.3.4:${PORTSDIR}/audio/libvorbis \ + libvorbis>=1.3.5:${PORTSDIR}/audio/libvorbis \ opus>=1.1:${PORTSDIR}/audio/opus \ libvpx>=1.3.0:${PORTSDIR}/multimedia/libvpx \ sqlite3>=3.8.6:${PORTSDIR}/databases/sqlite3 \ ${PYTHON_PKGNAMEPREFIX}sqlite3>0:${PORTSDIR}/databases/py-sqlite3 \ v4l_compat>0:${PORTSDIR}/multimedia/v4l_compat \ autoconf-2.13:${PORTSDIR}/devel/autoconf213 \ zip:${PORTSDIR}/archivers/zip \ unzip:${PORTSDIR}/archivers/unzip LIB_DEPENDS= libv4l2.so:${PORTSDIR}/multimedia/libv4l EM_VERSION= 1.7.2 L_VERSION= 3.7 SSP_UNSAFE= yes USE_GECKO= gecko USE_QT5= # empty QT_NONSTANDARD= yes USE_GL= gl USES= dos2unix tar:bzip2 DOS2UNIX_FILES= mozilla/media/webrtc/trunk/webrtc/system_wrappers/source/spreadsortlib/spreadsort.hpp MOZ_PIS_SCRIPTS= moz_pis_S50cleanhome MOZ_EXTENSIONS= default MOZ_OPTIONS+= --program-transform-name='s/seamonkey/${MOZILLA}/' \ --enable-application=suite USE_MOZILLA= # empty MOZ_PKGCONFIG_FILES= NOT_FOR_ARCHS= ia64 OPTIONS_DEFINE= CHATZILLA COMPOSER ENIGMAIL LDAP LIGHTNING MAILNEWS -OPTIONS_DEFAULT=CHATZILLA COMPOSER ENIGMAIL LDAP LIGHTNING MAILNEWS +OPTIONS_DEFAULT=CANBERRA CHATZILLA COMPOSER ENIGMAIL LDAP LIGHTNING MAILNEWS CHATZILLA_DESC?=Chatzilla IRC module COMPOSER_DESC?= HTML Composer module LDAP_DESC?= LDAP support for Mailnews MAILNEWS_DESC?= Mail and News modules .include "${.CURDIR}/../../www/firefox/Makefile.options" .include .if ${PORT_OPTIONS:MCHATZILLA} MOZ_EXTENSIONS:= ${MOZ_EXTENSIONS},irc .endif .include WRKSRC= ${WRKDIR}/comm-release MOZSRC:= ${WRKSRC}/mozilla XPI_LIBDIR= ${PREFIX}/lib/xpi .if ${PORT_OPTIONS:MALSA} RUN_DEPENDS+= alsa-lib>=1.0.27.2_1:${PORTSDIR}/audio/alsa-lib .endif .if ${PORT_OPTIONS:MGSTREAMER} RUN_DEPENDS+= gstreamer1-libav>=1.2.4_1:${PORTSDIR}/multimedia/gstreamer1-libav .endif .if ! ${PORT_OPTIONS:MMAILNEWS} MOZ_OPTIONS+= --disable-ldap --disable-mailnews .else # mail and news desired, but not LDAP .if ! ${PORT_OPTIONS:MLDAP} MOZ_OPTIONS+= --disable-ldap --enable-mailnews .else MOZ_OPTIONS+= --enable-ldap --enable-mailnews .endif .if ${PORT_OPTIONS:MENIGMAIL} MASTER_SITES+= https://www.enigmail.net/download/source/:enigmail DISTFILES+= ${EM_DISTFILE}:enigmail RUN_DEPENDS+= gpg:${PORTSDIR}/security/gnupg EM_DISTNAME= enigmail-${EM_VERSION} EM_DISTFILE= ${EM_DISTNAME}.tar.gz EM_XPI_FILE= ${WRKSRC}/mailnews/extensions/enigmail/build/${EM_DISTNAME}-${OPSYS:tl}-${ARCH:S/amd64/x86_64/:S/i386/x86/}-gcc3.xpi EM_ORIG_ID= {847b3a00-7ab1-11d4-8f02-006008948af5} EM_ID= ${PORTNAME}@mozilla-enigmail.org EM_ID_RFILES= ${XPI_LIBDIR}/${EM_ID}/install.rdf \ ${XPI_LIBDIR}/${EM_ID}/components/enigmail.js \ ${XPI_LIBDIR}/${EM_ID}/modules/enigmailCommon.jsm .endif .endif .if ! ${PORT_OPTIONS:MCOMPOSER} MOZ_OPTIONS+= --disable-composer .endif .if ${PORT_OPTIONS:MLIGHTNING} MOZ_OPTIONS+= --enable-calendar MOZ_MK_OPTIONS+= MOZ_CO_PROJECT=calendar LIGHTNING_DIR= share/lightning XPI_FILE= ${MOZ_OBJDIR}/dist/xpi-stage/lightning-${L_VERSION}.en-US.${OPSYS:tl}${OSREL}-${ARCH:S/amd64/x86_64/}.xpi XPI_ORIG_ID= {e2fda1a4-762b-4020-b5ad-a41df1933103} XPI_ID= lightning@seamonkey.mozilla.org .else MOZ_OPTIONS+= --disable-calendar .endif .if ${PORT_OPTIONS:MMAILNEWS} && ${PORT_OPTIONS:MENIGMAIL} post-extract: @${TAR} -xf ${_DISTDIR}/${EM_DISTFILE} \ -C ${WRKSRC}/mailnews/extensions .endif post-patch: @${REINPLACE_CMD} -e '/MOZPNG/s/=[0-9]*/=10511/' \ ${MOZSRC}/configure.in ${WRKSRC}/configure.in @${REINPLACE_CMD} -e 's|%%LOCALBASE%%|${LOCALBASE}|g' \ ${WRKSRC}/suite/app/nsSuiteApp.cpp @${REINPLACE_CMD} -e '/accessibility.typeaheadfind.enablesound/s/true/false/' \ ${WRKSRC}/mozilla/modules/libpref/init/all.js @${SED} -e 's|%%MOZILLA%%|${MOZILLA}|g' \ < ${FILESDIR}/seamonkey.desktop.in > \ ${WRKDIR}/${MOZILLA}.desktop .if ${PORT_OPTIONS:MMAILNEWS} && ${PORT_OPTIONS:MENIGMAIL} @${REINPLACE_CMD} -e 's,/usr/bin/perl,${PERL},' \ ${WRKSRC}/mailnews/extensions/enigmail/util/fixlang.pl \ ${WRKSRC}/mailnews/extensions/enigmail/util/make-lang-xpi.pl @${REINPLACE_CMD} -e '/^xpi/s/$$/ all/' \ -e '/^all/s/ xpi//' \ -e '/^XPI_MODULE_VERS/s/= .*/= ${EM_VERSION}/' \ ${WRKSRC}/mailnews/extensions/enigmail/Makefile @${REINPLACE_CMD} -e '/em:version/s,>[^<]*<,>${EM_VERSION}<,' \ -e '/em:maxVersion/s/pre//' \ ${WRKSRC}/mailnews/extensions/enigmail/package/install.rdf .endif pre-configure: (cd ${WRKSRC} && ${LOCALBASE}/bin/autoconf-2.13) (cd ${MOZSRC} && ${LOCALBASE}/bin/autoconf-2.13) (cd ${MOZSRC}/js/src/ && ${LOCALBASE}/bin/autoconf-2.13) .if ${PORT_OPTIONS:MMAILNEWS} && ${PORT_OPTIONS:MENIGMAIL} post-configure: cd ${WRKSRC}/mailnews/extensions/enigmail/ && \ ${SETENV} ${CONFIGURE_ENV} ${MAKE_ENV} ./configure .endif .if ${PORT_OPTIONS:MMAILNEWS} && ${PORT_OPTIONS:MENIGMAIL} post-build: ${DO_MAKE_BUILD:S/${MAKEFILE}/Makefile/} all xpi \ -C ${WRKSRC}/mailnews/extensions/enigmail .endif post-install: ${INSTALL_DATA} ${WRKDIR}/${MOZILLA}.desktop ${STAGEDIR}${PREFIX}/share/applications/ ${LN} -sf ${PREFIX}/lib/${MOZILLA}/chrome/icons/default/default48.png \ ${STAGEDIR}${PREFIX}/share/pixmaps/${MOZILLA}.png .if ${PORT_OPTIONS:MLIGHTNING} @${MKDIR} ${STAGEDIR}${XPI_LIBDIR}/${XPI_ID} ${STAGEDIR}${XPI_LIBDIR}/symlinks/seamonkey @(cd ${STAGEDIR}${XPI_LIBDIR}/${XPI_ID}; ${TAR} -xf ${XPI_FILE}) @${REINPLACE_CMD} -i "" "s/${XPI_ORIG_ID}/${XPI_ID}/" ${STAGEDIR}${XPI_LIBDIR}/${XPI_ID}/install.rdf @${CHMOD} -R a+rX,go-w ${STAGEDIR}${XPI_LIBDIR}/${XPI_ID} @${LN} -sf ${XPI_LIBDIR}/${XPI_ID} ${STAGEDIR}${XPI_LIBDIR}/symlinks/seamonkey 2>/dev/null || true @${ECHO_CMD} '@exec ${LN} -sf %D/lib/xpi/${XPI_ID} ${LOCALBASE}/lib/seamonkey/extensions 2>/dev/null || true' >> ${TMPPLIST} @${ECHO_CMD} '@unexec ${RM} -f ${LOCALBASE}/lib/seamonkey/extensions/${XPI_ID}' >> ${TMPPLIST} .endif .if ${PORT_OPTIONS:MMAILNEWS} && ${PORT_OPTIONS:MENIGMAIL} @${MKDIR} ${STAGEDIR}${XPI_LIBDIR}/${EM_ID} ${STAGEDIR}${XPI_LIBDIR}/symlinks/${PORTNAME} @(cd ${STAGEDIR}${XPI_LIBDIR}/${EM_ID}; ${TAR} -xf ${EM_XPI_FILE}) @${REINPLACE_CMD} -i "" "s/${EM_ORIG_ID}/${EM_ID}/" ${EM_ID_RFILES:S/^/${STAGEDIR}/g} @${CHMOD} -R a+rX,go-w ${STAGEDIR}${XPI_LIBDIR}/${EM_ID} @${LN} -sf ${XPI_LIBDIR}/${EM_ID} ${STAGEDIR}${XPI_LIBDIR}/symlinks/${PORTNAME} 2>/dev/null || true @${ECHO_CMD} '@exec ${LN} -sf %D/lib/xpi/${EM_ID} ${LOCALBASE}/lib/${PORTNAME}/extensions 2>/dev/null || true' >> ${TMPPLIST} @${ECHO_CMD} '@unexec ${RM} -f ${LOCALBASE}/lib/${PORTNAME}/extensions/${EM_ID}' >> ${TMPPLIST} .endif .include Index: head/www/seamonkey/files/patch-bug847568 =================================================================== --- head/www/seamonkey/files/patch-bug847568 (revision 380781) +++ head/www/seamonkey/files/patch-bug847568 (revision 380782) @@ -1,242 +1,242 @@ # Allow building against system-wide graphite2/harfbuzz. diff --git config/Makefile.in config/Makefile.in index 14bfc0d..5383399 100644 --- mozilla/config/Makefile.in +++ mozilla/config/Makefile.in @@ -75,6 +75,8 @@ export:: $(export-preqs) -DMOZ_NATIVE_LIBEVENT=$(MOZ_NATIVE_LIBEVENT) \ -DMOZ_NATIVE_LIBVPX=$(MOZ_NATIVE_LIBVPX) \ -DMOZ_NATIVE_ICU=$(MOZ_NATIVE_ICU) \ + -DMOZ_NATIVE_GRAPHITE2=$(MOZ_NATIVE_GRAPHITE2) \ + -DMOZ_NATIVE_HARFBUZZ=$(MOZ_NATIVE_HARFBUZZ) \ $(srcdir)/system-headers | $(PERL) $(topsrcdir)/nsprpub/config/make-system-wrappers.pl system_wrappers $(INSTALL) system_wrappers $(DIST) diff --git config/system-headers config/system-headers index 18e8703..bdc5f82 100644 --- mozilla/config/system-headers +++ mozilla/config/system-headers @@ -1357,3 +1357,11 @@ unicode/utypes.h #endif libutil.h unwind.h +#if MOZ_NATIVE_GRAPHITE2==1 +graphite2/Font.h +graphite2/Segment.h +#endif +#if MOZ_NATIVE_HARFBUZZ==1 +harfbuzz/hb-ot.h +harfbuzz/hb.h +#endif diff --git configure.in configure.in index ac38f40..87536b7 100644 --- mozilla/configure.in +++ mozilla/configure.in @@ -7986,6 +7986,49 @@ if test "$USE_FC_FREETYPE"; then fi dnl ======================================================== +dnl Check for harfbuzz +dnl ======================================================== + +MOZ_ARG_WITH_BOOL(system-harfbuzz, +[ --with-system-harfbuzz Use system harfbuzz (located with pkgconfig)], +MOZ_NATIVE_HARFBUZZ=1, +MOZ_NATIVE_HARFBUZZ=) + +if test -n "$MOZ_NATIVE_HARFBUZZ"; then -+ PKG_CHECK_MODULES(MOZ_HARFBUZZ, harfbuzz >= 0.9.25) ++ PKG_CHECK_MODULES(MOZ_HARFBUZZ, harfbuzz >= 0.9.34) +fi + +AC_SUBST(MOZ_NATIVE_HARFBUZZ) + +dnl ======================================================== +dnl Check for graphite2 +dnl ======================================================== + +MOZ_ARG_WITH_BOOL(system-graphite2, +[ --with-system-graphite2 Use system graphite2 (located with pkgconfig)], +MOZ_NATIVE_GRAPHITE2=1, +MOZ_NATIVE_GRAPHITE2=) + +if test -n "$MOZ_NATIVE_GRAPHITE2"; then + PKG_CHECK_MODULES(MOZ_GRAPHITE2, graphite2) + + dnl graphite2.pc has bogus version, check manually + AC_TRY_COMPILE([ #include + #define GR2_VERSION_REQUIRE(major,minor,bugfix) \ + ( GR2_VERSION_MAJOR * 10000 + GR2_VERSION_MINOR \ + * 100 + GR2_VERSION_BUGFIX >= \ + (major) * 10000 + (minor) * 100 + (bugfix) ) + ], [ + #if !GR2_VERSION_REQUIRE(1,2,4) + #error "Insufficient graphite2 version." + #endif + ], [], + [AC_MSG_ERROR([--with-system-graphite2 requested but no working libgraphite2 found])]) +fi + +AC_SUBST(MOZ_NATIVE_GRAPHITE2) + +dnl ======================================================== dnl Check for pixman and cairo dnl ======================================================== diff --git content/base/src/moz.build content/base/src/moz.build index a660ba4..6b2f602 100644 --- mozilla/content/base/src/moz.build +++ mozilla/content/base/src/moz.build @@ -196,6 +196,9 @@ SOURCES += [ 'nsObjectLoadingContent.cpp', ] +if CONFIG['MOZ_NATIVE_HARFBUZZ']: + SOURCES['nsContentUtils.cpp'].flags += CONFIG['MOZ_HARFBUZZ_CFLAGS'] + EXTRA_COMPONENTS += [ 'contentAreaDropListener.js', 'contentAreaDropListener.manifest', diff --git gfx/graphite2/moz-gr-update.sh gfx/graphite2/moz-gr-update.sh index f3d76ea..a9e7fb6 100644 --- mozilla/gfx/graphite2/moz-gr-update.sh +++ mozilla/gfx/graphite2/moz-gr-update.sh @@ -23,8 +23,14 @@ echo "\nSee" $0 "for update procedure.\n" >> gfx/graphite2/README.mozilla find gfx/graphite2/ -name "*.cpp" -exec perl -p -i -e "s///;s/Windows.h/windows.h/;" {} \; find gfx/graphite2/ -name "*.h" -exec perl -p -i -e "s///;s/Windows.h/windows.h/;" {} \; +# closest tag/release to require for system version +TAG=$(cd ../graphitedev/ && hg parents --template {latesttag}) + +perl -p -i -e "s/[0-9]+\,[0-9]+\,[0-9]+/$TAG/ and tr/./,/ \ + if /GR2_VERSION_REQUIRE/" configure.in + # summarize what's been touched -echo Updated to $CHANGESET. +echo Updated to $CHANGESET \($TAG for --with-system-graphite2\) echo Here is what changed in the gfx/graphite2 directory: echo diff --git gfx/harfbuzz/README-mozilla gfx/harfbuzz/README-mozilla index ca57d16..1ce21fe 100644 --- mozilla/gfx/harfbuzz/README-mozilla +++ mozilla/gfx/harfbuzz/README-mozilla @@ -21,3 +21,8 @@ In addition, the src/Makefile.in file here is NOT from upstream, nor is it generated from src/Makefile.am (the original harfbuzz version); it is a mozilla- specific makefile that is maintained by hand. It should only need updating when new source files or exported headers are added in harfbuzz. + +The in-tree copy may be omitted during build by --with-system-harfbuzz. +Make sure to keep pkg-config version check within configure.in in sync +with checkout version or increment latest tag by one if it's not based +on upstream release. diff --git gfx/moz.build gfx/moz.build index 519aa46..6929751 100644 --- mozilla/gfx/moz.build +++ mozilla/gfx/moz.build @@ -7,6 +7,12 @@ if CONFIG['MOZ_TREE_CAIRO']: DIRS += ['cairo'] +if not CONFIG['MOZ_NATIVE_GRAPHITE2']: + DIRS += ['graphite2/src' ] + +if not CONFIG['MOZ_NATIVE_HARFBUZZ']: + DIRS += ['harfbuzz/src'] + DIRS += [ '2d', 'ycbcr', @@ -15,8 +21,6 @@ DIRS += [ 'qcms', 'gl', 'layers', - 'graphite2/src', - 'harfbuzz/src', 'ots/src', 'thebes', 'ipc', diff --git gfx/skia/generate_mozbuild.py gfx/skia/generate_mozbuild.py index 28fa6b5..240dced 100755 --- mozilla/gfx/skia/generate_mozbuild.py +++ mozilla/gfx/skia/generate_mozbuild.py @@ -140,6 +140,9 @@ if CONFIG['GNU_CXX']: if not CONFIG['CLANG_CXX']: CXXFLAGS += ['-Wno-logical-op'] +if CONFIG['MOZ_NATIVE_HARFBUZZ']: + CXXFLAGS += CONFIG['MOZ_HARFBUZZ_CFLAGS'] + if CONFIG['MOZ_WIDGET_TOOLKIT'] in ('gtk2', 'gtk3', 'android', 'gonk', 'qt'): CXXFLAGS += CONFIG['MOZ_CAIRO_CFLAGS'] CXXFLAGS += CONFIG['CAIRO_FT_CFLAGS'] diff --git gfx/skia/moz.build gfx/skia/moz.build index 1d0c2f9..adb8941 100644 --- mozilla/gfx/skia/moz.build +++ mozilla/gfx/skia/moz.build @@ -968,6 +968,9 @@ if CONFIG['GNU_CXX']: if not CONFIG['CLANG_CXX']: CXXFLAGS += ['-Wno-logical-op'] +if CONFIG['MOZ_NATIVE_HARFBUZZ']: + CXXFLAGS += CONFIG['MOZ_HARFBUZZ_CFLAGS'] + if CONFIG['MOZ_WIDGET_TOOLKIT'] in ('gtk2', 'gtk3', 'android', 'gonk', 'qt'): CXXFLAGS += CONFIG['MOZ_CAIRO_CFLAGS'] CXXFLAGS += CONFIG['CAIRO_FT_CFLAGS'] diff --git gfx/thebes/moz.build gfx/thebes/moz.build index d5852fa..aeeab25 100644 --- mozilla/gfx/thebes/moz.build +++ mozilla/gfx/thebes/moz.build @@ -278,6 +278,12 @@ CXXFLAGS += CONFIG['TK_CFLAGS'] CFLAGS += CONFIG['MOZ_CAIRO_CFLAGS'] CFLAGS += CONFIG['TK_CFLAGS'] +if CONFIG['MOZ_NATIVE_HARFBUZZ']: + CXXFLAGS += CONFIG['MOZ_HARFBUZZ_CFLAGS'] + +if CONFIG['MOZ_NATIVE_GRAPHITE2']: + CXXFLAGS += CONFIG['MOZ_GRAPHITE2_CFLAGS'] + if CONFIG['MOZ_WIDGET_TOOLKIT'] in ('android', 'gonk', 'qt'): CXXFLAGS += CONFIG['CAIRO_FT_CFLAGS'] diff --git intl/unicharutil/util/moz.build intl/unicharutil/util/moz.build index d736943..41a931f 100644 --- mozilla/intl/unicharutil/util/moz.build +++ mozilla/intl/unicharutil/util/moz.build @@ -37,3 +37,6 @@ if CONFIG['_MSC_VER']: if CONFIG['ENABLE_INTL_API']: CXXFLAGS += CONFIG['MOZ_ICU_CFLAGS'] + +if CONFIG['MOZ_NATIVE_HARFBUZZ']: + CXXFLAGS += CONFIG['MOZ_HARFBUZZ_CFLAGS'] diff --git netwerk/dns/moz.build netwerk/dns/moz.build index 0b0717a..2e665c9 100644 --- mozilla/netwerk/dns/moz.build +++ mozilla/netwerk/dns/moz.build @@ -63,3 +63,6 @@ GENERATED_FILES = [ LOCAL_INCLUDES += [ '../base/src', ] + +if CONFIG['MOZ_NATIVE_HARFBUZZ']: + CXXFLAGS += CONFIG['MOZ_HARFBUZZ_CFLAGS'] diff --git toolkit/library/moz.build toolkit/library/moz.build index 67f0db9..d42137a 100644 --- mozilla/toolkit/library/moz.build +++ mozilla/toolkit/library/moz.build @@ -187,6 +187,12 @@ if CONFIG['MOZ_NATIVE_LIBVPX']: if not CONFIG['MOZ_TREE_PIXMAN']: OS_LIBS += CONFIG['MOZ_PIXMAN_LIBS'] +if CONFIG['MOZ_NATIVE_GRAPHITE2']: + OS_LIBS += CONFIG['MOZ_GRAPHITE2_LIBS'] + +if CONFIG['MOZ_NATIVE_HARFBUZZ']: + OS_LIBS += CONFIG['MOZ_HARFBUZZ_LIBS'] + if CONFIG['MOZ_ALSA']: OS_LIBS += CONFIG['MOZ_ALSA_LIBS'] Index: head/www/seamonkey/files/patch-z-bug517422 =================================================================== --- head/www/seamonkey/files/patch-z-bug517422 (revision 380781) +++ head/www/seamonkey/files/patch-z-bug517422 (revision 380782) @@ -1,524 +1,524 @@ # Allow more config/external/ libs built against system-wide version. diff --git config/Makefile.in config/Makefile.in index 5383399..0410004 100644 --- mozilla/config/Makefile.in +++ mozilla/config/Makefile.in @@ -77,6 +77,13 @@ export:: $(export-preqs) -DMOZ_NATIVE_ICU=$(MOZ_NATIVE_ICU) \ -DMOZ_NATIVE_GRAPHITE2=$(MOZ_NATIVE_GRAPHITE2) \ -DMOZ_NATIVE_HARFBUZZ=$(MOZ_NATIVE_HARFBUZZ) \ + -DMOZ_NATIVE_OGG=$(MOZ_NATIVE_OGG) \ + -DMOZ_NATIVE_THEORA=$(MOZ_NATIVE_THEORA) \ + -DMOZ_NATIVE_VORBIS=$(MOZ_NATIVE_VORBIS) \ + -DMOZ_NATIVE_TREMOR=$(MOZ_NATIVE_TREMOR) \ + -DMOZ_NATIVE_OPUS=$(MOZ_NATIVE_OPUS) \ + -DMOZ_NATIVE_SPEEX=$(MOZ_NATIVE_SPEEX) \ + -DMOZ_NATIVE_SOUNDTOUCH=$(MOZ_NATIVE_SOUNDTOUCH) \ $(srcdir)/system-headers | $(PERL) $(topsrcdir)/nsprpub/config/make-system-wrappers.pl system_wrappers $(INSTALL) system_wrappers $(DIST) diff --git config/external/moz.build config/external/moz.build index f67c5c7..eb909ce 100644 --- mozilla/config/external/moz.build +++ mozilla/config/external/moz.build @@ -16,13 +16,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']: external_dirs += ['media/libvorbis'] -if CONFIG['MOZ_TREMOR']: +if CONFIG['MOZ_TREMOR'] and not CONFIG['MOZ_NATIVE_TREMOR']: external_dirs += ['media/libtremor'] -if CONFIG['MOZ_OPUS']: +if CONFIG['MOZ_OPUS'] and not CONFIG['MOZ_NATIVE_OPUS']: external_dirs += ['media/libopus'] if CONFIG['MOZ_WEBM']: @@ -37,14 +43,16 @@ if CONFIG['MOZ_VPX'] and not CONFIG['MOZ_NATIVE_LIBVPX']: if not CONFIG['MOZ_NATIVE_PNG']: external_dirs += ['media/libpng'] +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/libstagefright', - 'media/libsoundtouch', ] DIRS += ['../../' + i for i in external_dirs] diff --git config/system-headers config/system-headers index bef567c..9807c29 100644 --- mozilla/config/system-headers +++ mozilla/config/system-headers @@ -1263,7 +1263,6 @@ X11/Xlocale.h X11/Xos.h X11/Xutil.h zmouse.h -soundtouch/SoundTouch.h #if MOZ_NATIVE_PNG==1 png.h #endif @@ -1325,6 +1324,7 @@ vorbis/codec.h theora/theoradec.h tremor/ivorbiscodec.h speex/speex_resampler.h +soundtouch/SoundTouch.h ogg/ogg.h ogg/os_types.h nestegg/nestegg.h @@ -1365,3 +1365,29 @@ graphite2/Segment.h harfbuzz/hb-ot.h harfbuzz/hb.h #endif +#if MOZ_NATIVE_OGG==1 +ogg/ogg.h +ogg/os_types.h +#endif +#if MOZ_NATIVE_THEORA==1 +theora/theoradec.h +#endif +#if MOZ_NATIVE_VORBIS==1 +vorbis/codec.h +vorbis/vorbisenc.h +#endif +#if MOZ_NATIVE_TREMOR==1 +tremor/ivorbiscodec.h +#endif +#if MOZ_NATIVE_OPUS==1 +opus.h +opus_multistream.h +opus/opus.h +opus/opus_multistream.h +#endif +#if MOZ_NATIVE_SPEEX==1 +speex/speex_resampler.h +#endif +#if MOZ_NATIVE_SOUNDTOUCH==1 +soundtouch/SoundTouch.h +#endif diff --git configure.in configure.in index 87db361..7947626 100644 --- mozilla/configure.in +++ mozilla/configure.in @@ -5056,6 +5056,57 @@ if test "${ac_cv_c_attribute_aligned}" != "0"; then fi dnl ======================================================== +dnl Check for libogg +dnl ======================================================== + +MOZ_ARG_WITH_BOOL(system-ogg, +[ --with-system-ogg Use system libogg (located with pkgconfig)], +MOZ_NATIVE_OGG=1, +MOZ_NATIVE_OGG=) + +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) + +dnl ======================================================== +dnl Check for libvorbis +dnl ======================================================== + +MOZ_ARG_WITH_BOOL(system-vorbis, +[ --with-system-vorbis Use system libvorbis (located with pkgconfig)], +MOZ_NATIVE_VORBIS=1, +MOZ_NATIVE_VORBIS=) + +if test -n "$MOZ_NATIVE_VORBIS"; then -+ PKG_CHECK_MODULES(MOZ_VORBIS, vorbis vorbisenc >= 1.3.4) ++ PKG_CHECK_MODULES(MOZ_VORBIS, vorbis vorbisenc >= 1.3.5) +fi + +AC_SUBST(MOZ_NATIVE_VORBIS) + +dnl ======================================================== +dnl Check for integer-only libvorbis aka tremor +dnl ======================================================== + +MOZ_ARG_WITH_BOOL(system-tremor, +[ --with-system-tremor Use system libtremor (located with pkgconfig)], +MOZ_NATIVE_TREMOR=1, +MOZ_NATIVE_TREMOR=) + +if test -n "$MOZ_NATIVE_TREMOR"; then + PKG_CHECK_MODULES(MOZ_TREMOR, vorbisidec >= 1.2.1) +fi + +AC_SUBST(MOZ_NATIVE_TREMOR) + +dnl ======================================================== dnl = Disable Opus audio codec support dnl ======================================================== MOZ_ARG_DISABLE_BOOL(opus, @@ -5064,6 +5115,89 @@ MOZ_ARG_DISABLE_BOOL(opus, MOZ_OPUS=1) dnl ======================================================== +dnl Check for libopus +dnl ======================================================== + +MOZ_ARG_WITH_BOOL(system-opus, +[ --with-system-opus Use system libopus (located with pkgconfig)], +MOZ_NATIVE_OPUS=1, +MOZ_NATIVE_OPUS=) + +if test -n "$MOZ_NATIVE_OPUS"; then + PKG_CHECK_MODULES(MOZ_OPUS, opus >= 1.1) +else + MOZ_OPUS_CFLAGS='-I$(topsrcdir)/media/libopus/include' +fi + +AC_SUBST(MOZ_NATIVE_OPUS) + +dnl ======================================================== +dnl Check for libtheora +dnl ======================================================== + +MOZ_ARG_WITH_BOOL(system-theora, +[ --with-system-theora Use system libtheora (located with pkgconfig)], +MOZ_NATIVE_THEORA=1, +MOZ_NATIVE_THEORA=) + +if test -n "$MOZ_NATIVE_THEORA"; then + PKG_CHECK_MODULES(MOZ_THEORA, theora >= 1.2) +fi + +AC_SUBST(MOZ_NATIVE_THEORA) + +dnl ======================================================== +dnl Check for libspeex resampler +dnl ======================================================== + +MOZ_ARG_WITH_BOOL(system-speex, +[ --with-system-speex Use system libspeex (located with pkgconfig)], +MOZ_NATIVE_SPEEX=1, +MOZ_NATIVE_SPEEX=) + +if test -n "$MOZ_NATIVE_SPEEX"; then + PKG_CHECK_MODULES(MOZ_SPEEX, speexdsp >= 1.2) +fi + +AC_SUBST(MOZ_NATIVE_SPEEX) + +dnl ======================================================== +dnl Check for libsoundtouch +dnl ======================================================== + +MOZ_ARG_WITH_BOOL(system-soundtouch, +[ --with-system-soundtouch Use system libsoundtouch (located with pkgconfig)], +MOZ_NATIVE_SOUNDTOUCH=1, +MOZ_NATIVE_SOUNDTOUCH=) + +if test -n "$MOZ_NATIVE_SOUNDTOUCH"; then + PKG_CHECK_MODULES(MOZ_SOUNDTOUCH, soundtouch >= 1.8.0) + + AC_LANG_SAVE + AC_LANG_CPLUSPLUS + _SAVE_CXXFLAGS=$CXXFLAGS + CXXFLAGS="$CXXFLAGS $MOZ_SOUNDTOUCH_CFLAGS" + AC_CACHE_CHECK(for soundtouch sample type, + ac_cv_soundtouch_sample_type, + [AC_TRY_COMPILE([#include + #ifndef SOUNDTOUCH_INTEGER_SAMPLES + #error soundtouch expects float samples + #endif], + [], + [ac_cv_soundtouch_sample_type=short], + [ac_cv_soundtouch_sample_type=float])]) + CXXFLAGS=$_SAVE_CXXFLAGS + AC_LANG_RESTORE + + if test \( -n "$MOZ_SAMPLE_TYPE_S16" -a "$ac_cv_soundtouch_sample_type" != short \) \ + -o \( -n "$MOZ_SAMPLE_TYPE_FLOAT32" -a "$ac_cv_soundtouch_sample_type" != float \) ; then + AC_MSG_ERROR([SoundTouch library is built with incompatible sample type. Either rebuild the library with/without --enable-integer-samples, chase default Mozilla sample type or remove --with-system-soundtouch.]) + fi +fi + +AC_SUBST(MOZ_NATIVE_SOUNDTOUCH) + +dnl ======================================================== 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 --- mozilla/content/media/AudioStream.h +++ mozilla/content/media/AudioStream.h @@ -17,7 +17,7 @@ #include "CubebUtils.h" namespace soundtouch { -class SoundTouch; +class MOZ_IMPORT_API SoundTouch; } namespace mozilla { diff --git content/media/moz.build content/media/moz.build index 7526cff..e0a0ca0 100644 --- mozilla/content/media/moz.build +++ mozilla/content/media/moz.build @@ -212,3 +212,24 @@ if CONFIG['ANDROID_VERSION'] > '15': CFLAGS += CONFIG['GSTREAMER_CFLAGS'] CXXFLAGS += CONFIG['GSTREAMER_CFLAGS'] + +if CONFIG['MOZ_NATIVE_OGG']: + CXXFLAGS += CONFIG['MOZ_OGG_CFLAGS'] + +if CONFIG['MOZ_NATIVE_THEORA']: + CXXFLAGS += CONFIG['MOZ_THEORA_CFLAGS'] + +if CONFIG['MOZ_NATIVE_VORBIS']: + CXXFLAGS += CONFIG['MOZ_VORBIS_CFLAGS'] + +if CONFIG['MOZ_NATIVE_TREMOR']: + CXXFLAGS += CONFIG['MOZ_TREMOR_CFLAGS'] + +if CONFIG['MOZ_NATIVE_OPUS']: + CXXFLAGS += CONFIG['MOZ_OPUS_CFLAGS'] + +if CONFIG['MOZ_NATIVE_SPEEX']: + CXXFLAGS += CONFIG['MOZ_SPEEX_CFLAGS'] + +if CONFIG['MOZ_NATIVE_SOUNDTOUCH']: + CXXFLAGS += CONFIG['MOZ_SOUNDTOUCH_CFLAGS'] diff --git media/libcubeb/src/moz.build media/libcubeb/src/moz.build index 944744d..9a7c8c0 100644 --- mozilla/media/libcubeb/src/moz.build +++ mozilla/media/libcubeb/src/moz.build @@ -65,6 +65,9 @@ if CONFIG['GKMEDIAS_SHARED_LIBRARY']: FINAL_LIBRARY = 'gkmedias' +if CONFIG['MOZ_NATIVE_SPEEX']: + SOURCES['cubeb_resampler.cpp'].flags += CONFIG['MOZ_SPEEX_CFLAGS'] + if CONFIG['MOZ_WIDGET_TOOLKIT'] == 'gonk': CFLAGS += [ '-I%s/%s' % (CONFIG['ANDROID_SOURCE'], d) for d in [ diff --git media/libogg/README_MOZILLA media/libogg/README_MOZILLA index 0833e4d..7ece97b 100644 --- mozilla/media/libogg/README_MOZILLA +++ mozilla/media/libogg/README_MOZILLA @@ -6,3 +6,6 @@ The svn revision number used was r17287. The int-types.patch address a bug that config_types.h generated from Linux platform can't be used on OpenSolaris directly see Mozilla bug 449754 + +The in-tree copy may be omitted during build by --with-system-ogg. +Keep version in configure.in in sync on updates. diff --git media/libopus/README_MOZILLA media/libopus/README_MOZILLA index 2d85c9f..d3fb9f8 100644 --- mozilla/media/libopus/README_MOZILLA +++ mozilla/media/libopus/README_MOZILLA @@ -9,3 +9,6 @@ files after the copy step. The upstream repository is https://git.xiph.org/opus.git The git tag/revision used was v1.1. + +The in-tree copy may be omitted during build by --with-system-opus. +So, keep its pkg-config version check within configure.in in sync on updates. diff --git media/libsoundtouch/README_MOZILLA media/libsoundtouch/README_MOZILLA index bfd4b1a..15b158d 100644 --- mozilla/media/libsoundtouch/README_MOZILLA +++ mozilla/media/libsoundtouch/README_MOZILLA @@ -6,3 +6,5 @@ The whole library is not used, only the relevant files are imported in the tree, using the script `update.sh`. Some changes have been made to the files, using the patch `moz-libsoundtouch.patch`. We also use a custom soundtouch_config.h. +The in-tree copy may be omitted during build by --with-system-soundtouch. +Keep version in configure.in in sync on updates. diff --git media/libspeex_resampler/README_MOZILLA media/libspeex_resampler/README_MOZILLA index 7f6b1bb..e830300 100644 --- mozilla/media/libspeex_resampler/README_MOZILLA +++ mozilla/media/libspeex_resampler/README_MOZILLA @@ -3,3 +3,6 @@ This source is from the Speex DSP library It consists in the audio resampling code (resampler.c) and its header files dependancies, imported into the tree using the update.sh script. + +The in-tree copy may be omitted during build by --with-system-speex. +Keep version in configure.in in sync on updates. diff --git media/libtheora/README_MOZILLA media/libtheora/README_MOZILLA index d48dbfa..f08a2ed 100644 --- mozilla/media/libtheora/README_MOZILLA +++ mozilla/media/libtheora/README_MOZILLA @@ -3,3 +3,6 @@ using the update.sh script. The changes made were those applied by update.sh, the addition/update of Makefile.in files for the Mozilla build system. The subversion revision used was r17578. + +The in-tree copy may be omitted during build by --with-system-theora. +Keep version in configure.in in sync on updates. diff --git media/libtheora/moz.build media/libtheora/moz.build index 14265b1..3069e99 100644 --- mozilla/media/libtheora/moz.build +++ mozilla/media/libtheora/moz.build @@ -6,3 +6,5 @@ DIRS += ['include', 'lib'] +if CONFIG['MOZ_NATIVE_OGG']: + CFLAGS += CONFIG['MOZ_OGG_CFLAGS'] diff --git media/libtremor/README_MOZILLA media/libtremor/README_MOZILLA index ee67b53..3f34a09 100644 --- mozilla/media/libtremor/README_MOZILLA +++ mozilla/media/libtremor/README_MOZILLA @@ -5,3 +5,6 @@ Makefile.in files for the Mozilla build system. The upstream release used was http://svn.xiph.org/trunk/Tremor/ The subversion revision used was r17547. + +The in-tree copy may be omitted during build by --with-system-tremor. +Keep version in configure.in in sync on updates. diff --git media/libtremor/moz.build media/libtremor/moz.build index 31831ba..a03d576 100644 --- mozilla/media/libtremor/moz.build +++ mozilla/media/libtremor/moz.build @@ -6,3 +6,5 @@ DIRS += ['include/tremor', 'lib'] +if CONFIG['MOZ_NATIVE_OGG']: + CFLAGS += CONFIG['MOZ_OGG_CFLAGS'] diff --git media/libvorbis/README_MOZILLA media/libvorbis/README_MOZILLA index 7c7454c..55baedd 100644 --- mozilla/media/libvorbis/README_MOZILLA +++ mozilla/media/libvorbis/README_MOZILLA @@ -8,3 +8,6 @@ https://svn.xiph.org/tags/vorbis/libvorbis-1.3.4@19059 Some files are renamed during the copy to prevent clashes with object file names with other Mozilla libraries. + +The in-tree copy may be omitted during build by --with-system-vorbis. +Keep version in configure.in in sync on updates. diff --git media/libvorbis/moz.build media/libvorbis/moz.build index 919b99e..cc776f7 100644 --- mozilla/media/libvorbis/moz.build +++ mozilla/media/libvorbis/moz.build @@ -55,3 +55,6 @@ FINAL_LIBRARY = 'gkmedias' # Suppress warnings in third-party code. if CONFIG['GNU_CC']: CFLAGS += ['-Wno-uninitialized'] + +if CONFIG['MOZ_NATIVE_OGG']: + CFLAGS += CONFIG['MOZ_OGG_CFLAGS'] diff --git media/webrtc/signaling/test/moz.build media/webrtc/signaling/test/moz.build index bbc971c..6ed7e41 100644 --- mozilla/media/webrtc/signaling/test/moz.build +++ mozilla/media/webrtc/signaling/test/moz.build @@ -127,6 +127,9 @@ if CONFIG['MOZ_ALSA']: if CONFIG['MOZ_NATIVE_JPEG']: OS_LIBS += CONFIG['MOZ_JPEG_LIBS'] +if CONFIG['MOZ_NATIVE_OPUS']: + OS_LIBS += CONFIG['MOZ_OPUS_LIBS'] + if CONFIG['MOZ_NATIVE_LIBVPX']: OS_LIBS += CONFIG['MOZ_LIBVPX_LIBS'] diff --git media/webrtc/trunk/webrtc/modules/audio_coding/codecs/opus/opus.gypi media/webrtc/trunk/webrtc/modules/audio_coding/codecs/opus/opus.gypi index 00e77e7..55f48ab 100644 --- mozilla/media/webrtc/trunk/webrtc/modules/audio_coding/codecs/opus/opus.gypi +++ mozilla/media/webrtc/trunk/webrtc/modules/audio_coding/codecs/opus/opus.gypi @@ -17,9 +17,9 @@ 'conditions': [ ['build_with_mozilla==1', { # Mozilla provides its own build of the opus library. - 'include_dirs': [ - '/media/libopus/include', - ] + 'cflags_mozilla': [ + '$(MOZ_OPUS_CFLAGS)', + ], }, { 'dependencies': [ '<(DEPTH)/third_party/opus/opus.gyp:opus' diff --git toolkit/library/moz.build toolkit/library/moz.build index d42137a..695e75a8 100644 --- mozilla/toolkit/library/moz.build +++ mozilla/toolkit/library/moz.build @@ -178,6 +178,27 @@ if CONFIG['MOZ_NATIVE_PNG']: if CONFIG['MOZ_NATIVE_HUNSPELL']: OS_LIBS += CONFIG['MOZ_HUNSPELL_LIBS'] +if CONFIG['MOZ_NATIVE_OGG']: + OS_LIBS += CONFIG['MOZ_OGG_LIBS'] + +if CONFIG['MOZ_NATIVE_THEORA']: + OS_LIBS += CONFIG['MOZ_THEORA_LIBS'] + +if CONFIG['MOZ_NATIVE_VORBIS']: + OS_LIBS += CONFIG['MOZ_VORBIS_LIBS'] + +if CONFIG['MOZ_NATIVE_TREMOR']: + OS_LIBS += CONFIG['MOZ_TREMOR_LIBS'] + +if CONFIG['MOZ_NATIVE_OPUS']: + OS_LIBS += CONFIG['MOZ_OPUS_LIBS'] + +if CONFIG['MOZ_NATIVE_SPEEX']: + OS_LIBS += CONFIG['MOZ_SPEEX_LIBS'] + +if CONFIG['MOZ_NATIVE_SOUNDTOUCH']: + OS_LIBS += CONFIG['MOZ_SOUNDTOUCH_LIBS'] + if CONFIG['MOZ_NATIVE_LIBEVENT']: OS_LIBS += CONFIG['MOZ_LIBEVENT_LIBS'] diff --git xpcom/build/XPCOMInit.cpp xpcom/build/XPCOMInit.cpp index 2cf281e..6d7af0e 100644 --- mozilla/xpcom/build/XPCOMInit.cpp +++ mozilla/xpcom/build/XPCOMInit.cpp @@ -138,7 +138,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 @@ -651,11 +653,13 @@ NS_InitXPCOM2(nsIServiceManager** aResult, // 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.