refdes_renum: warn of possible number clash with non-conforming values
[geda-gaf/whiteaudio.git] / m4 / geda-windows.m4
blob2e26d947d373f2fa1750c057cf03d89a52174d06
1 # geda-windows.m4                                           -*-Autoconf-*-
2 # serial 1
4 dnl Check Windows-specific flags
5 dnl Copyright (C) 2009  Cesar Strauss <cestrauss@gmail.com>
6 dnl
7 dnl This program is free software; you can redistribute it and/or modify
8 dnl it under the terms of the GNU General Public License as published by
9 dnl the Free Software Foundation; either version 2 of the License, or
10 dnl (at your option) any later version.
11 dnl
12 dnl This program is distributed in the hope that it will be useful,
13 dnl but WITHOUT ANY WARRANTY; without even the implied warranty of
14 dnl MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
15 dnl GNU General Public License for more details.
16 dnl
17 dnl You should have received a copy of the GNU General Public License
18 dnl along with this program; if not, write to the Free Software
19 dnl Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
21 # The Windows platform has a native gcc port (MinGW) and a
22 # POSIX compliant one (Cygwin). Both need specific flags to
23 # build correctly.
25 # The rules are:
27 # On all Windows platforms, pass -no-undefined to libtool.
28 # This allows shared libraries (DLLs) to be built.
29 #  
30 # On MinGW, use the -mms-bitfields compiler flag.
31 # This increases compatibility with the MSVC compiler.
33 # On MinGW, pass -mwindows when linking GUI-only applications.
34 # This avoids opening a text console when running from a shortcut.
35   
36 AC_DEFUN([AX_WINDOWS_FLAGS],
38   AC_PREREQ([2.60])dnl
39   AC_REQUIRE([AX_HOST])dnl
41   if test "$PLATFORM_WIN32" = "yes"; then
42     WINDOWS_LIBTOOL_FLAGS=-no-undefined
43   fi
45   if test "$PLATFORM_WIN32_NATIVE" = "yes"; then
46     MINGW_GUI_LDFLAGS=-mwindows
47     MINGW_CFLAGS="-mms-bitfields"
48   fi
50   AC_SUBST(WINDOWS_LIBTOOL_FLAGS)
51   AC_SUBST(MINGW_GUI_LDFLAGS)
52   AC_SUBST(MINGW_CFLAGS)