]> git.ipfire.org Git - thirdparty/asterisk.git/commitdiff
Handle non-standard OpenH323/PWLib library names
authorPaul Cadach <paul@odt.east.telecom.kz>
Tue, 30 Jan 2007 08:33:22 +0000 (08:33 +0000)
committerPaul Cadach <paul@odt.east.telecom.kz>
Tue, 30 Jan 2007 08:33:22 +0000 (08:33 +0000)
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@52807 65c4cc65-6c06-0410-ace0-fbb531ad65f3

acinclude.m4
configure

index 1800cc69c6fedd7bebedba189286b2f385c3c782..5c6d8126ada3117027f9d3b0099487cb2fd4d1e4 100644 (file)
@@ -146,21 +146,31 @@ if test "${HAS_PWLIB:-unset}" = "unset" ; then
           AC_PATH_PROG(PTLIB_CONFIG, ptlib-config, , /usr/local/share/pwlib/make)
         fi
         PWLIB_INCDIR="/usr/local/include"
-        if test "x$LIB64" != "x"; then
-          PWLIB_LIBDIR="/usr/local/lib64"
-        else
-          PWLIB_LIBDIR="/usr/local/lib"
+        PWLIB_LIBDIR=`${PTLIB_CONFIG} --pwlibdir`
+        if test "${PWLIB_LIBDIR:-unset}" = "unset"; then
+          if test "x$LIB64" != "x"; then
+            PWLIB_LIBDIR="/usr/local/lib64"
+          else
+            PWLIB_LIBDIR="/usr/local/lib"
+          fi
         fi
+        PWLIB_LIB=`${PTLIB_CONFIG} --ldflags --libs`
+        PWLIB_LIB="-L${PWLIB_LIBDIR} `echo ${PWLIB_LIB}`"
       else
         AC_CHECK_FILE(/usr/include/ptlib.h, HAS_PWLIB=1, )
         if test "${HAS_PWLIB:-unset}" != "unset" ; then
           AC_PATH_PROG(PTLIB_CONFIG, ptlib-config, , /usr/share/pwlib/make)
           PWLIB_INCDIR="/usr/include"
-          if test "x$LIB64" != "x"; then
-            PWLIB_LIBDIR="/usr/lib64"
-          else
-            PWLIB_LIBDIR="/usr/lib"
+          PWLIB_LIBDIR=`${PTLIB_CONFIG} --pwlibdir`
+          if test "${PWLIB_LIBDIR:-unset}" = "unset"; then
+            if test "x$LIB64" != "x"; then
+              PWLIB_LIBDIR="/usr/lib64"
+            else
+              PWLIB_LIBDIR="/usr/lib"
+            fi
           fi
+          PWLIB_LIB=`${PTLIB_CONFIG} --ldflags --libs`
+          PWLIB_LIB="-L${PWLIB_LIBDIR} `echo ${PWLIB_LIB}`"
         fi
       fi
     fi
@@ -352,6 +362,10 @@ if test "${HAS_OPENH323:-unset}" != "unset" ; then
     OPENH323_LIBDIR="${OPENH323DIR}/lib"
   fi
 
+  OPENH323_LIBDIR="`cd ${OPENH323_LIBDIR}; pwd`"
+  OPENH323_INCDIR="`cd ${OPENH323_INCDIR}; pwd`"
+  OPENH323DIR="`cd ${OPENH323DIR}; pwd`"
+
   AC_SUBST([OPENH323DIR])
   AC_SUBST([OPENH323_INCDIR])
   AC_SUBST([OPENH323_LIBDIR])
