Mikael Magnusson <[EMAIL PROTECTED]> 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.
--- 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
+])
> 2. AC_LINK_IFELSE always succeeds and runs ACTION-IF-FOUND, because
> the exit status of erlc (the Erlang compiler) is thrown away and
> configure uses the exit status of "chmod +x conftest$ac_exeext"
> instead. (Solution replace all semicolons with "&&" in the link
> command "ac_link".)
AC_LINK_IFELSE is documented not to work in Erlang, in the
manual's section 6.5 "Running the Linker":
The `AC_LINK_IFELSE' macro cannot be used for Erlang
tests, since Erlang programs are interpreted and do not
require linking.
--
"Premature optimization is the root of all evil."
--D. E. Knuth, "Structured Programming with go to Statements"
--
To UNSUBSCRIBE, email to [EMAIL PROTECTED]
with a subject of "unsubscribe". Trouble? Contact [EMAIL PROTECTED]