Index: pjproject/trunk/aconfigure
===================================================================
--- pjproject/trunk/aconfigure	(revision 3096)
+++ pjproject/trunk/aconfigure	(revision 3097)
@@ -704,5 +704,7 @@
 enable_libsamplerate
 enable_ipp
-enable_ipp_samples
+with_ipp
+with_ipp_samples
+with_ipp_arch
 enable_ssl
 '
@@ -1357,6 +1359,4 @@
                           IPPSAMPLES env var or with --with-ipp and
                           --with-ipp-samples options
-  --with-ipp=DIR          Specify the Intel IPP location
-  --with-ipp-samples=DIR  Specify the Intel IPP samples location
   --disable-ssl           Exclude SSL support the build (default: autodetect)
 
@@ -1380,4 +1380,8 @@
                           (hint: use CFLAGS and LDFLAGS env var to set the
                           include/lib paths)
+  --with-ipp=DIR          Specify the Intel IPP location
+  --with-ipp-samples=DIR  Specify the Intel IPP samples location
+  --with-ipp-arch=ARCH    Specify the Intel IPP ARCH suffix, e.g. "64" or
+                          "em64t"
 
 Some influential environment variables:
@@ -5638,7 +5642,8 @@
 
 
-# Check whether --enable-ipp was given.
-if test "${enable_ipp+set}" = set; then :
-  enableval=$enable_ipp;
+
+# Check whether --with-ipp was given.
+if test "${with_ipp+set}" = set; then :
+  withval=$with_ipp;
 else
   with_ipp=no
@@ -5647,9 +5652,20 @@
 
 
-# Check whether --enable-ipp-samples was given.
-if test "${enable_ipp_samples+set}" = set; then :
-  enableval=$enable_ipp_samples;
+
+# Check whether --with-ipp-samples was given.
+if test "${with_ipp_samples+set}" = set; then :
+  withval=$with_ipp_samples;
 else
   with_ipp_samples=no
+
+fi
+
+
+
+# Check whether --with-ipp-arch was given.
+if test "${with_ipp_arch+set}" = set; then :
+  withval=$with_ipp_arch;
+else
+  with_ipp_arch=no
 
 fi
@@ -5675,4 +5691,14 @@
     fi
 
+    if test "x$with_ipp_arch" != "xno"; then
+	IPP_SUFFIX="em64t"
+	{ $as_echo "$as_me:${as_lineno-$LINENO}: result: IPP arch suffix is set to $IPP_SUFFIX" >&5
+$as_echo "IPP arch suffix is set to $IPP_SUFFIX" >&6; }
+    else
+	IPP_SUFFIX=""
+	{ $as_echo "$as_me:${as_lineno-$LINENO}: result: IPP arch suffix is set to empty" >&5
+$as_echo "IPP arch suffix is set to empty" >&6; }
+    fi
+
     if test x$IPPROOT = x; then
 	as_fn_error "the location is neither specified nor can be guessed. Please specify with IPPROOT env var or with --with-ipp option" "$LINENO" 5
@@ -5684,5 +5710,5 @@
 	# IPP directory looks okay.
 	# Remove trailing backslash
-	IPPROOT=`echo $IPPROOT/ | sed 's/\/$//'`
+	IPPROOT=`echo $IPPROOT | sed 's/\/$//'`
 
 	SAVED_CFLAGS="$CFLAGS"
@@ -5692,5 +5718,5 @@
 	IPP_CFLAGS="-I$IPPROOT/include"
 	IPP_LDFLAGS="-L$IPPROOT/sharedlib"
-	IPP_LIBS="-lippsc -lipps -lippsr -lippcore -lguide"
+	IPP_LIBS="-lippsc${IPP_SUFFIX} -lipps${IPP_SUFFIX} -lippsr${IPP_SUFFIX} -lippcore${IPP_SUFFIX} -lguide"
 	#IPP_LDFLAGS="-L$IPPROOT/sharedlib"
 	#IPP_LIBS="-lippscmerged -lippsrmerged -lippsmerged -lippcore"
