(Message indoos:7418)

Date:    Sun, 17 Feb 2002 21:18:38 +0100
To:      guile-devel@gnu.org
cc:      Gerrit P. Haase" <gp@familiehaase.de>
From:    Jan Nieuwenhuizen <janneke@gnu.org>
Subject: guile-1.6 Cygwin compile fixes

From janneke@gnu.org  Sun Feb 17 21: 18:43 2002
Sender:  janneke@gnu.org
Organization: Jan at Appel
Lines:   108
MIME-Version: 1.0
X-Spam-Status: No, hits=-104.3 required=5.0 tests=SUPERLONG_LINE,UNIFIED_PATCH,
     ***A_FROM_IN_AUTO_WLIST version=2.01

Hi,

Now that a guile-1.6 release seemed imminent, I've tried to
cross-compile it for Cygwin.  It seems that some mingw/plain windows
enhancements broke the Cygwin compilation.

I don't know much about these winsock includes and who needs it, but
it seems a bit messy; there are two types of those:

    #ifdef HAVE_WINSOCK2_H
    #include <winsock2.h>

and   

    #ifdef __MINGW32__
    #include <winsock2.h>

I've changed (only) the first type, as that breaks for Cygwin, but
maybe the first variant should be removed entirely in favour of the
second, or the other way around (but then with fixes similar to patch
below).

Greetings,
Jan.


Btw1: Please make sure to run latest autoconf2.50 before releasing.

Btw2: I didn't manage to link guile-1.5.4 for Cygwin yet, but that may
      be due to my cross-compilation environment/libtool issues etc.
     
     libtool: link: not configured to extract global symbols from dlpreopened f
iles
     i686-pc-cygwin-gcc -O2 -g -Wall -Wmissing-prototypes /home/jan/usr/src/cyg
win/c\ygwin-1.3.9/usr/bin/cygwin1.dll -o guile.exe guile.o -Wl,--export-dynamic
  -L/h\ome/jan/usr/src/cygwin/cygwin-1.3.9/usr/lib ./.libs/libguile.a /home/jan
/usr/sr\c/cygwin/cygwin-1.3.9/usr/src/guile-1.5.4-1-build/libltdl/.libs/libltdl
.a
     guile.o: In function `main':
     /home/jan/usr/src/cygwin/cygwin-1.3.9/usr/src/guile-1.5.4-1-build/libguile
/../.\./guile-1.5.4-1/libguile/guile.c:90: undefined reference to `lt_preloaded
_symbo\ls'
     collect2: ld returned 1 exit status


diff --exclude=*~ --exclude=#* --exclude=*.in --exclude=Makefile --exclude=conf
ig* -purN ../guile-1.5.4/libguile/guile.c ./libguile/guile.c
--- ../guile-1.5.4/libguile/guile.c	Tue Jun 26 19:53:09 2001
+++ ./libguile/guile.c	Sun Feb 17 19:31:37 2002
@@ -55,7 +55,8 @@
 #include <libltdl/ltdl.h>
 #endif
 
-#ifdef HAVE_WINSOCK2_H
+#if defined (HAVE_WINSOCK2_H) \
+  && !(defined (__CYGWIN32__) || defined (__CYGWIN__))
 #include <winsock2.h>
 #endif
 
diff --exclude=*~ --exclude=#* --exclude=*.in --exclude=Makefile --exclude=conf
ig* -purN ../guile-1.5.4/libguile/iselect.h ./libguile/iselect.h
--- ../guile-1.5.4/libguile/iselect.h	Wed Oct 31 16:38:24 2001
+++ ./libguile/iselect.h	Sun Feb 17 19:25:46 2002
@@ -67,7 +67,8 @@
 #include <sys/select.h>
 #endif
 
-#ifdef HAVE_WINSOCK2_H
+#if defined (HAVE_WINSOCK2_H) \
+  && !(defined (__CYGWIN32__) || defined (__CYGWIN__))
 #include <winsock2.h>
 #endif
 
diff --exclude=*~ --exclude=#* --exclude=*.in --exclude=Makefile --exclude=conf
ig* -purN ../guile-1.5.4/libguile/net_db.c ./libguile/net_db.c
--- ../guile-1.5.4/libguile/net_db.c	Tue Jul 10 13:28:53 2001
+++ ./libguile/net_db.c	Sun Feb 17 19:31:37 2002
@@ -65,7 +65,8 @@
 
 #include <sys/types.h>
 
-#ifdef HAVE_WINSOCK2_H
+#if defined (HAVE_WINSOCK2_H) \
+  && !(defined (__CYGWIN32__) || defined (__CYGWIN__))
 #include <winsock2.h>
 #else
 #include <sys/socket.h>
diff --exclude=*~ --exclude=#* --exclude=*.in --exclude=Makefile --exclude=conf
ig* -purN ../guile-1.5.4/libguile/posix.c ./libguile/posix.c
--- ../guile-1.5.4/libguile/posix.c	Mon Jan 28 14:58:09 2002
+++ ./libguile/posix.c	Sun Feb 17 19:28:44 2002
@@ -95,7 +95,8 @@ extern char *ttyname();
 #ifdef HAVE_IO_H
 #include <io.h>
 #endif
-#ifdef HAVE_WINSOCK2_H
+#if defined (HAVE_WINSOCK2_H) \
+  && !(defined (__CYGWIN32__) || defined (__CYGWIN__))
 #include <winsock2.h>
 #endif
 
diff --exclude=*~ --exclude=#* --exclude=*.in --exclude=Makefile --exclude=conf
ig* -purN ../guile-1.5.4/libguile/socket.c ./libguile/socket.c
--- ../guile-1.5.4/libguile/socket.c	Tue Jul 10 13:28:54 2001
+++ ./libguile/socket.c	Sun Feb 17 19:31:34 2002
@@ -61,7 +61,8 @@
 #include <unistd.h>
 #endif
 #include <sys/types.h>
-#ifdef HAVE_WINSOCK2_H
+#if defined (HAVE_WINSOCK2_H) \
+  && !(defined (__CYGWIN32__) || defined (__CYGWIN__))
 #include <winsock2.h>
 #else
 #include <sys/socket.h>


-- 
Jan Nieuwenhuizen <janneke@gnu.org> | GNU LilyPond - The music typesetter
http://www.xs4all.nl/~jantien       | http://www.lilypond.org



