blob: 4ca7bb5427a83c9c40dc0d73be1a07e8dfcb6de2 [file] [log] [blame]
Carl-Daniel Hailfinger33a65a02011-12-20 00:51:44 +00001/*
2 * This file is part of the flashrom project.
3 *
4 * Copyright (C) 2011 Carl-Daniel Hailfinger
5 *
6 * This program is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License as published by
8 * the Free Software Foundation; version 2 of the License.
9 *
10 * This program is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 * GNU General Public License for more details.
14 *
15 * You should have received a copy of the GNU General Public License
16 * along with this program; if not, write to the Free Software
17 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
18 */
19
20/*
21 * Header file for OS checking.
22 */
23
24// Solaris
25#if defined (__sun) && (defined(__i386) || defined(__amd64))
26#define __FLASHROM_OS__ "SunOS"
27// OS X
28#elif defined(__MACH__) && defined(__APPLE__)
29#define __FLASHROM_OS__ "Darwin"
30// FreeBSD
31#elif defined(__FreeBSD__)
32#define __FLASHROM_OS__ "FreeBSD"
33// DragonFlyBSD
34#elif defined(__DragonFly__)
35#define __FLASHROM_OS__ "DragonFlyBSD"
36// NetBSD
37#elif defined(__NetBSD__)
38#define __FLASHROM_OS__ "NetBSD"
39// OpenBSD
40#elif defined(__OpenBSD__)
41#define __FLASHROM_OS__ "OpenBSD"
42// DJGPP
43#elif defined(__DJGPP__)
44#define __FLASHROM_OS__ "DOS"
45// MinGW (always has _WIN32 available)
46#elif defined(__MINGW32__)
47#define __FLASHROM_OS__ "MinGW"
48// Cygwin (usually without _WIN32)
49#elif defined( __CYGWIN__)
50#define __FLASHROM_OS__ "Cygwin"
51// libpayload
52#elif defined(__LIBPAYLOAD__)
53#define __FLASHROM_OS__ "libpayload"
54// Linux
55#elif defined(__linux__)
56#define __FLASHROM_OS__ "Linux"
57#endif
58__FLASHROM_OS__