autoconf/lib
Zack Weinberg 8bf19fe82e
Overhaul Erlang support.
Erlang is similar to Java in that it doesn’t compile to standalone
machine code; the output of ‘erlc’ is byte-code files that are then
interpreted by ‘erl’.  We handle this poorly in a whole bunch of ways,
particularly when cross-compiling.  This patch fixes up the more
serious problems:

 - AC_COMPILE_IFELSE now actually works when AC_LANG([Erlang]) is in
   effect.
 - ‘conftest.beam’ is now deleted in several more places where it
   could be created.
 - The various AC_ERLANG_* macros that interrogate the runtime
   environment do so by invoking ‘$ERL’ directly, rather than using
   AC_RUN_IFELSE, and thus do not crash the configure script when
   we think we’re cross-compiling.  (It is not clear to me whether
   they get the correct answer when cross-compiling, but this should
   still be strictly an improvement.)
 - The Erlang-related tests have been streamlined.

Further improvements are definitely possible, but we’d have to teach
the infrastructure to make $ac_objext language-specific first, which
seems like too big of a change for 2.70.

(This patch is all fallout from a logically unrelated testsuite change
which is coming up next.  Gotta love the fundamental interconnectedness
of things.)

* lib/autoconf/general.m4 (_AC_COMPILE_IFELSE_BODY)
  (_AC_LINK_IFELSE_BODY): Delete conftest.beam as well as conftest.$ac_objext.

* lib/autoconf/erlang.m4 (AC_ERLANG_PATH_ERLC, AC_ERLANG_PATH_ERL):
  Don’t repeat work done by AC_PATH_TOOL.
  (Erlang $ac_compile): Fake an .o file so AC_TRY_COMPILE will be happy.
  (AC_LANG_COMPILER(Erlang)): AC_REQUIRE AC_ERLANG_NEED_ERLC, not
  AC_ERLANG_PATH_ERLC.  Also AC_REQUIRE AC_ERLANG_NEED_ERL so
  AC_RUN_IFELSE works reliably.
  (AC_ERLANG_CHECK_LIB, AC_ERLANG_SUBST_ROOT_DIR)
  (AC_ERLANG_SUBST_LIB_DIR, AC_ERLANG_SUBST_ERTS_VER):
  Use $ERL -eval, not AC_RUN_IFELSE.
  No need to AC_REQUIRE AC_ERLANG_NEED_ERLC.

* tests/erlang.at: Don’t test anything here that’s tested adequately
  by acerlang.at; document which macros those are expected to be.
  Remove unnecessary AC_ERLANG_PATH_ERL/ERLC invocations throughout.
  (AT_CHECK_MACRO([Erlang])): Rename test to ‘Erlang basic compilation’;
  expect both AC_COMPILE_IFELSE and AC_RUN_IFELSE to work;
  handle cross compilation mode properly.
* tests/mktests.sh: Exclude from acerlang.at all macros completely
  covered by erlang.at.
2020-11-30 11:45:27 -05:00
..
autoconf Overhaul Erlang support. 2020-11-30 11:45:27 -05:00
Autom4te mktmpdir: Ensure that $tmp is always an absolute pathname. 2020-09-24 16:06:23 -04:00
autoscan maint: make update-copyright 2020-01-01 11:45:50 -08:00
autotest Improve handling of missing aux scripts. 2020-10-20 13:59:26 -04:00
emacs maint: make update-copyright 2020-01-01 11:45:50 -08:00
m4sugar AS_ECHO(_N): Do not expand macros named ‘s’ or ‘n’ (#110377) 2020-11-16 10:03:39 -05:00
autom4te.in Improve handling of missing aux scripts (autoreconf) 2020-10-20 16:57:01 -04:00
freeze.mk Port build procedure to AIX 7.1 2020-07-17 18:43:38 -07:00
local.mk Do not apply --program-transform-name to build-aux scripts. 2020-11-05 10:19:26 -05:00