Commit 34c433aa authored by Sergey Kosukhin's avatar Sergey Kosukhin
Browse files

Check whether libtool works right after switching to it at the configure-time.

parent 5ea7d5a6
......@@ -51,6 +51,19 @@ LT_INIT([pic-only])
dnl _KPSE_USE_LIBTOOL ensures libtool is also used for configure-time tests,
dnl which deduces dependent libraries automatically
_KPSE_USE_LIBTOOL
_KPSE_CHECK_LIBTOOL
AS_IF([test -n "$FC" && test "X$FC" != Xno],
[AC_LANG_PUSH([Fortran])
_KPSE_CHECK_LIBTOOL
AC_LANG_POP([Fortran])])
AS_IF([test -n "$F77" && test "X$F77" != Xno],
[AC_LANG_PUSH([Fortran 77])
_KPSE_CHECK_LIBTOOL
AC_LANG_POP([Fortran 77])])
AS_IF([test -n "$CXX" && test "X$CXX" != Xno],
[AC_LANG_PUSH([C++])
_KPSE_CHECK_LIBTOOL
AC_LANG_POP([C++])])
# -----------------------------------------------------------------------
# Check endianess of system
......
......@@ -35,3 +35,17 @@ AC_PROVIDE_IFELSE([AC_PROG_F77],
])])[]dnl
AC_LANG(_AC_LANG)[]dnl
]) # _KPSE_USE_LIBTOOL
# _KPSE_CHECK_LIBTOOL([ACTION-IF-SUCCESS], [ACTION-IF-FAILURE = FAILURE])
# Check that we can link programs written in the current language with libtool
# -------------------
AC_DEFUN([_KPSE_CHECK_LIBTOOL],
[m4_pushdef([acx_cache_var], [acx_cv_libtool_[]_AC_LANG_ABBREV[]_works])dnl
AC_CACHE_CHECK([whether libtool can link _AC_LANG programs],
[acx_cache_var],
[acx_cache_var=no
AC_LINK_IFELSE([AC_LANG_PROGRAM], [acx_cache_var=yes])])
AS_VAR_IF([acx_cache_var], [no], [m4_default([$2],
[AC_MSG_FAILURE([unable to link a _AC_LANG program using libtool])])],
[$1])
m4_popdef([acx_cache_var])])
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment