]> git.ipfire.org Git - thirdparty/autoconf.git/commitdiff
New AC_ERLANG_SUBST_ERTS_VER macro.
authorRomain Lenglet <romain.lenglet@berabera.info>
Thu, 28 May 2009 11:14:07 +0000 (20:14 +0900)
committerEric Blake <ebb9@byu.net>
Thu, 28 May 2009 12:19:57 +0000 (06:19 -0600)
* lib/autoconf/erlang.m4: Add macro AC_ERLANG_SUBST_ERTS_VER.
* doc/autoconf.texi (Erlang Libraries): Document
AC_ERLANG_SUBST_ERTS_VER.
* NEWS: Likewise.
* AUTHORS: Update Romain Lenglet's email address.
* THANKS: Update.
Suggested by Ruslan Babayev.

Signed-off-by: Eric Blake <ebb9@byu.net>
AUTHORS
ChangeLog
NEWS
THANKS
doc/autoconf.texi
lib/autoconf/erlang.m4

diff --git a/AUTHORS b/AUTHORS
index 9c07a86a5997f5e0bc17a09f5a39079c8a490c6b..aac3f0089fe43b3312d6e3d046436dcfb6e9c15f 100644 (file)
--- a/AUTHORS
+++ b/AUTHORS
@@ -83,7 +83,7 @@ Gregorio Guidi              greg_g@gentoo.org                   2005-03-03
 Bruno Haible                bruno@clisp.org                     2005-06-12
 Toby Oliver Hilary White    tow21@cam.ac.uk                     2005-10-18
 Eric Benjamin Blake         ebb9@byu.net                        2006-01-18
-Romain Lenglet              rlenglet@users.forge.objectweb.org  2006-02-10
+Romain Lenglet              romain.lenglet@laposte.net          2006-02-10
 Markus Duft                 markus.duft@salomon.at              2006-08-03
 Robert Schiele              rschiele@gmail.com                  2006-09-12
 Joel Edward Denny           jdenny@clemson.edu                  2006-09-15
index e07b300e38b3b3f879f092041bf8cf57ba11c2a8..a9f3ca84df9d59f7733a7f548cd29caeaceefc56 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,14 @@
+2009-05-28  Romain Lenglet  <romain.lenglet@laposte.net>
+
+       New AC_ERLANG_SUBST_ERTS_VER macro.
+       * lib/autoconf/erlang.m4: Add macro AC_ERLANG_SUBST_ERTS_VER.
+       * doc/autoconf.texi (Erlang Libraries): Document
+       AC_ERLANG_SUBST_ERTS_VER.
+       * NEWS: Likewise.
+       * AUTHORS: Update Romain Lenglet's email address.
+       * THANKS: Update.
+       Suggested by Ruslan Babayev.
+
 2009-05-26  Eric Blake  <ebb9@byu.net>
 
        Sanitize more problematic environment variables.
diff --git a/NEWS b/NEWS
index 9626cacd74a62caea3ecda28db93bfedb3545b6a..82ba6351539705c0a98ac92158ca44bc5ae17493 100644 (file)
--- a/NEWS
+++ b/NEWS
@@ -6,6 +6,9 @@ GNU Autoconf NEWS - User visible changes.
 ** AS_IF and AS_CASE have been taught to avoid syntax errors even when
    given arguments that expand to just whitespace.
 
+** The following documented autoconf macros are new:
+   AC_ERLANG_SUBST_ERTS_VER
+
 ** Ensure AT_CHECK can support commands that include a # given with
    proper m4 quoting.  For shell comments, this is a new feature; for
    non-shell comments, this fixes a regression introduced in 2.63b.
diff --git a/THANKS b/THANKS
index 3c2843b2e7b996df78578ccffb65f5c3931213af..eab63f2c551bd381da3d8a051367271334f09711 100644 (file)
--- a/THANKS
+++ b/THANKS
@@ -313,8 +313,9 @@ Roger Leigh                 rleigh@whinlatter.ukfsn.org
 Roland McGrath              roland@gnu.org
 Rolf Ebert                  rolf.ebert.gcc@gmx.de
 Rolf Vandevaart             Rolf.Vandevaart@sun.com
