plugin: more aggressive name change to avoid conflicts
[ia32rtools.git] / run_imp.sh
index 665b3f9..b069eba 100755 (executable)
@@ -27,9 +27,9 @@ cat $implist | while read i; do
     ;;
   esac
 
-  grep "\<_\?_$si\>" /usr/$mingwb/lib/lib* "$@" | awk '{print $3}' | \
+  grep -e "\<_\?_$si\>" -e "@$si\>" /usr/$mingwb/lib/lib* "$@" | awk '{print $3}' | \
     while read f; do
-      sym=`${mingwb}-nm $f | grep "\<_\?_$si\>" | grep ' T ' | awk '{print $3}'`
+      sym=`${mingwb}-nm $f | grep -e "\<_\?_$si\>" -e " @$si\>" | grep ' T ' | awk '{print $3}'`
       if test -n "$sym"; then
         echo $sym > $tmpsym
         break
@@ -37,8 +37,14 @@ cat $implist | while read i; do
     done
   sym=`cat $tmpsym`
   if test -z "$sym"; then
-    echo "no file/sym for $i, lf $f"
-    exit 1
+    # could be a data import
+    if test -n "$data_symf" && grep -q "$si" $data_symf; then
+      continue
+    else
+      echo "$target_s: no file/sym for $i"
+      rm $target_s
+      exit 1
+    fi
   fi
 
   echo ".globl $i" >> $target_s