Subject: Re: OpenLDAP and Cygwin
From: "Dr. Volker Zell" <[email-masked]>
To: "Kurt D. Zeilenga" <[email-masked]>
Cc: Cygnus <[email-masked]>
Date: 06 Jun 1999 13:12:09 +0200

>>>>> "Kurt" == Kurt D Zeilenga <[email-masked]> writes:

    Kurt> I just put together a quick port of OpenLDAP-devel to Cygwin
    Kurt> B20.1 w/ EGCS 1.2.1.

    Kurt> I must say that things went fairly smooth.  I was able to
    Kurt> success build our primary client libraries and tools.  To
    Kurt> build our servers and related tools will require more much
    Kurt> more work (pthreads and a database manager ie: BerkeleyDB2
    Kurt> or GDBM).

Hi Kurt

Here my configuration.

System:   WinNT 4.0/SP3
          Cygwin B20.1 with egcs-1.1.2
           - cygwin1.dll - ftp://sourceware.cygnus.com/pub/cygwin/snapshots/cygwin1-19990605.dll.gz
           - everything mounted binary,
           - CYGWIN = tty title binmode ntea nontsec

Software:  Xemacs-21.1.2   - http://www.xemacs.org/
           inetutils-1.3.2 - ftp://ftp.gnu.org/pub/gnu   (with patch from Sergey)
           ssh-1.2.26      - ftp://ftp.cs.hut.fi/pub/ssh (with patch from Sergey)

I already compiled ldap-1.2.1 a couple of weeks ago. I needed the libraries
for compiling Xemacs under Cygwin and it works perfect.

Also the clients run ok.

To compile I used the patch below. Basically I renamed all files with names
Version.c to CygVersion.c because lack of case sensitivity in the cygwin1.dll.

I also compiled the slapd daemon by simply uncommenting the flock stuff.
I'm not a programmer. So I expected no success.

When I run the test suite, slapd simply core dumps.
But when running the tests by hand, simply by pasting
line by line from the test00x scripts in a bash window
most of them pass.

Ciao
  Volker

++++++++++++++++++++++++++++++++++++++++++++++++++++++++

diff -upr /ldap/build/lib.mk ldap/build/lib.mk
--- /ldap/build/lib.mk	Thu Jan 07 18:36:30 1999
+++ ldap/build/lib.mk	Sat May 29 04:37:49 1999
@@ -8,13 +8,13 @@
 
 all-common: $(LIBRARY) $(PROGRAMS)
 
-version.c: $(OBJS) $(srcdir)/Version.c
+version.c: $(OBJS) $(srcdir)/CygVersion.c
 	$(RM) $@
 	(u=$${USER-root} v=`$(CAT) $(VERSIONFILE)` d=`$(PWD)` \
 	h=`$(HOSTNAME)` t=`$(DATE)`; $(SED) -e "s|%WHEN%|$${t}|" \
 	-e "s|%WHOANDWHERE%|$${u}@$${h}:$${d}|" \
 	-e "s|%VERSION%|$${v}|" \
-	< $(srcdir)/Version.c > $@)
+	< $(srcdir)/CygVersion.c > $@)
 
 install-common: FORCE
 
diff -upr /ldap/clients/fax500/Makefile.in ldap/clients/fax500/Makefile.in
--- /ldap/clients/fax500/Makefile.in	Thu Jan 14 02:02:10 1999
+++ ldap/clients/fax500/Makefile.in	Sat May 29 04:51:57 1999
@@ -32,7 +32,7 @@ fax5version.c: ${FAX5OBJS} $(LDAP_LIBDEP
 	    t=`$(DATE)`; $(SED) -e "s|%WHEN%|$${t}|" \
 	    -e "s|%WHOANDWHERE%|$${u}@$${h}:$${d}|" \
 	    -e "s|%VERSION%|$${v}|" \
-	    < $(srcdir)/Version.c > $@)
+	    < $(srcdir)/CygVersion.c > $@)
 
 install-local: $(PROGRAMS) xrpcomp FORCE
 	-$(MKDIR) $(libexecdir)
diff -upr /ldap/clients/fax500/main.c ldap/clients/fax500/main.c
--- /ldap/clients/fax500/main.c	Tue Mar 02 19:30:02 1999
+++ ldap/clients/fax500/main.c	Sat May 29 04:44:14 1999
@@ -32,7 +32,11 @@
 #include <sys/resource.h>
 #endif
 
+#ifdef __CYGWIN__
+#include "sysexits-compat.h"
+#else
 #include <sysexits.h>
+#endif
 
 #include "lber.h"
 #include "ldap.h"
