]> git.saurik.com Git - apple/ld64.git/blame - src/create_configure
ld64-224.1.tar.gz
[apple/ld64.git] / src / create_configure
CommitLineData
ebf6f434
A
1#!/bin/bash
2
3echo "" > ${DERIVED_FILE_DIR}/configure.h
4
5if [ -n "${IPHONEOS_DEPLOYMENT_TARGET}" ]; then
6 echo "#define DEFAULT_IPHONEOS_MIN_VERSION \"${IPHONEOS_DEPLOYMENT_TARGET}\"" >> ${DERIVED_FILE_DIR}/configure.h
7else
8 if [ -n "${MACOSX_DEPLOYMENT_TARGET}" ]; then
9 echo "#define DEFAULT_MACOSX_MIN_VERSION \"${MACOSX_DEPLOYMENT_TARGET}\"" >> ${DERIVED_FILE_DIR}/configure.h
10 fi
11fi
12
13if [ -z "${RC_SUPPORTED_ARCHS}" ]; then
f80fe69f 14 RC_SUPPORTED_ARCHS="i386 x86_64 armv7 armv7s arm64"
ebf6f434
A
15fi
16
17for ANARCH in ${RC_SUPPORTED_ARCHS}
18do
f80fe69f 19 KNOWN_ARCHS=",armv4t,armv5,armv6,armv7,armv7f,armv7k,armv7s,armv6m,armv7m,armv7em,armv8,arm64,arm64v8,i386,x86_64,"
ebf6f434
A
20 FOUND=`echo "$KNOWN_ARCHS" | grep ",$ANARCH,"`
21 if [ $FOUND ]; then
22 echo "#define SUPPORT_ARCH_$ANARCH 1" >> ${DERIVED_FILE_DIR}/configure.h
23 else
f80fe69f 24 echo "#error unknown architecture: $ANARCH" >> ${DERIVED_FILE_DIR}/configure.h
ebf6f434
A
25 fi
26done
27
28echo "#define ALL_SUPPORTED_ARCHS \"${RC_SUPPORTED_ARCHS}\"" >> ${DERIVED_FILE_DIR}/configure.h
29
30
31# <rdar://problem/10897631> ld64 hardcodes a reference to /Developer/usr/lib/libLTO.dylib
32if [ -n "${DT_TOOLCHAIN_DIR}" ]
33then
34 echo "-Wl,-lazy_library,${DT_TOOLCHAIN_DIR}/usr/lib/libLTO.dylib" > ${DERIVED_SOURCES_DIR}/LTO_option.txt
35else
36 if [ -e "/Developer/usr/lib/libLTO.dylib" ]
37 then
38 echo "-Wl,-lazy_library,/Developer/usr/lib/libLTO.dylib" > ${DERIVED_SOURCES_DIR}/LTO_option.txt
39 else
40 echo "-Wl,-lazy_library,${BUILT_PRODUCTS_DIR}/../lib/libLTO.dylib" > ${DERIVED_SOURCES_DIR}/LTO_option.txt
41 fi
42fi
43
44
45