[Opalvoip-svn] SF.net SVN: opalvoip:[20810] ptlib/trunk
Brought to you by:
csoutheren,
rjongbloed
From: <ms3...@us...> - 2008-09-01 17:12:05
|
Revision: 20810 http://opalvoip.svn.sourceforge.net/opalvoip/?rev=20810&view=rev Author: ms30002000 Date: 2008-09-01 17:12:15 +0000 (Mon, 01 Sep 2008) Log Message: ----------- Switch openLDAP to new configure routines. Modified Paths: -------------- ptlib/trunk/configure ptlib/trunk/configure.ac Modified: ptlib/trunk/configure =================================================================== --- ptlib/trunk/configure 2008-09-01 08:50:18 UTC (rev 20809) +++ ptlib/trunk/configure 2008-09-01 17:12:15 UTC (rev 20810) @@ -1409,6 +1409,7 @@ Optional Packages: --with-PACKAGE[=ARG] use PACKAGE [ARG=yes] --without-PACKAGE do not use PACKAGE (same as --with-PACKAGE=no) + --with-ldap-dir=PFX Location of LDAP --with-expat-dir=PFX Location of expat XML parser --with-directx-includedir=DIR Location of DirectX include files @@ -4603,9 +4604,6 @@ fi -if test ${OSTYPE} != solaris ; then - LDAP_LIBRARIES="-llber -lldap_r" -fi USE_GCC= @@ -9521,21 +9519,53 @@ # Check whether --enable-openldap was given. if test "${enable_openldap+set}" = set; then - enableval=$enable_openldap; -fi - - -if test "${enable_openldap}z" = "z" ; then + enableval=$enable_openldap; enable_openldap=$enableval +else enable_openldap=$default_openldap + fi + HAS_OPENLDAP= if test "$enable_openldap" = "no" ; then { echo "$as_me:$LINENO: OpenLDAP disabled" >&5 echo "$as_me: OpenLDAP disabled" >&6;} else - if test "${HAS_RESOLVER:-unset}" != "unset" -o "${OSTYPE}" = "mingw" ; then + +# Check whether --with-ldap-dir was given. +if test "${with_ldap_dir+set}" = set; then + withval=$with_ldap_dir; with_ldap_dir="$withval" +fi + + + ptlib_openldap=yes + if test "x${HAS_RESOLVER}" != "x1"; then + { echo "$as_me:$LINENO: OpenLDAP support disabled due to disabled dependency HAS_RESOLVER" >&5 +echo "$as_me: OpenLDAP support disabled due to disabled dependency HAS_RESOLVER" >&6;} + ptlib_openldap=no + fi + + if test "x${ptlib_openldap}" = "xyes"; then + case "$target_os" in + solaris* | sunos* ) + 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}" + + for ac_header in ldap.h do as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh` @@ -9670,24 +9700,21 @@ cat >>confdefs.h <<_ACEOF #define `echo "HAVE_$ac_header" | $as_tr_cpp` 1 _ACEOF - HAS_OPENLDAP=1 + ptlib_openldap=yes +else + ptlib_openldap=no fi done - - if test "${OSTYPE:-unknown}" = "solaris"; then - OPENLDAPSYSLIBS=-lposix4 - fi - - if test "${HAS_OPENLDAP:-unset}" != "unset" ; then - { echo "$as_me:$LINENO: checking for ldap_open in -lldap" >&5 + if test "x${ptlib_openldap}" = "xyes" ; then + { echo "$as_me:$LINENO: checking for ldap_open in -lldap" >&5 echo $ECHO_N "checking for ldap_open in -lldap... $ECHO_C" >&6; } if test "${ac_cv_lib_ldap_ldap_open+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_check_lib_save_LIBS=$LIBS -LIBS="-lldap $LDAP_LIBRARIES $RESOLVER_LIBS $ENDLDLIBS $OPENLDAPSYSLIBS $LIBS" +LIBS="-lldap $LIBS" cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF @@ -9743,121 +9770,36 @@ { echo "$as_me:$LINENO: result: $ac_cv_lib_ldap_ldap_open" >&5 echo "${ECHO_T}$ac_cv_lib_ldap_ldap_open" >&6; } if test $ac_cv_lib_ldap_ldap_open = yes; then - HAS_OPENLDAP=1 + ptlib_openldap=yes else - HAS_OPENLDAP= + ptlib_openldap=no fi - else - { echo "$as_me:$LINENO: checking for /usr/local/include/ldap.h" >&5 -echo $ECHO_N "checking for /usr/local/include/ldap.h... $ECHO_C" >&6; } -if test "${ac_cv_file__usr_local_include_ldap_h+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - test "$cross_compiling" = yes && - { { echo "$as_me:$LINENO: error: cannot check for file existence when cross compiling" >&5 -echo "$as_me: error: cannot check for file existence when cross compiling" >&2;} - { (exit 1); exit 1; }; } -if test -r "/usr/local/include/ldap.h"; then - ac_cv_file__usr_local_include_ldap_h=yes -else - ac_cv_file__usr_local_include_ldap_h=no -fi -fi -{ echo "$as_me:$LINENO: result: $ac_cv_file__usr_local_include_ldap_h" >&5 -echo "${ECHO_T}$ac_cv_file__usr_local_include_ldap_h" >&6; } -if test $ac_cv_file__usr_local_include_ldap_h = yes; then - HAS_OPENLDAP=1 -fi + fi - if test "${HAS_OPENLDAP:-unset}" != "unset" ; then - OPENLDAPINCLUDEDIR=/usr/local/include - OPENLDAPLIBDIR=/usr/local/lib - { echo "$as_me:$LINENO: checking for ldap_open in -lldap" >&5 -echo $ECHO_N "checking for ldap_open in -lldap... $ECHO_C" >&6; } -if test "${ac_cv_lib_ldap_ldap_open+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - ac_check_lib_save_LIBS=$LIBS -LIBS="-lldap -L/usr/local/lib $LDAP_LIBRARIES $RESOLVER_LIBS $ENDLDLIBS $OPENLDAPSYSLIBS $LIBS" -cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ + LIBS="$old_LIBS" + CFLAGS="$old_CFLAGS" -/* Override any GCC internal prototype to avoid an error. - Use char because int might match the return type of a GCC - builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif -char ldap_open (); -int -main () -{ -return ldap_open (); - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext conftest$ac_exeext -if { (ac_try="$ac_link" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_link") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest$ac_exeext && - $as_test_x conftest$ac_exeext; then - ac_cv_lib_ldap_ldap_open=yes -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - ac_cv_lib_ldap_ldap_open=no -fi - -rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ - conftest$ac_exeext conftest.$ac_ext -LIBS=$ac_check_lib_save_LIBS -fi -{ echo "$as_me:$LINENO: result: $ac_cv_lib_ldap_ldap_open" >&5 -echo "${ECHO_T}$ac_cv_lib_ldap_ldap_open" >&6; } -if test $ac_cv_lib_ldap_ldap_open = yes; then + if test "x${ptlib_openldap}" = "xyes" ; then + OPENLDAP_LIBS="-lldap ${ptlib_openldap_libs}" + OPENLDAP_CFLAGS="${ptlib_openldap_cflags}" + fi + fi + if test $ptlib_openldap = yes; then HAS_OPENLDAP=1 else HAS_OPENLDAP= fi - fi - fi - fi - if test "${HAS_OPENLDAP:-unset}" != "unset" ; then - HAS_OPENLDAP=1 + if test "x${HAS_OPENLDAP}" = "x1" ; then cat >>confdefs.h <<\_ACEOF #define P_LDAP 1 _ACEOF - ENDLDLIBS="-lldap $LDAP_LIBRARIES $ENDLDLIBS" - if test "${OPENLDAPINCLUDEDIR}unset" != "unset" ; then - STDCCFLAGS="$STDCCFLAGS -I${OPENLDAPINCLUDEDIR}" - fi - if test "${OPENLDAPLIBDIR}unset" != "unset" ; then - LDFLAGS="$LDFLAGS -L${OPENLDAPLIBDIR}" - fi + ENDLDLIBS="$ENDLDLIBS $OPENLDAP_LIBS" + STDCCFLAGS="$STDCCFLAGS $OPENLDAP_CFLAGS" fi fi @@ -9865,7 +9807,6 @@ - # Check whether --enable-openssl was given. if test "${enable_openssl+set}" = set; then enableval=$enable_openssl; enable_openssl=$enableval @@ -9884,10 +9825,11 @@ { echo "$as_me:$LINENO: checking for OPENSSL" >&5 echo $ECHO_N "checking for OPENSSL... $ECHO_C" >&6; } -if test -n "$OPENSSL_CFLAGS"; then - pkg_cv_OPENSSL_CFLAGS="$OPENSSL_CFLAGS" - elif test -n "$PKG_CONFIG"; then - if test -n "$PKG_CONFIG" && \ +if test -n "$PKG_CONFIG"; then + if test -n "$OPENSSL_CFLAGS"; then + pkg_cv_OPENSSL_CFLAGS="$OPENSSL_CFLAGS" + else + if test -n "$PKG_CONFIG" && \ { (echo "$as_me:$LINENO: \$PKG_CONFIG --exists --print-errors \"openssl\"") >&5 ($PKG_CONFIG --exists --print-errors "openssl") 2>&5 ac_status=$? @@ -9897,13 +9839,15 @@ else pkg_failed=yes fi - else - pkg_failed=untried + fi +else + pkg_failed=untried fi -if test -n "$OPENSSL_LIBS"; then - pkg_cv_OPENSSL_LIBS="$OPENSSL_LIBS" - elif test -n "$PKG_CONFIG"; then - if test -n "$PKG_CONFIG" && \ +if test -n "$PKG_CONFIG"; then + if test -n "$OPENSSL_LIBS"; then + pkg_cv_OPENSSL_LIBS="$OPENSSL_LIBS" + else + if test -n "$PKG_CONFIG" && \ { (echo "$as_me:$LINENO: \$PKG_CONFIG --exists --print-errors \"openssl\"") >&5 ($PKG_CONFIG --exists --print-errors "openssl") 2>&5 ac_status=$? @@ -9913,8 +9857,9 @@ else pkg_failed=yes fi - else - pkg_failed=untried + fi +else + pkg_failed=untried fi @@ -9927,9 +9872,9 @@ _pkg_short_errors_supported=no fi if test $_pkg_short_errors_supported = yes; then - OPENSSL_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors "openssl" 2>&1` + OPENSSL_PKG_ERRORS=`$PKG_CONFIG --short-errors --errors-to-stdout --print-errors "openssl"` else - OPENSSL_PKG_ERRORS=`$PKG_CONFIG --print-errors "openssl" 2>&1` + OPENSSL_PKG_ERRORS=`$PKG_CONFIG --errors-to-stdout --print-errors "openssl"` fi # Put the nasty error message in config.log where it belongs echo "$OPENSSL_PKG_ERRORS" >&5 @@ -10693,10 +10638,11 @@ { echo "$as_me:$LINENO: checking for SDL" >&5 echo $ECHO_N "checking for SDL... $ECHO_C" >&6; } -if test -n "$SDL_CFLAGS"; then - pkg_cv_SDL_CFLAGS="$SDL_CFLAGS" - elif test -n "$PKG_CONFIG"; then - if test -n "$PKG_CONFIG" && \ +if test -n "$PKG_CONFIG"; then + if test -n "$SDL_CFLAGS"; then + pkg_cv_SDL_CFLAGS="$SDL_CFLAGS" + else + if test -n "$PKG_CONFIG" && \ { (echo "$as_me:$LINENO: \$PKG_CONFIG --exists --print-errors \"sdl\"") >&5 ($PKG_CONFIG --exists --print-errors "sdl") 2>&5 ac_status=$? @@ -10706,13 +10652,15 @@ else pkg_failed=yes fi - else - pkg_failed=untried + fi +else + pkg_failed=untried fi -if test -n "$SDL_LIBS"; then - pkg_cv_SDL_LIBS="$SDL_LIBS" - elif test -n "$PKG_CONFIG"; then - if test -n "$PKG_CONFIG" && \ +if test -n "$PKG_CONFIG"; then + if test -n "$SDL_LIBS"; then + pkg_cv_SDL_LIBS="$SDL_LIBS" + else + if test -n "$PKG_CONFIG" && \ { (echo "$as_me:$LINENO: \$PKG_CONFIG --exists --print-errors \"sdl\"") >&5 ($PKG_CONFIG --exists --print-errors "sdl") 2>&5 ac_status=$? @@ -10722,8 +10670,9 @@ else pkg_failed=yes fi - else - pkg_failed=untried + fi +else + pkg_failed=untried fi @@ -10736,9 +10685,9 @@ _pkg_short_errors_supported=no fi if test $_pkg_short_errors_supported = yes; then - SDL_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors "sdl" 2>&1` + SDL_PKG_ERRORS=`$PKG_CONFIG --short-errors --errors-to-stdout --print-errors "sdl"` else - SDL_PKG_ERRORS=`$PKG_CONFIG --print-errors "sdl" 2>&1` + SDL_PKG_ERRORS=`$PKG_CONFIG --errors-to-stdout --print-errors "sdl"` fi # Put the nasty error message in config.log where it belongs echo "$SDL_PKG_ERRORS" >&5 Modified: ptlib/trunk/configure.ac =================================================================== --- ptlib/trunk/configure.ac 2008-09-01 08:50:18 UTC (rev 20809) +++ ptlib/trunk/configure.ac 2008-09-01 17:12:15 UTC (rev 20810) @@ -248,10 +248,6 @@ fi -dnl solaris has it's own ldap library -if test ${OSTYPE} != solaris ; then - LDAP_LIBRARIES="-llber -lldap_r" -fi dnl ######################################################################## dnl get the gcc version @@ -1041,54 +1037,26 @@ dnl MSWIN_CHECK_DIR openldap,\openldap\ dnl MSWIN_CHECK_DIR openldap,c:\openldap\ -AC_ARG_ENABLE(openldap, - [ --disable-openldap disable OpenLDAP support]) +AC_ARG_ENABLE([openldap], + AS_HELP_STRING([--disable-openldap],[disable OpenLDAP support]), + [enable_openldap=$enableval], + [enable_openldap=$default_openldap] + ) -if test "${enable_openldap}z" = "z" ; then - enable_openldap=$default_openldap -fi - HAS_OPENLDAP= if test "$enable_openldap" = "no" ; then AC_MSG_NOTICE(OpenLDAP disabled) else - if test "${HAS_RESOLVER:-unset}" != "unset" -o "${OSTYPE}" = "mingw" ; then - AC_CHECK_HEADERS(ldap.h, HAS_OPENLDAP=1) - - dnl posix4 is required by libldap_r on Solaris - if test "${OSTYPE:-unknown}" = "solaris"; then - OPENLDAPSYSLIBS=-lposix4 - fi - - dnl check also for lldap_r presence (required for thread safe OpenLDAP?) - if test "${HAS_OPENLDAP:-unset}" != "unset" ; then - AC_CHECK_LIB(ldap, ldap_open, HAS_OPENLDAP=1, HAS_OPENLDAP=,$LDAP_LIBRARIES $RESOLVER_LIBS $ENDLDLIBS $OPENLDAPSYSLIBS) - else - AC_CHECK_FILE(/usr/local/include/ldap.h, HAS_OPENLDAP=1) - if test "${HAS_OPENLDAP:-unset}" != "unset" ; then - OPENLDAPINCLUDEDIR=/usr/local/include - OPENLDAPLIBDIR=/usr/local/lib - AC_CHECK_LIB(ldap, ldap_open, HAS_OPENLDAP=1, HAS_OPENLDAP=,-L/usr/local/lib $LDAP_LIBRARIES $RESOLVER_LIBS $ENDLDLIBS $OPENLDAPSYSLIBS) - fi - fi - fi - - if test "${HAS_OPENLDAP:-unset}" != "unset" ; then - HAS_OPENLDAP=1 + PTLIB_FIND_OPENLDAP([HAS_OPENLDAP=1], [HAS_OPENLDAP=]) + if test "x${HAS_OPENLDAP}" = "x1" ; then AC_DEFINE(P_LDAP, 1, "OpenLDAP found") - ENDLDLIBS="-lldap $LDAP_LIBRARIES $ENDLDLIBS" - if test "${OPENLDAPINCLUDEDIR}unset" != "unset" ; then - STDCCFLAGS="$STDCCFLAGS -I${OPENLDAPINCLUDEDIR}" - fi - if test "${OPENLDAPLIBDIR}unset" != "unset" ; then - LDFLAGS="$LDFLAGS -L${OPENLDAPLIBDIR}" - fi + ENDLDLIBS="$ENDLDLIBS $OPENLDAP_LIBS" + STDCCFLAGS="$STDCCFLAGS $OPENLDAP_CFLAGS" fi fi AC_SUBST(HAS_OPENLDAP) - dnl ######################################################################## dnl look for OpenSSL dnl check for environment variable, then assume standard system install This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |