diff --git a/AUTHORS b/AUTHORS index 9c07a86..aac3f00 100644 --- a/AUTHORS +++ b/AUTHORS @@ -83,7 +83,7 @@ Gregorio Guidi address@hidden 2005-03-03 Bruno Haible address@hidden 2005-06-12 Toby Oliver Hilary White address@hidden 2005-10-18 Eric Benjamin Blake address@hidden 2006-01-18 -Romain Lenglet address@hidden 2006-02-10 +Romain Lenglet address@hidden 2006-02-10 Markus Duft address@hidden 2006-08-03 Robert Schiele address@hidden 2006-09-12 Joel Edward Denny address@hidden 2006-09-15 diff --git a/ChangeLog b/ChangeLog index e07b300..bac94f7 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,11 @@ +2009-05-28 Romain Lenglet + + * lib/autoconf/erlang.m4: Add macro AC_ERLANG_SUBST_ERTS_VER. + * doc/autoconf.texi (Erlang Libraries): Document + AC_ERLANG_SUBST_ERTS_VER. + * AUTHORS: Update Romain Lenglet's email address. + * THANKS: Add Ruslan Babayev. + 2009-05-26 Eric Blake Sanitize more problematic environment variables. diff --git a/THANKS b/THANKS index 3c2843b..eab63f2 100644 --- a/THANKS +++ b/THANKS @@ -313,8 +313,9 @@ Roger Leigh address@hidden Roland McGrath address@hidden Rolf Ebert address@hidden Rolf Vandevaart address@hidden -Romain Lenglet address@hidden +Romain Lenglet address@hidden Ruediger Kuhlmann address@hidden +Ruslan Babayev address@hidden Russ Allbery address@hidden Russ Boylan address@hidden Ryuji Abe address@hidden diff --git a/doc/autoconf.texi b/doc/autoconf.texi index 3ddecdf..1c8f481 100644 --- a/doc/autoconf.texi +++ b/doc/autoconf.texi @@ -7798,6 +7798,20 @@ presence of certain Erlang libraries. All those macros require the configuration of an Erlang interpreter and an Erlang compiler (@pxref{Erlang Compiler and Interpreter}). address@hidden AC_ERLANG_SUBST_ERTS_VER address@hidden address@hidden ERLANG_ERTS_VER + +Set the output variable @code{ERLANG_ERTS_VER} to the version of the +Erlang runtime system (as returned by Erlang's address@hidden:system_info(version)} function). The result of this test +is cached if caching is enabled when running @command{configure}. The address@hidden variable is not intended to be used for testing +for features of specific ERTS versions, but to be used for substituting +the ERTS version in Erlang/OTP release resource files (@code{.rel} +files), as shown below. address@hidden defmac + @defmac AC_ERLANG_SUBST_ROOT_DIR @acindex{ERLANG_SUBST_ROOT_DIR} @ovindex ERLANG_ROOT_DIR @@ -7848,6 +7862,35 @@ AC_ERLANG_CHECK_LIB([stdlib], echo "is installed in \"$ERLANG_LIB_DIR_stdlib\""], [AC_MSG_ERROR([stdlib was not found!])]) @end example + +The @address@hidden variables (set by address@hidden) and the @code{ERLANG_ERTS_VER} variable (set +by @code{AC_ERLANG_SUBST_ERTS_VER}) are not intended to be used for +testing for features of specific versions of libraries or of the Erlang +runtime system. Those variables are intended to be substituted in +Erlang release resource files (@code{.rel} files). For instance, to +generate a @code{example.rel} file for an application depending on the address@hidden library, an @code{configure.ac} file should contain for +instance: + address@hidden +AC_ERLANG_SUBST_ERTS_VER +AC_ERLANG_CHECK_LIB([stdlib], + [], + [AC_MSG_ERROR([stdlib was not found!])]) +AC_CONFIG_FILES([example.rel]) address@hidden example + +And the @code{example.rel.in} file used to generate @code{example.rel} +should contain: + address@hidden +{release, + {"@PACKAGE@", "@VERSION@"}, + {erts, "@ERLANG_ERTS_VER@"}, + [{stdlib, "@ERLANG_LIB_VER_stdlib@"}, + address@hidden@, "@VERSION@"}]}. address@hidden example @end defmac In addition to the above macros, which test installed Erlang libraries, the diff --git a/lib/autoconf/erlang.m4 b/lib/autoconf/erlang.m4 index 7f6d92d..619bc4d 100644 --- a/lib/autoconf/erlang.m4 +++ b/lib/autoconf/erlang.m4 @@ -1,6 +1,6 @@ # This file is part of Autoconf. -*- Autoconf -*- # Erlang/OTP language support. -# Copyright (C) 2006, 2008 Free Software Foundation, Inc. +# Copyright (C) 2006, 2008, 2009 Free Software Foundation, Inc. # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by @@ -161,6 +161,7 @@ $2 # AC_LANG_PREPROC(Erlang) # ----------------------- # Find the Erlang preprocessor. Must be AC_DEFUN'd to be AC_REQUIRE'able. +# AC_DEFUN([AC_LANG_PREPROC(Erlang)], [m4_warn([syntax], [$0: No preprocessor defined for ]_AC_LANG)]) @@ -168,6 +169,7 @@ AC_DEFUN([AC_LANG_PREPROC(Erlang)], # AC_LANG_COMPILER(Erlang) # ------------------------ # 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])]) @@ -262,7 +264,6 @@ AC_SUBST([ERLANG_LIB_DIR], [$erlang_cv_lib_dir]) # AC_ERLANG_SUBST_INSTALL_LIB_DIR # ------------------------------- -# # Directories for installing Erlang/OTP packages are separated from the # directories determined by running the Erlang/OTP installation that is used # for building. @@ -294,3 +295,27 @@ else AC_MSG_RESULT([$ERLANG_INSTALL_LIB_DIR/$1-$2]) fi ])# AC_ERLANG_SUBST_INSTALL_LIB_SUBDIR + + +# AC_ERLANG_SUBST_ERTS_VER +# ------------------------ +# Determines the Erlang runtime system version +# +AC_DEFUN([AC_ERLANG_SUBST_ERTS_VER], +[AC_REQUIRE([AC_ERLANG_NEED_ERLC])[]dnl +AC_REQUIRE([AC_ERLANG_NEED_ERL])[]dnl +AC_CACHE_CHECK([for Erlang/OTP ERTS version], + [erlang_cv_erts_ver], + [AC_LANG_PUSH(Erlang)[]dnl + AC_RUN_IFELSE( + [AC_LANG_PROGRAM([], [dnl + Version = erlang:system_info(version), + file:write_file("conftest.out", Version), + ReturnValue = 0, + halt(ReturnValue)])], + [erlang_cv_erts_ver=`cat conftest.out`], + [AC_MSG_FAILURE([test Erlang program execution failed])]) + AC_LANG_POP(Erlang)[]dnl + ]) +AC_SUBST([ERLANG_ERTS_VER], [$erlang_cv_erts_ver]) +])# AC_ERLANG_SUBST_ERTS_VER