delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/2004/04/06/18:04:20

Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm
List-Subscribe: <mailto:cygwin-subscribe AT cygwin DOT com>
List-Archive: <http://sources.redhat.com/ml/cygwin/>
List-Post: <mailto:cygwin AT cygwin DOT com>
List-Help: <mailto:cygwin-help AT cygwin DOT com>, <http://sources.redhat.com/ml/#faqs>
Sender: cygwin-owner AT cygwin DOT com
Mail-Followup-To: cygwin AT cygwin DOT com
Delivered-To: mailing list cygwin AT cygwin DOT com
Date: Tue, 6 Apr 2004 14:59:04 -0700 (PDT)
From: "Peter A. Castro" <doctor AT fruitbat DOT org>
To: cygwin AT cygwin DOT com
Subject: Re: zsh and line breaks
In-Reply-To: <20040406134902.GA18138@cygbert.vinschen.de>
Message-ID: <Pine.LNX.4.53.0404061450170.11532@gremlin.fruitbat.org>
References: <20040406083806 DOT GJ26575 AT cygbert DOT vinschen DOT de> <NUTMEGpiwHOOkCWaUJL0000038b AT NUTMEG DOT CAM DOT ARTIMI DOT COM> <20040406134902 DOT GA18138 AT cygbert DOT vinschen DOT de>
MIME-Version: 1.0
X-IsSubscribed: yes

On Tue, 6 Apr 2004, Corinna Vinschen wrote:

> On Apr  6 13:54, Dave Korn wrote:
> > >   case "$host" in
> > >   *-*-cygwin*)
> > >     LIBS="$LIBS /usr/lib/textreadmode.o";;
> > >   esac
> > >
> > > in configure.ac would do it then.
> >
> >   You could take it one step further: combine that with using the --wrap
> > option to ld
> >
> >    case "$host" in
> >    *-*-cygwin*)
> >      LIBS="$LIBS /usr/lib/textreadmode.o";;
> >      LDFLAGS="$LDFLAGS --wrap _main"
> >    esac
> >
> > and textreadmode.o has a function __wrap_main that sets the textmode and
> > calls __real_main.  That way the entire cygwinization can be done in
> > configure and no need for #ifdefs anywhere.  OTOH it's a bit obscure
> > maintenance-wise.
>
> And what's the gain?  My above configure.ac snippet is everything needed
> so what's the additional -wrap for?

I'm with Corinna on this one.  The wrapper is unnecessary because the
linker pulls in the premain hook from the object file already.  The
wrapper method might be useful if you want to redirect control before
main is called on non-Cygwin systems, but for Cygwin, the premain hook
does the same kind of thing.

Oh, btw, I'm all for having a textreadmode.o object file available.  I
also think this, and the other *mode.o object files should be outlined in
the Cygwin porting guide :)

> Corinna

-- 
Peter A. Castro <doctor AT fruitbat DOT org> or <Peter DOT Castro AT oracle DOT com>
	"Cats are just autistic Dogs" -- Dr. Tony Attwood

--
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple
Problem reports:       http://cygwin.com/problems.html
Documentation:         http://cygwin.com/docs.html
FAQ:                   http://cygwin.com/faq/

- Raw text -


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