From d699a01fabaa04a1aad60f6ca5777f82ee24839a Mon Sep 17 00:00:00 2001 From: Jay Freeman Date: Sun, 6 Apr 2008 10:28:29 +0000 Subject: Drastic, sweeping modifications to support iPhone 1.2.0/2.0. git-svn-id: http://svn.telesphoreo.org/trunk@199 514c082c-b64e-11dc-b46d-3d985efe055d --- util/collect2 | 54 ++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 54 insertions(+) create mode 100755 util/collect2 (limited to 'util/collect2') diff --git a/util/collect2 b/util/collect2 new file mode 100755 index 000000000..30cacb773 --- /dev/null +++ b/util/collect2 @@ -0,0 +1,54 @@ +#!/bin/bash + +unset GCC_EXEC_PREFIX +unset COMPILER_PATH + +unset aspen_version_min +unset macosx_version_min +unset o + +#export | grep 'GCC\|PATH\|PKG' + +function parse() { + while [[ $# -ne 0 ]]; do + if [[ $1 = -maspen-version-min=* ]]; then + maspen_version_min=${1#-maspen-version-min=} + elif [[ $1 = -mmacosx-version-min=* ]]; then + mmacosx_version_min=${1#-mmacosx-version-min=} + elif [[ $1 == -o ]]; then + o=$2 + shift + fi; shift + done +} + +set -e + +eval "parse ${COLLECT_GCC_OPTIONS}" + +if [[ "${maspen_version_min+@}" || "${mmacosx_version_min+@}" ]]; then + darwin= +else + unset darwin +fi + +declare -a flags +if [[ "${darwin+@}" ]]; then + flags[${#flags[@]}]=-no_uuid + + if [[ "${PKG_PATH+@}" ]]; then + flags=("${flags[@]}"$(echo "${PKG_PATH}:" | while read -r -d ':' path; do + find "${path}" -name '*.dylib' -print0 | while read -r -d $'\0' dylib_file; do + dylib_name=${dylib_file#${path}} + echo " -dylib_file ${dylib_name}:${dylib_file}" + done + done)) + fi +fi + +#echo ::: "$("${COLLECT_GCC}" -print-prog-name=collect2)" "$@" "${flags[@]}" +"$("${COLLECT_GCC}" -print-prog-name=collect2)" "$@" "${flags[@]}" + +if [[ "${o+@}" && "${darwin+@}" ]]; then + ldid -T- "$o" +fi -- cgit v1.2.3