ftp.delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin-apps/2002/06/14/06:56:31

Mailing-List: contact cygwin-apps-help AT cygwin DOT com; run by ezmlm
Sender: cygwin-apps-owner AT cygwin DOT com
List-Subscribe: <mailto:cygwin-apps-subscribe AT cygwin DOT com>
List-Archive: <http://sources.redhat.com/ml/cygwin-apps/>
List-Post: <mailto:cygwin-apps AT cygwin DOT com>
List-Help: <mailto:cygwin-apps-help AT cygwin DOT com>, <http://sources.redhat.com/lists.html#faqs>
Mail-Followup-To: cygwin-apps AT cygwin DOT com
Delivered-To: mailing list cygwin-apps AT cygwin DOT com
To: cygwin-apps AT cygwin DOT com
Subject: building setup.exe -- solved
Organization: Jan at Appel
Mail-Followup-To: cygwin-apps AT cygwin DOT com
From: Jan Nieuwenhuizen <janneke AT gnu DOT org>
Date: Fri, 14 Jun 2002 12:55:23 +0200
Message-ID: <87sn3qf7tw.fsf@peder.flower>
Lines: 52
User-Agent: Gnus/5.090006 (Oort Gnus v0.06) Emacs/21.2
MIME-Version: 1.0


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.


12:40:55 fred AT 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)

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

- Raw text -

  webmaster     delorie software   privacy  
  Copyright 2019   by DJ Delorie     Updated Jul 2019