Index: pjproject/trunk/aconfigure.ac
===================================================================
--- pjproject/trunk/aconfigure.ac	(revision 2190)
+++ pjproject/trunk/aconfigure.ac	(revision 2232)
@@ -1,3 +1,3 @@
-AC_INIT(pjproject,0.8)
+AC_INIT(pjproject,1.0)
 
 host_orig="$host"
@@ -39,4 +39,5 @@
 
 AC_SUBST(ac_pjdir)
+AC_SUBST(ac_build_mak_vars)
 case $target in 
     *mingw* | *cygw* | *win32* | *w32* )
@@ -545,4 +546,156 @@
 
 
+dnl ########################################################
+dnl # Intel IPP support
+dnl #
+AC_ARG_ENABLE(ipp,
+    AC_HELP_STRING([--enable-ipp],
+		   [Enable Intel IPP support. Specify the Intel IPP package and samples location using IPPROOT and IPPSAMPLES env var or with --with-ipp and --with-ipp-samples options]),
+    [],
+    [enable_ipp=no]
+    )
+
+AC_ARG_ENABLE(ipp,
+    AC_HELP_STRING([--with-ipp=DIR],
+		   [Specify the Intel IPP location]),
+    [],
+    [with_ipp=no]
+    )
+
+AC_ARG_ENABLE(ipp-samples,
+    AC_HELP_STRING([--with-ipp-samples=DIR],
+		   [Specify the Intel IPP samples location]),
+    [],
+    [with_ipp_samples=no]
+    )
+
+if test "x$enable_ipp" != "xno"; then
+    dnl # 
+    dnl # Verifying Intel IPP path
+    dnl #
+    AC_MSG_CHECKING([Intel IPP location])
+
+    if test "x$with_ipp" != "xno" -a "x$with_ipp" != "x"; then
+	AC_MSG_RESULT([$with_ipp])
+	IPPROOT=$with_ipp
+    elif test "x$IPPROOT" = "x"; then
+	if test -d /opt/intel/ipp; then
+	    IPPROOT=`ls -d /opt/intel/ipp/*/* | head -1`
+	    AC_MSG_RESULT([autodetected in $IPPROOT])
+	fi
+    else
+	AC_MSG_RESULT([$IPPROOT])
+    fi
+
+    if test x$IPPROOT = x; then
+	AC_MSG_ERROR([the location is neither specified nor can be guessed. Please specify with IPPROOT env var or with --with-ipp option])
+    elif test ! -d $IPPROOT; then
+	AC_MSG_ERROR([not found])
+    elif test ! -d $IPPROOT/include; then
+	AC_MSG_ERROR([directory doesn't seem to be valid])
+    else
+	# IPP directory looks okay.
+	# Remove trailing backslash
+	IPPROOT=`echo $IPPROOT/ | sed 's/\/$//'`
+
+	SAVED_CFLAGS="$CFLAGS"
+	SAVED_LDFLAGS="$LDFLAGS"
+	SAVED_LIBS="$LIBS"
+
+	IPP_CFLAGS="-I$IPPROOT/include"
+	IPP_LDFLAGS="-L$IPPROOT/sharedlib"
+	IPP_LIBS="-lippsc -lipps -lippsr -lippcore -lguide"
+	#IPP_LDFLAGS="-L$IPPROOT/sharedlib"
+	#IPP_LIBS="-lippscmerged -lippsrmerged -lippsmerged -lippcore"
+
+	CFLAGS="$CFLAGS $IPP_CFLAGS"
+	LDFLAGS="$LDFLAGS $IPP_LDFLAGS"
+	LIBS="$IPP_LIBS $LIBS"
+
+
+	AC_MSG_CHECKING([Intel IPP usability])
+	AC_LINK_IFELSE([AC_LANG_PROGRAM([[#include <ippcore.h>
+					   ]],
+					   [ippStaticInit();])],
+		  [AC_MSG_RESULT(ok)],
+		  [AC_MSG_FAILURE(failed)])
+
+	CFLAGS="$SAVED_CFLAGS"
+	LDFLAGS="$SAVED_LDFLAGS"
+	LIBS="$SAVED_LIBS"
+    fi
+
+    dnl # 
+    dnl # Verifying Intel IPP samples path
+    dnl #
+    AC_MSG_CHECKING([Intel IPP samples location])
+
+    if test "x$with_ipp_samples" != "xno" -a "x$with_ipp_samples" != "x"; then
+	AC_MSG_RESULT([$with_ipp_samples])
+	IPPSAMPLES=$with_ipp_samples
+    elif test "x$IPPSAMPLES" = "x"; then
+	if test -d /opt/intel/ipp-samples; then
+	    IPPSAMPLES=/opt/intel/ipp-samples
+	    AC_MSG_RESULT([autodetected in $IPPSAMPLES])
+	fi
+    else
+	AC_MSG_RESULT([$IPPSAMPLES])
+    fi
+
+    if test x$IPPSAMPLES = x; then
+	AC_MSG_ERROR([the location is neither specified nor can be guessed. Please specify with IPPSAMPLES env var or with --with-ipp-samples option])
+    elif test ! -d $IPPSAMPLES; then
+	AC_MSG_ERROR([not found])
+    elif test ! -d $IPPSAMPLES/speech-codecs; then
+	AC_MSG_ERROR([directory doesn't seem to be valid])
+    else
+	# Remove trailing backslash
+	IPPSAMPLES=`echo $IPPSAMPLES | sed 's/\/$//'`
+
+	# Guess the libusc.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])
+
+	SAVED_CFLAGS="$CFLAGS"
+	SAVED_LDFLAGS="$LDFLAGS"
+	SAVED_LIBS="$LIBS"
+
+	IPPSAMPLESINC="-I$IPPSAMPLES/speech-codecs/core/usc/include"
+	CFLAGS="$CFLAGS $IPPSAMPLESINC"
+	LDFLAGS="$LDFLAGS -L$IPPSAMPLESLIB"
+	LIBS="-lusc $LIBS"
+
+	AC_MSG_CHECKING([Intel IPP USC usability])
+	AC_LINK_IFELSE([AC_LANG_PROGRAM([[#include <usc.h>
+					   ]],
+					   [extern USC_Fxns USC_G729AFP_Fxns;])],
+		  [AC_MSG_RESULT(ok)],
+		  [AC_MSG_FAILURE(failed)])
+
+	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"
+    fi
+
+    ac_build_mak_vars="$ac_build_mak_vars\n\
+export IPP_CFLAGS=$IPP_CFLAGS\n\
+export IPP_LDFLAGS=$IPP_LDFLAGS\n\
+export IPP_LIBS=$IPP_LIBS"
+else
+    AC_MSG_RESULT([Skipping Intel IPP settings (not wanted)])
+fi
+
+
 dnl ##########################################
 dnl #
@@ -666,4 +819,6 @@
 esac
 AC_SUBST(CC)
+
+ac_build_mak_vars=`echo $ac_build_mak_vars | sed 's/\\\\n/\n/g'`
 AC_OUTPUT()
 
