-mwin32 test macro

Robert Collins robert.collins@itdomain.com.au
Wed Mar 14 06:16:00 GMT 2001


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
-------------- next part --------------
A non-text attachment was scrubbed...
Name: acinclude.m4
Type: text/x-m4
Size: 1355 bytes
Desc: not available
URL: <http://cygwin.com/pipermail/cygwin-apps/attachments/20010314/3b8b37a7/attachment.bin>


More information about the Cygwin-apps mailing list