]> www.ginac.de Git - cln.git/blob - m4/as-underscore.m4
* Cumulative patch including Bruno's work on large fixnums on 64 bit machines.
[cln.git] / m4 / as-underscore.m4
1 dnl -*- Autoconf -*-
2 dnl Copyright (C) 1993-2003 Free Software Foundation, Inc.
3 dnl This file is free software, distributed under the terms of the GNU
4 dnl General Public License.  As a special exception to the GNU General
5 dnl Public License, this file may be distributed as part of a program
6 dnl that contains a configuration script generated by Autoconf, under
7 dnl the same distribution terms as the rest of that program.
8
9 dnl From Bruno Haible, Marcus Daniels, Sam Steingold.
10
11 AC_PREREQ(2.57)
12
13 AC_DEFUN([CL_AS_UNDERSCORE],
14 [AC_BEFORE([$0], [CL_GLOBAL_CONSTRUCTORS])
15 m4_pattern_allow([^AS_UNDERSCORE$])
16 AC_CACHE_CHECK(for underscore in external names, cl_cv_prog_as_underscore, [
17 cat > conftest.c <<EOF
18 #ifdef __cplusplus
19 extern "C"
20 #endif
21 int foo() { return 0; }
22 EOF
23 # look for the assembly language name in the .s file
24 AC_TRY_COMMAND(${CC-cc} -S conftest.c) >/dev/null 2>&1
25 if grep _foo conftest.s >/dev/null ; then
26   cl_cv_prog_as_underscore=yes
27 else
28   cl_cv_prog_as_underscore=no
29 fi
30 rm -f conftest*
31 ])
32 if test $cl_cv_prog_as_underscore = yes; then
33   AS_UNDERSCORE=true
34   AC_DEFINE(ASM_UNDERSCORE,,[symbols are prefixed by an underscore in assembly language])
35 else
36   AS_UNDERSCORE=false
37 fi
38 AC_SUBST(AS_UNDERSCORE)dnl
39 ])