@@ -387,7 +401,11 @@ AC_DEFUN(
 
           saved_cppflags="${CPPFLAGS}"
           saved_libs="${LIBS}"
-          LIBS="${LIBS} -L${$2_LIBDIR} -l${PLATFORM_$2} $7"
+          if test "${$2_LIB:-unset}" != "unset"; then
+             LIBS="${LIBS} ${$2_LIB} $7"
+          else
+             LIBS="${LIBS} -L${$2_LIBDIR} -l${PLATFORM_$2} $7"
+          fi
           CPPFLAGS="${CPPFLAGS} -I${$2_INCDIR} $6"
 
           AC_LANG_PUSH([C++])
@@ -408,10 +426,12 @@ AC_DEFUN(
           CPPFLAGS="${saved_cppflags}"
 
           if test "${ac_cv_lib_$2}" = "yes"; then
-             if test "${$2_LIBDIR}" != "" -a "${$2_LIBDIR}" != "/usr/lib"; then
-                $2_LIB="-L${$2_LIBDIR} -l${PLATFORM_$2}"
-             else
-                $2_LIB="-l${PLATFORM_$2}"
+             if test "${$2_LIB:-undef}" = "undef"; then
+                if test "${$2_LIBDIR}" != "" -a "${$2_LIBDIR}" != "/usr/lib"; then
+                   $2_LIB="-L${$2_LIBDIR} -l${PLATFORM_$2}"
+                else
+                   $2_LIB="-l${PLATFORM_$2}"
+                fi
              fi
              if test "${$2_INCDIR}" != "" -a "${$2_INCDIR}" != "/usr/include"; then
                 $2_INCLUDE="-I${$2_INCDIR}"
@@ -427,18 +447,25 @@ AC_DEFUN(
        if test "${HAS_OPENH323:-unset}" != "unset"; then
                AC_MSG_CHECKING(OpenH323 build option)
                OPENH323_SUFFIX=
-               files=`ls -l ${OPENH323_LIBDIR}/libh323_${PWLIB_PLATFORM}_*.so*`
-               libfile=
-               if test -n "$files"; then
-                       for f in $files; do
-                               if test -f $f -a ! -L $f; then
-                                       libfile=`basename $f`
-                                       break;
-                               fi
-                       done
-               fi
+               prefixes="h323_${PWLIB_PLATFORM}_ h323_ openh323"
+               for pfx in $prefixes; do
+                       files=`ls -l ${OPENH323_LIBDIR}/lib${pfx}*.so* 2>/dev/null`
+                       libfile=
+                       if test -n "$files"; then
+                               for f in $files; do
+                                       if test -f $f -a ! -L $f; then
+                                               libfile=`basename $f`
+                                               break;
+                                       fi
+                               done
+                       fi
+                       if test -n "$libfile"; then
+                               OPENH323_PREFIX=$pfx
+                               break;
+                       fi
+               done
                if test "${libfile:-unset}" != "unset"; then
-                       OPENH323_SUFFIX=`eval "echo ${libfile} | sed -e 's/libh323_${PWLIB_PLATFORM}_\(@<:@^.@:>@*\)\..*/\1/'"`
+                       OPENH323_SUFFIX=`eval "echo ${libfile} | sed -e 's/lib${OPENH323_PREFIX}\(@<:@^.@:>@*\)\..*/\1/'"`
                fi
                case "${OPENH323_SUFFIX}" in
                        n)
@@ -448,7 +475,21 @@ AC_DEFUN(
                        d)
                                OPENH323_BUILD="debug";;
                        *)
-                               OPENH323_BUILD="notrace";;
+                               if test "${OPENH323_PREFIX:-undef}" = "openh323"; then
+                                       notrace=`eval "grep NOTRACE ${OPENH323DIR}/openh323u.mak | grep = | sed -e 's/@<:@A-Z0-9_@:>@*@<:@      @:>@*=@<:@      @:>@*//'"`
+                                       if test "x$notrace" = "x"; then
+                                               notrace="0"
+                                       fi
+                                       if test "$notrace" -ne 0; then
+                                               OPENH323_BUILD="notrace"
+                                       else
+                                               OPENH323_BUILD="opt"
+                                       fi
+                                       OPENH323_LIB="-l${OPENH323_PREFIX}"
+                               else
+                                       OPENH323_BUILD="notrace"
+                               fi
+                               ;;
                esac
                AC_MSG_RESULT(${OPENH323_BUILD})
 
index d305f5d131029b0a4b15b142a7b89d314a45592d..292666537a9749e7bbfa39e62417fbfe82b75dbd 100755 (executable)
--- a/configure
+++ b/configure
 
         fi
         PWLIB_INCDIR="/usr/local/include"
-        if test "x$LIB64" != "x"; then
-          PWLIB_LIBDIR="/usr/local/lib64"
-        else
-          PWLIB_LIBDIR="/usr/local/lib"
+        PWLIB_LIBDIR=`${PTLIB_CONFIG} --pwlibdir`
+        if test "${PWLIB_LIBDIR:-unset}" = "unset"; then
+          if test "x$LIB64" != "x"; then
+            PWLIB_LIBDIR="/usr/local/lib64"
+          else
+            PWLIB_LIBDIR="/usr/local/lib"
+          fi
         fi
+        PWLIB_LIB=`${PTLIB_CONFIG} --ldflags --libs`
+        PWLIB_LIB="-L${PWLIB_LIBDIR} `echo ${PWLIB_LIB}`"
       else
         { echo "$as_me:$LINENO: checking for /usr/include/ptlib.h" >&5
 echo $ECHO_N "checking for /usr/include/ptlib.h... $ECHO_C" >&6; }
 
 
           PWLIB_INCDIR="/usr/include"
-          if test "x$LIB64" != "x"; then
-            PWLIB_LIBDIR="/usr/lib64"
-          else
-            PWLIB_LIBDIR="/usr/lib"
+          PWLIB_LIBDIR=`${PTLIB_CONFIG} --pwlibdir`
+          if test "${PWLIB_LIBDIR:-unset}" = "unset"; then
+            if test "x$LIB64" != "x"; then
+              PWLIB_LIBDIR="/usr/lib64"
+            else
+              PWLIB_LIBDIR="/usr/lib"
+            fi
           fi
+          PWLIB_LIB=`${PTLIB_CONFIG} --ldflags --libs`
+          PWLIB_LIB="-L${PWLIB_LIBDIR} `echo ${PWLIB_LIB}`"
         fi
       fi
     fi
@@ -24120,7 +24130,11 @@ echo $ECHO_N "checking PWLib installation validity... $ECHO_C" >&6; }
 
           saved_cppflags="${CPPFLAGS}"
           saved_libs="${LIBS}"
