blob: 0812c3635bb993397579f4ec4807cefc5693d4ac (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
|
/*
* MRustC - Rust Compiler
* - By John Hodge (Mutabah/thePowersGang)
*
* common/target_detect.h
* - Auto-magical host target detection
*/
#pragma once
// - Windows (MSVC)
#ifdef _MSC_VER
# if defined(_WIN64)
# define DEFAULT_TARGET_NAME "x86_64-windows-msvc"
# else
# define DEFAULT_TARGET_NAME "x86-windows-msvc"
# endif
// - Linux
#elif defined(__linux__)
# if defined(__amd64__)
# define DEFAULT_TARGET_NAME "x86_64-linux-gnu"
# elif defined(__aarch64__)
# define DEFAULT_TARGET_NAME "aarch64-linux-gnu"
# elif defined(__arm__)
# define DEFAULT_TARGET_NAME "arm-linux-gnu"
# elif defined(__i386__)
# define DEFAULT_TARGET_NAME "i586-linux-gnu"
# elif defined(__m68k__)
# define DEFAULT_TARGET_NAME "m68k-linux-gnu"
# else
# warning "Unable to detect a suitable default target (linux-gnu)"
# endif
// - MinGW
#elif defined(__MINGW32__)
# if defined(_WIN64)
# define DEFAULT_TARGET_NAME "x86_64-windows-gnu"
# else
# define DEFAULT_TARGET_NAME "i586-windows-gnu"
# endif
// - FreeBSD
#elif defined(__FreeBSD__)
# if defined(__amd64__)
# define DEFAULT_TARGET_NAME "x86_64-unknown-freebsd"
# elif defined(__aarch64__)
# define DEFAULT_TARGET_NAME "aarch64-unknown-freebsd"
# elif defined(__arm__)
# define DEFAULT_TARGET_NAME "arm-unknown-freebsd"
# elif defined(__i386__)
# define DEFAULT_TARGET_NAME "i686-unknown-freebsd"
# else
# warning "Unable to detect a suitable default target (FreeBSD)"
# endif
// - NetBSD
#elif defined(__NetBSD__)
# if defined(__amd64__)
# define DEFAULT_TARGET_NAME "x86_64-unknown-netbsd"
# else
# warning "Unable to detect a suitable default target (NetBSD)"
# endif
// - OpenBSD
#elif defined(__OpenBSD__)
# if defined(__amd64__)
# define DEFAULT_TARGET_NAME "x86_64-unknown-openbsd"
# elif defined(__aarch64__)
# define DEFAULT_TARGET_NAME "aarch64-unknown-openbsd"
# elif defined(__arm__)
# define DEFAULT_TARGET_NAME "arm-unknown-openbsd"
# elif defined(__i386__)
# define DEFAULT_TARGET_NAME "i686-unknown-openbsd"
# else
# warning "Unable to detect a suitable default target (OpenBSD)"
# endif
// - DragonFly
#elif defined(__DragonFly__)
# define DEFAULT_TARGET_NAME "x86_64-unknown-dragonfly"
// - Apple devices
#elif defined(__APPLE__)
# define DEFAULT_TARGET_NAME "x86_64-apple-macosx"
// - Unknown
#else
# warning "Unable to detect a suitable default target"
#endif
#ifndef DEFAULT_TARGET_NAME
# define DEFAULT_TARGET_NAME ""
#endif
|