1 | /* $Id: ccconfig.h,v 1.4 2008/07/18 06:53:48 gmcgarry Exp $ */
|
---|
2 | /*-
|
---|
3 | * Copyright (c) 2007, 2008
|
---|
4 | * Thorsten Glaser <tg@mirbsd.de>
|
---|
5 | *
|
---|
6 | * Provided that these terms and disclaimer and all copyright notices
|
---|
7 | * are retained or reproduced in an accompanying document, permission
|
---|
8 | * is granted to deal in this work without restriction, including un-
|
---|
9 | * limited rights to use, publicly perform, distribute, sell, modify,
|
---|
10 | * merge, give away, or sublicence.
|
---|
11 | *
|
---|
12 | * This work is provided "AS IS" and WITHOUT WARRANTY of any kind, to
|
---|
13 | * the utmost extent permitted by applicable law, neither express nor
|
---|
14 | * implied; without malicious intent or gross negligence. In no event
|
---|
15 | * may a licensor, author or contributor be held liable for indirect,
|
---|
16 | * direct, other damage, loss, or other issues arising in any way out
|
---|
17 | * of dealing in the work, even if advised of the possibility of such
|
---|
18 | * damage or existence of a defect, except proven that it results out
|
---|
19 | * of said person's immediate fault when using the work as intended.
|
---|
20 | */
|
---|
21 |
|
---|
22 | /**
|
---|
23 | * Configuration for pcc on a MidnightBSD (amd64, i386 or sparc64) target
|
---|
24 | */
|
---|
25 |
|
---|
26 | /* === mi part === */
|
---|
27 |
|
---|
28 | #ifndef LIBDIR
|
---|
29 | #define LIBDIR "/usr/lib/"
|
---|
30 | #endif
|
---|
31 |
|
---|
32 | /* cpp MI defines */
|
---|
33 | #define CPPADD { \
|
---|
34 | "-D__MidnightBSD__", \
|
---|
35 | "-D__FreeBSD__", \
|
---|
36 | "-D__unix__", \
|
---|
37 | "-D__unix", \
|
---|
38 | "-Dunix", \
|
---|
39 | "-D__ELF__", \
|
---|
40 | "-D_LONGLONG", \
|
---|
41 | NULL \
|
---|
42 | }
|
---|
43 |
|
---|
44 | /* for dynamically linked binaries */
|
---|
45 | #define DYNLINKER { \
|
---|
46 | "-dynamic-linker", \
|
---|
47 | "/libexec/ld-elf.so.1", \
|
---|
48 | NULL \
|
---|
49 | }
|
---|
50 | #define STARTFILES { \
|
---|
51 | LIBDIR "crti.o", \
|
---|
52 | LIBDIR "crtbegin.o", \
|
---|
53 | NULL \
|
---|
54 | }
|
---|
55 | #define ENDFILES { \
|
---|
56 | LIBDIR "crtend.o", \
|
---|
57 | LIBDIR "crtn.o", \
|
---|
58 | NULL \
|
---|
59 | }
|
---|
60 |
|
---|
61 | /* for shared libraries */
|
---|
62 | #define STARTFILES_S { \
|
---|
63 | LIBDIR "crti.o", \
|
---|
64 | LIBDIR "crtbeginS.o", \
|
---|
65 | NULL \
|
---|
66 | }
|
---|
67 | #define ENDFILES_S { \
|
---|
68 | LIBDIR "crtendS.o", \
|
---|
69 | LIBDIR "crtn.o", \
|
---|
70 | NULL \
|
---|
71 | }
|
---|
72 |
|
---|
73 | /* for statically linked binaries */
|
---|
74 | #define STARTFILES_T { \
|
---|
75 | LIBDIR "crti.o", \
|
---|
76 | LIBDIR "crtbeginT.o", \
|
---|
77 | NULL \
|
---|
78 | }
|
---|
79 | #define ENDFILES_T { \
|
---|
80 | LIBDIR "crtend.o", \
|
---|
81 | LIBDIR "crtn.o", \
|
---|
82 | NULL \
|
---|
83 | }
|
---|
84 |
|
---|
85 | #define LIBCLIBS { \
|
---|
86 | "-lc", \
|
---|
87 | "-lpcc", \
|
---|
88 | NULL \
|
---|
89 | }
|
---|
90 | #define LIBCLIBS_PROFILE { \
|
---|
91 | "-lc_p", \
|
---|
92 | "-lpcc", \
|
---|
93 | NULL \
|
---|
94 | }
|
---|
95 |
|
---|
96 |
|
---|
97 | /* C run-time startup */
|
---|
98 | #define CRT0FILE LIBDIR "crt1.o"
|
---|
99 | #define CRT0FILE_PROFILE LIBDIR "gcrt1.o"
|
---|
100 | #define STARTLABEL "_start"
|
---|
101 |
|
---|
102 | /* debugging info */
|
---|
103 | #define STABS
|
---|
104 |
|
---|
105 | /* === md part === */
|
---|
106 |
|
---|
107 | #if defined(mach_i386)
|
---|
108 | #define CPPMDADD { \
|
---|
109 | "-D__i386__", \
|
---|
110 | "-D__i386", \
|
---|
111 | "-Di386", \
|
---|
112 | NULL, \
|
---|
113 | }
|
---|
114 | #elif defined(mach_sparc64)
|
---|
115 | #define CPPMDADD { \
|
---|
116 | "-D__sparc64__", \
|
---|
117 | "-D__sparc_v9__", \
|
---|
118 | "-D__sparcv9", \
|
---|
119 | "-D__sparc__", \
|
---|
120 | "-D__sparc", \
|
---|
121 | "-Dsparc", \
|
---|
122 | "-D__arch64__", \
|
---|
123 | "-D__LP64__", \
|
---|
124 | "-D_LP64", \
|
---|
125 | NULL, \
|
---|
126 | }
|
---|
127 | #elif defined(mach_amd64)
|
---|
128 | #error pcc does not support amd64 yet
|
---|
129 | #else
|
---|
130 | #error this architecture is not supported by MidnightBSD
|
---|
131 | #endif
|
---|