-          LIBS="${LIBS} -L${PWLIB_LIBDIR} -l${PLATFORM_PWLIB} "
+          if test "${PWLIB_LIB:-unset}" != "unset"; then
+             LIBS="${LIBS} ${PWLIB_LIB} "
+          else
+             LIBS="${LIBS} -L${PWLIB_LIBDIR} -l${PLATFORM_PWLIB} "
+          fi
           CPPFLAGS="${CPPFLAGS} -I${PWLIB_INCDIR} "
 
           ac_ext=cpp
@@ -24192,10 +24206,12 @@ ac_compiler_gnu=$ac_cv_c_compiler_gnu
           CPPFLAGS="${saved_cppflags}"
 
           if test "${ac_cv_lib_PWLIB}" = "yes"; then
-             if test "${PWLIB_LIBDIR}" != "" -a "${PWLIB_LIBDIR}" != "/usr/lib"; then
-                PWLIB_LIB="-L${PWLIB_LIBDIR} -l${PLATFORM_PWLIB}"
-             else
-                PWLIB_LIB="-l${PLATFORM_PWLIB}"
+             if test "${PWLIB_LIB:-undef}" = "undef"; then
+                if test "${PWLIB_LIBDIR}" != "" -a "${PWLIB_LIBDIR}" != "/usr/lib"; then
+                   PWLIB_LIB="-L${PWLIB_LIBDIR} -l${PLATFORM_PWLIB}"
+                else
+                   PWLIB_LIB="-l${PLATFORM_PWLIB}"
+                fi
              fi
              if test "${PWLIB_INCDIR}" != "" -a "${PWLIB_INCDIR}" != "/usr/include"; then
                 PWLIB_INCLUDE="-I${PWLIB_INCDIR}"
@@ -24407,6 +24423,10 @@ if test "${HAS_OPENH323:-unset}" != "unset" ; then
     OPENH323_LIBDIR="${OPENH323DIR}/lib"
   fi
 
+  OPENH323_LIBDIR="`cd ${OPENH323_LIBDIR}; pwd`"
+  OPENH323_INCDIR="`cd ${OPENH323_INCDIR}; pwd`"
+  OPENH323DIR="`cd ${OPENH323DIR}; pwd`"
+
 
 
 
@@ -24438,18 +24458,25 @@ echo "${ECHO_T}yes" >&6; }
                { echo "$as_me:$LINENO: checking OpenH323 build option" >&5
 echo $ECHO_N "checking OpenH323 build option... $ECHO_C" >&6; }
                OPENH323_SUFFIX=
