Index: /pjproject/trunk/aconfigure
===================================================================
--- /pjproject/trunk/aconfigure	(revision 5360)
+++ /pjproject/trunk/aconfigure	(revision 5361)
@@ -623,4 +623,5 @@
 ac_main_obj
 ac_host
+ac_no_yuv
 opus_present
 opus_h_present
@@ -643,6 +644,4 @@
 ac_webrtc_ldflags
 ac_webrtc_cflags
-ac_libyuv_ldflags
-ac_libyuv_cflags
 ac_openh264_ldflags
 ac_openh264_cflags
@@ -683,4 +682,5 @@
 ac_pjmedia_snd
 ac_pjmedia_resample
+ac_external_yuv
 ac_srtp_shutdown_present
 ac_srtp_deinit_present
@@ -780,4 +780,5 @@
 with_external_gsm
 with_external_srtp
+with_external_yuv
 enable_resample
 enable_sound
@@ -805,6 +806,4 @@
 with_openh264
 enable_openh264
-with_libyuv
-enable_libyuv
 with_webrtc
 enable_webrtc
@@ -823,4 +822,5 @@
 with_opus
 enable_opus
+enable_libyuv
 '
       ac_precious_vars='build_alias
@@ -1475,5 +1475,4 @@
   --disable-v4l2          Disable Video4Linux2 (default: not disabled)
   --disable-openh264      Disable OpenH264 (default: not disabled)
-  --disable-libyuv        Exclude libyuv in the build
   --disable-webrtc        Exclude webrtc in the build
   --enable-ipp            Enable Intel IPP support. Specify the Intel IPP
@@ -1492,4 +1491,5 @@
                           autodetect)
 
+  --disable-libyuv        Exclude libyuv in the build
 
 Optional Packages:
@@ -1511,4 +1511,9 @@
                           CFLAGS and LDFLAGS env var to set the include/lib
                           paths)
+  --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)
   --with-external-pa      Use external PortAudio development files, not the
                           one in "third_party" directory. When this option is
@@ -1519,5 +1524,4 @@
   --with-ffmpeg=DIR       Specify alternate FFMPEG prefix
   --with-openh264=DIR     Specify alternate OpenH264 prefix
-  --with-libyuv=DIR       Specify alternate libyuv prefix
   --with-webrtc=DIR       Specify alternate WebRtc prefix
   --with-ipp=DIR          Specify the Intel IPP location
@@ -6050,4 +6054,42 @@
 fi
 
+
+ac_external_yuv=0
+
+
+# Check whether --with-external-yuv was given.
+if test "${with_external_yuv+set}" = set; then :
+  withval=$with_external_yuv;
+	if test "x$with_external_yuv" != "xno"; then
+		# Test libyuv installation
+		{ $as_echo "$as_me:${as_lineno-$LINENO}: checking if external libyuv devkit is installed" >&5
+$as_echo_n "checking if external libyuv devkit is installed... " >&6; }
+		cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+#include <libyuv.h>
+int
+main ()
+{
+RGB24ToI420(0,0,0,0,0,0,0,0,0,0);
+  ;
+  return 0;
+}
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes!!" >&5
+$as_echo "yes!!" >&6; }
+				   ac_external_yuv="1"
+
+else
+  as_fn_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" "$LINENO" 5
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+	fi
+
+
+fi
+
+
+
 ac_pjmedia_resample=libresample
 
@@ -6213,4 +6255,11 @@
 
 
+# Disable video on mingw
+case $target in
+ *mingw*)
+	enable_video="no"
+	;;
+esac
+
 # Check whether --enable-video was given.
 if test "${enable_video+set}" = set; then :
@@ -6871,4 +6920,5 @@
 				ac_ffmpeg_cflags="$ac_ffmpeg_cflags -DPJMEDIA_HAS_LIBSWSCALE=1"
 				av_pkg="$av_pkg libswscale"
+								enable_libyuv="no"
 			fi
 			if $PKG_CONFIG --exists libavutil; then
@@ -7109,4 +7159,5 @@
   ac_ffmpeg_cflags="$ac_ffmpeg_cflags -DPJMEDIA_HAS_LIBSWSCALE=1"
 				      ac_ffmpeg_ldflags="$ac_ffmpeg_ldflags -lswscale"
+				      enable_libyuv="no"
 
 fi
@@ -7321,121 +7372,4 @@
 rm -f core conftest.err conftest.$ac_objext \
     conftest$ac_exeext conftest.$ac_ext
-
-
-fi
-
-
-
-# Check whether --with-libyuv was given.
-if test "${with_libyuv+set}" = set; then :
-  withval=$with_libyuv;
-else
-  with_libyuv=no
-
-fi
-
-
-if test "x$ac_cross_compile" != "x" -a "x$with_libyuv" = "xno"; then
-    enable_libyuv=no
-fi
-
-
-
-# Check whether --enable-libyuv was given.
-if test "${enable_libyuv+set}" = set; then :
-  enableval=$enable_libyuv; if test "$enable_libyuv" = "no"; then
-		{ $as_echo "$as_me:${as_lineno-$LINENO}: result: Checking if libyuv is disabled...yes" >&5
-$as_echo "Checking if libyuv is disabled...yes" >&6; }
-	       fi
-else
-
-		  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
-
-			{ $as_echo "$as_me:${as_lineno-$LINENO}: result: Using libyuv prefix... $with_libyuv" >&5
-$as_echo "Using libyuv prefix... $with_libyuv" >&6; }
-		  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"
-
-		  { $as_echo "$as_me:${as_lineno-$LINENO}: checking for I420Scale in -lyuv" >&5
-$as_echo_n "checking for I420Scale in -lyuv... " >&6; }
-if ${ac_cv_lib_yuv_I420Scale+:} false; then :
-  $as_echo_n "(cached) " >&6
-else
-  ac_check_lib_save_LIBS=$LIBS
-LIBS="-lyuv
-			        $LIBS"
-cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h.  */
-
-/* Override any GCC internal prototype to avoid an error.
-   Use char because int might match the return type of a GCC
-   builtin and then its argument prototype would still apply.  */
-#ifdef __cplusplus
-extern "C"
-#endif
-char I420Scale ();
-int
-main ()
-{
-return I420Scale ();
-  ;
-  return 0;
-}
-_ACEOF
-if ac_fn_c_try_link "$LINENO"; then :
-  ac_cv_lib_yuv_I420Scale=yes
-else
-  ac_cv_lib_yuv_I420Scale=no
-fi
-rm -f core conftest.err conftest.$ac_objext \
-    conftest$ac_exeext conftest.$ac_ext
-LIBS=$ac_check_lib_save_LIBS
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_yuv_I420Scale" >&5
-$as_echo "$ac_cv_lib_yuv_I420Scale" >&6; }
-if test "x$ac_cv_lib_yuv_I420Scale" = xyes; then :
-   ac_libyuv_cflags="-DPJMEDIA_HAS_LIBYUV=1 $LIBYUV_CFLAGS"
-		  		 ac_libyuv_ldflags="$LIBYUV_LDFLAGS $LIBYUV_LIBS"
-
-else
-   LIBS="$SAVED_LIBS"
-				 LDFLAGS="$SAVED_LDFLAGS"
-				 CFLAGS="$SAVED_CFLAGS"
-
-fi
 
 
@@ -8441,4 +8375,20 @@
 		fi
 
+fi
+
+
+
+# Check whether --enable-libyuv was given.
+if test "${enable_libyuv+set}" = set; then :
+  enableval=$enable_libyuv; if test "$enable_libyuv" = "no"; then
+		ac_no_yuv=1,
+		$as_echo "#define PJMEDIA_HAS_LIBYUV 0" >>confdefs.h
+
+		{ $as_echo "$as_me:${as_lineno-$LINENO}: result: Checking if libyuv is disabled...yes" >&5
+$as_echo "Checking if libyuv is disabled...yes" >&6; }
+	       fi
+else
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: Checking if libyuv is disabled...no" >&5
+$as_echo "Checking if libyuv is disabled...no" >&6; }
 fi
 
Index: /pjproject/trunk/aconfigure.ac
===================================================================
--- /pjproject/trunk/aconfigure.ac	(revision 5360)
+++ /pjproject/trunk/aconfigure.ac	(revision 5361)
@@ -569,4 +569,25 @@
 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)
@@ -685,4 +706,11 @@
 
 AC_SUBST(ac_pjmedia_video)
+
+# Disable video on mingw
+case $target in
+ *mingw*)
+	enable_video="no"
+	;;
+esac
 
 dnl # --disable-video option
@@ -1038,4 +1066,6 @@
 				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
@@ -1096,4 +1126,5 @@
 				     [ac_ffmpeg_cflags="$ac_ffmpeg_cflags -DPJMEDIA_HAS_LIBSWSCALE=1"
 				      ac_ffmpeg_ldflags="$ac_ffmpeg_ldflags -lswscale"
+				      enable_libyuv="no"
 				     ],
 				     [],
@@ -1204,80 +1235,4 @@
 		  		 ])
 
-	      ])
-
-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"
-			       ],
-			       []
-			       )
 	      ])
 
@@ -1835,4 +1790,16 @@
 	      ])
 
+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 ##########################################
Index: /pjproject/trunk/build.mak.in
===================================================================
--- /pjproject/trunk/build.mak.in	(revision 5360)
+++ /pjproject/trunk/build.mak.in	(revision 5361)
@@ -122,4 +122,19 @@
 endif
 
+ifneq (@ac_no_yuv@,1)
+ifeq (@ac_external_yuv@,1)
+APP_THIRD_PARTY_EXT += -lyuv
+else
+APP_THIRD_PARTY_LIB_FILES += $(PJ_DIR)/third_party/lib/libyuv-$(LIB_SUFFIX)
+ifeq ($(PJ_SHARED_LIBRARIES),)
+APP_THIRD_PARTY_LIBS += -lyuv-$(TARGET_NAME)
+else
+APP_THIRD_PARTY_LIBS += -lyuv
+APP_THIRD_PARTY_LIB_FILES += $(PJ_DIR)/third_party/lib/libyuv.$(SHLIB_SUFFIX).$(PJ_VERSION_MAJOR) $(PJ_DIR)/third_party/lib/libyuv.$(SHLIB_SUFFIX)
+endif
+endif
+endif
+
+
 # Additional flags
 @ac_build_mak_vars@
@@ -158,13 +173,9 @@
 ANDROID_CFLAGS = @ac_android_cflags@
 
-# libyuv
-LIBYUV_CFLAGS = @ac_libyuv_cflags@ 
-LIBYUV_LDFLAGS =  @ac_libyuv_ldflags@
-
 # PJMEDIA features exclusion
 PJ_VIDEO_CFLAGS += $(SDL_CFLAGS) $(FFMPEG_CFLAGS) $(V4L2_CFLAGS) $(QT_CFLAGS) \
-		   $(OPENH264_CFLAGS) $(DARWIN_CFLAGS) $(LIBYUV_CFLAGS)
+		   $(OPENH264_CFLAGS) $(DARWIN_CFLAGS)
 PJ_VIDEO_LDFLAGS += $(SDL_LDFLAGS) $(FFMPEG_LDFLAGS) $(V4L2_LDFLAGS) \
-                   $(OPENH264_LDFLAGS) $(LIBYUV_LDFLAGS)
+                   $(OPENH264_LDFLAGS)
 
 # CFLAGS, LDFLAGS, and LIBS to be used by applications
Index: /pjproject/trunk/build/rules.mak
===================================================================
--- /pjproject/trunk/build/rules.mak	(revision 5360)
+++ /pjproject/trunk/build/rules.mak	(revision 5361)
@@ -52,5 +52,5 @@
 # FULL_SRCS is ../src/app/file1.c ../src/app/file1.S
 #
-FULL_SRCS = $(foreach file, $($(APP)_OBJS), $(SRCDIR)/$(basename $(file)).m $(SRCDIR)/$(basename $(file)).c $(SRCDIR)/$(basename $(file)).cpp $(SRCDIR)/$(basename $(file)).S)
+FULL_SRCS = $(foreach file, $($(APP)_OBJS), $(SRCDIR)/$(basename $(file)).m $(SRCDIR)/$(basename $(file)).c $(SRCDIR)/$(basename $(file)).cpp $(SRCDIR)/$(basename $(file)).cc $(SRCDIR)/$(basename $(file)).S)
 
 #
@@ -171,4 +171,9 @@
 
 $(OBJDIR)/%$(OBJEXT): $(SRCDIR)/%.cpp
