Remove bashisms from scripts so dash works as /bin/sh.

diff -urNad babel-1.2.0.dfsg.orig/bin/babel-cc.in babel-1.2.0.dfsg/bin/babel-cc.in
--- babel-1.2.0.dfsg.orig/bin/babel-cc.in	2008-04-22 16:22:28.000000000 +0100
+++ babel-1.2.0.dfsg/bin/babel-cc.in	2008-04-22 16:27:04.000000000 +0100
@@ -501,7 +501,7 @@
   esac
 done
 
-if test $linkage != static -a $action == link -a $outtype == lib ; then 
+if test $linkage != static -a $action = link -a $outtype = lib ; then 
   if test $has_impl = true; then
     args_misc="$args_misc -module -no-undefined"
   else
diff -urNad babel-1.2.0.dfsg.orig/bin/babel-cxx.in babel-1.2.0.dfsg/bin/babel-cxx.in
--- babel-1.2.0.dfsg.orig/bin/babel-cxx.in	2008-04-22 16:22:28.000000000 +0100
+++ babel-1.2.0.dfsg/bin/babel-cxx.in	2008-04-22 16:27:16.000000000 +0100
@@ -500,7 +500,7 @@
   esac
 done
 
-if test $linkage != static -a $action == link -a $outtype == lib ; then 
+if test $linkage != static -a $action = link -a $outtype = lib ; then 
   if test $has_impl = true; then
     args_misc="$args_misc -module -no-undefined"
   else
diff -urNad babel-1.2.0.dfsg.orig/bin/babel-f77.in babel-1.2.0.dfsg/bin/babel-f77.in
--- babel-1.2.0.dfsg.orig/bin/babel-f77.in	2008-04-22 16:22:28.000000000 +0100
+++ babel-1.2.0.dfsg/bin/babel-f77.in	2008-04-22 16:25:45.000000000 +0100
@@ -501,7 +501,7 @@
   esac
 done
 
-if test $linkage != static -a $action == link -a $outtype == lib ; then 
+if test $linkage != static -a $action = link -a $outtype = lib ; then 
   if test $has_impl = true; then
     args_misc="$args_misc -module -no-undefined"
   else
diff -urNad babel-1.2.0.dfsg.orig/bin/babel-f90.in babel-1.2.0.dfsg/bin/babel-f90.in
--- babel-1.2.0.dfsg.orig/bin/babel-f90.in	2008-04-22 16:22:28.000000000 +0100
+++ babel-1.2.0.dfsg/bin/babel-f90.in	2008-04-22 16:25:36.000000000 +0100
@@ -535,7 +535,7 @@
   esac
 done
 
-if test $linkage != static -a $action == link -a $outtype = lib ; then 
+if test $linkage != static -a $action = link -a $outtype = lib ; then 
   if test $has_impl = true; then
     args_misc="$args_misc -module -no-undefined"
   else
diff -urNad babel-1.2.0.dfsg.orig/runtime/config/ltmain.sh babel-1.2.0.dfsg/runtime/config/ltmain.sh
--- babel-1.4.0.dfsg/runtime/config/ltmain.sh~	2008-10-17 16:29:07.000000000 -0400
+++ babel-1.4.0.dfsg/runtime/config/ltmain.sh	2009-05-27 13:04:05.000000000 -0400
@@ -367,6 +367,7 @@
 
       if test ! -d "$my_tmpdir"; then
         # Failing that, at least try and use $RANDOM to avoid a race
+	RANDOM="$(dd if=/dev/urandom bs=1k count=2 2>/dev/null | cksum | cut -b-8)"
         my_tmpdir="${my_template}-${RANDOM-0}$$"
 
         save_mktempdir_umask=`umask`
@@ -1330,7 +1331,7 @@
 
     $opt_dry_run || $RM $removelist
     removelist="$removelist $lockfile"
-    trap '$opt_dry_run || $RM $removelist; exit $EXIT_FAILURE' 1 2 15
+    trap '$opt_dry_run || $RM $removelist; exit $EXIT_FAILURE' HUP INT TERM
 
     if test -n "$fix_srcfile_path"; then
       eval srcfile=\"$fix_srcfile_path\"
@@ -7319,7 +7320,7 @@
 	    cwrappersource="$output_path/$objdir/lt-$output_name.c"
 	    cwrapper="$output_path/$output_name.exe"
 	    $RM $cwrappersource $cwrapper
-	    trap "$RM $cwrappersource $cwrapper; exit $EXIT_FAILURE" 1 2 15
+	    trap "$RM $cwrappersource $cwrapper; exit $EXIT_FAILURE" HUP INT TERM
 
 	    func_emit_cwrapperexe_src > $cwrappersource
 
@@ -7336,7 +7337,7 @@
 	    # Now, create the wrapper script for func_source use:
 	    func_ltwrapper_scriptname $cwrapper
 	    $RM $func_ltwrapper_scriptname_result
-	    trap "$RM $func_ltwrapper_scriptname_result; exit $EXIT_FAILURE" 1 2 15
+	    trap "$RM $func_ltwrapper_scriptname_result; exit $EXIT_FAILURE" HUP INT TERM
 	    $opt_dry_run || {
 	      # note: this script will not be executed, so do not chmod.
 	      if test "x$build" = "x$host" ; then
@@ -7348,7 +7349,7 @@
 	  ;;
 	  * )
 	    $RM $output
-	    trap "$RM $output; exit $EXIT_FAILURE" 1 2 15
+	    trap "$RM $output; exit $EXIT_FAILURE" HUP INT TERM
 
 	    func_emit_wrapper no > $output
 	    chmod +x $output