diff -upr /ldap/clients/finger/Makefile.in ldap/clients/finger/Makefile.in
--- /ldap/clients/finger/Makefile.in	Thu Jan 14 02:02:10 1999
+++ ldap/clients/finger/Makefile.in	Sat May 29 04:52:09 1999
@@ -18,7 +18,7 @@ version.c: ${OBJS} ${LDAP_LIBDEPEND}
 	    t=`$(DATE)`; $(SED) -e "s|%WHEN%|$${t}|" \
 	    -e "s|%WHOANDWHERE%|$${u}@$${h}:$${d}|" \
 	    -e "s|%VERSION%|$${v}|" \
-	    < $(srcdir)/Version.c > $@)
+	    < $(srcdir)/CygVersion.c > $@)
 
 install-local: $(PROGRAMS) FORCE
 	-$(MKDIR) $(libexecdir)
diff -upr /ldap/clients/gopher/Makefile.in ldap/clients/gopher/Makefile.in
--- /ldap/clients/gopher/Makefile.in	Thu Jan 14 02:02:11 1999
+++ ldap/clients/gopher/Makefile.in	Sat May 29 04:51:44 1999
@@ -26,7 +26,7 @@ goversion.c: ${GOOBJS} $(LDAP_LIBDEPEND)
 	    t=`$(DATE)`; $(SED) -e "s|%WHEN%|$${t}|" \
 	    -e "s|%WHOANDWHERE%|$${u}@$${h}:$${d}|" \
 	    -e "s|%VERSION%|$${v}|" \
-	    < $(srcdir)/Version.c > $@)
+	    < $(srcdir)/CygVersion.c > $@)
 
 gwversion.c: ${GWOBJS} $(LDAP_LIBDEPEND)
 	$(RM) $@
diff -upr /ldap/clients/mail500/Makefile.in ldap/clients/mail500/Makefile.in
--- /ldap/clients/mail500/Makefile.in	Thu Jan 14 02:02:11 1999
+++ ldap/clients/mail500/Makefile.in	Sat May 29 04:50:45 1999
@@ -19,7 +19,7 @@ version.c: ${OBJS} $(LDAP_LIBDEPEND)
 	    t=`$(DATE)`; $(SED) -e "s|%WHEN%|$${t}|" \
 	    -e "s|%WHOANDWHERE%|$${u}@$${h}:$${d}|" \
 	    -e "s|%VERSION%|$${v}|" \
-	    < $(srcdir)/Version.c > $@)
+	    < $(srcdir)/CygVersion.c > $@)
 
 install-local: $(PROGRAMS) FORCE
 	-$(MKDIR) $(libexecdir)
diff -upr /ldap/clients/mail500/main.c ldap/clients/mail500/main.c
--- /ldap/clients/mail500/main.c	Tue Mar 02 19:30:03 1999
+++ ldap/clients/mail500/main.c	Sat May 29 04:44:14 1999
@@ -33,7 +33,11 @@
 #include <sys/resource.h>
 #endif
 
+#ifdef __CYGWIN__
+#include "sysexits-compat.h"
+#else
 #include <sysexits.h>
+#endif
 
 #include "lber.h"
 #include "ldap.h"
diff -upr /ldap/clients/rcpt500/Makefile.in ldap/clients/rcpt500/Makefile.in
--- /ldap/clients/rcpt500/Makefile.in	Thu Jan 14 02:02:11 1999
+++ ldap/clients/rcpt500/Makefile.in	Sat May 29 04:50:35 1999
@@ -19,7 +19,7 @@ version.c: ${OBJS} $(LDAP_LIBDEPEND)
 	    t=`$(DATE)`; $(SED) -e "s|%WHEN%|$${t}|" \
 	    -e "s|%WHOANDWHERE%|$${u}@$${h}:$${d}|" \
 	    -e "s|%VERSION%|$${v}|" \
-	    < $(srcdir)/Version.c > $@)
+	    < $(srcdir)/CygVersion.c > $@)
 
 install-local: $(PROGRAMS) rcpt500.help FORCE
 	-$(MKDIR) $(libexecdir) $(datadir)
diff -upr /ldap/clients/tools/Makefile.in ldap/clients/tools/Makefile.in
--- /ldap/clients/tools/Makefile.in	Wed Jan 20 00:22:47 1999
+++ ldap/clients/tools/Makefile.in	Sat May 29 04:44:14 1999
@@ -31,7 +31,7 @@ ldappasswd:	ldappasswd.o
 
 ldapadd:	ldapmodify
 	$(RM) $@
-	$(LN) ldapmodify ldapadd
+	$(LN) ldapmodify.exe ldapadd.exe
 
 ldsversion.c: ldapsearch.o $(LDAP_LIBDEPEND)
 	$(RM) $@
