Made stdcall decoration in .def files the default, and added -k option
to switch it off.

diff --git a/configure b/configure
index 5917ba0..5c1c8b1 100755
--- a/configure
+++ b/configure
@@ -9823,56 +9823,6 @@
 fi
 
 
-echo "$as_me:$LINENO: checking whether stdcall symbols need to be decorated" >&5
-echo $ECHO_N "checking whether stdcall symbols need to be decorated... $ECHO_C" >&6
-if test "${ac_cv_c_stdcall_decoration+set}" = set; then
-  echo $ECHO_N "(cached) $ECHO_C" >&6
-else
-  cat >conftest.$ac_ext <<_ACEOF
-#line $LINENO "configure"
-#include "confdefs.h"
-void ac_asm(void) { asm("\t.globl _ac_test@0\n_ac_test@0:\n\t.globl ac_test@0\nac_test@0:"); }
-extern void __attribute__((__stdcall__)) ac_test(void);
-int
-main ()
-{
-ac_test()
-  ;
-  return 0;
-}
-_ACEOF
-rm -f conftest.$ac_objext conftest$ac_exeext
-if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
-  (eval $ac_link) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } &&
-         { ac_try='test -s conftest$ac_exeext'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; }; then
-  ac_cv_c_stdcall_decoration="yes"
-else
-  echo "$as_me: failed program was:" >&5
-cat conftest.$ac_ext >&5
-ac_cv_c_stdcall_decoration="no"
-fi
-rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
-fi
-echo "$as_me:$LINENO: result: $ac_cv_c_stdcall_decoration" >&5
-echo "${ECHO_T}$ac_cv_c_stdcall_decoration" >&6
-if test "$ac_cv_c_stdcall_decoration" = "yes"
-then
-
-cat >>confdefs.h <<\_ACEOF
-#define NEED_STDCALL_DECORATION 1
-_ACEOF
-
-fi
-
-
 echo "$as_me:$LINENO: checking whether assembler accepts .string" >&5
 echo $ECHO_N "checking whether assembler accepts .string... $ECHO_C" >&6
 if test "${ac_cv_c_asm_string+set}" = set; then
diff --git a/configure.ac b/configure.ac
index 44ad8a6..ab571d3 100644
--- a/configure.ac
+++ b/configure.ac
@@ -735,18 +735,6 @@
   AC_DEFINE([__ASM_NAME(name)], [name])
 fi
 
