Bug 577653 - Allow to build against system libvpx. r=khuey a=roc

This commit is contained in:
Mike Hommey 2010-11-05 18:24:28 +01:00
parent dfa15fbaa9
commit 3bcb9ab5e3
9 changed files with 71 additions and 5 deletions

View File

@ -132,6 +132,7 @@ export::
-DMOZ_NATIVE_PNG=$(MOZ_NATIVE_PNG) \
-DMOZ_NATIVE_JPEG=$(MOZ_NATIVE_JPEG) \
-DMOZ_NATIVE_LIBEVENT=$(MOZ_NATIVE_LIBEVENT) \
-DMOZ_NATIVE_LIBVPX=$(MOZ_NATIVE_LIBVPX) \
$(srcdir)/system-headers | $(PERL) $(topsrcdir)/nsprpub/config/make-system-wrappers.pl system_wrappers
$(INSTALL) system_wrappers $(DIST)

View File

@ -231,6 +231,10 @@ MOZ_NATIVE_LIBEVENT = @MOZ_NATIVE_LIBEVENT@
MOZ_LIBEVENT_LIBS = @MOZ_LIBEVENT_LIBS@
MOZ_LIBEVENT_INCLUDES = @MOZ_LIBEVENT_INCLUDES@
MOZ_NATIVE_LIBVPX = @MOZ_NATIVE_LIBVPX@
MOZ_LIBVPX_LIBS = @MOZ_LIBVPX_LIBS@
MOZ_LIBVPX_INCLUDES = @MOZ_LIBVPX_INCLUDES@
MOZ_NATIVE_ZLIB = @SYSTEM_ZLIB@
MOZ_NATIVE_BZ2 = @SYSTEM_BZ2@
MOZ_NATIVE_JPEG = @SYSTEM_JPEG@

View File

@ -1051,3 +1051,7 @@ pixman.h
#if MOZ_ENABLE_MEEGOTOUCHSHARE
shareuiinterface.h
#endif
#if MOZ_NATIVE_LIBVPX==1
vpx/vpx_decoder.h
vpx/vp8dx.h
#endif

View File

@ -5993,8 +5993,50 @@ MOZ_ARG_DISABLE_BOOL(webm,
MOZ_WEBM=,
MOZ_WEBM=1)
dnl system libvpx Support
dnl ========================================================
MOZ_ARG_WITH_STRING(system-libvpx,
[ --with-system-libvpx=[PFX]
Use system libvpx [installed at prefix PFX]],
LIBVPX_DIR=$withval)
MOZ_NATIVE_LIBVPX=
MOZ_LIBVPX_INCLUDES=
MOZ_LIBVPX_LIBS=
if test -n "$MOZ_WEBM"; then
AC_DEFINE(MOZ_WEBM)
if test -n "$LIBVPX_DIR" -a "$LIBVPX_DIR" != no; then
_SAVE_CFLAGS=$CFLAGS
_SAVE_LDFLAGS=$LDFLAGS
_SAVE_LIBS=$LIBS
if test "${LIBVPX_DIR}" = "yes"; then
LIBVPX_DIR=/usr
fi
CFLAGS="-I${LIBVPX_DIR}/include $CFLAGS"
LDFLAGS="-L${LIBVPX_DIR}/lib $LDFLAGS"
AC_CHECK_HEADER(vpx/vpx_decoder.h,
[if test ! -f "${LIBVPX_DIR}/include/vpx/vpx_decoder.h"; then
AC_MSG_ERROR([vpx/vpx_decoder.h found, but is not in ${LIBVPX_DIR}/include])
fi],
AC_MSG_ERROR([--with-system-libvpx requested but vpx/vpx_decoder.h not found]))
AC_CHECK_LIB(vpx, vpx_codec_dec_init_ver,
[MOZ_NATIVE_LIBVPX=1
MOZ_LIBVPX_INCLUDES="-I${LIBVPX_DIR}/include"
MOZ_LIBVPX_LIBS="-L${LIBVPX_DIR}/lib -lvpx"],
([--with-system-libvpx requested but symbol vpx_codec_dec_init_ver not found]))
CFLAGS=$_SAVE_CFLAGS
LDFLAGS=$_SAVE_LDFLAGS
LIBS=$_SAVE_LIBS
fi
fi
AC_SUBST(MOZ_NATIVE_LIBVPX)
AC_SUBST(MOZ_LIBVPX_INCLUDES)
AC_SUBST(MOZ_LIBVPX_LIBS)
if test -n "$MOZ_WEBM" -a -z "$MOZ_NATIVE_LIBVPX"; then
MOZ_SYDNEYAUDIO=1
MOZ_MEDIA=1
case "$target_cpu" in

View File

@ -63,4 +63,5 @@ include $(topsrcdir)/config/rules.mk
INCLUDES += \
-I$(srcdir)/../../base/src \
-I$(srcdir)/../../html/content/src \
$(MOZ_LIBVPX_INCLUDES) \
$(NULL)

View File

@ -1051,3 +1051,7 @@ pixman.h
#if MOZ_ENABLE_MEEGOTOUCHSHARE
shareuiinterface.h
#endif
#if MOZ_NATIVE_LIBVPX==1
vpx/vpx_decoder.h
vpx/vp8dx.h
#endif

View File

@ -194,8 +194,10 @@ ifdef MOZ_WEBM
SHARED_LIBRARY_LIBS += \
$(DEPTH)/content/media/webm/$(LIB_PREFIX)gkconwebm_s.$(LIB_SUFFIX) \
$(DEPTH)/media/libnestegg/src/$(LIB_PREFIX)nestegg.$(LIB_SUFFIX) \
$(DEPTH)/media/libvpx/$(LIB_PREFIX)vpx.$(LIB_SUFFIX) \
$(NULL)
ifndef MOZ_NATIVE_LIBVPX
SHARED_LIBRARY_LIBS += $(DEPTH)/media/libvpx/$(LIB_PREFIX)vpx.$(LIB_SUFFIX)
endif
endif
ifdef MOZ_WAVE
@ -305,6 +307,10 @@ OS_LIBS += -framework CoreAudio -framework AudioToolbox -framework AudioUnit -fr
endif
endif
ifdef MOZ_NATIVE_LIBVPX
EXTRA_DSO_LDOPTS += $(MOZ_LIBVPX_LIBS)
endif
ifdef MOZ_IPC
include $(topsrcdir)/config/config.mk
include $(topsrcdir)/ipc/chromium/chromium-config.mk

View File

@ -385,6 +385,10 @@ ifdef MOZ_NATIVE_LIBEVENT
EXTRA_DSO_LDOPTS += $(MOZ_LIBEVENT_LIBS)
endif
ifdef MOZ_NATIVE_LIBVPX
EXTRA_DSO_LDOPTS += $(MOZ_LIBVPX_LIBS)
endif
ifdef MOZ_SYDNEYAUDIO
ifeq ($(OS_ARCH),Linux)
EXTRA_DSO_LDOPTS += $(MOZ_ALSA_LIBS)

View File

@ -155,10 +155,10 @@ tier_platform_dirs += \
endif
ifdef MOZ_WEBM
tier_platform_dirs += \
media/libnestegg \
media/libvpx \
$(NULL)
tier_platform_dirs += media/libnestegg
ifndef MOZ_NATIVE_LIBVPX
tier_platform_dirs += media/libvpx
endif
endif
ifdef MOZ_OGG