1
1

* don't declare functions being checked as extern char * - that's not a

function and causes problems with false negatives on some linux distros.
  Instead, use the test code used by AC_CHECK_FUNC.

This commit was SVN r8592.
Этот коммит содержится в:
Brian Barrett 2005-12-22 14:26:24 +00:00
родитель 4395d440dc
Коммит f74e24df69

Просмотреть файл

@ -25,22 +25,24 @@ dnl
# in LIBS) then lib is added to LIBS. If func is not in lib, then # in LIBS) then lib is added to LIBS. If func is not in lib, then
# LIBS is not modified. # LIBS is not modified.
AC_DEFUN([OMPI_CHECK_FUNC_LIB],[ AC_DEFUN([OMPI_CHECK_FUNC_LIB],[
AC_MSG_CHECKING([if we need -l$2 for $1]) AS_VAR_PUSHDEF([ompi_var], [ompi_cv_func_lib_$1_$2])dnl
AC_LINK_IFELSE([AC_LANG_PROGRAM([[extern char *]$1[;]], AC_CACHE_CHECK([if we need -l$2 for $1],
[[char *bar = ]$1[;]])], ompi_var,
[MSG="no"], [AC_LINK_IFELSE([AC_LANG_FUNC_LINK_TRY([$1])],
[AS_VAR_SET(ompi_var, "no")],
[LIBS_save="$LIBS" [LIBS_save="$LIBS"
LIBS="$LIBS -l$2" LIBS="$LIBS -l$2"
AC_LINK_IFELSE([AC_LANG_PROGRAM([[extern char *]$1[;]], AC_LINK_IFELSE([AC_LANG_FUNC_LINK_TRY([$1])],
[[char *bar = ]$1[;]])], [AS_VAR_SET(ompi_var, "yes")],
[WRAPPER_EXTRA_LIBS="$WRAPPER_EXTRA_LIBS -l$2" [AS_VAR_SET(ompi_var, "not found")])
MSG="yes"], LIBS="$LIBS_save"])])
[LIBS="$LIBS_save" AS_IF([test "AS_VAR_GET(ompi_var)" = "yes"],
MSG="not found"])]) [LIBS="$LIBS -l$2"
AC_MSG_RESULT([$MSG]) WRAPPER_EXTRA_LIBS="$WRAPPER_EXTRA_LIBS -l$2"])
# see if we actually have $1. Use AC_CHECK_FUNCS so that it # see if we actually have $1. Use AC_CHECK_FUNCS so that it
# does the glibs "not implemented" check. Will use the current LIBS, # does the glibc "not implemented" check. Will use the current LIBS,
# so will check in -l$2 if we decided we needed it above # so will check in -l$2 if we decided we needed it above
AC_CHECK_FUNCS([$1]) AC_CHECK_FUNCS([$1])
AS_VAR_POPDEF([ompi_var])dnl
]) ])