Debian Codegraph @

os/darwin/ccconfig.h

raw symbols SCIP
1 /* $Id: ccconfig.h,v 1.21 2021/08/09 07:47:11 gmcgarry Exp $ */
2
3 /*
4 * Copyright (c) 2004 Anders Magnusson ([email protected]).
5 * All rights reserved.
6 *
7 * Redistribution and use in source and binary forms, with or without
8 * modification, are permitted provided that the following conditions
9 * are met:
10 * 1. Redistributions of source code must retain the above copyright
11 * notice, this list of conditions and the following disclaimer.
12 * 2. Redistributions in binary form must reproduce the above copyright
13 * notice, this list of conditions and the following disclaimer in the
14 * documentation and/or other materials provided with the distribution.
15 *
16 * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
17 * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
18 * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
19 * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
20 * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
21 * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
22 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
23 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
24 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
25 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
26 */
27
28 #define XCODE_PLATFORM "MacOSX"
29 #define XCODE_SELECT_LINK "/var/db/xcode_select_link/"
30 #define XCODE_PLATFORM_SDK XCODE_SELECT_LINK "Platforms/" XCODE_PLATFORM ".platform/Developer/SDKs/" XCODE_PLATFORM ".sdk"
31
32 /*
33 * Various settings that controls how the C compiler works.
34 */
35
36 /* common cpp predefines */
37 #define CPPADD { "-D__Darwin__", "-D__APPLE__", "-D__MACH__", "-D__APPLE_CPP__", NULL }
38 #define STDINC XCODE_PLATFORM_SDK "/usr/include"
39 #define CRT0 "crt1.o"
40 #define GCRT0 "gcrt1.o"
41 #define CRTBEGIN_T 0
42 #define CRTEND_T 0
43 #define CRTBEGIN 0
44 #define CRTEND 0
45 #define CRTBEGIN_S "dylib1.o"
46 #define CRTEND_S 0
47 #define CRTI 0
48 #define CRTN 0
49 #define DEFLIBS { "-lSystem", "-lpcc", NULL }
50 #define DEFPROFLIBS { "-lSystem_profile", "-lpcc", NULL }
51 #define DEFLIBDIRS { XCODE_PLATFORM_SDK "/usr/lib", NULL }
52 #define STARTLABEL "start"
53
54 #ifdef LANG_F77
55 #define F77LIBLIST { "-L" PCCLIBDIR, "-lF77", "-lI77", "-lm", "-lc", NULL };
56 #endif
57
58 /*
59 ld -arch ppc -weak_reference_mismatches non-weak -o a.out -lcrt1.o -lcrt2.o -L/usr/lib/gcc/powerpc-apple-darwin8/4.0.1 hello_ppc.o -lgcc -lSystemStubs -lSystem
60 */
61
62 #if defined(mach_i386)
63 #define CPPMDADD { "-D__i386__", "-D__LITTLE_ENDIAN__", NULL }
64 #elif defined(mach_powerpc)
65 #define CPPMDADD { "-D__ppc__", "-D__BIG_ENDIAN__", NULL }
66 #elif defined(mach_amd64)
67 #define CPPMDADD \
68 { "-D__x86_64__", "-D__x86_64", "-D__amd64__", "-D__amd64", \
69 "-D__LP64__", "-D_LP64", "-D__LITTLE_ENDIAN__", NULL }
70 #elif define(mach_m68k)
71 #define CPPMDADD { "-D__m68k__", "-D__BIG_ENDIAN__", NULL }
72 #else
73 #error defines for arch missing
74 #endif
75
76
77 /*
78 * Deal with some darwin-specific args.
79 */
80 #define PCC_EARLY_ARG_CHECK { \
81 if (match(argp, "-install_name")) { \
82 strlist_append(&middle_linker_flags, argp); \
83 strlist_append(&middle_linker_flags, nxtopt(0)); \
84 continue; \
85 } else if (match(argp, "-compatibility_version") || \
86 match(argp, "-current_version")) { \
87 strlist_append(&middle_linker_flags, argp); \
88 strlist_append(&middle_linker_flags, nxtopt(0)); \
89 continue; \
90 } else if (strcmp(argp, "-dynamiclib") == 0) { \
91 shared = 1; \
92 continue; \
93 } else if (strcmp(argp, "-shared") == 0) { \
94 oerror(argp); \
95 continue; \
96 } else if (strncmp(argp, "-mmacosx-version-min", 20) == 0) { \
97 char tmp[10]; \
98 char *p = &argp[21]; \
99 int idx = 0; \
100 while (*p != 0) { \
101 if (*p != '.') \
102 tmp[idx++] = *p; \
103 p++; \
104 } \
105 while (idx < 4) \
106 tmp[idx++] = '0'; \
107 tmp[idx] = 0; \
108 strlist_append(&preprocessor_flags, cat("-D__ENVIRONMENT_MAC_OS_X_VERSION_MIN_REQUIRED__=", tmp)); \
109 strlist_append(&middle_linker_flags, "-macosx_version_min"); \
110 strlist_append(&middle_linker_flags, &argp[21]); \
111 continue; \
112 } else if (strcmp(argp, "-framework") == 0) { \
113 strlist_append(&middle_linker_flags, argp); \
114 strlist_append(&middle_linker_flags, nxtopt(0)); \
115 continue; \
116 } \
117 }