Debian Codegraph @

m4/kpse-asm.m4

raw
1 # Private macro for the TeX Live (TL) tree.
2 # Copyright (C) 1996 - 2009 Peter Breitenlohner <[email protected]>
3 #
4 # This file is free software; the copyright holder
5 # gives unlimited permission to copy and/or distribute it,
6 # with or without modifications, as long as this notice is preserved.
7
8 # serial 3
9
10 # KPSE_ASM_UNDERSCORE
11 # -------------------
12 # Check if gcc asm for i386 needs external symbols with an underscore.
13 AC_DEFUN([KPSE_ASM_UNDERSCORE],
14 [AC_CACHE_CHECK([whether gcc asm needs underscore],
15 [pb_cv_asm_underscore],
16 [
17 # Some versions of GCC asm for i386 need an underscore prepended to
18 # external symbols. Figure out if this is so.
19 AC_LINK_IFELSE([AC_LANG_PROGRAM([[
20 extern char val ;
21 extern void sub () ;
22 #if defined (__i386__) && defined (__GNUC__)
23 asm(" .align 4\n"
24 ".globl sub\n"
25 "sub:\n"
26 " movb \$][1,val\n"
27 " ret\n");
28 #else
29 void sub () { val = 1; }
30 #endif /* assembler */
31 char val ;]],
32 [[sub (); return 0;]])],
33 [pb_cv_asm_underscore=no],
34 [pb_cv_asm_underscore=yes])])
35 if test "x$pb_cv_asm_underscore" = xyes; then
36 AC_DEFINE([ASM_NEEDS_UNDERSCORE], 1,
37 [web2c: Define if gcc asm needs _ on external symbols.])
38 fi
39 ]) # KPSE_ASM_UNDERSCORE
40