Skip to content

Instantly share code, notes, and snippets.

@dak180
Created July 2, 2013 19:14
Show Gist options
  • Save dak180/5912200 to your computer and use it in GitHub Desktop.
Save dak180/5912200 to your computer and use it in GitHub Desktop.
#!/bin/bash -ev
# Add symlinks to recreate previous naming of executables in %p/bin
# as well as %p/lib/gcc4.8/bin and new -fsf-4.8 naming in %p/bin.
binfiles="gfortran gcj gcj-dbtool gcjh gij gjnih grmiregistry grmic jcf-dump jv-convert jv-scan"
function lunker {
local TARGETFILE="${1}"
local XCRUNTAGET="${2}"
if [[ -z "${XCRUNTAGET}" ]]; then
local XCRUNTAGET="${TARGETFILE}"
fi
cat > "${TARGETFILE}" << EOF
#!/bin/bash
exec xcrun ${XCRUNTAGET}
EOF
chmod ugo+x "${TARGETFILE}"
}
for binfile in ${binfiles}; do
lunker "inst/lib/gcc4.8/bin/${binfile}" "lib/gcc4.8/bin/${binfile}-fsf-4.8"
lunker "inst/bin/${binfile}" "lib/gcc4.8/bin/${binfile}-fsf-4.8"
lunker "inst/bin/${binfile}-fsf-4.8" "lib/gcc4.8/bin/${binfile}-fsf-4.8"
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment