diff options
author | Nanang Izzuddin <nanang@teluu.com> | 2016-06-28 14:32:08 +0000 |
---|---|---|
committer | Nanang Izzuddin <nanang@teluu.com> | 2016-06-28 14:32:08 +0000 |
commit | f2de888a88002f4812ce56c39aabf1fb773073d5 (patch) | |
tree | f83fc8015eccbf41cabf9f3c3c0b6fec27e10c57 /aconfigure.ac | |
parent | 583f97ce8a39782f22741f03917d54a21178d090 (diff) |
Re #1937: Added libyuv build configs for GNU build systems.
git-svn-id: http://svn.pjsip.org/repos/pjproject/trunk@5361 74dad513-b988-da41-8d7b-12977e46ad98
Diffstat (limited to 'aconfigure.ac')
-rw-r--r-- | aconfigure.ac | 119 |
1 files changed, 43 insertions, 76 deletions
diff --git a/aconfigure.ac b/aconfigure.ac index b0b147ce..bc4eb456 100644 --- a/aconfigure.ac +++ b/aconfigure.ac @@ -568,6 +568,27 @@ if test "x$ac_external_srtp" = "x1"; then fi fi + +dnl # Use external libyuv installation +AC_SUBST(ac_external_yuv,0) +AC_ARG_WITH(external-yuv, + AS_HELP_STRING([--with-external-yuv], + [Use external libyuv development files, not the one in "third_party" directory. When this option is set, make sure that libyuv is accessible to use (hint: use CFLAGS and LDFLAGS env var to set the include/lib paths)]), + [ + if test "x$with_external_yuv" != "xno"; then + # Test libyuv installation + AC_MSG_CHECKING([if external libyuv devkit is installed]) + AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include <libyuv.h>]], + [RGB24ToI420(0,0,0,0,0,0,0,0,0,0);])], + [AC_MSG_RESULT(yes!!) + ac_external_yuv="1" + ], + [AC_MSG_ERROR([Unable to use external libyuv. If libyuv development files are not available in the default locations, use CFLAGS and LDFLAGS env var to set the include/lib paths])]) + fi + ] + ) + + dnl # Resample implementation AC_SUBST(ac_pjmedia_resample,libresample) AC_ARG_ENABLE(resample, @@ -685,6 +706,13 @@ fi AC_SUBST(ac_pjmedia_video) +# Disable video on mingw +case $target in + *mingw*) + enable_video="no" + ;; +esac + dnl # --disable-video option AC_ARG_ENABLE(video, AS_HELP_STRING([--disable-video], @@ -1037,6 +1065,8 @@ AC_ARG_ENABLE(ffmpeg, if $PKG_CONFIG --exists libswscale; then ac_ffmpeg_cflags="$ac_ffmpeg_cflags -DPJMEDIA_HAS_LIBSWSCALE=1" av_pkg="$av_pkg libswscale" + dnl # disable libyuv when libswscale is enabled + enable_libyuv="no" fi if $PKG_CONFIG --exists libavutil; then ac_ffmpeg_cflags="$ac_ffmpeg_cflags -DPJMEDIA_HAS_LIBAVUTIL=1" @@ -1095,6 +1125,7 @@ AC_ARG_ENABLE(ffmpeg, sws_scale, [ac_ffmpeg_cflags="$ac_ffmpeg_cflags -DPJMEDIA_HAS_LIBSWSCALE=1" ac_ffmpeg_ldflags="$ac_ffmpeg_ldflags -lswscale" + enable_libyuv="no" ], [], [-lavutil] @@ -1205,82 +1236,6 @@ AC_ARG_ENABLE(openh264, ]) -dnl # libyuv alt prefix -AC_ARG_WITH(libyuv, - AS_HELP_STRING([--with-libyuv=DIR], - [Specify alternate libyuv prefix]), - [], - [with_libyuv=no] - ) - -dnl # Do not use default libyuv installation if we are cross-compiling -if test "x$ac_cross_compile" != "x" -a "x$with_libyuv" = "xno"; then - enable_libyuv=no -fi - -dnl # Include libyuv -AC_SUBST(ac_libyuv_cflags) -AC_SUBST(ac_libyuv_ldflags) -AC_ARG_ENABLE(libyuv, - AS_HELP_STRING([--disable-libyuv], - [Exclude libyuv in the build]), - [if test "$enable_libyuv" = "no"; then - AC_MSG_RESULT([Checking if libyuv is disabled...yes]) - fi], - [ - if test "x$with_libyuv" != "xno" -a "x$with_libyuv" != "x"; then - LIBYUV_PREFIX=$with_libyuv - LIBYUV_CFLAGS="-I$LIBYUV_PREFIX/include" - - case $target in - *-apple-darwin_ios*) - LIBYUV_LDFLAGS="-L$LIBYUV_PREFIX/out_ios/Release-iphoneos" - case $ARCH in - *arm*) - LIBYUV_LIBS="-lyuv_neon" - ;; - *) - ;; - esac - ;; - *mingw* | *cygw* | *win32* | *w32* | *darwin* | *linux* | *android*) - LIBYUV_LDFLAGS="-L$LIBYUV_PREFIX/out/Release" - ;; - *) - LIBYUV_CFLAGS="" - LIBYUV_LDFLAGS="" - ;; - esac - - AC_MSG_RESULT([Using libyuv prefix... $with_libyuv]) - else - LIBYUV_CFLAGS="" - LIBYUV_LDFLAGS="" - fi - - LIBYUV_LIBS="$LIBYUV_LIBS -lyuv" - - SAVED_LIBS="$LIBS" - SAVED_LDFLAGS="$LDFLAGS" - SAVED_CFLAGS="$CFLAGS" - - LIBS="$LIBYUV_LIBS $LIBS" - LDFLAGS="$LIBYUV_LDFLAGS $LDFLAGS" - CFLAGS="$LIBYUV_CFLAGS $CFLAGS" - - AC_CHECK_LIB(yuv, - I420Scale, - [ ac_libyuv_cflags="-DPJMEDIA_HAS_LIBYUV=1 $LIBYUV_CFLAGS" - ac_libyuv_ldflags="$LIBYUV_LDFLAGS $LIBYUV_LIBS" - ], - [ LIBS="$SAVED_LIBS" - LDFLAGS="$SAVED_LDFLAGS" - CFLAGS="$SAVED_CFLAGS" - ], - [] - ) - ]) - dnl # WebRtc alt prefix AC_ARG_WITH(webrtc, @@ -1834,6 +1789,18 @@ AC_ARG_ENABLE(opus, fi ]) +dnl # Include libyuv +AC_SUBST(ac_no_yuv) +AC_ARG_ENABLE(libyuv, + AS_HELP_STRING([--disable-libyuv], + [Exclude libyuv in the build]), + [if test "$enable_libyuv" = "no"; then + [ac_no_yuv=1], + AC_DEFINE(PJMEDIA_HAS_LIBYUV,0) + AC_MSG_RESULT([Checking if libyuv is disabled...yes]) + fi], + AC_MSG_RESULT([Checking if libyuv is disabled...no])) + dnl ########################################## dnl # |