-Romain Lenglet              rlenglet@users.forge.objectweb.org
+Romain Lenglet              romain.lenglet@laposte.net
 Ruediger Kuhlmann           info@ruediger-kuhlmann.de
+Ruslan Babayev              ruslan@babayev.com
 Russ Allbery                rra@stanford.edu
 Russ Boylan                 ross@biostat.ucsf.edu
 Ryuji Abe                   raeva@t3.rim.or.jp
index 3ddecdf6174e6ae2672f923533a807cf14b2c60d..632058db72008321f6ff774503bf8b00c28ad6ca 100644 (file)
@@ -7798,10 +7798,22 @@ presence of certain Erlang libraries.  All those macros require the
 configuration of an Erlang interpreter and an Erlang compiler
 (@pxref{Erlang Compiler and Interpreter}).
 
+@defmac AC_ERLANG_SUBST_ERTS_VER
+@acindex{ERLANG_SUBST_ERTS_VER}
+@ovindex ERLANG_ERTS_VER
+Set the output variable @code{ERLANG_ERTS_VER} to the version of the
+Erlang runtime system (as returned by Erlang's
+@code{erlang:system_info(version)} function).  The result of this test
+is cached if caching is enabled when running @command{configure}.  The
+@code{ERLANG_ERTS_VER} 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.
+@end defmac
+
 @defmac AC_ERLANG_SUBST_ROOT_DIR
 @acindex{ERLANG_SUBST_ROOT_DIR}
 @ovindex ERLANG_ROOT_DIR
-
 Set the output variable @code{ERLANG_ROOT_DIR} to the path to the base
 directory in which Erlang/OTP is installed (as returned by Erlang's
 @code{code:root_dir/0} function).  The result of this test is cached if
@@ -7811,7 +7823,6 @@ caching is enabled when running @command{configure}.
 @defmac AC_ERLANG_SUBST_LIB_DIR
 @acindex{ERLANG_SUBST_LIB_DIR}
 @ovindex ERLANG_LIB_DIR
-
 Set the output variable @code{ERLANG_LIB_DIR} to the path of the library
 directory of Erlang/OTP (as returned by Erlang's
 @code{code:lib_dir/0} function), which subdirectories each contain an installed
@@ -7824,7 +7835,6 @@ when running @command{configure}.
 @acindex{ERLANG_CHECK_LIB}
 @ovindex ERLANG_LIB_DIR_@var{library}
 @ovindex ERLANG_LIB_VER_@var{library}
-
 Test whether the Erlang/OTP library @var{library} is installed by
 calling Erlang's @code{code:lib_dir/1} function.  The result of this
 test is cached if caching is enabled when running @command{configure}.
@@ -7848,6 +7858,35 @@ AC_ERLANG_CHECK_LIB([stdlib],
    echo "is installed in \"$ERLANG_LIB_DIR_stdlib\""],
   [AC_MSG_ERROR([stdlib was not found!])])
 @end example
+
+The @samp{ERLANG_LIB_VER_@var{library}} variables (set by
+@code{AC_ERLANG_CHECK_LIB}) 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 @file{example.rel} file for an application depending on the
+@code{stdlib} library, @file{configure.ac} could contain:
+
+@example
+AC_ERLANG_SUBST_ERTS_VER
+AC_ERLANG_CHECK_LIB([stdlib],
+  [],
+  [AC_MSG_ERROR([stdlib was not found!])])
+AC_CONFIG_FILES([example.rel])
+@end example
+
+@noindent
+The @file{example.rel.in} file used to generate @file{example.rel}
+should contain:
+
+@example
+{release,
+    {"@@PACKAGE@@", "@@VERSION@@"},
+    {erts, "@@ERLANG_ERTS_VER@@"},
+    [{stdlib, "@@ERLANG_LIB_VER_stdlib@@"},
+     {@@PACKAGE@@, "@@VERSION@@"}]}.
+@end example
 @end defmac
 
 In addition to the above macros, which test installed Erlang libraries, the