+	$(CXX) $($(APP)_CXXFLAGS) \
+		$(CC_OUT)$(subst /,$(HOST_PSEP),$@) \
+		$(subst /,$(HOST_PSEP),$<)
+
+$(OBJDIR)/%$(OBJEXT): $(SRCDIR)/%.cc
 	$(CXX) $($(APP)_CXXFLAGS) \
 		$(CC_OUT)$(subst /,$(HOST_PSEP),$@) \
Index: /pjproject/trunk/pjmedia/build/os-auto.mak.in
===================================================================
--- /pjproject/trunk/pjmedia/build/os-auto.mak.in	(revision 5360)
+++ /pjproject/trunk/pjmedia/build/os-auto.mak.in	(revision 5361)
@@ -29,8 +29,4 @@
 ANDROID_CFLAGS = @ac_android_cflags@
 
-# libyuv
-LIBYUV_CFLAGS = @ac_libyuv_cflags@
-LIBYUV_LDFLAGS = @ac_libyuv_ldflags@
-
 # openh264
 OPENH264_CFLAGS = @ac_openh264_cflags@
@@ -45,8 +41,8 @@
 export CFLAGS += @ac_no_small_filter@ @ac_no_large_filter@ @ac_no_speex_aec@ \
 		 $(SDL_CFLAGS) $(FFMPEG_CFLAGS) $(V4L2_CFLAGS) $(QT_CFLAGS) \
-		 $(DARWIN_CFLAGS) $(ANDROID_CFLAGS) $(LIBYUV_CFLAGS) \
+		 $(DARWIN_CFLAGS) $(ANDROID_CFLAGS) \
 		 $(OPENH264_CFLAGS) $(WEBRTC_CFLAGS)
 export LDFLAGS += $(SDL_LDFLAGS) $(FFMPEG_LDFLAGS) $(V4L2_LDFLAGS) \
-		  $(LIBYUV_LDFLAGS) $(OPENH264_LDFLAGS) $(WEBRTC_LDFLAGS)
+		  $(OPENH264_LDFLAGS) $(WEBRTC_LDFLAGS)
 
 # Define the desired sound device backend
@@ -197,4 +193,17 @@
 
 #
+# libyuv
+#
+ifeq (@ac_no_yuv@,1)
+export CFLAGS += -DPJMEDIA_HAS_LIBYUV=0
+else
+export CFLAGS += -DPJMEDIA_HAS_LIBYUV=1
+ifeq (@ac_external_yuv@,0)
+export CFLAGS += -I$(THIRD_PARTY)/yuv/include
+endif
+endif
+
+
+#
 # MacOSX specific
 #
