* lib/autoconf/erlang.m4 (AC_ERLANG_CHECK_LIB): Added substitution

of ERLANG_LIB_VER_* variables.
* doc/autoconf.texi (Erlang Libraries): Document ERLANG_LIB_VER_*
variables.
This commit is contained in:
Paul Eggert 2006-09-05 14:36:17 +00:00
parent ae048f75de
commit 4add5e895c
3 changed files with 36 additions and 12 deletions

View File

@ -1,3 +1,10 @@
2006-09-05 Romain Lenglet <rlenglet@users.forge.objectweb.org>
* lib/autoconf/erlang.m4 (AC_ERLANG_CHECK_LIB): Added substitution
of ERLANG_LIB_VER_* variables.
* doc/autoconf.texi (Erlang Libraries): Document ERLANG_LIB_VER_*
variables.
2006-09-03 Paul Eggert <eggert@cs.ucla.edu>
and Ralf Wildenhues <Ralf.Wildenhues@gmx.de>

View File

@ -7337,20 +7337,29 @@ when running @command{configure}.
@defmac AC_ERLANG_CHECK_LIB (@var{library}, @ovar{action-if-found}, @ovar{action-if-not-found})
@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}. @var{action-if-found} is a
list of shell commands to run if the library is installed;
@var{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
@samp{ERLANG_LIB_DIR_@var{library}} is set to the path to the library
installation directory. For example, to check if library @code{stdlib} is
installed:
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}.
@var{action-if-found} is a list of shell commands to run if the library
is installed; @var{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 @samp{ERLANG_LIB_DIR_@var{library}} is set to the path to the
library installation directory, and the output variable
@samp{ERLANG_LIB_VER_@var{library}} is set to the version number that is
part of the subdirectory name, if it is in the standard form
(@code{@var{library}-@var{version}}). If the directory name does not
have a version part, @samp{ERLANG_LIB_VER_@var{library}} is set to the
empty string. If the library is not installed,
@samp{ERLANG_LIB_DIR_@var{library}} and
@samp{ERLANG_LIB_VER_@var{library}} are set to @code{"not found"}. For
example, to check if library @code{stdlib} is installed:
@example
AC_ERLANG_CHECK_LIB([stdlib],
[echo "stdlib is installed in $ERLANG_LIB_DIR_stdlib"],
[echo "stdlib version \"$ERLANG_LIB_VER_stdlib\""
echo "is installed in \"$ERLANG_LIB_DIR_stdlib\""],
[AC_MSG_ERROR([stdlib was not found!])])
@end example
@end defmac

View File

@ -181,7 +181,8 @@ AC_DEFUN([AC_LANG_COMPILER(Erlang)],
dnl Macro for checking if an Erlang library is installed
dnl Macro for checking if an Erlang library is installed, and to
dnl determine its version
# AC_ERLANG_CHECK_LIB(LIBRARY, [ACTION-IF-FOUND], [ACTION-IF-NOT-FOUND])
# -------------------------------------------------------------------
@ -203,14 +204,21 @@ AC_CACHE_CHECK([for Erlang/OTP '$1' library subdirectory],
end,
halt(ReturnValue)])],
[erlang_cv_lib_dir_$1=`cat conftest.out`],
[if ! test -f conftest.out; then
[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=`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])
AS_IF([test "$erlang_cv_lib_dir_$1" = "not found"], [$3], [$2])
])# AC_ERLANG_CHECK_LIB