Permalink
Browse files

Add a shell script to switch ld-mac and ld-mac32

  • Loading branch information...
1 parent ea93cac commit 46543699be50740746e385ce569d4d6c35cd2d20 @shinh committed Jun 16, 2011
Showing with 24 additions and 0 deletions.
  1. +24 −0 ld-mac.sh
View
@@ -0,0 +1,24 @@
+#!/bin/sh
+
+set -e
+
+ld_mac_dir=$(cd $(dirname $0) && pwd)
+
+if [ "x" != "x$LD_MAC_LOG" ]; then
+ set -x
+fi
+
+if [ "x" = "x$LD_MAC_BITS" ]; then
+ ld_mac_binary="$ld_mac_dir/ld-mac"
+ if file $1 | grep i386 2>&1 > /dev/null; then
+ ld_mac_binary="$ld_mac_dir/ld-mac32"
+ fi
+else
+ ld_mac_binary="$ld_mac_dir/ld-mac$LD_MAC_BITS"
+ if [ ! -x $ld_mac_binary ]; then
+ echo "Cannot run $ld_mac_binary"
+ exit 1
+ fi
+fi
+
+exec $ld_mac_binary "$@"

0 comments on commit 4654369

Please sign in to comment.