index 7f6d92d9df72fa9376babf743c80ba583979e7f5..1e4418bddef0f0d5146afaee6a5109222ce930f8 100644 (file)
@@ -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
@@ -163,7 +163,7 @@ $2
 # 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)])
+        [$0: No preprocessor defined for ]_AC_LANG)])
 
 # AC_LANG_COMPILER(Erlang)
 # ------------------------
@@ -175,8 +175,7 @@ AC_DEFUN([AC_LANG_COMPILER(Erlang)],
 # AC_ERLANG_CHECK_LIB(LIBRARY, [ACTION-IF-FOUND], [ACTION-IF-NOT-FOUND])
 # ----------------------------------------------------------------------
 # Macro for checking if an Erlang library is installed, and to
-# determine its version
-#
+# determine its version.
 AC_DEFUN([AC_ERLANG_CHECK_LIB],
 [AC_REQUIRE([AC_ERLANG_PATH_ERLC])[]dnl
 AC_REQUIRE([AC_ERLANG_PATH_ERL])[]dnl
@@ -184,29 +183,29 @@ AC_CACHE_CHECK([for Erlang/OTP '$1' library subdirectory],
     [erlang_cv_lib_dir_$1],
     [AC_LANG_PUSH(Erlang)[]dnl
      AC_RUN_IFELSE(
-        [AC_LANG_PROGRAM([], [dnl
-            ReturnValue = case code:lib_dir("[$1]") of
-            {error, bad_name} ->
-                file:write_file("conftest.out", "not found\n"),
-                1;
-            LibDir ->
-                file:write_file("conftest.out", LibDir),
-                0
-            end,
-            halt(ReturnValue)])],
-        [erlang_cv_lib_dir_$1=`cat conftest.out`],
-        [if test ! -f conftest.out; then
-             AC_MSG_FAILURE([test Erlang program execution failed])
-         else
-             erlang_cv_lib_dir_$1="not found"
-         fi])
+       [AC_LANG_PROGRAM([], [dnl
+           ReturnValue = case code:lib_dir("[$1]") of
+           {error, bad_name} ->
+               file:write_file("conftest.out", "not found\n"),
+               1;
+           LibDir ->
+               file:write_file("conftest.out", LibDir),
+               0
+           end,
+           halt(ReturnValue)])],
+       [erlang_cv_lib_dir_$1=`cat conftest.out`],
+       [if test ! -f conftest.out; then
+            AC_MSG_FAILURE([test Erlang program execution failed])
+        else
+            erlang_cv_lib_dir_$1="not found"
+        fi])
      AC_LANG_POP(Erlang)[]dnl
     ])
 AC_CACHE_CHECK([for Erlang/OTP '$1' library version],
     [erlang_cv_lib_ver_$1],
     [AS_IF([test "$erlang_cv_lib_dir_$1" = "not found"],
-        [erlang_cv_lib_ver_$1="not found"],
-        [erlang_cv_lib_ver_$1=`AS_ECHO(["$erlang_cv_lib_dir_$1"]) | sed -n -e 's,^.*-\([[^/-]]*\)$,\1,p'`])[]dnl
+       [erlang_cv_lib_ver_$1="not found"],
+       [erlang_cv_lib_ver_$1=`AS_ECHO(["$erlang_cv_lib_dir_$1"]) | sed -n -e 's,^.*-\([[^/-]]*\)$,\1,p'`])[]dnl
     ])
 AC_SUBST([ERLANG_LIB_DIR_$1], [$erlang_cv_lib_dir_$1])
 AC_SUBST([ERLANG_LIB_VER_$1], [$erlang_cv_lib_ver_$1])
@@ -216,8 +215,7 @@ AS_IF([test "$erlang_cv_lib_dir_$1" = "not found"], [$3], [$2])
 
 # AC_ERLANG_SUBST_ROOT_DIR
 # ------------------------
-# Determines the Erlang/OTP root directory
-#
+# Determines the Erlang/OTP root directory.
 AC_DEFUN([AC_ERLANG_SUBST_ROOT_DIR],
 [AC_REQUIRE([AC_ERLANG_NEED_ERLC])[]dnl
 AC_REQUIRE([AC_ERLANG_NEED_ERL])[]dnl
@@ -225,13 +223,13 @@ AC_CACHE_CHECK([for Erlang/OTP root directory],
     [erlang_cv_root_dir],
     [AC_LANG_PUSH(Erlang)[]dnl
      AC_RUN_IFELSE(
-        [AC_LANG_PROGRAM([], [dnl
-            RootDir = code:root_dir(),
-            file:write_file("conftest.out", RootDir),
-            ReturnValue = 0,
-            halt(ReturnValue)])],
-        [erlang_cv_root_dir=`cat conftest.out`],
-        [AC_MSG_FAILURE([test Erlang program execution failed])])
+       [AC_LANG_PROGRAM([], [dnl
+           RootDir = code:root_dir(),
+           file:write_file("conftest.out", RootDir),
+           ReturnValue = 0,
+           halt(ReturnValue)])],
+       [erlang_cv_root_dir=`cat conftest.out`],
+       [AC_MSG_FAILURE([test Erlang program execution failed])])
      AC_LANG_POP(Erlang)[]dnl
     ])
 AC_SUBST([ERLANG_ROOT_DIR], [$erlang_cv_root_dir])
@@ -247,13 +245,13 @@ AC_CACHE_CHECK([for Erlang/OTP library base directory],
     [erlang_cv_lib_dir],
     [AC_LANG_PUSH(Erlang)[]dnl
      AC_RUN_IFELSE(
-        [AC_LANG_PROGRAM([], [dnl
-            LibDir = code:lib_dir(),
-            file:write_file("conftest.out", LibDir),
-            ReturnValue = 0,
-            halt(ReturnValue)])],
-        [erlang_cv_lib_dir=`cat conftest.out`],
-        [AC_MSG_FAILURE([test Erlang program execution failed])])
+       [AC_LANG_PROGRAM([], [dnl
+           LibDir = code:lib_dir(),
+           file:write_file("conftest.out", LibDir),
+           ReturnValue = 0,
+           halt(ReturnValue)])],
+       [erlang_cv_lib_dir=`cat conftest.out`],
+       [AC_MSG_FAILURE([test Erlang program execution failed])])
      AC_LANG_POP(Erlang)[]dnl
     ])
 AC_SUBST([ERLANG_LIB_DIR], [$erlang_cv_lib_dir])
@@ -262,11 +260,9 @@ 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.
-#
 AC_DEFUN([AC_ERLANG_SUBST_INSTALL_LIB_DIR],
 [AC_MSG_CHECKING([for Erlang/OTP library installation base directory])
 AC_ARG_VAR([ERLANG_INSTALL_LIB_DIR],
@@ -286,7 +282,8 @@ AC_DEFUN([AC_ERLANG_SUBST_INSTALL_LIB_SUBDIR],
 [AC_REQUIRE([AC_ERLANG_SUBST_INSTALL_LIB_DIR])[]dnl
 AC_MSG_CHECKING([for Erlang/OTP '$1' library installation subdirectory])
 AC_ARG_VAR([ERLANG_INSTALL_LIB_DIR_$1],
-    [Erlang/OTP '$1' library installation subdirectory [ERLANG_INSTALL_LIB_DIR/$1-$2]])
+    [Erlang/OTP '$1' library installation subdirectory
+       [ERLANG_INSTALL_LIB_DIR/$1-$2]])
 if test -n "$ERLANG_INSTALL_LIB_DIR_$1"; then
     AC_MSG_RESULT([$ERLANG_INSTALL_LIB_DIR_$1])
 else
@@ -294,3 +291,26 @@ 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