1 # Macro added for some Cygwin-specific support -*- sh -*-
2 # @author@: Kayvan Sylvan
4 AC_DEFUN([CHECK_WITH_CYGWIN],
7 cygwin* | mingw* | pw32* )
8 if test "$GCC" = yes; then
9 # Ensure MSVC-compatible struct packing convention.
10 # Depends on GCC version. gcc2 uses -fnative-struct while
11 # gcc3 uses -mms-bitfields.
14 AC_MSG_CHECKING([how to get MSVC-compatible struct packing])
15 case `$CC --version | sed -e 's,\..*,.,' -e q` in
17 if $CC -v --help 2>/dev/null | grep fnative-struct > /dev/null; then
18 msnative_struct='-fnative-struct'
22 if $CC -v --help 2>/dev/null | grep ms-bitfields > /dev/null; then
23 msnative_struct='-mms-bitfields'
28 if test x"$msnative_struct" = x; then
29 AC_MSG_RESULT([no way])
30 AC_MSG_WARN([produced libraries might be incompatible with MSVC libs])
32 CXXFLAGS="$CXXFLAGS $msnative_struct"
33 AC_MSG_RESULT([${msnative_struct}])
37 # Export all symbols to Win32 DLL using MinGW 2.0 ld.
38 WIN32_LD_EXPORT_ALL_SYMBOLS=''
39 AC_MSG_CHECKING([whether ld accepts --export-all-symbols])
40 if $LD --help 2>&1 | egrep 'export-all-symbols' > /dev/null; then
41 WIN32_LD_EXPORT_ALL_SYMBOLS='-Wl,--export-all-symbols'
46 if test x"$WIN32_LD_EXPORT_ALL_SYMBOLS" != x; then
47 LDFLAGS="$LDFLAGS $WIN32_LD_EXPORT_ALL_SYMBOLS"