Index: pjproject/trunk/aconfigure.ac
===================================================================
--- pjproject/trunk/aconfigure.ac	(revision 4271)
+++ pjproject/trunk/aconfigure.ac	(revision 4331)
@@ -1321,37 +1321,67 @@
 	      ])
 
-dnl # opencore-amrnb alt prefix
+dnl # Obsolete option --with-opencore-amrnb
 AC_ARG_WITH(opencore-amrnb,
     AC_HELP_STRING([--with-opencore-amrnb=DIR],
-		   [Specify alternate libopencore-amrnb prefix]),
+		   [This option is obsolete and replaced by --with-opencore-amr=DIR]),
+    [AC_MSG_ERROR(This option is obsolete and replaced by --with-opencore-amr=DIR)],
+    []
+    )
+
+dnl # opencore-amr alt prefix
+AC_ARG_WITH(opencore-amr,
+    AC_HELP_STRING([--with-opencore-amr=DIR],
+		   [Specify alternate libopencore-amr prefix]),
     [],
-    [with_opencore_amrnb=no]
+    [with_opencore_amr=no]
     )
 
-dnl # Do not use default opencore-amrnb installation if we are cross-compiling
-if test "x$ac_cross_compile" != "x" -a "x$with_opencore_amrnb" = "xno"; then
-    enable_opencore_amrnb=no
+dnl # Do not use default opencore-amr installation if we are cross-compiling
+if test "x$ac_cross_compile" != "x" -a "x$with_opencore_amr" = "xno"; then
+    enable_opencore_amr=no
 fi
 
-dnl # Include opencore-amrnb support
+dnl # vo-amrwbenc alt prefix
+AC_ARG_WITH(opencore-amrwbenc,
+    AC_HELP_STRING([--with-opencore-amrwbenc=DIR],
+		   [Specify alternate libvo-amrwbenc prefix]),
+    [],
+    [with_opencore_amrwbenc=no]
+    )
+
+dnl # Do not use default vo-amrwbenc installation if we are cross-compiling
+if test "x$ac_cross_compile" != "x" -a "x$with_opencore_amrwbenc" = "xno"; then
+    enable_opencore_amrwbenc=no
+fi
+
+
+dnl # Include opencore-amr support
 AC_SUBST(ac_no_opencore_amrnb)
-AC_ARG_ENABLE(opencore_amrnb,
-	      AC_HELP_STRING([--disable-opencore-amrnb],
-			     [Exclude OpenCORE AMR-NB support from the build (default: autodetect)])
+AC_SUBST(ac_no_opencore_amrwb)
+AC_ARG_ENABLE(opencore_amr,
+	      AC_HELP_STRING([--disable-opencore-amr],
+			     [Exclude OpenCORE AMR support from the build (default: autodetect)])
 	      ,
 	      [
-		if test "$enable_opencore_amrnb" = "no"; then
+		if test "$enable_opencore_amr" = "no"; then
 		 [ac_no_opencore_amrnb=1]
+		 [ac_no_opencore_amrwb=1]
 		 AC_DEFINE(PJMEDIA_HAS_OPENCORE_AMRNB_CODEC,0)
-		 AC_MSG_RESULT([Checking if OpenCORE AMR-NB support is disabled... yes])
+		 AC_DEFINE(PJMEDIA_HAS_OPENCORE_AMRWB_CODEC,0)
+		 AC_MSG_RESULT([Checking if OpenCORE AMR support is disabled... yes])
 	        fi
 	      ],
 	      [
-		AC_MSG_RESULT([checking for OpenCORE AMR-NB installations..])
-                if test "x$with_opencore_amrnb" != "xno" -a "x$with_opencore_amrnb" != "x"; then
-                    CFLAGS="$CFLAGS -I$with_opencore_amrnb/include"
-                    LDFLAGS="$LDFLAGS -L$with_opencore_amrnb/lib"
-                    AC_MSG_RESULT([Using OpenCORE AMR-NB prefix... $with_opencore_amrnb])
-                fi                
+		AC_MSG_RESULT([checking for OpenCORE AMR installations..])
+                if test "x$with_opencore_amr" != "xno" -a "x$with_opencore_amr" != "x"; then
+                    CFLAGS="$CFLAGS -I$with_opencore_amr/include"
+                    LDFLAGS="$LDFLAGS -L$with_opencore_amr/lib"
+                    AC_MSG_RESULT([Using OpenCORE AMR prefix... $with_opencore_amr])
+                fi
+                if test "x$with_opencore_amrwbenc" != "xno" -a "x$with_opencore_amrwbenc" != "x"; then
+                    CFLAGS="$CFLAGS -I$with_opencore_amrwbenc/include"
+                    LDFLAGS="$LDFLAGS -L$with_opencore_amrwbenc/lib"
+                    AC_MSG_RESULT([Using OpenCORE AMRWB-enc prefix... $with_opencore_amrwbenc])
+                fi
 		AC_SUBST(opencore_amrnb_h_present)
 		AC_SUBST(opencore_amrnb_present)
@@ -1365,4 +1395,20 @@
 			AC_DEFINE(PJMEDIA_HAS_OPENCORE_AMRNB_CODEC,0)
 		fi
+		AC_SUBST(opencore_amrwb_enc_h_present)
+		AC_SUBST(opencore_amrwb_enc_present)
+		AC_SUBST(opencore_amrwb_dec_h_present)
+		AC_SUBST(opencore_amrwb_dec_present)
+		AC_CHECK_HEADER(vo-amrwbenc/enc_if.h,[opencore_amrwb_enc_h_present=1])
+		AC_CHECK_HEADER(opencore-amrwb/dec_if.h,[opencore_amrwb_dec_h_present=1])
+		AC_CHECK_LIB(opencore-amrwb,D_IF_init,[opencore_amrwb_dec_present=1 && LIBS="$LIBS -lopencore-amrwb"])
+		AC_CHECK_LIB(vo-amrwbenc,E_IF_init,[opencore_amrwb_enc_present=1 && LIBS="$LIBS -lvo-amrwbenc"])
+		if test "x$opencore_amrwb_enc_h_present" = "x1" -a "x$opencore_amrwb_dec_h_present" = "x1" -a "x$opencore_amrwb_enc_present" = "x1" -a "x$opencore_amrwb_dec_present" = "x1"; then
+	        	AC_MSG_RESULT([OpenCORE AMR-WB library found, AMR-WB support enabled])
+	        	AC_DEFINE(PJMEDIA_HAS_OPENCORE_AMRWB_CODEC,1)
+		else
+			[ac_no_opencore_amrwb=1]
+			AC_DEFINE(PJMEDIA_HAS_OPENCORE_AMRWB_CODEC,0)
+		fi
+
 	      ])
 
