Previous: Posix Variants, Up: Existing Tests


5.13 Erlang Libraries

The following macros check for an installation of Erlang/OTP, and for the presence of certain Erlang libraries. All those macros require the configuration of an Erlang interpreter and an Erlang compiler (see Erlang Compiler and Interpreter).

— Macro: AC_ERLANG_SUBST_ROOT_DIR

Set the output variable ERLANG_ROOT_DIR to the path to the base directory in which Erlang/OTP is installed (as returned by Erlang's code:root_dir/0 function). The result of this test is cached if caching is enabled when running configure.

— Macro: AC_ERLANG_SUBST_LIB_DIR

Set the output variable ERLANG_LIB_DIR to the path of the library directory of Erlang/OTP (as returned by Erlang's code:lib_dir/0 function), which subdirectories each contain an installed Erlang/OTP library. The result of this test is cached if caching is enabled when running configure.

— Macro: AC_ERLANG_CHECK_LIB (library, [action-if-found], [action-if-not-found])

Test whether the Erlang/OTP library library is installed by calling Erlang's code:lib_dir/1 function. The result of this test is cached if caching is enabled when running configure. action-if-found is a list of shell commands to run if the library is installed; action-if-not-found is a list of shell commands to run if it is not. Additionally, if the library is installed, the output variable `ERLANG_LIB_DIR_library' is set to the path to the library installation directory, and the output variable `ERLANG_LIB_VER_library' is set to the version number that is part of the subdirectory name, if it is in the standard form (library-version). If the directory name does not have a version part, `ERLANG_LIB_VER_library' is set to the empty string. If the library is not installed, `ERLANG_LIB_DIR_library' and `ERLANG_LIB_VER_library' are set to "not found". For example, to check if library stdlib is installed:

          AC_ERLANG_CHECK_LIB([stdlib],
            [echo "stdlib version \"$ERLANG_LIB_VER_stdlib\""
             echo "is installed in \"$ERLANG_LIB_DIR_stdlib\""],
            [AC_MSG_ERROR([stdlib was not found!])])
     

In addition to the above macros, which test installed Erlang libraries, the following macros determine the paths to the directories into which newly built Erlang libraries are to be installed:

— Macro: AC_ERLANG_SUBST_INSTALL_LIB_DIR

Set the ERLANG_INSTALL_LIB_DIR output variable to the directory into which every built Erlang library should be installed in a separate subdirectory. If this variable is not set in the environment when configure runs, its default value is $ERLANG_LIB_DIR, which value is set by the AC_ERLANG_SUBST_LIB_DIR macro.

— Macro: AC_ERLANG_SUBST_INSTALL_LIB_SUBDIR (library, version)

Set the `ERLANG_INSTALL_LIB_DIR_library' output variable to the directory into which the built Erlang library library version version should be installed. If this variable is not set in the environment when configure runs, its default value is `$ERLANG_INSTALL_LIB_DIR/library-version', the value of the ERLANG_INSTALL_LIB_DIR variable being set by the AC_ERLANG_SUBST_INSTALL_LIB_DIR macro.