version 1.1.1.1, 2012/05/29 09:29:44
|
version 1.1.1.2, 2021/03/17 13:38:46
|
Line 1
|
Line 1
|
# asm-underscore.m4 serial 1 | # asm-underscore.m4 serial 4 |
dnl Copyright (C) 2010-2011 Free Software Foundation, Inc. | dnl Copyright (C) 2010-2019 Free Software Foundation, Inc. |
dnl This file is free software; the Free Software Foundation |
dnl This file is free software; the Free Software Foundation |
dnl gives unlimited permission to copy and/or distribute it, |
dnl gives unlimited permission to copy and/or distribute it, |
dnl with or without modifications, as long as this notice is preserved. |
dnl with or without modifications, as long as this notice is preserved. |
Line 14 dnl From Bruno Haible. Based on as-underscore.m4 in GN
|
Line 14 dnl From Bruno Haible. Based on as-underscore.m4 in GN
|
|
|
AC_DEFUN([gl_ASM_SYMBOL_PREFIX], |
AC_DEFUN([gl_ASM_SYMBOL_PREFIX], |
[ |
[ |
|
AC_REQUIRE([AC_PROG_EGREP]) |
dnl We don't use GCC's __USER_LABEL_PREFIX__ here, because |
dnl We don't use GCC's __USER_LABEL_PREFIX__ here, because |
dnl 1. It works only for GCC. |
dnl 1. It works only for GCC. |
dnl 2. It is incorrectly defined on some platforms, in some GCC versions. |
dnl 2. It is incorrectly defined on some platforms, in some GCC versions. |
|
AC_REQUIRE([gl_C_ASM]) |
AC_CACHE_CHECK( |
AC_CACHE_CHECK( |
[whether C symbols are prefixed with underscore at the linker level], |
[whether C symbols are prefixed with underscore at the linker level], |
[gl_cv_prog_as_underscore], |
[gl_cv_prog_as_underscore], |
Line 27 extern "C" int foo (void);
|
Line 29 extern "C" int foo (void);
|
int foo(void) { return 0; } |
int foo(void) { return 0; } |
EOF |
EOF |
# Look for the assembly language name in the .s file. |
# Look for the assembly language name in the .s file. |
AC_TRY_COMMAND(${CC-cc} $CFLAGS $CPPFLAGS -S conftest.c) >/dev/null 2>&1 | AC_TRY_COMMAND(${CC-cc} $CFLAGS $CPPFLAGS $gl_c_asm_opt conftest.c) >/dev/null 2>&1 |
if grep _foo conftest.s >/dev/null ; then | if LC_ALL=C $EGREP '(^|[[^a-zA-Z0-9_]])_foo([[^a-zA-Z0-9_]]|$)' conftest.$gl_asmext >/dev/null; then |
gl_cv_prog_as_underscore=yes |
gl_cv_prog_as_underscore=yes |
else |
else |
gl_cv_prog_as_underscore=no |
gl_cv_prog_as_underscore=no |
Line 45 EOF
|
Line 47 EOF
|
either an underscore or empty.]) |
either an underscore or empty.]) |
ASM_SYMBOL_PREFIX='"'${USER_LABEL_PREFIX}'"' |
ASM_SYMBOL_PREFIX='"'${USER_LABEL_PREFIX}'"' |
AC_SUBST([ASM_SYMBOL_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' |
|
]) |
]) |
]) |