delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin-apps/2001/03/11/20:36:33

Mailing-List: contact cygwin-apps-help AT sourceware DOT cygnus DOT com; run by ezmlm
Sender: cygwin-apps-owner AT sourceware DOT cygnus DOT com
List-Subscribe: <mailto:cygwin-apps-subscribe AT sources DOT redhat DOT com>
List-Archive: <http://sources.redhat.com/ml/cygwin-apps/>
List-Post: <mailto:cygwin-apps AT sources DOT redhat DOT com>
List-Help: <mailto:cygwin-apps-help AT sources DOT redhat DOT com>, <http://sources.redhat.com/lists.html#faqs>
Delivered-To: mailing list cygwin-apps AT sources DOT redhat DOT com
Date: Sun, 11 Mar 2001 20:36:29 -0500
From: Christopher Faylor <cgf AT redhat DOT com>
To: cygwin-apps AT cygwin DOT com
Subject: -mwin32 again
Message-ID: <20010311203629.A17992@redhat.com>
Reply-To: cygwin-apps AT cygwin DOT com
Mail-Followup-To: cygwin-apps AT cygwin DOT com
Mime-Version: 1.0
User-Agent: Mutt/1.3.11i

I'm going through the sourceware directories adding logic for checking
if -mwin32 as needed.  It is required in, IMO, a surprising number of
cases.

Every time I add it, it feels wrong.  Many times I add it on a global
basis when it is needed for just one file, such as in the gdb
directory.

I really wish I could come up with some kind of heuristic in gcc that
says something on the line of "Oh, you're including windows.h?  In that
case, this is a windows file and I'll add blah/w32api to the include
search path."

There doesn't seem to be anything remotely like this in gcc but I was
wondering if anyone had any creative ideas for achieving this effect.

FYI, I've been adding something like the following to configure.in's
that need it:

case "${host}" in
*-*-cygwin*)
        touch ac$$.c
        if ${CC} -c -mwin32 ac$$.c >/dev/null 2>&1; then
            case "$EXTRA_CFLAGS" in
                *-mwin32*) ;;
                *) EXTRA_CFLAGS="-mwin32 $EXTRA_CFLAGS" ;;
            esac
        fi
        rm -f ac$$.o ac$$.c
        ;;
esac
AC_SUBST(EXTRA_CFLAGS)

I also have to add logic to Makefile.in that handles the "EXTRA_CFLAGS"
stuff.

cgf

- Raw text -


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