From mboxrd@z Thu Jan 1 00:00:00 1970 Path: main.gmane.org!not-for-mail From: Jan Nieuwenhuizen Newsgroups: gmane.lisp.guile.devel Subject: [PATCH]: Cross building and Cygwin fixes. Date: Wed, 03 Jul 2002 18:25:01 +0200 Organization: Jan at Appel Sender: guile-devel-admin@gnu.org Message-ID: <87r8ikdbj6.fsf@peder.flower> NNTP-Posting-Host: localhost.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: main.gmane.org 1025713620 18377 127.0.0.1 (3 Jul 2002 16:27:00 GMT) X-Complaints-To: usenet@main.gmane.org NNTP-Posting-Date: Wed, 3 Jul 2002 16:27:00 +0000 (UTC) Cc: Han-Wen Return-path: Original-Received: from fencepost.gnu.org ([199.232.76.164]) by main.gmane.org with esmtp (Exim 3.33 #1 (Debian)) id 17Pmy3-0004mI-00 for ; Wed, 03 Jul 2002 18:27:00 +0200 Original-Received: from localhost ([127.0.0.1] helo=fencepost.gnu.org) by fencepost.gnu.org with esmtp (Exim 3.34 #1 (Debian)) id 17Pmy9-0004yt-00; Wed, 03 Jul 2002 12:27:05 -0400 Original-Received: from node-d-3053.a2000.nl ([62.195.48.83] helo=peder.flower) by fencepost.gnu.org with esmtp (Exim 3.34 #1 (Debian)) id 17PmwC-0004ve-00 for ; Wed, 03 Jul 2002 12:25:04 -0400 Original-Received: from localhost.localdomain ([127.0.0.1] helo=peder.flower) by peder.flower with esmtp (Exim 3.35 #1 (Debian)) id 17PmwA-0006bS-00; Wed, 03 Jul 2002 18:25:02 +0200 Original-To: guile-devel@gnu.org Mail-Followup-To: cygwin-apps@cygwin.com Original-Lines: 341 User-Agent: Gnus/5.090006 (Oort Gnus v0.06) Emacs/21.2 (i386-debian-linux-gnu) Errors-To: guile-devel-admin@gnu.org X-BeenThere: guile-devel@gnu.org X-Mailman-Version: 2.0.11 Precedence: bulk List-Help: List-Post: List-Subscribe: , List-Id: Developers list for Guile, the GNU extensibility library List-Unsubscribe: , List-Archive: Xref: main.gmane.org gmane.lisp.guile.devel:736 X-Report-Spam: http://spam.gmane.org/gmane.lisp.guile.devel:736 Hi, Today I spent making a fresh Guile patch to get it compiled for Cygwin, and to fix cross building issues that were introduced during Guile's 1.5 development cycle. It's against latest 1.6 CVS, making use of autoconf, automake, and libtool from CVS, that are supposed to have fresh fixes for Cygwin. I still can't get the shared version to link: /bin/sh ../libtool --mode=link gcc -I/home/cygwin/cygwin-1.3.10/usr/include -L/home/cygwin/cygwin-1.3.10/usr/lib -L/home/cygwin/cygwin-1.3.10/usr/lib/w32api -L/home/cygwin/cygwin-1.3.10/usr/bin -O2 -g -Wall -Wmissing-prototypes -o guile.exe -dlpreopen force guile.o libguile.la -lm libtool: link: not configured to extract global symbols from dlpreopened files gcc -I/home/cygwin/cygwin-1.3.10/usr/include -O2 -g -Wall -Wmissing-prototypes -o guile.exe guile.o -L/home/cygwin/cygwin-1.3.10/usr/lib -L/home/cygwin/cygwin-1.3.10/usr/lib/w32api -L/home/cygwin/cygwin-1.3.10/usr/bin ./.libs/libguile.a /home/fred/cvs/guile/cygwin/libltdl/.libs/libltdl.a guile.o: In function `main': /home/fred/cvs/guile/cygwin/libguile/../../guile-core-1.6/libguile/guile.c:90: undefined reference to `lt_preloaded_symbols' but the static version cross builds fine. Of course, I'm enquiring at Cygwin and will continue to look into this. Please let me know what needs to be done to get this into CVS. Greetings, Jan. Index: ChangeLog =================================================================== RCS file: /cvsroot/guile/guile/guile-core/ChangeLog,v retrieving revision 1.281.2.72 diff -p -u -r1.281.2.72 ChangeLog --- ChangeLog 6 May 2002 19:15:04 -0000 1.281.2.72 +++ ChangeLog 3 Jul 2002 15:40:16 -0000 @@ -1,3 +1,13 @@ +2002-07-03 Jan Nieuwenhuizen + + * autogen.sh: Only fix libltdl/configure.in if it exists. Current + libtool CVS does not need this fix. + + * configure.in (AC_LIBTOOL_WIN32_DLL): Add for shared Cygwin + build. + Add --with-cc-for-build option to re-enable cross building. + Add --with-guile-for-build option to re-enable cross building. + 2002-05-06 Marius Vollmer * configure.in: Include before when Index: autogen.sh =================================================================== RCS file: /cvsroot/guile/guile/guile-core/autogen.sh,v retrieving revision 1.11.2.10 diff -p -u -r1.11.2.10 autogen.sh --- autogen.sh 1 May 2002 21:05:26 -0000 1.11.2.10 +++ autogen.sh 3 Jul 2002 15:40:16 -0000 @@ -47,11 +47,14 @@ $mscripts/render-bugs > BUGS rm -rf libltdl libtoolize --force --copy --automake --ltdl +# Fix older versions of libtool. # Make sure we use a ./configure.in compatible autoconf in ./libltdl/ -mv libltdl/configure.in libltdl/configure.tmp -echo 'AC_PREREQ(2.50)' > libltdl/configure.in -cat libltdl/configure.tmp >> libltdl/configure.in -rm libltdl/configure.tmp +if [ -f libltdl/configure.in ]; then + mv libltdl/configure.in libltdl/configure.tmp + echo 'AC_PREREQ(2.50)' > libltdl/configure.in + cat libltdl/configure.tmp >> libltdl/configure.in + rm libltdl/configure.tmp +fi ###################################################################### autoheader Index: configure.in =================================================================== RCS file: /cvsroot/guile/guile/guile-core/configure.in,v retrieving revision 1.157.2.19 diff -p -u -r1.157.2.19 configure.in --- configure.in 6 May 2002 19:11:00 -0000 1.157.2.19 +++ configure.in 3 Jul 2002 15:40:17 -0000 @@ -155,6 +155,9 @@ AC_ISC_POSIX AC_MINIX AM_PROG_CC_STDC + +## Needed for building DLLs on Cygwin, before AM_PROG_LIBTOOL +AC_LIBTOOL_WIN32_DLL AM_PROG_LIBTOOL AC_CHECK_PROG(have_makeinfo, makeinfo, yes, no) @@ -621,6 +624,54 @@ if test "${THREAD_PACKAGE}" != "" ; then fi fi +## Cross building +if test "$cross_compiling" = "yes"; then + AC_MSG_CHECKING(cc for build) + ## /usr/bin/cc still uses wrong assembler + ## CC_FOR_BUILD="${CC_FOR_BUILD-/usr/bincc}" + CC_FOR_BUILD="${CC_FOR_BUILD-PATH=/usr/bin:$PATH cc}" +else + CC_FOR_BUILD="${CC_FOR_BUILD-$CC}" +fi +AC_ARG_WITH(cc-for-build, + [ --with-cc-for-build=CC native C compiler, to be used during build]) +test -n "$with_cc_for_build" && CC_FOR_BUILD="$with_cc_for_build" + +## AC_MSG_CHECKING("if we are cross compiling") +## AC_MSG_RESULT($cross_compiling) +if test "$cross_compiling" = "yes"; then + AC_MSG_RESULT($CC_FOR_BUILD) +fi + +## No need as yet to be more elaborate +CCLD_FOR_BUILD="$CC_FOR_BUILD" + +AC_SUBST(cross_compiling) +AC_SUBST(CC_FOR_BUILD) +AC_SUBST(CCLD_FOR_BUILD) + +## libtool erroneously calls CC_FOR_BUILD HOST_CC; +## --HOST is the platform that PACKAGE is compiled for. +HOST_CC="$CC_FOR_BUILD" +AC_SUBST(HOST_CC) + +if test "$cross_compiling" = "yes"; then + AC_MSG_CHECKING(guile for build) + GUILE_FOR_BUILD="${GUILE_FOR_BUILD-guile}" +else + GUILE_FOR_BUILD='$(top_builddir_absolute)/pre-inst-guile' +fi +AC_ARG_WITH(guile-for-build, + [ --with-guile-for-build=CC native guile executable, to be used during build]) +test -n "$with_guile_for_build" && GUILE_FOR_BUILD="$with_cc_for_build" + +## AC_MSG_CHECKING("if we are cross compiling") +## AC_MSG_RESULT($cross_compiling) +if test "$cross_compiling" = "yes"; then + AC_MSG_RESULT($GUILE_FOR_BUILD) +fi +AC_SUBST(GUILE_FOR_BUILD) + ## If we're using GCC, ask for aggressive warnings. case "$GCC" in yes ) Index: am/ChangeLog =================================================================== RCS file: /cvsroot/guile/guile/guile-core/am/ChangeLog,v retrieving revision 1.1.2.4 diff -p -u -r1.1.2.4 ChangeLog --- am/ChangeLog 1 Apr 2002 20:02:29 -0000 1.1.2.4 +++ am/ChangeLog 3 Jul 2002 15:40:17 -0000 @@ -1,3 +1,8 @@ +2002-07-03 Jan Nieuwenhuizen + + * pre-inst-guile (preinstguile): Initialize with + $(GUILE_FOR_BUILD) configure parameter. + 2002-04-01 Thien-Thi Nguyen * maintainer-dirs: Remove "if MAINTAINER_MODE" conditional. Index: am/pre-inst-guile =================================================================== RCS file: /cvsroot/guile/guile/guile-core/am/pre-inst-guile,v retrieving revision 1.1.2.1 diff -p -u -r1.1.2.1 pre-inst-guile --- am/pre-inst-guile 26 Feb 2002 11:12:18 -0000 1.1.2.1 +++ am/pre-inst-guile 3 Jul 2002 15:40:17 -0000 @@ -28,7 +28,7 @@ ## Code: -preinstguile = $(top_builddir_absolute)/pre-inst-guile +preinstguile = $(GUILE_FOR_BUILD) preinstguiletool = GUILE="$(preinstguile)" $(top_srcdir)/scripts ## am/pre-inst-guile ends here Index: libguile/ChangeLog =================================================================== RCS file: /cvsroot/guile/guile/guile-core/libguile/ChangeLog,v retrieving revision 1.1465.2.92 diff -p -u -r1.1465.2.92 ChangeLog --- libguile/ChangeLog 17 Jun 2002 23:22:45 -0000 1.1465.2.92 +++ libguile/ChangeLog 3 Jul 2002 15:40:20 -0000 @@ -1,3 +1,14 @@ +2002-07-03 Jan Nieuwenhuizen + + * Makefile.am: Override default rule for c-tokenize.$(OBJECT); + this should be compiled for BUILD host. + Override default rule for + guile_filter_doc_snarfage$(EEXECT); this should run on BUILD host. + Add missing $(EXEEXT) to guile_filter_doc_snarfage invocation. + + * guile.c, iselect.h, net_db.c, posix.c, socket.c: Cygwin compile + fixes. + 2002-06-18 Marius Vollmer * print.c (scm_simple_format): Print missing part of format before Index: libguile/Makefile.am =================================================================== RCS file: /cvsroot/guile/guile/guile-core/libguile/Makefile.am,v retrieving revision 1.138.2.21 diff -p -u -r1.138.2.21 Makefile.am --- libguile/Makefile.am 9 Apr 2002 17:24:41 -0000 1.138.2.21 +++ libguile/Makefile.am 3 Jul 2002 15:40:20 -0000 @@ -33,14 +33,33 @@ ETAGS_ARGS = --regex='/SCM_\(GLOBAL_\)?\ lib_LTLIBRARIES = libguile.la bin_PROGRAMS = guile + noinst_PROGRAMS = guile_filter_doc_snarfage +guile_filter_doc_snarfage_SOURCES = c-tokenize.c + +## Override default rule; this should be compiled for BUILD host. +## For some reason, OBJEXT does not include the dot +c-tokenize.$(OBJEXT): c-tokenize.c + if [ "$(cross_compiling)" = "yes" ]; then \ + $(CC_FOR_BUILD) -c -o $@ $<; \ + else \ + $(COMPILE) -c -o $@ $<; \ + fi + +## Override default rule; this should run on BUILD host. +guile_filter_doc_snarfage$(EXEEXT): $(guile_filter_doc_snarfage_OBJECTS) $(guile_filter_doc_snarfage_DEPENDENCIES) + @rm -f guile_filter_doc_snarfage$(EXEEXT) + if [ "$(cross_compiling)" = "yes" ]; then \ + $(CCLD_FOR_BUILD) -o $@ $(guile_filter_doc_snarfage_OBJECTS); \ + else \ + $(LINK) $(guile_filter_doc_snarfage_OBJECTS) $(LDADD) $(LIBS); \ + fi + guile_SOURCES = guile.c guile_LDADD = libguile.la guile_LDFLAGS = @DLPREOPEN@ -guile_filter_doc_snarfage_SOURCES = c-tokenize.c - libguile_la_SOURCES = alist.c arbiters.c async.c backtrace.c boolean.c \ chars.c continuations.c debug.c deprecation.c dynl.c dynwind.c \ environments.c eq.c error.c eval.c evalext.c extensions.c \ @@ -197,7 +216,7 @@ SUFFIXES = .x .doc .c.doc: -(test -n "${AWK+set}" || AWK="@AWK@"; ${AWK} -f ./guile-func-name-check $<) (./guile-snarf-docs $(snarfcppopts) $< | \ - ./guile_filter_doc_snarfage --filter-snarfage) > $@ || { rm $@; false; } + ./guile_filter_doc_snarfage$(EXEEXT) --filter-snarfage) > $@ || { rm $@; false; } $(DOT_X_FILES) $(EXTRA_DOT_DOC_FILES): snarf.h guile-snarf.in Index: libguile/guile.c =================================================================== RCS file: /cvsroot/guile/guile/guile-core/libguile/guile.c,v retrieving revision 1.8 diff -p -u -r1.8 guile.c --- libguile/guile.c 26 Jun 2001 17:53:09 -0000 1.8 +++ libguile/guile.c 3 Jul 2002 15:40:21 -0000 @@ -55,7 +55,8 @@ #include #endif -#ifdef HAVE_WINSOCK2_H +#if defined (HAVE_WINSOCK2_H) \ + && !(defined (__CYGWIN32__) || defined (__CYGWIN__)) #include #endif Index: libguile/iselect.h =================================================================== RCS file: /cvsroot/guile/guile/guile-core/libguile/iselect.h,v retrieving revision 1.9.2.1 diff -p -u -r1.9.2.1 iselect.h --- libguile/iselect.h 19 Jul 2001 21:28:54 -0000 1.9.2.1 +++ libguile/iselect.h 3 Jul 2002 15:40:21 -0000 @@ -67,7 +67,8 @@ #include #endif -#ifdef HAVE_WINSOCK2_H +#if defined (HAVE_WINSOCK2_H) \ + && !(defined (__CYGWIN32__) || defined (__CYGWIN__)) #include #endif Index: libguile/net_db.c =================================================================== RCS file: /cvsroot/guile/guile/guile-core/libguile/net_db.c,v retrieving revision 1.62.2.3 diff -p -u -r1.62.2.3 net_db.c --- libguile/net_db.c 15 Mar 2002 09:23:19 -0000 1.62.2.3 +++ libguile/net_db.c 3 Jul 2002 15:40:21 -0000 @@ -65,7 +65,8 @@ #include -#ifdef HAVE_WINSOCK2_H +#if defined (HAVE_WINSOCK2_H) \ + && !(defined (__CYGWIN32__) || defined (__CYGWIN__)) #include #else #include Index: libguile/posix.c =================================================================== RCS file: /cvsroot/guile/guile/guile-core/libguile/posix.c,v retrieving revision 1.92.2.5 diff -p -u -r1.92.2.5 posix.c --- libguile/posix.c 15 Mar 2002 10:33:37 -0000 1.92.2.5 +++ libguile/posix.c 3 Jul 2002 15:40:22 -0000 @@ -95,7 +95,8 @@ extern char *ttyname(); #ifdef HAVE_IO_H #include #endif -#ifdef HAVE_WINSOCK2_H +#if defined (HAVE_WINSOCK2_H) \ + && !(defined (__CYGWIN32__) || defined (__CYGWIN__)) #include #endif Index: libguile/socket.c =================================================================== RCS file: /cvsroot/guile/guile/guile-core/libguile/socket.c,v retrieving revision 1.80.2.3 diff -p -u -r1.80.2.3 socket.c --- libguile/socket.c 15 Mar 2002 09:23:19 -0000 1.80.2.3 +++ libguile/socket.c 3 Jul 2002 15:40:22 -0000 @@ -61,7 +61,8 @@ #include #endif #include -#ifdef HAVE_WINSOCK2_H +#if defined (HAVE_WINSOCK2_H) \ + && !(defined (__CYGWIN32__) || defined (__CYGWIN__)) #include #else #include -- Jan Nieuwenhuizen | GNU LilyPond - The music typesetter http://www.xs4all.nl/~jantien | http://www.lilypond.org _______________________________________________ Guile-devel mailing list Guile-devel@gnu.org http://mail.gnu.org/mailman/listinfo/guile-devel