Index: /pjproject/trunk/pjsip-apps/src/swig/java/android/src/org/pjsip/pjsua2/app/MyApp.java
===================================================================
--- /pjproject/trunk/pjsip-apps/src/swig/java/android/src/org/pjsip/pjsua2/app/MyApp.java	(revision 5360)
+++ /pjproject/trunk/pjsip-apps/src/swig/java/android/src/org/pjsip/pjsua2/app/MyApp.java	(revision 5361)
@@ -284,5 +284,6 @@
 	try{
 	    System.loadLibrary("openh264");
-	    System.loadLibrary("yuv");
+            // Ticket #1937: libyuv is now included as static lib
+            //System.loadLibrary("yuv");
 	} catch (UnsatisfiedLinkError e) {
 	    System.out.println("UnsatisfiedLinkError: " + e.getMessage());
Index: /pjproject/trunk/third_party/build/os-auto.mak.in
===================================================================
--- /pjproject/trunk/third_party/build/os-auto.mak.in	(revision 5360)
+++ /pjproject/trunk/third_party/build/os-auto.mak.in	(revision 5361)
@@ -41,2 +41,10 @@
 DIRS += resample
 endif
+
+ifneq (@ac_no_yuv@,1)
+ifeq (@ac_external_yuv@,1)
+# External yuv
+else
+DIRS += yuv
+endif
+endif
Index: /pjproject/trunk/third_party/build/yuv/Makefile
===================================================================
--- /pjproject/trunk/third_party/build/yuv/Makefile	(revision 5361)
+++ /pjproject/trunk/third_party/build/yuv/Makefile	(revision 5361)
@@ -0,0 +1,339 @@
+include ../../../build.mak
+include ../../../build/common.mak
+
+export LIBDIR := ../../lib
+
+RULES_MAK := $(PJDIR)/build/rules.mak
+
+export YUV_LIB := libyuv-$(TARGET_NAME)$(LIBEXT)
+
+ifeq ($(PJ_SHARED_LIBRARIES),)
+else
+export YUV_SONAME := libyuv.$(SHLIB_SUFFIX)
+export YUV_SHLIB := $(YUV_SONAME).$(PJ_VERSION_MAJOR)
+endif
+
+###############################################################################
+# Gather all flags.
+#
+export _CFLAGS 	:= $(CC_CFLAGS) $(OS_CFLAGS) $(HOST_CFLAGS) $(M_CFLAGS) \
+		   $(CFLAGS) $(CC_INC). $(CC_INC)../../yuv/include \
+		   $(CC_INC)../../../pjlib/include
+export _CXXFLAGS:= $(_CFLAGS) $(CC_CXXFLAGS) $(OS_CXXFLAGS) $(M_CXXFLAGS) \
+		   $(HOST_CXXFLAGS) $(CXXFLAGS)
+export _LDFLAGS := $(CC_LDFLAGS) $(OS_LDFLAGS) $(M_LDFLAGS) $(HOST_LDFLAGS) \
+		   $(LDFLAGS) 
+
+export YUV_SRCDIR = ../../yuv/source
+export YUV_OBJS = \
+	compare.o           \
+	compare_common.o    \
+	compare_gcc.o       \
+	compare_neon64.o    \
+	compare_neon.o      \
+	compare_win.o       \
+	convert_argb.o      \
+	convert.o           \
+	convert_from_argb.o \
+	convert_from.o      \
+	convert_jpeg.o      \
+	convert_to_argb.o   \
+	convert_to_i420.o   \
+	cpu_id.o            \
+	mjpeg_decoder.o     \
+	mjpeg_validate.o    \
+	planar_functions.o  \
+	rotate_any.o        \
+	rotate_argb.o       \
+	rotate.o            \
+	rotate_common.o     \
+	rotate_gcc.o        \
+	rotate_mips.o       \
+	rotate_neon64.o     \
+	rotate_neon.o       \
+	rotate_win.o        \
+	row_any.o           \
+	row_common.o        \
+	row_gcc.o           \
+	row_mips.o          \
+	row_neon64.o        \
+	row_neon.o          \
+	row_win.o           \
+	scale_any.o         \
+	scale_argb.o        \
+	scale.o             \
+	scale_common.o      \
+	scale_gcc.o         \
+	scale_mips.o        \
+	scale_neon64.o      \
+	scale_neon.o        \
+	scale_win.o         \
+	video_common.o
+
+export YUV_CFLAGS = -fomit-frame-pointer $(_CFLAGS)
+export YUV_CXXFLAGS = $(YUV_CFLAGS)
+
+
+export CC_OUT CC AR RANLIB HOST_MV HOST_RM HOST_RMDIR HOST_MKDIR OBJEXT LD LDOUT 
+###############################################################################
+# Main entry
+#
+# $(TARGET) is defined in os-$(OS_NAME).mak file in current directory.
+#
+TARGETS := $(YUV_LIB) $(YUV_SONAME)
+
+all: $(TARGETS)
+
+doc:
+	cd .. && doxygen docs/doxygen.cfg
+
+dep: depend
+distclean: realclean
+
+.PHONY: all dep depend clean realclean distclean
+.PHONY: $(TARGETS)
+.PHONE: $(YUV_LIB) $(YUV_SONAME)
+
+libyuv: $(YUV_LIB)
+$(YUV_SONAME): $(YUV_LIB)
+$(YUV_LIB) $(YUV_SONAME):
+	$(MAKE) -f $(RULES_MAK) APP=YUV app=libyuv $(subst /,$(HOST_PSEP),$(LIBDIR)/$@)
+
+clean print_lib:
+	$(MAKE) -f $(RULES_MAK) APP=YUV app=libyuv $@
+
+realclean:
+	$(subst @@,$(subst /,$(HOST_PSEP),.yuv-$(TARGET_NAME).depend),$(HOST_RMR))
+	
+	$(MAKE) -f $(RULES_MAK) APP=YUV app=libyuv $@
+
+depend:
+	$(MAKE) -f $(RULES_MAK) APP=YUV app=libyuv $@
+
+
+include ../../../build.mak
+include ../../../build/common.mak
+
+export LIBDIR := ../../lib
+
+RULES_MAK := $(PJDIR)/build/rules.mak
+
+export YUV_LIB := libyuv-$(TARGET_NAME)$(LIBEXT)
+
+ifeq ($(PJ_SHARED_LIBRARIES),)
+else
+export YUV_SONAME := libyuv.$(SHLIB_SUFFIX)
+export YUV_SHLIB := $(YUV_SONAME).$(PJ_VERSION_MAJOR)
+endif
+
+###############################################################################
+# Gather all flags.
+#
+export _CFLAGS 	:= $(CC_CFLAGS) $(OS_CFLAGS) $(HOST_CFLAGS) $(M_CFLAGS) \
+		   $(CFLAGS) $(CC_INC). $(CC_INC)../../yuv/include \
+		   $(CC_INC)../../../pjlib/include
+export _CXXFLAGS:= $(_CFLAGS) $(CC_CXXFLAGS) $(OS_CXXFLAGS) $(M_CXXFLAGS) \
+		   $(HOST_CXXFLAGS) $(CXXFLAGS)
+export _LDFLAGS := $(CC_LDFLAGS) $(OS_LDFLAGS) $(M_LDFLAGS) $(HOST_LDFLAGS) \
+		   $(LDFLAGS) 
+
+export YUV_SRCDIR = ../../yuv/source
+export YUV_OBJS = \
+	compare.o           \
+	compare_common.o    \
+	compare_gcc.o       \
+	compare_neon64.o    \
+	compare_neon.o      \
+	compare_win.o       \
+	convert_argb.o      \
+	convert.o           \
+	convert_from_argb.o \
+	convert_from.o      \
+	convert_jpeg.o      \
+	convert_to_argb.o   \
+	convert_to_i420.o   \
+	cpu_id.o            \
+	mjpeg_decoder.o     \
+	mjpeg_validate.o    \
+	planar_functions.o  \
+	rotate_any.o        \
+	rotate_argb.o       \
+	rotate.o            \
+	rotate_common.o     \
+	rotate_gcc.o        \
+	rotate_mips.o       \
+	rotate_neon64.o     \
+	rotate_neon.o       \
+	rotate_win.o        \
+	row_any.o           \
+	row_common.o        \
+	row_gcc.o           \
+	row_mips.o          \
+	row_neon64.o        \
+	row_neon.o          \
+	row_win.o           \
+	scale_any.o         \
+	scale_argb.o        \
+	scale.o             \
+	scale_common.o      \
+	scale_gcc.o         \
+	scale_mips.o        \
+	scale_neon64.o      \
+	scale_neon.o        \
+	scale_win.o         \
+	video_common.o
+
+export YUV_CFLAGS = -fomit-frame-pointer $(_CFLAGS)
+export YUV_CXXFLAGS = $(YUV_CFLAGS)
+
+
+export CC_OUT CC AR RANLIB HOST_MV HOST_RM HOST_RMDIR HOST_MKDIR OBJEXT LD LDOUT 
+###############################################################################
+# Main entry
+#
+# $(TARGET) is defined in os-$(OS_NAME).mak file in current directory.
+#
+TARGETS := $(YUV_LIB) $(YUV_SONAME)
+
+all: $(TARGETS)
+
+doc:
+	cd .. && doxygen docs/doxygen.cfg
+
+dep: depend
+distclean: realclean
+
+.PHONY: all dep depend clean realclean distclean
+.PHONY: $(TARGETS)
+.PHONE: $(YUV_LIB) $(YUV_SONAME)
+
+libyuv: $(YUV_LIB)
+$(YUV_SONAME): $(YUV_LIB)
+$(YUV_LIB) $(YUV_SONAME):
+	$(MAKE) -f $(RULES_MAK) APP=YUV app=libyuv $(subst /,$(HOST_PSEP),$(LIBDIR)/$@)
+
+clean print_lib:
+	$(MAKE) -f $(RULES_MAK) APP=YUV app=libyuv $@
+
+realclean:
+	$(subst @@,$(subst /,$(HOST_PSEP),.yuv-$(TARGET_NAME).depend),$(HOST_RMR))
+	
+	$(MAKE) -f $(RULES_MAK) APP=YUV app=libyuv $@
+
+depend:
+	$(MAKE) -f $(RULES_MAK) APP=YUV app=libyuv $@
+
+
+include ../../../build.mak
+include ../../../build/common.mak
+
+export LIBDIR := ../../lib
+
+RULES_MAK := $(PJDIR)/build/rules.mak
+
+export YUV_LIB := libyuv-$(TARGET_NAME)$(LIBEXT)
+
+ifeq ($(PJ_SHARED_LIBRARIES),)
+else
+export YUV_SONAME := libyuv.$(SHLIB_SUFFIX)
+export YUV_SHLIB := $(YUV_SONAME).$(PJ_VERSION_MAJOR)
+endif
+
+###############################################################################
+# Gather all flags.
+#
+export _CFLAGS 	:= $(CC_CFLAGS) $(OS_CFLAGS) $(HOST_CFLAGS) $(M_CFLAGS) \
+		   $(CFLAGS) $(CC_INC). $(CC_INC)../../yuv/include \
+		   $(CC_INC)../../../pjlib/include
+export _CXXFLAGS:= $(_CFLAGS) $(CC_CXXFLAGS) $(OS_CXXFLAGS) $(M_CXXFLAGS) \
+		   $(HOST_CXXFLAGS) $(CXXFLAGS)
+export _LDFLAGS := $(CC_LDFLAGS) $(OS_LDFLAGS) $(M_LDFLAGS) $(HOST_LDFLAGS) \
+		   $(LDFLAGS) 
+
+export YUV_SRCDIR = ../../yuv/source
+export YUV_OBJS = \
+	compare.o           \
+	compare_common.o    \
+	compare_gcc.o       \
+	compare_neon64.o    \
+	compare_neon.o      \
+	compare_win.o       \
+	convert_argb.o      \
+	convert.o           \
+	convert_from_argb.o \
+	convert_from.o      \
+	convert_jpeg.o      \
+	convert_to_argb.o   \
+	convert_to_i420.o   \
+	cpu_id.o            \
+	mjpeg_decoder.o     \
+	mjpeg_validate.o    \
+	planar_functions.o  \
+	rotate_any.o        \
+	rotate_argb.o       \
+	rotate.o            \
+	rotate_common.o     \
+	rotate_gcc.o        \
+	rotate_mips.o       \
+	rotate_neon64.o     \
+	rotate_neon.o       \
+	rotate_win.o        \
+	row_any.o           \
+	row_common.o        \
+	row_gcc.o           \
+	row_mips.o          \
+	row_neon64.o        \
+	row_neon.o          \
+	row_win.o           \
+	scale_any.o         \
+	scale_argb.o        \
+	scale.o             \
+	scale_common.o      \
+	scale_gcc.o         \
+	scale_mips.o        \
+	scale_neon64.o      \
+	scale_neon.o        \
+	scale_win.o         \
+	video_common.o
+
+export YUV_CFLAGS = -fomit-frame-pointer $(_CFLAGS)
+export YUV_CXXFLAGS = $(YUV_CFLAGS)
+
+
+export CC_OUT CC AR RANLIB HOST_MV HOST_RM HOST_RMDIR HOST_MKDIR OBJEXT LD LDOUT 
+###############################################################################
+# Main entry
+#
+# $(TARGET) is defined in os-$(OS_NAME).mak file in current directory.
+#
+TARGETS := $(YUV_LIB) $(YUV_SONAME)
+
+all: $(TARGETS)
+
+doc:
+	cd .. && doxygen docs/doxygen.cfg
+
+dep: depend
+distclean: realclean
+
+.PHONY: all dep depend clean realclean distclean
+.PHONY: $(TARGETS)
+.PHONE: $(YUV_LIB) $(YUV_SONAME)
+
+libyuv: $(YUV_LIB)
+$(YUV_SONAME): $(YUV_LIB)
+$(YUV_LIB) $(YUV_SONAME):
+	$(MAKE) -f $(RULES_MAK) APP=YUV app=libyuv $(subst /,$(HOST_PSEP),$(LIBDIR)/$@)
+
+clean print_lib:
+	$(MAKE) -f $(RULES_MAK) APP=YUV app=libyuv $@
+
+realclean:
+	$(subst @@,$(subst /,$(HOST_PSEP),.yuv-$(TARGET_NAME).depend),$(HOST_RMR))
+	
+	$(MAKE) -f $(RULES_MAK) APP=YUV app=libyuv $@
+
+depend:
+	$(MAKE) -f $(RULES_MAK) APP=YUV app=libyuv $@
+
+
