1 # geda-host.m4 -*-Autoconf-*-
4 dnl Checks for host platform and features
5 dnl Copyright (C) 2011 Peter TB Brett <peter@peter-b.co.uk>
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.
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.
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
24 AC_REQUIRE([AC_CANONICAL_HOST])dnl
26 # Need to distinguish between native Windows (via MinGW) and Unix
27 # compat. layer on Windows (Cygwin).
34 AC_DEFINE([OS_LINUX], [1],
35 [Define to 1 if on Linux.])
39 AC_DEFINE([OS_WIN32_NATIVE], [1],
40 [Define to 1 if on native Windows.])
44 AC_DEFINE([OS_CYGWIN], [1],
45 [Define to 1 if on Cygwin.])
51 AC_MSG_CHECKING([for Linux host])
52 AC_MSG_RESULT([$OS_LINUX])
54 AC_MSG_CHECKING([for Windows host])
56 if test "$OS_WIN32_NATIVE" = "yes" ||
57 test "$OS_CYGWIN" = "yes" ; then
59 AC_DEFINE([OS_WIN32], [1],
60 [Define to 1 if on Windows.])
62 AC_MSG_RESULT([$OS_WIN32])
64 AC_MSG_CHECKING([for Cygwin host])
65 AC_MSG_RESULT([$OS_CYGWIN])
67 # Carbon is the best way to check for OSX. There are some non-OSX
68 # Darwin platforms out there!
69 AC_MSG_CHECKING([for Mac OS X Carbon host])
72 #include <Carbon/Carbon.h>
73 #include <CoreServices/CoreServices.h>
76 AC_DEFINE([OS_CARBON], [1],
77 [Define to 1 if on Mac OS X Carbon.])])
78 AC_MSG_RESULT([$OS_CARBON])