bug-autoconf
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Bug#454798: Erlang: AC_COMPILE_IFELSE always fails, and AC_LINK_IFEL


From: Ralf Wildenhues
Subject: Re: Bug#454798: Erlang: AC_COMPILE_IFELSE always fails, and AC_LINK_IFELSE always succeeds
Date: Mon, 10 Dec 2007 10:10:07 +0100
User-agent: Mutt/1.5.17 (2007-11-13)

tags upstream
thanks

[ Cc:ing bug-autoconf ]

Hello,

thanks for the report and patch.

* Ben Pfaff wrote on Mon, Dec 10, 2007 at 02:00:16AM CET:
> Mikael Magnusson <address@hidden> writes:
> 
> > AC_COMPILE_IFELSE and AC_LINK_IFELSE don't work as documented when
> > Erlang is the current language. I include a configure.ac which shows two
> > bugs.
> >
> > 1. AC_COMPILE_IFELSE always fails and runs ACTION-IF-NOT-FOUND, because
> >    configure checks if conftest.$ac_objext is present. But it never is
> >    when using Erlang.
> 
> It looks to me like the proper solution to this is to set
> $ac_objext.  Perhaps the following patch is sufficient?  It makes
> the AC_COMPILE_IFELSE succeed on my system here.

Autoconf currently assumes that ac_objext is the same for all languages.
This patch violates that assumption, and, by looking at it, will make
a later compile test in a different language (say, C) fail, e.g.:
  AC_INIT
  AC_PROG_CC
  AC_PROG_ERLANG
  AC_ERLANG_PATH_ERLC
  AC_LANG([C])
  AC_COMPILE_IFELSE(...)

I suppose we could change all the AC_LANG(XXX) macros (with XXX being
C, C++, Fortran, Fortran 77, Objective C, and Erlang) to set ac_objext
accordingly; and let ac_cv_objext be valid only for all != Erlang.

Anyway, I haven't tested that, and however the fix looks like in the
end, it should be accompanied by testsuite additions that exercise
AC_COMPILE_IFELSE with Erlang (if compiler is available) and that
exercise an AC_COMPILE_IFELSE with C after one with Erlang.

I'd be glad to assist if you need help writing such a patch, or write
one eventually, but I'd need someone with Erlang to test it for me.

Cheers,
Ralf

> --- tmp/autoconf-2.61/lib/autoconf/erlang.m4  2006-09-05 07:36:18.000000000 
> -0700
> +++ autoconf-2.61/lib/autoconf/erlang.m4      2007-12-09 16:57:45.000000000 
> -0800
> @@ -175,7 +175,9 @@
>  # ----------------------------
>  # Find the Erlang compiler.  Must be AC_DEFUN'd to be AC_REQUIRE'able.
>  AC_DEFUN([AC_LANG_COMPILER(Erlang)],
> -[AC_REQUIRE([AC_ERLANG_PATH_ERLC])])
> +[AC_REQUIRE([AC_ERLANG_PATH_ERLC])
> +ac_objext=beam
> +])




reply via email to

[Prev in Thread] Current Thread [Next in Thread]