First implementation of lowering for calls with compound return values
[libfirm] / aclocal.m4
1 dnl
2 dnl Project:     libFIRM
3 dnl File name:   aclocal.m4
4 dnl Purpose:     Macros for autoconf
5 dnl Author:      Till Riedel
6 dnl Modified by:
7 dnl Created:
8 dnl CVS-ID:      $Id$
9 dnl Copyright:   (c) 2002-2003 Universität Karlsruhe
10 dnl Licence:     This file protected by GPL -  GNU GENERAL PUBLIC LICENSE.
11 dnl
12
13
14 dnl Set variable `LD' to the name of the linker program.
15 AC_DEFUN(LIBFIRM_PROG_LD,[
16 dnl AC_REQUIRE([AC_PROG_CC])
17 if test -z "$LD"; then
18   AC_CHECK_TOOL(LD, ld)
19 fi
20 ])
21
22
23 dnl Set variable `libfirm_cv_prog_ld_r' to yes if the linker accepts -r, else to no.
24 AC_DEFUN(LIBFIRM_PROG_LD_R,
25 [AC_CACHE_CHECK(whether $LD accepts -r, libfirm_cv_prog_ld_r,
26 [AC_REQUIRE([LIBFIRM_PROG_LD])
27 libfirm_cv_prog_ld_r=no
28 if test "$LD"; then
29   cat > conftest.$ac_ext <<EOF
30 int foo() { return 0; }
31 EOF
32   if eval $ac_compile && mv conftest.o conftest2.o; then
33     cat > conftest.$ac_ext <<EOF
34 extern int foo();
35 int main() { return foo(); }
36 EOF
37     if eval $ac_compile; then
38       if $LD -r -o conftest conftest.o conftest2.o; then
39         libfirm_cv_prog_ld_r=yes
40       fi
41     fi
42   fi
43 fi
44 rm -f conftest*])
45 AC_SUBST(libfirm_cv_prog_ld_r)
46 ])
47
48 dnl end of aclocal.m