This is the mail archive of the cygwin-apps@cygwin.com mailing list for the Cygwin project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Re: -mwin32 again


Christopher Faylor wrote:
> 
> 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.
> 

I believe this to be the best you can do.  It's unfortunate that so many
are intertwined with the w32api.  Is there any possibility for just
removing the w32api dependency in any of the applications to reduce the
number that require it?

Earnie.

_________________________________________________________
Do You Yahoo!?
Get your free @yahoo.com address at http://mail.yahoo.com



Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]