PATCH: Shell quoting fix in configure.ac

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



With this patch I can finally play winemine on my machine! Be still,
my heart! ;-)  Configure was setting __ASM_STRING to ".ascii", which 
doesn't include a trailing NUL, which made the symbol tables in DLLs
unreadable. The root problem is a shell quoting issue (which is
also described in Autoconf's portability guidelines). I've tested
that it still behaves correctly with bash and the other shells
at my disposal...

This patch also makes configure check its fallback choice and error
out if even that doesn't work, instead of going on to fail at compile
or run time.

Changelog:
   Fixed shell quoting of the inline-asm tests in configure.ac so that
they work properly with the pdksh that ships with OpenBSD.


diff --recursive orig/wine-20031212/configure.ac wine-20031212/configure.ac
--- orig/wine-20031212/configure.ac	Thu Dec  4 16:20:28 2003
+++ wine-20031212/configure.ac	Thu Jan  1 22:28:42 2004
@@ -811,22 +811,30 @@
 
 dnl **** Check how to do strings in assembler ****
 
+asmstring=no
 AC_CACHE_CHECK([whether assembler accepts .string], ac_cv_c_asm_string,
-    WINE_TRY_ASM_LINK([".data\n\t.string \"test\"\n\t.text"],,,
-                      ac_cv_c_asm_string="yes",ac_cv_c_asm_string="no"))
-if test "$ac_cv_c_asm_string" = "yes"
+    WINE_TRY_ASM_LINK([".data\\n\\t.string \\"test\\"\\n\\t.text"],,,
+                      [ac_cv_c_asm_string="yes" asmstring=".string"],
+		      ac_cv_c_asm_string="no"))
+if test "$asmstring" = "no"
 then
-  AC_DEFINE(__ASM_STRING, [".string"], [Define to the assembler keyword used to specify an ASCII string])
-else
     AC_CACHE_CHECK([whether assembler accepts .asciz], ac_cv_c_asm_asciz,
-        WINE_TRY_ASM_LINK([".data\n\t.asciz \"test\"\n\t.text"],,,
-                      ac_cv_c_asm_asciz="yes",ac_cv_c_asm_asciz="no"))
-    if test "$ac_cv_c_asm_asciz" = "yes"
-    then
-      AC_DEFINE(__ASM_STRING, [".asciz"])
-    else
-      AC_DEFINE(__ASM_STRING, [".ascii"])
-    fi					
+        WINE_TRY_ASM_LINK([".data\\n\\t.asciz \\"test\\"\\n\\t.text"],,,
+                      [ac_cv_c_asm_asciz="yes" asmstring=".asciz"],
+		      ac_cv_c_asm_asciz="no"))
+fi
+if test "$asmstring" = "no"
+then
+    AC_CACHE_CHECK([whether assembler accepts .ascii], ac_cv_c_asm_ascii,
+        WINE_TRY_ASM_LINK([".data\\n\\t.ascii \\"test\\"\\n\\t.text"],,,
+                      [ac_cv_c_asm_ascii="yes" asmstring=".ascii"],
+		      ac_cv_c_asm_ascii="no"))
+fi
+if test "$asmstring" = "no"
+then
+  AC_MSG_ERROR([could not discover how to produce C strings with assembler.])
+else
+  AC_DEFINE_UNQUOTED(__ASM_STRING,"$asmstring", [The assembler keyword used to specify an ASCII string])
 fi
 
 dnl **** Check for .short in assembler ****
[EOF]


[Index of Archives]     [Gimp for Windows]     [Red Hat]     [Samba]     [Yosemite Camping]     [Graphics Cards]     [Wine Home]

  Powered by Linux