Index: trunk/src/binutils/ltcf-c.sh
===================================================================
--- trunk/src/binutils/ltcf-c.sh	(revision 225)
+++ trunk/src/binutils/ltcf-c.sh	(revision 228)
@@ -392,5 +392,5 @@
     allow_undefined_flag=no
     archive_cmds='$echo "LIBRARY $soname INITINSTANCE" > $output_objdir/$libname.def~$echo "DESCRIPTION \"$libname\"" >> $output_objdir/$libname.def~$echo DATA >> $output_objdir/$libname.def~$echo " SINGLE NONSHARED" >> $output_objdir/$libname.def~$echo EXPORTS >> $output_objdir/$libname.def~emxexp $libobjs >> $output_objdir/$libname.def~$CC -Zdll -Zcrtdll -o $lib $libobjs $deplibs $compiler_flags $output_objdir/$libname.def'
-    old_archive_from_new_cmds='emximp -o $output_objdir/$name.a $output_objdir/$libname.def'
+    old_archive_from_new_cmds='emximp -o $output_objdir/$libname.a $output_objdir/$libname.def'
     ;;
 
Index: trunk/src/binutils/ltconfig
===================================================================
--- trunk/src/binutils/ltconfig	(revision 225)
+++ trunk/src/binutils/ltconfig	(revision 228)
@@ -1144,7 +1144,18 @@
   # old: library_names_spec='$libname.dll $libname.a'
   # assumes no dots in the $name.
-  soname_spec="\`echo \"\${release}...\" | name=\"\${name}\" gawk -- 'BEGIN { FS = \".\"} ; { printf(\"%.5s\", sprintf(\"%s%x%x\",ENVIRON[\"name\"], sub(/-*/,\"\",\$1),\$2)); }'\`"
-  libname_spec="\`echo \"\${release}...\" | name=\"\${name}\" gawk -- 'BEGIN { FS = \".\"} ; { printf(\"%.5s\", sprintf(\"%s%x%x\",ENVIRON[\"name\"], sub(/-*/,\"\",\$1),\$2)); }'\`"
-  library_names_spec="\`echo \"\${release}...\" | name=\"\${name}\" gawk -- 'BEGIN { FS = \".\"} ; { printf(\"%.5s\", sprintf(\"%s%x%x\",ENVIRON[\"name\"], sub(/-*/,\"\",\$1),\$2)); }'\`.dll \${name}.a"
+  # Man, awk is cute!
+  soname_spec="\`echo \"\${release}...\" | name=\"\${name}\" gawk -- 'BEGIN { FS = \".\"} ; \
+    {  sNum=\"0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ\"; sVer=\"\"; \
+       if (\$1 != \"\" || \$2 != \"\") { if (\$1 < 0) \$1= -\$1; sVer=substr(sNum,\$1%length(sNum)+1, 1) } \
+       if (\$2 != \"\") { if (\$2 >= length(sNum)) sVer=sVer\"\"substr(sNum,\$2/length(sNum)+1, 1); sVer=sVer\"\"substr(sNum, \$2%length(sNum)+1, 1); } \
+       printf(\"%.*s%s\", 8-length(sVer), ENVIRON[\"NAME\"], sVer); \
+    } ' \`"
+  libname_spec='lib$name'
+  library_names_spec="\`echo \"\${release}...\" | name=\"\${name}\" gawk -- 'BEGIN { FS = \".\"} ; \
+    {  sNum=\"0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ\"; sVer=\"\"; \
+       if (\$1 != \"\" || \$2 != \"\") { if (\$1 < 0) \$1= -\$1; sVer=substr(sNum,\$1%length(sNum)+1, 1) } \
+       if (\$2 != \"\") { if (\$2 >= length(sNum)) sVer=sVer\"\"substr(sNum,\$2/length(sNum)+1, 1); sVer=sVer\"\"substr(sNum, \$2%length(sNum)+1, 1); } \
+       printf(\"%.*s%s\", 8-length(sVer), ENVIRON[\"NAME\"], sVer); \
+    } ' \`.dll lib\${name}.a"
   dynamic_linker='OS/2 ld.exe'
   shlibpath_var=BEGINLIBPATH
