Add WAY_debug_t_NAME and WAY_debug_t_HC_OPTS
[ghc-hetmet.git] / mk / fix_install_names.sh
index 7e51f23..f6278ce 100644 (file)
@@ -7,6 +7,13 @@
 prefix=$1
 file=$2
 
+type=`file "$file"`
+
+if `test "${type/Mach-O}" == "$type"`
+then
+    exit
+fi
+
 if `test x${prefix%/} != x"" `
 then
     prefix=${prefix%/}/
@@ -16,6 +23,10 @@ for i in `otool -L $file \
          | grep 'libHS.*_dyn.dylib' \
          | sed 's/.\(.*libHS.*_dyn.dylib\).*/\1/'`
 do
-    install_name_tool -change $i $prefix`basename $i` $file
+    install_name_tool -change $i "$prefix`basename $i`" $file
 done
 
+if `test "${file%.dylib}" != "${file}"`
+then
+    install_name_tool -id "$prefix`basename $file`" $file
+fi