OpenLDAP Win64 build

2012-02-02
2013-06-06
  • Tobias kick
    Tobias kick
    2012-02-02

    Hi all,

    there is already an entry in the mailing list archive for this topic:
    https://sourceforge.net/mailarchive/forum.php?thread_name=20120131090239.68450%40gmx.net&forum_name=mingw-w64-public

    If anyone is interested.. I solved this problem.
    It seems to be a problem in liblunicode-Makefile. The workaround is:
    Copy all files from liblunicode-subdirs to the liblunicode folder.
    Add a '.links' file to this folder. Now 'make depend' should run without errors.

    But executing 'make' fails because of a wrong configured portable.h file.
    If anyone is interested how to fix this errors in libldap (os-ip.c and …), I will provide my
    fixes/workaround here in this thread (why here? because openldap mailing list admin does not care about my Win64 build issues..)

    Regards
    Tobias

     
  • Tobias kick
    Tobias kick
    2012-02-03

    workaround: 2 entries in portable.h have to be commented out (they are only enabled by configuring x86_64-w64-mingw32):

    /* #undef HAVE_GETADDRINFO */         (avoids compile err in os-ip.c)
    /* #undef HAVE_GETNAMEINFO */         (avoids compile err in util-int.c)

    But compiling now breaks in clients\tools with the following error:

    make: Entering directory `/mingw64/tmp/openldap-2.4.28/clients/tools'
    ../../build/mkversion -v "2.4.28" -s ldapsearch > ldsversion.c
    gcc -g -O2 -I../../include        -I../../include       -c -o ldapsearch.o ldapsearch.c
    ldapsearch.c: In function 'dosearch':
    ldapsearch.c:1379:17: error: storage size of 'tv' isn't known
    ldapsearch.c:1380:17: error: storage size of 'tv_timelimit' isn't known
    make: ***  Error 1
    make: Leaving directory `/mingw64/tmp/openldap-2.4.28/clients/tools'
    make: ***  Error 1
    make: Leaving directory `/mingw64/tmp/openldap-2.4.28/clients'
    make: ***  Error 1

     
  • Tobias kick
    Tobias kick
    2012-02-03

    OpenLDAP also uses an old libtool version 1.5.22. This probably causes the 64-bit-build fail to build dynamic link libraries:

    *** Warning: This system can not link to static lib archive ../../libraries/liblber/liblber.la.
    *** I have the capability to make that library automatically link in when
    *** you link to this library.  But I can only do this if you have a
    *** shared version of the library, which you do not appear to have.

    *** Warning: linker path does not have real file for library -lregex.
    *** I have the capability to make that library automatically link in when
    *** you link to this library.  But I can only do this if you have a
    *** shared version of the library, which you do not appear to have
    *** because I did check the linker path looking for a file starting
    *** with libregex and none of the candidates passed a file format test
    *** using a file magic. Last file checked: d:/projects/mingw/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/4.6.1/../../../../x86_64-w64-mingw32/lib//libregex.a

    *** Warning: linker path does not have real file for library -lws2_32.
    *** I have the capability to make that library automatically link in when
    *** you link to this library.  But I can only do this if you have a
    *** shared version of the library, which you do not appear to have
    *** because I did check the linker path looking for a file starting
    *** with libws2_32 and none of the candidates passed a file format test
    *** using a file magic. Last file checked: d:/projects/mingw/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/4.6.1/../../../../x86_64-w64-mingw32/lib//libws2_32.a

    *** Warning: linker path does not have real file for library -lssl.
    *** I have the capability to make that library automatically link in when
    *** you link to this library.  But I can only do this if you have a
    *** shared version of the library, which you do not appear to have
    *** because I did check the linker path looking for a file starting
    *** with libssl and none of the candidates passed a file format test
    *** using a file magic. Last file checked: d:/projects/mingw/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/4.6.1/../../..//libssl.dll.a

    *** Warning: linker path does not have real file for library -lcrypto.
    *** I have the capability to make that library automatically link in when
    *** you link to this library.  But I can only do this if you have a
    *** shared version of the library, which you do not appear to have
    *** because I did check the linker path looking for a file starting
    *** with libcrypto and none of the candidates passed a file format test
    *** using a file magic. Last file checked: d:/projects/mingw/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/4.6.1/../../..//libcrypto.dll.a
    *** The inter-library dependencies that have been dropped here will be
    *** automatically added whenever a program is linked with this library
    *** or is declared to -dlopen it.

    An actual libtool version may solve this (configuring openldap with -target=mingw32 works fine).

     
  • Tobias kick
    Tobias kick
    2012-02-03

    my configuration command changed to:

    ./configure -target=x86_64-w64-mingw32 -with-tls=openssl -enable-static -enable-shared -disable-slapd -disable-bdb -disable-hdb -disable-backends -prefix=/mingw64/openldap/2.4.28 -sysconfdir=/mingw64/openldap/2.4.28

     
  • Tobias kick
    Tobias kick
    2012-02-03

    Workaround for this error "ldapsearch.c:1379:17: error: storage size of 'tv' isn't known"

    configure script does know where to find sys/time.h:

    checking sys/time.h usability… yes
    checking sys/time.h presence… yes
    checking for sys/time.h… yes

    but libtool could not link because of sys\time.h.
    portable.h is configured with  #define HAVE_SYS_TIME_H 1
    but in ldapsearch.c there are the following lines are missing:

    #ifdef HAVE_SYS_TIME_H
    #include <sys/time.h>
    #endif

    Finally the whole build works.