4 dnl Macros for autoconf
8 dnl Set variable `LD' to the name of the linker program.
9 AC_DEFUN(LIBFIRM_PROG_LD,
10 dnl AC_REQUIRE([AC_PROG_CC])
11 [if test -z "$LD" && test "$GCC" = yes; then
12 AC_CHECK_TOOL(LD, gld, "")
14 if test -z "$LD"; then
20 dnl Set variable `libfirm_cv_prog_ld_r' to yes if the linker accepts -r, else to no.
21 AC_DEFUN(LIBFIRM_PROG_LD_R,
22 [AC_CACHE_CHECK(whether $LD accepts -r, libfirm_cv_prog_ld_r,
23 [AC_REQUIRE([LIBFIRM_PROG_LD])
24 libfirm_cv_prog_ld_r=no
26 cat > conftest.$ac_ext <<EOF
27 int foo() { return 0; }
29 if eval $ac_compile && mv conftest.o conftest2.o; then
30 cat > conftest.$ac_ext <<EOF
31 int main() { return foo(); }
33 if eval $ac_compile; then
34 if $LD -r -o conftest conftest.o conftest2.o; then
35 libfirm_cv_prog_ld_r=yes
41 AC_SUBST(libfirm_cv_prog_ld_r)