summaryrefslogtreecommitdiff
path: root/aconfigure.ac
diff options
context:
space:
mode:
authorBenny Prijono <bennylp@teluu.com>2008-08-21 20:59:58 +0000
committerBenny Prijono <bennylp@teluu.com>2008-08-21 20:59:58 +0000
commitedb66e2fd22c9ed3cfd2161924e159f84ada758b (patch)
tree61666c495ba28e26f0b1127a523f7f8b4f0860c6 /aconfigure.ac
parentf88c166abb7eb1bac53fda07157ea357c7eca1a0 (diff)
More ticket #583: autoconf support for Intel IPP
git-svn-id: http://svn.pjsip.org/repos/pjproject/trunk@2232 74dad513-b988-da41-8d7b-12977e46ad98
Diffstat (limited to 'aconfigure.ac')
-rw-r--r--aconfigure.ac157
1 files changed, 156 insertions, 1 deletions
diff --git a/aconfigure.ac b/aconfigure.ac
index c53f8628..85e06f20 100644
--- a/aconfigure.ac
+++ b/aconfigure.ac
@@ -1,4 +1,4 @@
-AC_INIT(pjproject,0.8)
+AC_INIT(pjproject,1.0)
host_orig="$host"
@@ -38,6 +38,7 @@ AC_PROG_CXX
AC_LANG_C
AC_SUBST(ac_pjdir)
+AC_SUBST(ac_build_mak_vars)
case $target in
*mingw* | *cygw* | *win32* | *w32* )
ac_pjdir=`pwd -W`
@@ -544,6 +545,158 @@ AC_ARG_ENABLE(libsamplerate,
)
+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 #
dnl # PJSIP CONFIG
@@ -665,6 +818,8 @@ case $target in
;;
esac
AC_SUBST(CC)
+
+ac_build_mak_vars=`echo $ac_build_mak_vars | sed 's/\\\\n/\n/g'`
AC_OUTPUT()