]> git.saurik.com Git - apple/libc.git/blame - xcodescripts/libc.xcconfig
Libc-997.1.1.tar.gz
[apple/libc.git] / xcodescripts / libc.xcconfig
CommitLineData
ad3c9f2a
A
1#include "<DEVELOPER_DIR>/Makefiles/CoreOS/Xcode/BSD.xcconfig"
2
3// Standard settings
4SUPPORTED_PLATFORMS = macosx iphoneos iphonesimulator
6465356a 5SRCROOT_SEARCH_PATHS = $(SRCROOT) $(SRCROOT)/include $(SRCROOT)/gen $(SRCROOT)/locale $(SRCROOT)/locale/FreeBSD $(SRCROOT)/stdtime/FreeBSD
ad3c9f2a 6SYSTEM_FRAMEWORK_HEADERS = $(SDKROOT)/System/Library/Frameworks/System.framework/PrivateHeaders
6465356a 7HEADER_SEARCH_PATHS = $($(TARGET_NAME)_SEARCH_PATHS) $(DERIVED_FILES_DIR)/dtrace $(SRCROOT_SEARCH_PATHS) $(SYSTEM_FRAMEWORK_HEADERS) $(SDKROOT)/usr/local/include $(inherited)
ad3c9f2a
A
8ALWAYS_SEARCH_USER_PATHS = YES
9USE_HEADERMAP = NO
10BUILD_VARIANTS = normal
11GCC_OPTIMIZATION_LEVEL = s
12GCC_C_LANGUAGE_STANDARD = gnu99
13GCC_ENABLE_OBJC_EXCEPTIONS = YES
14GCC_SYMBOLS_PRIVATE_EXTERN = NO
15GCC_DYNAMIC_NO_PIC = NO
16GCC_THUMB_SUPPORT = YES
6465356a
A
17GCC_TREAT_IMPLICIT_FUNCTION_DECLARATIONS_AS_ERRORS = YES;
18GCC_WARN_UNINITIALIZED_AUTOS = YES;
19GCC_WARN_UNUSED_VARIABLE = YES;
20GCC_WARN_ABOUT_RETURN_TYPE = YES;
21WARNING_CFLAGS = "-Wall";
22
ad3c9f2a
A
23COPY_PHASE_STRIP = NO
24SKIP_INSTALL = YES
25INSTALLHDRS_SCRIPT_PHASE = YES
26VERSIONING_SYSTEM =
27COPY_PHASE_STRIP = NO
28STRIP_INSTALLED_PRODUCT = NO
29LD_DYLIB_INSTALL_NAME = /usr/lib/system/$(EXECUTABLE_NAME)
30
31BUILD_VARIANTS = normal debug
6465356a 32BUILD_ARCHIVES = Platform Base FreeBSD NetBSD TRE vCancelable vDarwinExtsn vDarwinExtsnCancelable vPre1050 vLegacy vInode32 FortifySource
ad3c9f2a 33
6465356a 34// clang is desired over llvm-gcc for OSAtomics. However, it isn't capable of building armv6 correctly.
ad3c9f2a
A
35GCC_VERSION = com.apple.compilers.llvm.clang.1_0
36GCC_VERSION[arch=armv6] = com.apple.compilers.llvmgcc42
37
38EXECUTABLE_PREFIX = libsystem_
39INSTALL_PATH = /usr/lib/system
40PUBLIC_HEADERS_FOLDER_PATH = /usr/include
41PRIVATE_HEADERS_FOLDER_PATH = /usr/local/include
42
43// Simulator
44EXECUTABLE_PREFIX[sdk=iphonesimulator*] = libsystem_sim_
45PUBLIC_HEADERS_FOLDER_PATH[sdk=iphonesimulator*] = $(SDKROOT)/usr/include
46PRIVATE_HEADERS_FOLDER_PATH[sdk=iphonesimulator*] = $(SDKROOT)/usr/local/include
47INSTALL_PATH[sdk=iphonesimulator*] = $(SDKROOT)/usr/lib/system
48
49BASE_PREPROCESSOR_MACROS = __LIBC__ __DARWIN_UNIX03=1 __DARWIN_64_BIT_INO_T=1 __DARWIN_NON_CANCELABLE=1 __DARWIN_VERS_1050=1 _FORTIFY_SOURCE=0
6465356a 50OTHER_CFLAGS = -fdollars-in-identifiers -fno-common -fverbose-asm $($(TARGET_NAME)_CFLAGS) $(VARIANT_PREPROCESSOR_MACROS)
ad3c9f2a
A
51OTHER_CFLAGS_debug = -fstack-protector -fno-inline -O0 -DDEBUG=1
52
53GCC_PREPROCESSOR_DEFINITIONS = $(BASE_PREPROCESSOR_MACROS)
6465356a 54GCC_PREPROCESSOR_DEFINITIONS[sdk=iphone*] = $(BASE_PREPROCESSOR_MACROS) LIBC_NO_LIBCRASHREPORTERCLIENT=1
ad3c9f2a
A
55
56// libsystem_c.dylib linking
57CR_LDFLAGS[sdk=macosx*] = -lCrashReporterClient
58LIBCOMPILER_RT_LDFLAGS = -lcompiler_rt
6465356a
A
59LIBCOMPILER_RT_LDFLAGS[sdk=iphonesimulator*] = -lcompiler_rt_sim
60LIBMALLOC_LDFLAGS = -lsystem_malloc
61LIBMALLOC_LDFLAGS[sdk=iphonesimulator*] =
62LIBPLATFORM_LDFLAGS = -lsystem_platform
63LIBPLATFORM_LDFLAGS[sdk=iphonesimulator*] =
64LIBPTHREAD_LDFLAGS = -lsystem_pthread
65LIBPTHREAD_LDFLAGS[sdk=iphonesimulator*] =
66LIBSYSCALL_LDFLAGS = -lsystem_kernel
67LIBSYSCALL_LDFLAGS[sdk=iphonesimulator*] =
68LIBM_LDFLAGS = -lsystem_m
69LIBM_LDFLAGS[sdk=iphonesimulator*] = -lsystem_sim_m
70LIBDYLD_LDFLAGS = -ldyld
71LIBDYLD_LDFLAGS[sdk=iphonesimulator*] = -ldyld_sim
72LIBSYSTEM_C_LDFLAGS = -all_load -nostdlib -L/usr/lib/system -umbrella System $(CR_LDFLAGS) $(LIBCOMPILER_RT_LDFLAGS) $(LIBDYLD_LDFLAGS) $(LIBSYSCALL_LDFLAGS) $(LIBM_LDFLAGS) $(LIBMALLOC_LDFLAGS) $(LIBPLATFORM_LDFLAGS) $(LIBPTHREAD_LDFLAGS) $(UPWARD_LDFLAGS) -Wl,-interposable_list,$(DERIVED_FILES_DIR)/interposable.list -Wl,-unexported_symbols_list,$(DERIVED_FILES_DIR)/unexport.list -Wl,-alias_list,$(SRCROOT)/string/alias.list @$(BUILT_PRODUCTS_DIR)/$(CURRENT_VARIANT).linklist
73
74// TODO: Remove upward links - mostly <rdar://problem/13183469>, macho is for assumes.c
75UPWARD_LDFLAGS = -Wl,-upward-ldispatch -Wl,-upward-llaunch -Wl,-upward-lmacho -Wl,-upward-lsystem_asl -Wl,-upward-lsystem_blocks -Wl,-upward-lsystem_info -Wl,-upward-lsystem_notify -Wl,-upward-lxpc
76UPWARD_LDFLAGS[sdk=iphonesimulator*] = -Wl,-upward-ldispatch -Wl,-upward-lmacho_sim -Wl,-upward-lsystem_sim_blocks -Wl,-upward-lsystem_sim_info -Wl,-upward-lnotify_sim -Wl,-upward-lxpc -Wl,-upward-lSystem
ad3c9f2a
A
77
78// libPlatform.a architectures
79ARCH_FAMILY = $(ARCH_FAMILY_$(CURRENT_ARCH))
80ARCH_FAMILY_x86_64 = x86_64
81ARCH_FAMILY_i386 = i386
82ARCH_FAMILY_armv6 = arm
83ARCH_FAMILY_armv7 = arm
065eae9f 84ARCH_FAMILY_armv7s = arm
ad3c9f2a
A
85ARCH_FAMILY_armv7f = arm
86ARCH_FAMILY_armv7k = arm
87
6465356a
A
88// Platform target
89Platform_INCLUDED_SOURCE_FILE_NAMES = $(Platform_INCLUDED_SOURCE_FILE_NAMES_$(PLATFORM_NAME))
90Platform_INCLUDED_SOURCE_FILE_NAMES_macosx = $(Platform_INCLUDED_SOURCE_FILE_NAMES_gen) $(Platform_INCLUDED_SOURCE_FILE_NAMES_stdlib) $(Platform_INCLUDED_SOURCE_FILE_NAMES_string) $(Platform_INCLUDED_SOURCE_FILE_NAMES_sys)
91Platform_INCLUDED_SOURCE_FILE_NAMES_iphoneos = $(Platform_INCLUDED_SOURCE_FILE_NAMES_gen) $(Platform_INCLUDED_SOURCE_FILE_NAMES_stdlib) $(Platform_INCLUDED_SOURCE_FILE_NAMES_string) $(Platform_INCLUDED_SOURCE_FILE_NAMES_sys)
92Platform_INCLUDED_SOURCE_FILE_NAMES_iphonesimulator = $(Platform_INCLUDED_SOURCE_FILE_NAMES_gen) $(Platform_INCLUDED_SOURCE_FILE_NAMES_stdlib) $(Platform_INCLUDED_SOURCE_FILE_NAMES_string)
93
94Platform_INCLUDED_SOURCE_FILE_NAMES_gen = $(ARCH_FAMILY)/gen/*.c $(ARCH_FAMILY)/gen/*.s $(ARCH_FAMILY)/gen/*.S
95Platform_INCLUDED_SOURCE_FILE_NAMES_stdlib = $(ARCH_FAMILY)/stdlib/*.c $(ARCH_FAMILY)/stdlib/*.s $(ARCH_FAMILY)/stdlib/*.S
96Platform_INCLUDED_SOURCE_FILE_NAMES_string = $(ARCH_FAMILY)/string/*.c $(ARCH_FAMILY)/string/*.s $(ARCH_FAMILY)/string/*.S
97Platform_INCLUDED_SOURCE_FILE_NAMES_sys = $(ARCH_FAMILY)/sys/*.c $(ARCH_FAMILY)/sys/*.s $(ARCH_FAMILY)/sys/*.S
98
ad3c9f2a
A
99// FreeBSD target
100FreeBSD_CFLAGS = -include $(SRCROOT)/fbsdcompat/_fbsd_compat_.h
101FreeBSD_SEARCH_PATHS = $(SRCROOT)/fbsdcompat $(SRCROOT)/gdtoa $(SRCROOT)/gdtoa/FreeBSD
102FreeBSD_EXCLUDED_SOURCE_GDTOA = gdtoa/FreeBSD/machdep* gdtoa-strtopx.c
103// Include the correct parts of gdtoa per-arch
104FreeBSD_INCLUDED_SOURCE_FILE_NAMES_x86_64 = gdtoa-strtopx.c machdep_ldisx.c
105FreeBSD_INCLUDED_SOURCE_FILE_NAMES_i386 = $(FreeBSD_INCLUDED_SOURCE_FILE_NAMES_x86_64)
106FreeBSD_INCLUDED_SOURCE_FILE_NAMES_armv7 = machdep_ldisd.c
065eae9f 107FreeBSD_INCLUDED_SOURCE_FILE_NAMES_armv7s = $(FreeBSD_INCLUDED_SOURCE_FILE_NAMES_armv7)
ad3c9f2a
A
108FreeBSD_INCLUDED_SOURCE_FILE_NAMES_armv7k = $(FreeBSD_INCLUDED_SOURCE_FILE_NAMES_armv7)
109FreeBSD_INCLUDED_SOURCE_FILE_NAMES_armv7f = $(FreeBSD_INCLUDED_SOURCE_FILE_NAMES_armv7)
110FreeBSD_INCLUDED_SOURCE_FILE_NAMES_armv6 = $(FreeBSD_INCLUDED_SOURCE_FILE_NAMES_armv7)
111
ad3c9f2a
A
112// NetBSD target
113NetBSD_CFLAGS = -include $(SRCROOT)/nbsdcompat/_nbsd_compat_.h
114NetBSD_SEARCH_PATHS = $(SRCROOT)/nbsdcompat
115
116// TRE target
117TRE_CFLAGS = -DHAVE_CONFIG_H
118TRE_SEARCH_PATHS = $(SRCROOT)/regex/TRE $(SRCROOT)/regex/FreeBSD
119
120// Files per architecture to exclude from the non-platform builds (because optimised versions exist in Platform)
121BASE_EXCLUDED_SOURCE_FILE_NAMES = $(BASE_EXCLUDED_SOURCE_FILE_NAMES_$(CURRENT_ARCH)) $(BASE_EXCLUDED_SOURCE_FILE_NAMES_$(PLATFORM_NAME))
6465356a
A
122BASE_EXCLUDED_SOURCE_FILE_NAMES_x86_64 = kvm.c nlist.c strcpy.c strlen.c strncpy.c strnlen.c
123BASE_EXCLUDED_SOURCE_FILE_NAMES_i386 = strcpy.c strlcat.c strlcpy.c strlen.c strncpy.c
124BASE_EXCLUDED_SOURCE_FILE_NAMES_armv7 = strlen.c strnlen.c strstr.c
065eae9f 125BASE_EXCLUDED_SOURCE_FILE_NAMES_armv7s = $(BASE_EXCLUDED_SOURCE_FILE_NAMES_armv7)
ad3c9f2a
A
126BASE_EXCLUDED_SOURCE_FILE_NAMES_armv7k = $(BASE_EXCLUDED_SOURCE_FILE_NAMES_armv7)
127BASE_EXCLUDED_SOURCE_FILE_NAMES_armv7f = $(BASE_EXCLUDED_SOURCE_FILE_NAMES_armv7)
128BASE_EXCLUDED_SOURCE_FILE_NAMES_armv6 = $(BASE_EXCLUDED_SOURCE_FILE_NAMES_armv7)
129
6465356a
A
130// utmp/utmpx doesn't really fit in iOS, and this has some dependence on
131// libasl, so ignore it for now.
132BASE_EXCLUDED_SOURCE_FILE_NAMES_sim_utmpx = utmpx-darwin.c utmpx.c logwtmp.c
133
134// Others which at one point in time were tied too closely to the host.
135// It's probably a good idea to have only one set of functions accessing the
136// environment at a given time, but the rest may not need to be excluded
137// any more. This should be investigated.
138BASE_EXCLUDED_SOURCE_FILE_NAMES_sim_misc = thread_stack_pcs.c backtrace.c getenv.c putenv.c setenv.c stack_protector.c crt_externs.c gettimeofday.c
139
140BASE_EXCLUDED_SOURCE_FILE_NAMES_sim = $(BASE_EXCLUDED_SOURCE_FILE_NAMES_sim_utmpx) $(BASE_EXCLUDED_SOURCE_FILE_NAMES_sim_misc)
141
ad3c9f2a
A
142// Rune support isn't included on iOS but there's no better way to exclude their complication
143BASE_EXCLUDED_SOURCE_FILE_NAMES_macosx = OSMemoryNotification.c OSThermalNotification.c
144BASE_EXCLUDED_SOURCE_FILE_NAMES_iphoneos = frune.c login.c logout.c mbrune.c runedepreciated.c setinvalidrune.c getmntinfo64.c
6465356a 145BASE_EXCLUDED_SOURCE_FILE_NAMES_iphonesimulator = $(BASE_EXCLUDED_SOURCE_FILE_NAMES_sim) $(BASE_EXCLUDED_SOURCE_FILE_NAMES_iphoneos)
ad3c9f2a
A
146
147// <rdar://problem/9513665> - collate.c crashes llvm-gcc on armv6 with -Os + -gdwarf-2
148COLLATE_C_CFLAGS_macosx_armv6 = -O1
149
150// ARMv6 thumb doesn't support all the instructions needed for OSAtomics
151OSATOMIC_C_CFLAGS_macosx_armv6 = -mno-thumb
152OSATOMIC_C_CFLAGS_iphoneos_armv6 = -mno-thumb
6465356a
A
153
154// Make sure that OSAtomic isn't build unoptimised, otherwise the inlines
155// don't do what they are designed to do.
156OSATOMIC_C_CFLAGS = -Os -momit-leaf-frame-pointer $(OSATOMIC_C_CFLAGS_$(PLATFORM_NAME)_$(CURRENT_ARCH))