-               files=`ls -l ${OPENH323_LIBDIR}/libh323_${PWLIB_PLATFORM}_*.so*`
-               libfile=
-               if test -n "$files"; then
-                       for f in $files; do
-                               if test -f $f -a ! -L $f; then
-                                       libfile=`basename $f`
-                                       break;
-                               fi
-                       done
-               fi
+               prefixes="h323_${PWLIB_PLATFORM}_ h323_ openh323"
+               for pfx in $prefixes; do
+                       files=`ls -l ${OPENH323_LIBDIR}/lib${pfx}*.so* 2>/dev/null`
+                       libfile=
+                       if test -n "$files"; then
+                               for f in $files; do
+                                       if test -f $f -a ! -L $f; then
+                                               libfile=`basename $f`
+                                               break;
+                                       fi
+                               done
+                       fi
+                       if test -n "$libfile"; then
+                               OPENH323_PREFIX=$pfx
+                               break;
+                       fi
+               done
                if test "${libfile:-unset}" != "unset"; then
-                       OPENH323_SUFFIX=`eval "echo ${libfile} | sed -e 's/libh323_${PWLIB_PLATFORM}_\([^.]*\)\..*/\1/'"`
+                       OPENH323_SUFFIX=`eval "echo ${libfile} | sed -e 's/lib${OPENH323_PREFIX}\([^.]*\)\..*/\1/'"`
                fi
                case "${OPENH323_SUFFIX}" in
                        n)
@@ -24459,7 +24486,21 @@ echo $ECHO_N "checking OpenH323 build option... $ECHO_C" >&6; }
                        d)
                                OPENH323_BUILD="debug";;
                        *)
-                               OPENH323_BUILD="notrace";;
+                               if test "${OPENH323_PREFIX:-undef}" = "openh323"; then
+                                       notrace=`eval "grep NOTRACE ${OPENH323DIR}/openh323u.mak | grep = | sed -e 's/[A-Z0-9_]*[       ]*=[    ]*//'"`
+                                       if test "x$notrace" = "x"; then
+                                               notrace="0"
+                                       fi
+                                       if test "$notrace" -ne 0; then
+                                               OPENH323_BUILD="notrace"
+                                       else
+                                               OPENH323_BUILD="opt"
+                                       fi
+                                       OPENH323_LIB="-l${OPENH323_PREFIX}"
+                               else
+                                       OPENH323_BUILD="notrace"
+                               fi
+                               ;;
                esac
                { echo "$as_me:$LINENO: result: ${OPENH323_BUILD}" >&5
 echo "${ECHO_T}${OPENH323_BUILD}" >&6; }
@@ -24476,7 +24517,11 @@ echo $ECHO_N "checking OpenH323 installation validity... $ECHO_C" >&6; }
 
           saved_cppflags="${CPPFLAGS}"
           saved_libs="${LIBS}"
-          LIBS="${LIBS} -L${OPENH323_LIBDIR} -l${PLATFORM_OPENH323} ${PWLIB_LIB}"
+          if test "${OPENH323_LIB:-unset}" != "unset"; then
+             LIBS="${LIBS} ${OPENH323_LIB} ${PWLIB_LIB}"
+          else
+             LIBS="${LIBS} -L${OPENH323_LIBDIR} -l${PLATFORM_OPENH323} ${PWLIB_LIB}"
+          fi
           CPPFLAGS="${CPPFLAGS} -I${OPENH323_INCDIR} ${PWLIB_INCLUDE}"
 
           ac_ext=cpp
@@ -24550,10 +24595,12 @@ ac_compiler_gnu=$ac_cv_c_compiler_gnu
           CPPFLAGS="${saved_cppflags}"
 
           if test "${ac_cv_lib_OPENH323}" = "yes"; then
-             if test "${OPENH323_LIBDIR}" != "" -a "${OPENH323_LIBDIR}" != "/usr/lib"; then
-                OPENH323_LIB="-L${OPENH323_LIBDIR} -l${PLATFORM_OPENH323}"
-             else
-                OPENH323_LIB="-l${PLATFORM_OPENH323}"
+             if test "${OPENH323_LIB:-undef}" = "undef"; then
+                if test "${OPENH323_LIBDIR}" != "" -a "${OPENH323_LIBDIR}" != "/usr/lib"; then
+                   OPENH323_LIB="-L${OPENH323_LIBDIR} -l${PLATFORM_OPENH323}"
+                else
+                   OPENH323_LIB="-l${PLATFORM_OPENH323}"
+                fi
              fi
              if test "${OPENH323_INCDIR}" != "" -a "${OPENH323_INCDIR}" != "/usr/include"; then
                 OPENH323_INCLUDE="-I${OPENH323_INCDIR}"