@@ -72,5 +72,5 @@ install-local:	FORCE
 	$(LTINSTALL) $(INSTALLFLAGS) -m 755 ldapdelete $(bindir)
 	$(LTINSTALL) $(INSTALLFLAGS) -m 755 ldapmodrdn $(bindir)
 	$(LTINSTALL) $(INSTALLFLAGS) -m 755 ldappasswd $(bindir)
-	$(RM) $(bindir)/ldapadd
-	$(LN) $(bindir)/ldapmodify $(bindir)/ldapadd
+	$(RM) $(bindir)/ldapadd.exe
+	$(LN) $(bindir)/ldapmodify.exe $(bindir)/ldapadd.exe
diff -upr /ldap/clients/ud/Makefile.in ldap/clients/ud/Makefile.in
--- /ldap/clients/ud/Makefile.in	Thu Jan 14 02:02:11 1999
+++ ldap/clients/ud/Makefile.in	Sat May 29 04:50:19 1999
@@ -21,9 +21,9 @@ version.c: ${OBJS} $(LDAP_LIBDEPEND)
 	    t=`$(DATE)`; $(SED) -e "s|%WHEN%|$${t}|" \
 	    -e "s|%WHOANDWHERE%|$${u}@$${h}:$${d}|" \
 	    -e "s|%VERSION%|$${v}|" \
-	    < $(srcdir)/Version.c > $@)
+	    < $(srcdir)/CygVersion.c > $@)
 
 install-local: FORCE
 	-$(MKDIR) $(bindir)
-	-mv -f $(bindir)/ud $(bindir)/ud-
+	-mv -f $(bindir)/ud.exe $(bindir)/ud.exe-
 	$(LTINSTALL) $(INSTALLFLAGS) -m 775 ud $(bindir)
diff -upr /ldap/servers/ldapd/Makefile.in ldap/servers/ldapd/Makefile.in
--- /ldap/servers/ldapd/Makefile.in	Thu Jan 14 02:02:13 1999
+++ ldap/servers/ldapd/Makefile.in	Sat May 29 05:01:59 1999
@@ -33,7 +33,7 @@ version.c: $(OBJS) $(LDAP_LIBLBER_DEPEND
 	 t=`$(DATE)`; $(SED) -e "s|%WHEN%|$${t}|" \
 	-e "s|%WHOANDWHERE%|$${u}@$${h}:$${d}|" \
 	-e "s|%VERSION%|$${v}|" \
-	< $(srcdir)/Version.c > $@)
+	< $(srcdir)/CygVersion.c > $@)
 
 request.o:	LDAP-types.h
 
diff -upr /ldap/servers/slapd/Makefile.in ldap/servers/slapd/Makefile.in
--- /ldap/servers/slapd/Makefile.in	Fri Mar 05 02:00:28 1999
+++ ldap/servers/slapd/Makefile.in	Sat May 29 04:48:21 1999
@@ -81,7 +81,7 @@ version.c: libbackends.a $(OBJS) $(SLAPD
 	t=`$(DATE)`; $(SED) -e "s|%WHEN%|$${t}|" \
 	-e "s|%WHOANDWHERE%|$${u}@$${h}:$${d}|" \
 	-e "s|%VERSION%|$${v}|" \
-	< $(srcdir)/Version.c > $@)
+	< $(srcdir)/CygVersion.c > $@)
 
 depend-local-srv: FORCE
 	@for i in back-* shell-backends tools; do \
diff -upr /ldap/servers/slapd/back-ldbm/Makefile.in ldap/servers/slapd/back-ldbm/Makefile.in
--- /ldap/servers/slapd/back-ldbm/Makefile.in	Sun Dec 20 20:32:08 1998
+++ ldap/servers/slapd/back-ldbm/Makefile.in	Sat May 29 04:48:39 1999
@@ -33,4 +33,4 @@ version.c:	$(OBJS) $(LDAP_LIBDEPEND)
 	 $(SED) -e "s|%WHEN%|$${t}|" \
 		-e "s|%WHOANDWHERE%|$${u}@$${h}:$${d}|" \
 		-e "s|%VERSION%|$${v}|" \
-		< $(srcdir)/Version.c > $@)
+		< $(srcdir)/CygVersion.c > $@)
diff -upr /ldap/servers/slapd/back-passwd/Makefile.in ldap/servers/slapd/back-passwd/Makefile.in
--- /ldap/servers/slapd/back-passwd/Makefile.in	Sun Dec 20 20:32:08 1998
+++ ldap/servers/slapd/back-passwd/Makefile.in	Sat May 29 04:48:52 1999
@@ -26,5 +26,5 @@ version.c: $(OBJS) $(LDAP_LIBDEPEND)
 	 t=`$(DATE)`; $(SED) -e "s|%WHEN%|$${t}|" \
 	-e "s|%WHOANDWHERE%|$${u}@$${h}:$${d}|" \
 	-e "s|%VERSION%|$${v}|" \
