Index: /pjproject/trunk/aconfigure
===================================================================
--- /pjproject/trunk/aconfigure	(revision 4130)
+++ /pjproject/trunk/aconfigure	(revision 4131)
@@ -724,4 +724,5 @@
 with_external_pa
 enable_oss
+enable_video
 enable_ext_sound
 enable_small_filter
@@ -1381,4 +1382,5 @@
   --disable-sound         Exclude sound (i.e. use null sound)
   --disable-oss           Disable OSS audio (default: not disabled)
+  --disable-video         Disable video feature
   --enable-ext-sound      PJMEDIA will not provide any sound device backend
   --disable-small-filter  Exclude small filter in resampling
@@ -5672,4 +5674,27 @@
 
 
+
+# Check whether --enable-video was given.
+if test "${enable_video+set}" = set; then :
+  enableval=$enable_video; if test "$enable_video" = "no"; then
+	        #AC_DEFINE(PJMEDIA_HAS_VIDEO,0)
+                { $as_echo "$as_me:${as_lineno-$LINENO}: result: Video is disabled" >&5
+$as_echo "Video is disabled" >&6; }
+                enable_sdl="no"
+                enable_ffmpeg="no"
+		enable_v4l2="no"
+               fi
+fi
+
+
+case $target in
+ arm-apple-darwin*)
+ 	LIBS="$LIBS -framework UIKit"
+	;;
+ *darwin*)
+ 	LIBS="$LIBS -framework Foundation -framework AppKit"
+	;;
+esac
+
 if test "$enable_video" = "no"; then
   true;
@@ -5681,5 +5706,5 @@
 
 	SAVED_LIBS="$LIBS"
-	LIBS="-framework AVFoundation -framework UIKit -framework CoreGraphics -framework QuartzCore -framework CoreVideo -framework CoreMedia"
+	LIBS="-framework AVFoundation -framework CoreGraphics -framework QuartzCore -framework CoreVideo -framework CoreMedia"
 	cat confdefs.h - <<_ACEOF >conftest.$ac_ext
 /* end confdefs.h.  */
@@ -5703,5 +5728,5 @@
 	if test "$ac_pjmedia_video_has_ios" = "yes"; then
 	  ac_ios_cflags="-DPJMEDIA_VIDEO_DEV_HAS_IOS=1"
-	  LIBS="$LIBS -framework AVFoundation -framework UIKit -framework CoreGraphics -framework QuartzCore -framework CoreVideo -framework CoreMedia"
+	  LIBS="$LIBS -framework AVFoundation -framework CoreGraphics -framework QuartzCore -framework CoreVideo -framework CoreMedia"
 	  { $as_echo "$as_me:${as_lineno-$LINENO}: result: Checking if AVFoundation framework is available... yes" >&5
 $as_echo "Checking if AVFoundation framework is available... yes" >&6; }
@@ -5738,5 +5763,5 @@
 	if test "$ac_pjmedia_video_has_qt" = "yes"; then
 	  ac_qt_cflags="-DPJMEDIA_VIDEO_DEV_HAS_QT=1"
-	  LIBS="$LIBS -framework QTKit -framework Foundation -framework AppKit -framework QuartzCore -framework OpenGL"
+	  LIBS="$LIBS -framework QTKit -framework QuartzCore -framework OpenGL"
 	  { $as_echo "$as_me:${as_lineno-$LINENO}: result: Checking if QTKit framework is available... yes" >&5
 $as_echo "Checking if QTKit framework is available... yes" >&6; }
@@ -6052,5 +6077,5 @@
 			{ $as_echo "$as_me:${as_lineno-$LINENO}: result: Using ffmpeg prefix... $FFMPEG_PREFIX" >&5
 $as_echo "Using ffmpeg prefix... $FFMPEG_PREFIX" >&6; }
-			PKG_CONFIG_PATH=$FFMPEG_PREFIX/lib/pkgconfig
+			export PKG_CONFIG_PATH=$FFMPEG_PREFIX/lib/pkgconfig
 		fi
 
@@ -6410,5 +6435,5 @@
 
 		LIBS="$LIBS $ac_ffmpeg_ldflags"
-		PKG_CONFIG_PATH=$SAVED_PKG_CONFIG_PATH
+		export PKG_CONFIG_PATH=$SAVED_PKG_CONFIG_PATH
 
 
Index: /pjproject/trunk/aconfigure.ac
===================================================================
--- /pjproject/trunk/aconfigure.ac	(revision 4130)
+++ /pjproject/trunk/aconfigure.ac	(revision 4131)
@@ -613,4 +613,27 @@
 
 AC_SUBST(ac_pjmedia_video)
+
+dnl # --disable-video option
+AC_ARG_ENABLE(video,
+	      AC_HELP_STRING([--disable-video],
+	      		     [Disable video feature]),
+	      [if test "$enable_video" = "no"; then
+	        #AC_DEFINE(PJMEDIA_HAS_VIDEO,0)
+                AC_MSG_RESULT([Video is disabled]) 
+                enable_sdl="no"
+                enable_ffmpeg="no"
+		enable_v4l2="no"
+               fi],
+	      [])
+
+case $target in
+ arm-apple-darwin*)
+ 	LIBS="$LIBS -framework UIKit"
+	;;
+ *darwin*)
+ 	LIBS="$LIBS -framework Foundation -framework AppKit"
+	;;
+esac
+
 if test "$enable_video" = "no"; then
   true;
@@ -622,10 +645,10 @@
 	AC_SUBST(ac_ios_cflags)
 	SAVED_LIBS="$LIBS"
-	LIBS="-framework AVFoundation -framework UIKit -framework CoreGraphics -framework QuartzCore -framework CoreVideo -framework CoreMedia"
+	LIBS="-framework AVFoundation -framework CoreGraphics -framework QuartzCore -framework CoreVideo -framework CoreMedia"
 	AC_LINK_IFELSE([AC_LANG_PROGRAM([[]], [])],[ac_pjmedia_video_has_ios=yes],[ac_pjmedia_video_has_ios=no])
 	LIBS="$SAVED_LIBS"
 	if test "$ac_pjmedia_video_has_ios" = "yes"; then
 	  ac_ios_cflags="-DPJMEDIA_VIDEO_DEV_HAS_IOS=1"
-	  LIBS="$LIBS -framework AVFoundation -framework UIKit -framework CoreGraphics -framework QuartzCore -framework CoreVideo -framework CoreMedia"
+	  LIBS="$LIBS -framework AVFoundation -framework CoreGraphics -framework QuartzCore -framework CoreVideo -framework CoreMedia"
 	  AC_MSG_RESULT([Checking if AVFoundation framework is available... yes])
 	else
@@ -643,5 +666,5 @@
 	if test "$ac_pjmedia_video_has_qt" = "yes"; then
 	  ac_qt_cflags="-DPJMEDIA_VIDEO_DEV_HAS_QT=1"
-	  LIBS="$LIBS -framework QTKit -framework Foundation -framework AppKit -framework QuartzCore -framework OpenGL"
+	  LIBS="$LIBS -framework QTKit -framework QuartzCore -framework OpenGL"
 	  AC_MSG_RESULT([Checking if QTKit framework is available... yes])
 	else
@@ -858,5 +881,5 @@
 			FFMPEG_PREFIX=$with_ffmpeg
 			AC_MSG_RESULT([Using ffmpeg prefix... $FFMPEG_PREFIX])
-			PKG_CONFIG_PATH=$FFMPEG_PREFIX/lib/pkgconfig
+			export PKG_CONFIG_PATH=$FFMPEG_PREFIX/lib/pkgconfig
 		fi
 
@@ -957,5 +980,5 @@
 		
 		LIBS="$LIBS $ac_ffmpeg_ldflags"
-		PKG_CONFIG_PATH=$SAVED_PKG_CONFIG_PATH
+		export PKG_CONFIG_PATH=$SAVED_PKG_CONFIG_PATH
 	      ]
 	      )
