autoconf: Erlang Libraries

1 
1 5.13 Erlang Libraries
1 =====================
1 
1 The following macros check for an installation of Erlang/OTP, and for
1 the presence of certain Erlang libraries.  All those macros require the
11 configuration of an Erlang interpreter and an Erlang compiler (⇒
 Erlang Compiler and Interpreter).
1 
1  -- Macro: AC_ERLANG_SUBST_ERTS_VER
1      Set the output variable `ERLANG_ERTS_VER' to the version of the
1      Erlang runtime system (as returned by Erlang's
1      `erlang:system_info(version)' function).  The result of this test
1      is cached if caching is enabled when running `configure'.  The
1      `ERLANG_ERTS_VER' variable is not intended to be used for testing
1      for features of specific ERTS versions, but to be used for
1      substituting the ERTS version in Erlang/OTP release resource files
1      (`.rel' files), as shown below.
1 
1  -- Macro: AC_ERLANG_SUBST_ROOT_DIR
1      Set the output variable `ERLANG_ROOT_DIR' to the path to the base
1      directory in which Erlang/OTP is installed (as returned by Erlang's
1      `code:root_dir/0' function).  The result of this test is cached if
1      caching is enabled when running `configure'.
1 
1  -- Macro: AC_ERLANG_SUBST_LIB_DIR
1      Set the output variable `ERLANG_LIB_DIR' to the path of the library
1      directory of Erlang/OTP (as returned by Erlang's `code:lib_dir/0'
1      function), which subdirectories each contain an installed
1      Erlang/OTP library.  The result of this test is cached if caching
1      is enabled when running `configure'.
1 
1  -- Macro: AC_ERLANG_CHECK_LIB (LIBRARY, [ACTION-IF-FOUND],
1           [ACTION-IF-NOT-FOUND])
1      Test whether the Erlang/OTP library LIBRARY is installed by
1      calling Erlang's `code:lib_dir/1' function.  The result of this
1      test is cached if caching is enabled when running `configure'.
1      ACTION-IF-FOUND is a list of shell commands to run if the library
1      is installed; ACTION-IF-NOT-FOUND is a list of shell commands to
1      run if it is not.  Additionally, if the library is installed, the
1      output variable `ERLANG_LIB_DIR_LIBRARY' is set to the path to the
1      library installation directory, and the output variable
1      `ERLANG_LIB_VER_LIBRARY' is set to the version number that is part
1      of the subdirectory name, if it is in the standard form
1      (`LIBRARY-VERSION').  If the directory name does not have a
1      version part, `ERLANG_LIB_VER_LIBRARY' is set to the empty string.
1      If the library is not installed, `ERLANG_LIB_DIR_LIBRARY' and
1      `ERLANG_LIB_VER_LIBRARY' are set to `"not found"'.  For example,
1      to check if library `stdlib' is installed:
1 
1           AC_ERLANG_CHECK_LIB([stdlib],
1             [echo "stdlib version \"$ERLANG_LIB_VER_stdlib\""
1              echo "is installed in \"$ERLANG_LIB_DIR_stdlib\""],
1             [AC_MSG_ERROR([stdlib was not found!])])
1 
1      The `ERLANG_LIB_VER_LIBRARY' variables (set by
1      `AC_ERLANG_CHECK_LIB') and the `ERLANG_ERTS_VER' variable (set by
1      `AC_ERLANG_SUBST_ERTS_VER') are not intended to be used for
1      testing for features of specific versions of libraries or of the
1      Erlang runtime system.  Those variables are intended to be
1      substituted in Erlang release resource files (`.rel' files).  For
1      instance, to generate a `example.rel' file for an application
1      depending on the `stdlib' library, `configure.ac' could contain:
1 
1           AC_ERLANG_SUBST_ERTS_VER
1           AC_ERLANG_CHECK_LIB([stdlib],
1             [],
1             [AC_MSG_ERROR([stdlib was not found!])])
1           AC_CONFIG_FILES([example.rel])
1 
1      The `example.rel.in' file used to generate `example.rel' should
1      contain:
1 
1           {release,
1               {"@PACKAGE@", "@VERSION@"},
1               {erts, "@ERLANG_ERTS_VER@"},
1               [{stdlib, "@ERLANG_LIB_VER_stdlib@"},
1                {@PACKAGE@, "@VERSION@"}]}.
1 
1    In addition to the above macros, which test installed Erlang
1 libraries, the following macros determine the paths to the directories
1 into which newly built Erlang libraries are to be installed:
1 
1  -- Macro: AC_ERLANG_SUBST_INSTALL_LIB_DIR
1      Set the `ERLANG_INSTALL_LIB_DIR' output variable to the directory
1      into which every built Erlang library should be installed in a
1      separate subdirectory.  If this variable is not set in the
1      environment when `configure' runs, its default value is
1      `${libdir}/erlang/lib'.
1 
1  -- Macro: AC_ERLANG_SUBST_INSTALL_LIB_SUBDIR (LIBRARY, VERSION)
1      Set the `ERLANG_INSTALL_LIB_DIR_LIBRARY' output variable to the
1      directory into which the built Erlang library LIBRARY version
1      VERSION should be installed.  If this variable is not set in the
1      environment when `configure' runs, its default value is
1      `$ERLANG_INSTALL_LIB_DIR/LIBRARY-VERSION', the value of the
1      `ERLANG_INSTALL_LIB_DIR' variable being set by the
1      `AC_ERLANG_SUBST_INSTALL_LIB_DIR' macro.
1