@@ -5721,6 +5747,7 @@
   { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
-as_fn_error "failed
-See \`config.log' for more details." "$LINENO" 5; }
+{ as_fn_set_status run with --help for more info
+as_fn_error "Error: unable to recognize your IPP installation. Make sure the paths and ARCH suffix are set correctly
+See \`config.log' for more details." "$LINENO" 5; }; }
 fi
 rm -f core conftest.err conftest.$ac_objext \
@@ -5760,22 +5787,51 @@
 	IPPSAMPLES=`echo $IPPSAMPLES | sed 's/\/$//'`
 
-	# Guess the libusc.a build location
+	# Guess the libusc.a/libspeech.a build location
 	{ $as_echo "$as_me:${as_lineno-$LINENO}: checking Intel IPP USC build location" >&5
 $as_echo_n "checking Intel IPP USC build location... " >&6; }
-	IPPSAMPLESLIB=`ls -d $IPPSAMPLES/speech-codecs/bin/*gcc*/lib | head -1`
-	if test ! -d $IPPSAMPLESLIB; then
+	if test -d $IPPSAMPLES/speech-codecs/bin; then
+	    IPPVER=5
+	    IPPSAMP_DIR=`ls -d $IPPSAMPLES/speech-codecs/bin/*gcc*/lib | head -1`
+	elif test -d $IPPSAMPLES/speech-codecs/_bin; then
+	    IPPVER=6
+	    IPPSAMP_DIR=`ls -d $IPPSAMPLES/speech-codecs/_bin/*gcc*/lib | head -1`
+	else
 	    { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
-as_fn_error "the $IPPSAMPLES/speech-codecs/bin/*gcc*/lib directory not found. Have you built the samples?
+as_fn_error "unable to find $IPPSAMPLES/speech-codecs/bin/*gcc*/lib or $IPPSAMPLES/speech-codecs/_bin/*gcc*/lib directory. Have you built the samples?
 See \`config.log' for more details." "$LINENO" 5; }
 	fi
-	if test ! -f $IPPSAMPLESLIB/libusc.a; then
+
+	# Test the directory
+	if test ! -d $IPPSAMP_DIR; then
 	    { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
-as_fn_error "libusc.a doesn't exist in $IPPSAMPLESLIB
+as_fn_error "There's something wrong with this script, directory $IPPSAMP_DIR does not exist
+See \`config.log' for more details." "$LINENO" 5; }
+	    exit 1;
+	fi
+
+    	if test "x$IPPVER" = "x5"; then
+	    IPPSAMP_LIBS="libusc.a"
+	    IPPSAMP_LDLIBS="-lusc"
+	elif test "x$IPPVER" = "x6"; then
+	    IPPSAMP_LIBS="libspeech.a"
+	    IPPSAMP_LDLIBS="-lspeech"
+	else
+	    { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
+$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
+as_fn_error "bug in this script: unsupported IPP version
 See \`config.log' for more details." "$LINENO" 5; }
 	fi
-	{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $IPPSAMPLESLIB" >&5
-$as_echo "$IPPSAMPLESLIB" >&6; }
+
+	if test ! -f $IPPSAMP_DIR/$IPPSAMP_LIBS; then
+	    { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
+$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
+as_fn_error "$IPPSAMP_LIBS doesn't exist in $IPPSAMP_DIR
+See \`config.log' for more details." "$LINENO" 5; }
+	fi
+
+	{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $IPPSAMP_DIR" >&5
+$as_echo "$IPPSAMP_DIR" >&6; }
 
 	SAVED_CFLAGS="$CFLAGS"
@@ -5783,8 +5839,8 @@
 	SAVED_LIBS="$LIBS"
 
-	IPPSAMPLESINC="-I$IPPSAMPLES/speech-codecs/core/usc/include"
-	CFLAGS="$CFLAGS $IPPSAMPLESINC"
-	LDFLAGS="$LDFLAGS -L$IPPSAMPLESLIB"
-	LIBS="-lusc $LIBS"
+	IPPSAMP_INC="-I$IPPSAMPLES/speech-codecs/core/usc/include"
+	CFLAGS="$CFLAGS $IPPSAMP_INC"
+	LDFLAGS="$LDFLAGS -L$IPPSAMP_DIR"
+	LIBS="$IPPSAMP_LDLIBS $LIBS"
 
 	{ $as_echo "$as_me:${as_lineno-$LINENO}: checking Intel IPP USC usability" >&5
@@ -5815,11 +5871,15 @@
 
 	CFLAGS="$SAVED_CFLAGS"
-	LDFLAGS="\$(IPP_LDFLAGS) $SAVED_LDFLAGS"
-	LIBS="\$(IPP_LIBS) $SAVED_LIBS"
-
-	IPP_CFLAGS="$IPP_CFLAGS $IPPSAMPLESINC"
-	IPP_LDFLAGS="$IPP_LDFLAGS -L$IPPSAMPLESLIB"
-	IPP_LIBS="-lusc $IPP_LIBS"
+	LDFLAGS="$IPP_LDFLAGS $SAVED_LDFLAGS"
+	LIBS="$IPP_LIBS $SAVED_LIBS"
+
+	IPP_CFLAGS="$IPP_CFLAGS $IPPSAMP_INC"
+	IPP_LDFLAGS="$IPP_LDFLAGS -L$IPPSAMP_DIR"
+	IPP_LIBS="$IPPSAMP_LDLIBS $IPP_LIBS"
     fi
+
+    CFLAGS="$CFLAGS $IPP_CFLAGS"
+    LDFLAGS="$LDFLAGS $IPP_LDFLAGS"
+    LIBS="$LIBS $IPP_LIBS"
 
     ac_build_mak_vars="$ac_build_mak_vars\n\
Index: pjproject/trunk/aconfigure.ac
===================================================================
--- pjproject/trunk/aconfigure.ac	(revision 3096)
+++ pjproject/trunk/aconfigure.ac	(revision 3097)
@@ -668,5 +668,5 @@
     )
 
-AC_ARG_ENABLE(ipp,
+AC_ARG_WITH(ipp,
     AC_HELP_STRING([--with-ipp=DIR],
 		   [Specify the Intel IPP location]),
@@ -675,9 +675,16 @@
     )
 
-AC_ARG_ENABLE(ipp-samples,
+AC_ARG_WITH(ipp-samples,
     AC_HELP_STRING([--with-ipp-samples=DIR],
 		   [Specify the Intel IPP samples location]),
     [],
     [with_ipp_samples=no]
+    )
+
+AC_ARG_WITH(ipp-arch,
+    AC_HELP_STRING([--with-ipp-arch=ARCH],
+		   [Specify the Intel IPP ARCH suffix, e.g. "64" or "em64t. Default is blank for IA32"]),
+    [],
+    [with_ipp_arch=no]
     )
 
@@ -698,4 +705,12 @@
     else
 	AC_MSG_RESULT([$IPPROOT])
+    fi
+
+    if test "x$with_ipp_arch" != "xno"; then
+	IPP_SUFFIX="em64t"
+	AC_MSG_RESULT([IPP arch suffix is set to $IPP_SUFFIX])
+    else
+	IPP_SUFFIX=""
+	AC_MSG_RESULT([IPP arch suffix is set to empty])
     fi
 
@@ -709,5 +724,5 @@
 	# IPP directory looks okay.
 	# Remove trailing backslash
-	IPPROOT=`echo $IPPROOT/ | sed 's/\/$//'`
+	IPPROOT=`echo $IPPROOT | sed 's/\/$//'`
 
 	SAVED_CFLAGS="$CFLAGS"
@@ -717,5 +732,5 @@
 	IPP_CFLAGS="-I$IPPROOT/include"
 	IPP_LDFLAGS="-L$IPPROOT/sharedlib"
-	IPP_LIBS="-lippsc -lipps -lippsr -lippcore -lguide"
+	IPP_LIBS="-lippsc${IPP_SUFFIX} -lipps${IPP_SUFFIX} -lippsr${IPP_SUFFIX} -lippcore${IPP_SUFFIX} -lguide"
 	#IPP_LDFLAGS="-L$IPPROOT/sharedlib"
 	#IPP_LIBS="-lippscmerged -lippsrmerged -lippsmerged -lippcore"
@@ -731,5 +746,5 @@
 					   [ippStaticInit();])],
 		  [AC_MSG_RESULT(ok)],
-		  [AC_MSG_FAILURE(failed)])
+		  [AC_MSG_FAILURE(Error: unable to recognize your IPP installation. Make sure the paths and ARCH suffix are set correctly, run with --help for more info)])
 
 	CFLAGS="$SAVED_CFLAGS"
@@ -764,15 +779,38 @@
 	# Remove trailing backslash
 	IPPSAMPLES=`echo $IPPSAMPLES | sed 's/\/$//'`
-
-	# Guess the libusc.a build location
+	
+	# Guess the libusc.a/libspeech.a build location
 	AC_MSG_CHECKING([Intel IPP USC build location])
-	IPPSAMPLESLIB=`ls -d $IPPSAMPLES/speech-codecs/bin/*gcc*/lib | head -1`
-	if test ! -d $IPPSAMPLESLIB; then
-	    AC_MSG_FAILURE([the $IPPSAMPLES/speech-codecs/bin/*gcc*/lib directory not found. Have you built the samples?])
-	fi
-	if test ! -f $IPPSAMPLESLIB/libusc.a; then
-	    AC_MSG_FAILURE([libusc.a doesn't exist in $IPPSAMPLESLIB])
-	fi
-	AC_MSG_RESULT([$IPPSAMPLESLIB])
+	if test -d $IPPSAMPLES/speech-codecs/bin; then
+	    IPPVER=5 
+	    IPPSAMP_DIR=`ls -d $IPPSAMPLES/speech-codecs/bin/*gcc*/lib | head -1`
+	elif test -d $IPPSAMPLES/speech-codecs/_bin; then
+	    IPPVER=6
+	    IPPSAMP_DIR=`ls -d $IPPSAMPLES/speech-codecs/_bin/*gcc*/lib | head -1`
+	else
+	    AC_MSG_FAILURE([unable to find $IPPSAMPLES/speech-codecs/bin/*gcc*/lib or $IPPSAMPLES/speech-codecs/_bin/*gcc*/lib directory. Have you built the samples?])
+	fi
+
+	# Test the directory
+	if test ! -d $IPPSAMP_DIR; then
+	    AC_MSG_FAILURE([There's something wrong with this script, directory $IPPSAMP_DIR does not exist])
+	    exit 1;
+	fi
+
+    	if test "x$IPPVER" = "x5"; then
+	    IPPSAMP_LIBS="libusc.a"
+	    IPPSAMP_LDLIBS="-lusc"
+	elif test "x$IPPVER" = "x6"; then
+	    IPPSAMP_LIBS="libspeech.a"
+	    IPPSAMP_LDLIBS="-lspeech"
+	else
+	    AC_MSG_FAILURE([bug in this script: unsupported IPP version])
+	fi
+
+	if test ! -f $IPPSAMP_DIR/$IPPSAMP_LIBS; then
+	    AC_MSG_FAILURE([$IPPSAMP_LIBS doesn't exist in $IPPSAMP_DIR])
+	fi
+
+	AC_MSG_RESULT([$IPPSAMP_DIR])
 
 	SAVED_CFLAGS="$CFLAGS"
@@ -780,8 +818,8 @@
 	SAVED_LIBS="$LIBS"
 
-	IPPSAMPLESINC="-I$IPPSAMPLES/speech-codecs/core/usc/include"
-	CFLAGS="$CFLAGS $IPPSAMPLESINC"
-	LDFLAGS="$LDFLAGS -L$IPPSAMPLESLIB"
-	LIBS="-lusc $LIBS"
+	IPPSAMP_INC="-I$IPPSAMPLES/speech-codecs/core/usc/include"
+	CFLAGS="$CFLAGS $IPPSAMP_INC"
+	LDFLAGS="$LDFLAGS -L$IPPSAMP_DIR"
+	LIBS="$IPPSAMP_LDLIBS $LIBS"
 
 	AC_MSG_CHECKING([Intel IPP USC usability])
@@ -793,11 +831,15 @@
 
 	CFLAGS="$SAVED_CFLAGS"
-	LDFLAGS="\$(IPP_LDFLAGS) $SAVED_LDFLAGS"
-	LIBS="\$(IPP_LIBS) $SAVED_LIBS"
-
-	IPP_CFLAGS="$IPP_CFLAGS $IPPSAMPLESINC"
-	IPP_LDFLAGS="$IPP_LDFLAGS -L$IPPSAMPLESLIB"
-	IPP_LIBS="-lusc $IPP_LIBS"
+	LDFLAGS="$IPP_LDFLAGS $SAVED_LDFLAGS"
+	LIBS="$IPP_LIBS $SAVED_LIBS"
+
+	IPP_CFLAGS="$IPP_CFLAGS $IPPSAMP_INC"
+	IPP_LDFLAGS="$IPP_LDFLAGS -L$IPPSAMP_DIR"
+	IPP_LIBS="$IPPSAMP_LDLIBS $IPP_LIBS"
     fi
+
+    CFLAGS="$CFLAGS $IPP_CFLAGS"
+    LDFLAGS="$LDFLAGS $IPP_LDFLAGS"
+    LIBS="$LIBS $IPP_LIBS"
 
     ac_build_mak_vars="$ac_build_mak_vars\n\
