]> git.lyx.org Git - lyx.git/blob - config/cygwin.m4
One letter typo
[lyx.git] / config / cygwin.m4
1 # Macro added for some Cygwin-specific support     -*- sh -*-
2 # @author@: Kayvan Sylvan
3
4 AC_DEFUN(CHECK_WITH_CYGWIN,
5 [
6   case $host_os in
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.
12       #
13       msnative_struct=''
14       AC_MSG_CHECKING([how to get MSVC-compatible struct packing])
15       case `$CC --version | sed -e 's,\..*,.,' -e q` in
16       2.)
17         if $CC -v --help 2>/dev/null | grep fnative-struct > /dev/null; then
18         msnative_struct='-fnative-struct'
19         fi
20         ;;
21       *)
22         if $CC -v --help 2>/dev/null | grep ms-bitfields > /dev/null; then
23         msnative_struct='-mms-bitfields'
24         fi
25         ;;
26       esac
27
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])
31       else
32         CXXFLAGS="$CXXFLAGS $msnative_struct"
33         AC_MSG_RESULT([${msnative_struct}])
34       fi
35     fi
36
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'
42       AC_MSG_RESULT([yes])
43     else
44       AC_MSG_RESULT([no])
45     fi
46     if test x"$WIN32_LD_EXPORT_ALL_SYMBOLS" != x; then
47       LDFLAGS="$LDFLAGS $WIN32_LD_EXPORT_ALL_SYMBOLS"
48     fi
49     ;;
50   esac
51 ])