-	< $(srcdir)/Version.c > $@)
+	< $(srcdir)/CygVersion.c > $@)
 
diff -upr /ldap/servers/slapd/back-shell/Makefile.in ldap/servers/slapd/back-shell/Makefile.in
--- /ldap/servers/slapd/back-shell/Makefile.in	Sun Dec 20 20:32:08 1998
+++ ldap/servers/slapd/back-shell/Makefile.in	Sat May 29 04:49:05 1999
@@ -28,5 +28,5 @@ version.c: $(OBJS) $(LDAP_LIBDEPEND)
 	t=`$(DATE)`; $(SED) -e "s|%WHEN%|$${t}|" \
 	-e "s|%WHOANDWHERE%|$${u}@$${h}:$${d}|" \
 	-e "s|%VERSION%|$${v}|" \
-	< $(srcdir)/Version.c > $@)
+	< $(srcdir)/CygVersion.c > $@)
 
diff -upr /ldap/servers/slapd/lock.c ldap/servers/slapd/lock.c
--- /ldap/servers/slapd/lock.c	Tue Nov 17 00:24:28 1998
+++ ldap/servers/slapd/lock.c	Sat May 29 04:44:14 1999
@@ -28,6 +28,7 @@ lock_fopen( char *fname, char *type, FIL
 	}
 
 	/* acquire the lock */
+#ifndef __CYGWIN__
 #ifdef HAVE_FLOCK
 	while ( flock( fileno( *lfp ), LOCK_EX ) != 0 ) {
 #else
@@ -35,15 +36,18 @@ lock_fopen( char *fname, char *type, FIL
 #endif
 		;	/* NULL */
 	}
+#endif
 
 	/* open the log file */
 	if ( (fp = fopen( fname, type )) == NULL ) {
 		Debug( LDAP_DEBUG_ANY, "could not open \"%s\"\n", fname, 0, 0 );
+#ifndef __CYGWIN__
 #ifdef HAVE_FLOCK
 		flock( fileno( *lfp ), LOCK_UN );
 #else
 		lockf( fileno( *lfp ), F_ULOCK, 0 );
 #endif
+#endif
 		fclose( *lfp );
 		*lfp = NULL;
 		return( NULL );
@@ -56,10 +60,12 @@ int
 lock_fclose( FILE *fp, FILE *lfp )
 {
 	/* unlock */
+#ifndef __CYGWIN__
 #ifdef HAVE_FLOCK
 	flock( fileno( lfp ), LOCK_UN );
 #else
 	lockf( fileno( lfp ), F_ULOCK, 0 );
+#endif
 #endif
 	fclose( lfp );
 
diff -upr /ldap/servers/slapd/shell-backends/Makefile.in ldap/servers/slapd/shell-backends/Makefile.in
--- /ldap/servers/slapd/shell-backends/Makefile.in	Sun Dec 20 20:32:08 1998
+++ ldap/servers/slapd/shell-backends/Makefile.in	Sat May 29 04:49:41 1999
@@ -21,4 +21,4 @@ pwd-version.c: $(OBJS) $(LDAP_LIBDEPEND)
 	t=`$(DATE)`; $(SED) -e "s|%WHEN%|$${t}|" \
 	-e "s|%WHOANDWHERE%|$${u}@$${h}:$${d}|" \
 	-e "s|%VERSION%|$${v}|" \
-	< $(srcdir)/pwd-Version.c > $@)
+	< $(srcdir)/Cygpwd-Version.c > $@)
diff -upr /ldap/servers/slurpd/Makefile.in ldap/servers/slurpd/Makefile.in
--- /ldap/servers/slurpd/Makefile.in	Fri Jan 29 06:11:51 1999
+++ ldap/servers/slurpd/Makefile.in	Sat May 29 04:47:33 1999
@@ -39,7 +39,7 @@ version.c: $(OBJS) $(LDAP_LIBDEPEND) $(L
 	t=`$(DATE)`; $(SED) -e "s|%WHEN%|$${t}|" \
 	-e "s|%WHOANDWHERE%|$${u}@$${h}:$${d}|" \
 	-e "s|%VERSION%|$${v}|" \
-	< $(srcdir)/Version.c > $@)
+	< $(srcdir)/CygVersion.c > $@)
 
 install-local-srv: FORCE
 	@-$(MKDIR) $(libexecdir)

--
Want to unsubscribe from this list?
Send a message to [email-masked]