[Opalvoip-svn] SF.net SVN: opalvoip:[20770] ptlib/trunk
Brought to you by:
csoutheren,
rjongbloed
From: <ms3...@us...> - 2008-08-30 08:03:27
|
Revision: 20770 http://opalvoip.svn.sourceforge.net/opalvoip/?rev=20770&view=rev Author: ms30002000 Date: 2008-08-30 08:03:35 +0000 (Sat, 30 Aug 2008) Log Message: ----------- Add three more functions to ptlib.m4 to find sasl, expat and openldap. Do not use them yet. Modified Paths: -------------- ptlib/trunk/configure ptlib/trunk/ptlib.m4 Modified: ptlib/trunk/configure =================================================================== --- ptlib/trunk/configure 2008-08-30 00:00:24 UTC (rev 20769) +++ ptlib/trunk/configure 2008-08-30 08:03:35 UTC (rev 20770) @@ -662,6 +662,7 @@ CXX CXXFLAGS ac_ct_CXX +HAS_EXPAT PTLIBDIR PTINSTDIR INSTALLPREFIX @@ -709,7 +710,6 @@ HAS_OPENSSL P_STATIC_ENDLDLIBS P_STATIC_LDFLAGS -HAS_EXPAT HAS_IPV6 SDL_CFLAGS SDL_LIBS @@ -3323,6 +3323,12 @@ + + + + + + PTLIBDIR=`pwd` @@ -15458,6 +15464,7 @@ CXX!$CXX$ac_delim CXXFLAGS!$CXXFLAGS$ac_delim ac_ct_CXX!$ac_ct_CXX$ac_delim +HAS_EXPAT!$HAS_EXPAT$ac_delim PTLIBDIR!$PTLIBDIR$ac_delim PTINSTDIR!$PTINSTDIR$ac_delim INSTALLPREFIX!$INSTALLPREFIX$ac_delim @@ -15505,7 +15512,6 @@ HAS_OPENSSL!$HAS_OPENSSL$ac_delim P_STATIC_ENDLDLIBS!$P_STATIC_ENDLDLIBS$ac_delim P_STATIC_LDFLAGS!$P_STATIC_LDFLAGS$ac_delim -HAS_EXPAT!$HAS_EXPAT$ac_delim _ACEOF if test `sed -n "s/.*$ac_delim\$/X/p" conf$$subs.sed | grep -c X` = 97; then Modified: ptlib/trunk/ptlib.m4 =================================================================== --- ptlib/trunk/ptlib.m4 2008-08-30 00:00:24 UTC (rev 20769) +++ ptlib/trunk/ptlib.m4 2008-08-30 08:03:35 UTC (rev 20770) @@ -329,3 +329,133 @@ AC_MSG_RESULT(${ptlib_fdsize}) ]) +dnl PTLIB_CHECK_SASL_INCLUDE +dnl Try to find a library containing dlopen() +dnl Arguments: $1 action if-found +dnl $2 action if-not-found +dnl Return: $DL_LIBS The libs for dlopen() +AC_DEFUN([PTLIB_CHECK_SASL_INCLUDE], + [ + ptlib_sasl=no + AC_MSG_CHECKING([if <sasl.h> works]) + AC_COMPILE_IFELSE([[ + #include <sasl.h> + int main(int argc,char **argv) + { int v = SASL_LOG_PASS; } + ]], + [ + AC_MSG_RESULT(yes) + ptlib_sasl=yes + SASL_HEADER= + ], + [ + AC_MSG_RESULT(no) + ]) + + if test "x${HAS_INCLUDE_SASL_H}" != "xyes" ; then + AC_MSG_CHECKING([if <sasl/sasl.h> works]) + AC_COMPILE_IFELSE([[ + #include <sasl/sasl.h> + int main(int argc,char **argv){ int v = SASL_LOG_PASS; } + ]], + [ + AC_MSG_RESULT(yes) + ptlib_sasl=yes + SASL_HEADER=sasl + ], + [ + AC_MSG_RESULT(no) + ]) + fi + AS_IF([test AS_VAR_GET([ptlib_sasl]) = yes], [$1], [$2])[] + ]) + +dnl PTLIB_FIND_OPENLDAP +dnl Find OpenLDAP +dnl Arguments: $STDCCFLAGS +dnl Return: $STDCCFLAGS +AC_DEFUN([PTLIB_FIND_OPENLDAP], + [ + AC_ARG_WITH([ldap-dir], + AS_HELP_STRING([--with-ldap-dir=PFX],[Location of LDAP]), + [with_ldap_dir="$withval"]) + + ptlib_openldap=yes + if test "x${HAS_RESOLVER}" != "x1"; then + AC_MSG_NOTICE([OpenLDAP support disabled due to disabled dependency HAS_RESOLVER]) + ptlib_openldap=no + fi + + if test "x${ptlib_openldap}" = "xyes"; then + case "$target_os" in + solaris* | sunos* ) + dnl posix4 is required by libldap_r on Solaris + ptlib_openldap_libs="-lposix4" + ;; + * ) + ptlib_openldap_libs="-llber -lldap_r" + esac + + if test "x${with_ldap_dir}" != "x"; then + ptlib_openldap_libs="${ptlib_openldap_libs} -L${with_ldap_dir}/lib" + ptlib_openldap_cflags="${ptlib_openldap_cflags} -I${with_ldap_dir}/include" + fi + + old_LIBS="$LIBS" + old_CFLAGS="$CFLAGS" + LIBS="$LIBS ${ptlib_openldap_libs} $RESOLVER_LIBS" + CFLAGS="$CFLAGS ${ptlib_openldap_cflags}" + + AC_CHECK_HEADERS([ldap.h], [ptlib_openldap=yes], [ptlib_openldap=no]) + if test "x${ptlib_openldap}" = "xyes" ; then + AC_CHECK_LIB([ldap], [ldap_open], [ptlib_openldap=yes], [ptlib_openldap=no]) + fi + + LIBS="$old_LIBS" + CFLAGS="$old_CFLAGS" + + if test "x${ptlib_openldap}" = "xyes" ; then + OPENLDAP_LIBS="-lldap ${ptlib_openldap_libs}" + OPENLDAP_CFLAGS="${ptlib_openldap_cflags}" + fi + fi + AS_IF([test AS_VAR_GET([ptlib_openldap]) = yes], [$1], [$2])[] + ]) + +AC_SUBST(HAS_EXPAT) +dnl PTLIB_FIND_EXPAT +dnl Find OpenLDAP +dnl Arguments: $STDCCFLAGS +dnl Return: $STDCCFLAGS +AC_DEFUN([PTLIB_FIND_EXPAT], + [ + AC_ARG_WITH([expat-dir], + AS_HELP_STRING([--with-expat-dir=PFX],[Location of expat XML parser]), + [with_expat_dir="$withval"]) + + ptlib_expat=no + + if test "x${with_expat_dir}" != "x"; then + ptlib_expat_cflags="-I${with_expat_dir}/include" + ptlib_expat_libs="-L${with_expat_dir}/lib" + fi + + old_LIBS="$LIBS" + old_CFLAGS="$CFLAGS" + LIBS="$LIBS ${ptlib_expat_libs}" + CFLAGS="$CFLAGS ${ptlib_expat_cflags}" + + AC_CHECK_HEADERS([expat.h], [ptlib_expat=yes]) + if test "x${ptlib_expat}" = "xyes" ; then + AC_CHECK_LIB([expat], [XML_ParserCreate], [ptlib_expat=yes], [ptlib_expat=no]) + fi + + LIBS="$old_LIBS" + CFLAGS="$old_CFLAGS" + + if test "x${ptlib_expat}" = "xyes" ; then + EXPAT_LIBS="-lexpat ${ptlib_expat_libs}" + EXPAT_CFLAGS="${ptlib_expat_cflags}" + fi + AS_IF([test AS_VAR_GET([ptlib_expat]) = yes], [$1], [$2])[] + ]) This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |