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]

-mwin32 test macro


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

acinclude.m4


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