summaryrefslogtreecommitdiffstats
path: root/tools
diff options
context:
space:
mode:
authorViktor Szakats <vszakats@users.noreply.github.com>2017-03-13 12:29:34 (GMT)
committerViktor Szakats <vszakats@users.noreply.github.com>2017-03-14 16:08:02 (GMT)
commite1471ec0552d0bd5c2bb22dfa29d196e97fc4d95 (patch)
tree61e4826a930b3d7a6db6b5419f60f5fbca063bbb /tools
parentd37b0deb49239b9f9a3489c3d86506c34586b587 (diff)
downloadmxe-e1471ec0552d0bd5c2bb22dfa29d196e97fc4d95.zip
mxe-e1471ec0552d0bd5c2bb22dfa29d196e97fc4d95.tar.gz
mxe-e1471ec0552d0bd5c2bb22dfa29d196e97fc4d95.tar.bz2
rewrite hardcoded absolute paths
Diffstat (limited to 'tools')
-rwxr-xr-xtools/mxe-get16
1 files changed, 15 insertions, 1 deletions
diff --git a/tools/mxe-get b/tools/mxe-get
index 11bccd4..b9ec5ff 100755
--- a/tools/mxe-get
+++ b/tools/mxe-get
@@ -135,10 +135,24 @@ mkdir -p "${MXE_HOME}"
echo "! Installed:${done//|/}"
if [ -n "${done}" ]; then
+ ori='/usr/lib/mxe'
+ pwd="$(pwd)"
+
echo '! Retargeting symlinks...'
find . -type l -name '*' | while IFS= read -r f; do
# FIXME: readlink may need to be adapted for non-macOS systems
- ln -f -s "$(readlink "${f}" | sed "s|/usr/lib/mxe|$(pwd)|")" "${f}"
+ ln -f -s "$(readlink "${f}" | sed "s|${ori}|${pwd}|")" "${f}"
+ done
+
+ echo '! Rewriting hardcoded absolute paths...'
+ find . -type f \
+ -name '*.la' -o \
+ -name '*.pc' -o \
+ -name '*.cmake' -o \
+ -name '*-config' | while IFS= read -r f; do
+
+ sed "s|${ori}|${pwd}|" \
+ < "${f}" > "${f}-mod" && cp "${f}-mod" "${f}" && rm -f "${f}-mod"
done
fi