summaryrefslogtreecommitdiff
path: root/exec.sh
diff options
context:
space:
mode:
authorJay Freeman <saurik@saurik.com>2008-04-06 10:28:29 +0000
committerJay Freeman <saurik@saurik.com>2008-04-06 10:28:29 +0000
commitd699a01fabaa04a1aad60f6ca5777f82ee24839a (patch)
tree1eb62bad23b14a0877c5b9171f2a5f9358c8d592 /exec.sh
parent8a49e427447f40fdd43fc4b5f513b166dd639e2a (diff)
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
Diffstat (limited to 'exec.sh')
-rwxr-xr-xexec.sh51
1 files changed, 51 insertions, 0 deletions
diff --git a/exec.sh b/exec.sh
new file mode 100755
index 000000000..be9d554aa
--- /dev/null
+++ b/exec.sh
@@ -0,0 +1,51 @@
+#!/bin/bash
+set -e
+shopt -s extglob nullglob
+
+export PKG_NAME=${1%_}
+export PKG_BASE=$(realpath "$(dirname "$0")")
+export PATH=${PKG_BASE}/util:$PATH
+shift
+
+source "${PKG_BASE}/helper.sh"
+
+PKG_PATH=
+
+PKG_INCL=
+PKG_LIBS=
+PKG_PKGS=
+
+for dep in $(find -L "${PKG_DATA}"/_metadata -name '*.dep' | cut -d '/' -f - | sort -u); do
+ DEP_NAME=$(basename "${dep}" .dep)
+ DEP_DEST=$(PKG_DEST_ "${DEP_NAME}")
+ PKG_PATH=${PKG_PATH}:${DEP_DEST}
+
+ if [[ -d ${DEP_DEST}/usr/include ]]; then
+ PKG_INCL=${DEP_DEST}/usr/include:${PKG_INCL}
+ fi
+
+ if [[ -d ${DEP_DEST}/usr/lib ]]; then
+ PKG_LIBS=${DEP_DEST}/usr/lib:${PKG_LIBS}
+ fi
+
+ if [[ -d ${DEP_DEST}/usr/lib/pkgconfig ]]; then
+ PKG_PKGS=${DEP_DEST}/usr/lib/pkgconfig:${PKG_PKGS}
+ fi
+done
+
+PKG_PATH=${PKG_PATH}:${PKG_ROOT}
+export PKG_PATH=${PKG_PATH#:}
+
+PKG_INCL=${PKG_INCL%:}
+PKG_LIBS=${PKG_LIBS%:}
+PKG_PKGS=${PKG_PKGS%:}
+
+C_INCLUDE_PATH= \
+COMPILER_PATH=${PKG_BASE}/util \
+CPATH=${PKG_INCL} \
+CPLUS_INCLUDE_PATH= \
+GCC_EXEC_PREFIX=${PKG_PFIX}/lib/gcc \
+LD_LIBRARY_PATH=${PKG_LIBS} \
+LIBRARY_PATH=${PKG_LIBS} \
+PKG_CONFIG_PATH=${PKG_PKGS} \
+ "$@"