autoconf
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

-mwin32 test macro


From: Robert Collins
Subject: -mwin32 test macro
Date: Thu, 15 Mar 2001 01:15:31 +1100

I've put together a autoconf macro to configure CC to include the Win32
API, if it is available. I've only put in the methods _I know of and can
test_, more fallback tests are welcome.

Sample code to use it in configure.in, when the program _needs_ the
win32 API:

AC_CANONICAL_HOST

case "${host}" in
*-*-cygwin*)
        AC_PROG_CC_WIN32
        test "$ac_cc_win32" = "no" && { echo "configure: error: Win32
API needed and no ac
ceptable cc could be found" 1>&2; exit 1; }
        ;;
esac


It sets ac_cc_win32 to yes or no as appropriate, so test writers in
configure.in can do an AC_SUBST or AC_DEFINE and switch off bits of
their code, or do as above, and fail the configure script.

It's my first foray into m4 beyond being a bare bones configure.in
tweaker, so if I'm breaking coding rules etc just let me know and I'll
go fix it up.

This test should allow existing programs that build under the Cygwin net
release gcc-2.95.2-6 or before (current release) or under the new
gcc-2.95.2-9 which no longer has the Win32 API by default.

If this looks ok I'll submit it to the autoconf macro archive..

Rob

Attachment: acinclude.m4
Description: Binary data


reply via email to

[Prev in Thread] Current Thread [Next in Thread]