Index: trunk/src/gcc/ltcf-c.sh
===================================================================
--- trunk/src/gcc/ltcf-c.sh	(revision 225)
+++ trunk/src/gcc/ltcf-c.sh	(revision 228)
@@ -481,5 +481,5 @@
   allow_undefined_flag=no
   archive_cmds='$echo "LIBRARY $soname INITINSTANCE" > $output_objdir/$libname.def~$echo "DESCRIPTION \"$libname\"" >> $output_objdir/$libname.def~$echo DATA >> $output_objdir/$libname.def~$echo " SINGLE NONSHARED" >> $output_objdir/$libname.def~$echo EXPORTS >> $output_objdir/$libname.def~emxexp $libobjs >> $output_objdir/$libname.def~$CC -Zdll -Zcrtdll -o $lib $libobjs $deplibs $compiler_flags $output_objdir/$libname.def'
-  old_archive_from_new_cmds='emximp -o $output_objdir/$name.a $output_objdir/$libname.def'
+  old_archive_from_new_cmds='emximp -o $output_objdir/$libname.a $output_objdir/$libname.def'
     ;;
 
Index: trunk/src/gcc/ltconfig
===================================================================
--- trunk/src/gcc/ltconfig	(revision 225)
+++ trunk/src/gcc/ltconfig	(revision 228)
@@ -1266,7 +1266,18 @@
   # old: library_names_spec='$libname.dll $libname.a'
   # assumes no dots in the $name.
-  soname_spec="\`echo \"\${release}...\" | name=\"\${name}\" gawk -- 'BEGIN { FS = \".\"} ; { printf(\"%.5s\", sprintf(\"%s%x%x\",ENVIRON[\"name\"], sub(/-*/,\"\",\$1),\$2)); }'\`"
-  libname_spec="\`echo \"\${release}...\" | name=\"\${name}\" gawk -- 'BEGIN { FS = \".\"} ; { printf(\"%.5s\", sprintf(\"%s%x%x\",ENVIRON[\"name\"], sub(/-*/,\"\",\$1),\$2)); }'\`"
-  library_names_spec="\`echo \"\${release}...\" | name=\"\${name}\" gawk -- 'BEGIN { FS = \".\"} ; { printf(\"%.5s\", sprintf(\"%s%x%x\",ENVIRON[\"name\"], sub(/-*/,\"\",\$1),\$2)); }'\`.dll \${name}.a"
+  # Man, awk is cute!
+  soname_spec="\`echo \"\${release}...\" | name=\"\${name}\" gawk -- 'BEGIN { FS = \".\"} ; \
+    {  sNum=\"0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ\"; sVer=\"\"; \
+       if (\$1 != \"\" || \$2 != \"\") { if (\$1 < 0) \$1= -\$1; sVer=substr(sNum,\$1%length(sNum)+1, 1) } \
+       if (\$2 != \"\") { if (\$2 >= length(sNum)) sVer=sVer\"\"substr(sNum,\$2/length(sNum)+1, 1); sVer=sVer\"\"substr(sNum, \$2%length(sNum)+1, 1); } \
+       printf(\"%.*s%s\", 8-length(sVer), ENVIRON[\"NAME\"], sVer); \
+    } ' \`"
+  libname_spec='lib$name'
+  library_names_spec="\`echo \"\${release}...\" | name=\"\${name}\" gawk -- 'BEGIN { FS = \".\"} ; \
+    {  sNum=\"0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ\"; sVer=\"\"; \
+       if (\$1 != \"\" || \$2 != \"\") { if (\$1 < 0) \$1= -\$1; sVer=substr(sNum,\$1%length(sNum)+1, 1) } \
+       if (\$2 != \"\") { if (\$2 >= length(sNum)) sVer=sVer\"\"substr(sNum,\$2/length(sNum)+1, 1); sVer=sVer\"\"substr(sNum, \$2%length(sNum)+1, 1); } \
+       printf(\"%.*s%s\", 8-length(sVer), ENVIRON[\"NAME\"], sVer); \
+    } ' \`.dll lib\${name}.a"
   dynamic_linker='OS/2 ld.exe'
   shlibpath_var=BEGINLIBPATH
