X-Git-Url: http://erislabs.net/gitweb/?a=blobdiff_plain;f=m4%2Fasm-underscore.m4;h=910144aacc48bbc3304d00f65afdc1dc47e38726;hb=7422b7ede18016dea87d207cbb7535428afba3ec;hp=15c89cca91e427ce7c3209f7333667cac49a24cf;hpb=d599e5add275f75ed08e6527b8ee4d3f4f7c3aea;p=gnulib.git diff --git a/m4/asm-underscore.m4 b/m4/asm-underscore.m4 index 15c89cca9..910144aac 100644 --- a/m4/asm-underscore.m4 +++ b/m4/asm-underscore.m4 @@ -1,5 +1,5 @@ -# asm-underscore.m4 serial 1 -dnl Copyright (C) 2010-2011 Free Software Foundation, Inc. +# asm-underscore.m4 serial 2 +dnl Copyright (C) 2010-2014 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, dnl with or without modifications, as long as this notice is preserved. @@ -17,6 +17,7 @@ AC_DEFUN([gl_ASM_SYMBOL_PREFIX], dnl We don't use GCC's __USER_LABEL_PREFIX__ here, because dnl 1. It works only for GCC. dnl 2. It is incorrectly defined on some platforms, in some GCC versions. + AC_REQUIRE([gl_C_ASM]) AC_CACHE_CHECK( [whether C symbols are prefixed with underscore at the linker level], [gl_cv_prog_as_underscore], @@ -27,8 +28,8 @@ extern "C" int foo (void); int foo(void) { return 0; } EOF # Look for the assembly language name in the .s file. - AC_TRY_COMMAND(${CC-cc} $CFLAGS $CPPFLAGS -S conftest.c) >/dev/null 2>&1 - if grep _foo conftest.s >/dev/null ; then + AC_TRY_COMMAND(${CC-cc} $CFLAGS $CPPFLAGS $gl_c_asm_opt conftest.c) >/dev/null 2>&1 + if grep _foo conftest.$gl_asmext >/dev/null ; then gl_cv_prog_as_underscore=yes else gl_cv_prog_as_underscore=no @@ -46,3 +47,25 @@ EOF ASM_SYMBOL_PREFIX='"'${USER_LABEL_PREFIX}'"' AC_SUBST([ASM_SYMBOL_PREFIX]) ]) + +# gl_C_ASM +# Determines how to produce an assembly language file from C source code. +# Sets the variables: +# gl_asmext - the extension of assembly language output, +# gl_c_asm_opt - the C compiler option that produces assembly language output. + +AC_DEFUN([gl_C_ASM], +[ + AC_EGREP_CPP([MicrosoftCompiler], + [ +#ifdef _MSC_VER +MicrosoftCompiler +#endif + ], + [gl_asmext='asm' + gl_c_asm_opt='-c -Fa' + ], + [gl_asmext='s' + gl_c_asm_opt='-S' + ]) +])