cURL / Mailing Lists / curl-library / Single Mail


Re: curl-library Digest, Vol 81, Issue 37

From: slon v sobstvennom palto <>
Date: Mon, 28 May 2012 23:39:44 +0300

> Please stop top-posting and full-quoting. If you intend to respond to emails
> on this list, you really shouldn't use digest mode emails. I don't think the
> netiquette document leaves a lot of doubt in any of these matters.

I'm really sorry for that. This will not happen anymore.

>> I run 'configure' (curl 7.25) with the next parametrs:
>> configure --enable-ldap --enable-ldaps =ldap50
> What is that =ldap50 supposed to mean?

The command line of configure is:
configure --enable-ldap --enable-ldaps --with-ldap-lib=ldap50 is Mozilla LDAP SDK library. Just another LDAP SDK
implementation, it implements the standard Open LDAP interface. Before
running configure I setup the environment. MY_DIR is my directory that
contains sub-directories lib and include where Mozilla LDAP SDK and
OpenSSL are situated.

MY_DIR=<my lib dir>
export LDFLAGS="-L$MY_DIR/lib -lcrypto -lssl"
export CPPFLAGS="-I$MY_DIR/include -I$MY_DIR/include/ldap"

>> At line 19209 of 'configure' we see:
> Can't we instead talk about details as that's the file we write.
>> if test "$LDAPLIBNAME" ; then
>> This is true if we specified something at '--with-ldap-lib' parameter of
>> 'configure' script.
> Yes, or if you run it on windows without specifying a lib.
>> Then at line 19267 we see:
> That's done at three different places in
>> This last code line seems to be unconditionally executed if the condition
>> from line above is true. It means that if I specify LDAP library with
>> '--with-ldap-lib' then LDAPS support will be disabled. Could you please
>> assist/comment?
> That's not how I read the code. See line 887 and onwards in for
> something that is much more readable than the gibberish in the generated
> configure script.
> I'll admit I don't understand the flow the code runs in your case but then I
> also don't have the slightest idea about what "Mozilla LDAP SDK" is...

'' contains the code regarding LDAP that seems very
proper. However after I ran 'configure' I received the result that
LDAP is enabled and LDAPS is disabled. Let's take a look on a code
portion from '', line 904:

if test "$LDAPLIBNAME" ; then
    AC_CHECK_LIB("$LDAPLIBNAME", ldap_init,, [
      AC_MSG_WARN(["$LDAPLIBNAME" is not an LDAP library: LDAP disabled])
      AC_DEFINE(CURL_DISABLE_LDAP, 1, [to disable LDAP])
      AC_DEFINE(CURL_DISABLE_LDAPS, 1, [to disable LDAPS])

It seems that when it is translated into 'configure' then we have some
phantom small piece of code at the very bottom (I marked it with a
comment) that disables LDAPS unconditionally when the first 'if'
condition is true. Here's the code from 'configure' that corresponds
to the lines from '' above ((I just made a proper
indentation to make it easier for reading):

if test "$LDAPLIBNAME" ; then
            as_ac_Lib=`$as_echo "ac_cv_lib_"$LDAPLIBNAME"''_ldap_init" | $as_tr_sh`
        { $as_echo "$as_me:${as_lineno-$LINENO}: checking for ldap_init in
-l\"$LDAPLIBNAME\"" >&5
        $as_echo_n "checking for ldap_init in -l\"$LDAPLIBNAME\"... " >&6; }
        if { as_var=$as_ac_Lib; eval "test \"\${$as_var+set}\" = set"; }; then :
                  $as_echo_n "(cached) " >&6
                LIBS="-l"$LDAPLIBNAME" $LIBS"
                cat confdefs.h - <<_ACEOF >conftest.$ac_ext
                /* end confdefs.h. */

                #ifdef __cplusplus
                extern "C"
                char ldap_init ();
                int main (void)
                        return ldap_init ();
                        return 0;
                if ac_fn_c_try_link "$LINENO"; then :
                          eval "$as_ac_Lib=yes"
                          eval "$as_ac_Lib=no"
                rm -f core conftest.err conftest.$ac_objext \
                    conftest$ac_exeext conftest.$ac_ext
        eval ac_res=\$$as_ac_Lib
        { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5
        $as_echo "$ac_res" >&6; }
        eval as_val=\$$as_ac_Lib
           if test "x$as_val" = x""yes; then :
                  cat >>confdefs.h <<_ACEOF
                #define `$as_echo "HAVE_LIB"$LDAPLIBNAME"" | $as_tr_cpp` 1

                  LIBS="-l"$LDAPLIBNAME" $LIBS"


                      { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING:
\"$LDAPLIBNAME\" is not an LDAP library: LDAP disabled" >&5
                $as_echo "$as_me: WARNING: \"$LDAPLIBNAME\" is not an LDAP library:
LDAP disabled" >&2;}

                $as_echo "#define CURL_DISABLE_LDAP 1" >>confdefs.h



              # ------------------------------------------------------------------------------------------------
              # This is a strange piece of code that disable LDAPS unconditionally
              # ------------------------------------------------------------------------------------------------
        $as_echo "#define CURL_DISABLE_LDAPS 1" >>confdefs.h


I appreciate your help on this issue.
List admin:
Received on 2012-05-28