-dnl **** Check whether stdcall symbols need to be decorated ****
-
-AC_CACHE_CHECK([whether stdcall symbols need to be decorated], ac_cv_c_stdcall_decoration,
-    WINE_TRY_ASM_LINK(["\t.globl _ac_test@0\n_ac_test@0:\n\t.globl ac_test@0\nac_test@0:"],
-                      [extern void __attribute__((__stdcall__)) ac_test(void);],
-                      [ac_test()],
-                      ac_cv_c_stdcall_decoration="yes",ac_cv_c_stdcall_decoration="no"))
-if test "$ac_cv_c_stdcall_decoration" = "yes"
-then
-  AC_DEFINE(NEED_STDCALL_DECORATION, 1, [Define if stdcall symbols need to be decorated])
-fi
-
 dnl **** Check for .string in assembler ****
 
 AC_CACHE_CHECK([whether assembler accepts .string], ac_cv_c_asm_string,
diff --git a/include/config.h.in b/include/config.h.in
index 6d03a8d..40c36ad 100644
--- a/include/config.h.in
+++ b/include/config.h.in
@@ -680,9 +680,6 @@
 /* Define if we have __va_copy */
 #undef HAVE___VA_COPY
 
-/* Define if stdcall symbols need to be decorated */
-#undef NEED_STDCALL_DECORATION
-
 /* Define to disable all debug messages. */
 #undef NO_DEBUG_MSGS
 
diff --git a/tools/winebuild/build.h b/tools/winebuild/build.h
index 7248926..6efe29a 100644
--- a/tools/winebuild/build.h
+++ b/tools/winebuild/build.h
@@ -181,6 +181,7 @@
 extern int nb_debug_channels;
 extern int nb_lib_paths;
 extern int display_warnings;
+extern int kill_at;
 
 extern char DLLName[80];
 extern char DLLFileName[80];
diff --git a/tools/winebuild/main.c b/tools/winebuild/main.c
index dcfaadd..7c139af 100644
--- a/tools/winebuild/main.c
+++ b/tools/winebuild/main.c
@@ -50,6 +50,7 @@
 int nb_debug_channels = 0;
 int nb_lib_paths = 0;
 int display_warnings = 0;
+int kill_at = 0;
 
 /* we only support relay debugging on i386 */
 #if defined(__i386__) && !defined(NO_TRACE_MSGS)
@@ -126,6 +127,7 @@
 static void do_include( const char *arg );
 static void do_k_flags( const char *arg );
 static void do_ignore( const char *arg );
+static void do_kill_at(void);
 static void do_exe_mode( const char *arg );
 static void do_module( const char *arg );
 static void do_heap( const char *arg );
@@ -154,6 +156,7 @@
     { "-I",        1, do_include, "-I dir           Ignored for C flags compatibility" },
     { "-K",        1, do_k_flags, "-K flags         Compiler flags (only -KPIC is supported)" },
     { "-i",        1, do_ignore,  "-i sym[,sym]     Ignore specified symbols when resolving imports" },
+    { "-k",        0, do_kill_at, "-k               Kill stdcall decorations in generated .def files" },
     { "-m",        1, do_exe_mode,"-m mode          Set the executable mode (cui|gui|cuiw|guiw)" },
     { "-M",        1, do_module,  "-M module        Set the name of the main (Win32) module for a Win16 dll" },
     { "-L",        1, do_lib,     "-L directory     Look for imports libraries in 'directory'" },
@@ -243,6 +246,11 @@
     free( str );
 }
 
+static void do_kill_at(void)
+{
+    kill_at = 1;
+}
+
 static void do_heap( const char *arg )
 {
     if (!isdigit(arg[0]))
diff --git a/tools/winebuild/spec32.c b/tools/winebuild/spec32.c
index d61d8c4..ea94ee6 100644
--- a/tools/winebuild/spec32.c
+++ b/tools/winebuild/spec32.c
@@ -891,17 +891,13 @@
             break;
         case TYPE_STDCALL:
         {
-#ifdef NEED_STDCALL_DECORATION
             int at_param = strlen(odp->u.func.arg_types) * sizeof(int);
-            fprintf(outfile, "@%d", at_param);
-#endif /* NEED_STDCALL_DECORATION */
+            if (!kill_at) fprintf(outfile, "@%d", at_param);
             /* try to reduce output */
             if(strcmp(name, odp->link_name))
             {
                 fprintf(outfile, "=%s", odp->link_name);
-#ifdef NEED_STDCALL_DECORATION
-                fprintf(outfile, "@%d", at_param);
-#endif /* NEED_STDCALL_DECORATION */
+                if (!kill_at) fprintf(outfile, "@%d", at_param);
             }
             break;
         }
diff --git a/tools/winebuild/winebuild.man.in b/tools/winebuild/winebuild.man.in
index d66c86c..95084f6 100644
--- a/tools/winebuild/winebuild.man.in
+++ b/tools/winebuild/winebuild.man.in
@@ -112,6 +112,10 @@
 .BI \-K\  flags
 Ignored for compatibility with the C compiler.
 .TP
+.BI \-k
+Remove the stdcall decorations from the symbol names in the
+generated .def file. Only meaningful in \fB--def\fR mode.
+.TP
 .BI \-L\  directory
 Append the specified directory to the list of directories that are
 searched for import libraries.