building setup.exe -- solved

Jan Nieuwenhuizen janneke@gnu.org
Fri Jun 14 09:21:00 GMT 2002


Hi,

Finally, I found the problem.  I'm including the error messages I got
for others to find.

Here's what I've been struggling with:

    g++ -v -mno-cygwin -o setup.exe  ... -lmingw32
    ...
    /home/fred/cvs/cygwin/cygwin-apps/setup-build/bz2lib/../../setup/bz2lib/bzlib.c:866: undefined reference to `_impure_ptr'
    bz2lib/libbz2.a(bzlib.o): In function `bzopen_or_bzdopen':
    /home/fred/cvs/cygwin/cygwin-apps/setup-build/bz2lib/../../setup/bz2lib/bzlib.c:1424: undefined reference to `_ctype_'
    ...
    
And, adding -lg:

    g++ -v -mno-cygwin -o setup.exe  ... -lmingw32 -lg
    Warning: resolving __ctype_ by linking to __imp___ctype_ (auto-import)
    bz2lib/libbz2.a(bzlib.o): In function `bzopen_or_bzdopen':
    /home/fred/cvs/cygwin/cygwin-apps/setup-build/bz2lib/../../setup/bz2lib/bzlib.c:1424: variable '_ctype_' can't be auto-imported. Please read the documentation for ld's --enable-auto-import for details.
    collect2: ld returned 1 exit status

It turned out to be a rather silly bug (once you know it): CPPFLAGS,
when passed to ./configure (like setup's webpage advertises), doesn't
make in into bz2lib/Makefile.  When using a gcc -mno-cygwin
cross-compiler on linux, you need to override CPPFLAGS for bz2lib too,
so that mingw's _G_config.h and other mingw headers get included.

I would like to suggest the patch below.

Greetings,
Jan.

12:40:55 fred@peder:~/cvs/cygwin/cygwin-apps/setup
$ diff -u bz2lib/configure.in.orig bz2lib/configure.in
--- bz2lib/configure.in.orig	Fri Jun 14 12:35:07 2002
+++ bz2lib/configure.in	Fri Jun 14 12:36:09 2002
@@ -7,7 +7,7 @@
 AM_INIT_AUTOMAKE(libbz2, 0.0)
 AM_MAINTAINER_MODE
 
-CPPFLAGS=-U_WIN32
+CPPFLAGS="$CPPFLAGS -U_WIN32"
 AC_CANONICAL_HOST
 AC_PROG_CC
 AC_PROG_RANLIB



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



More information about the Cygwin-apps mailing list