8
0
mirror of https://github.com/FirebirdSQL/firebird.git synced 2025-01-23 04:43:03 +01:00

Added tests for presence of dlinfo() and its options on building host.

Thanks to Alex for patch for configure.ac.
This commit is contained in:
hvlad 2021-08-09 15:50:46 +03:00
parent 9226fcdb12
commit b1d1195256
2 changed files with 20 additions and 2 deletions

View File

@ -983,6 +983,18 @@ case $host in
;;
esac
AC_CHECK_FUNCS(poll)
AC_CHECK_FUNCS(dlinfo)
if test "$ac_cv_func_dlinfo" = "yes"; then
AC_MSG_CHECKING(if dlinfo supports RTLD_DI_LINKMAP)
AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#define _GNU_SOURCE
#include <link.h>
#include <dlfcn.h>]], [[struct link_map info; dlinfo(0, RTLD_DI_LINKMAP, &info);]])],[AC_DEFINE(HAVE_RTLD_DI_LINKMAP, [1], [Linkmap info support]) AC_MSG_RESULT(yes)],[AC_MSG_RESULT(no)])
AC_MSG_CHECKING(if dlinfo supports RTLD_DI_ORIGIN)
AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#define _GNU_SOURCE
#include <link.h>
#include <dlfcn.h>]], [[char info[256]; dlinfo(0, RTLD_DI_ORIGIN, info);]])],[AC_DEFINE(HAVE_RTLD_DI_ORIGIN, [1], [Origin info support]) AC_MSG_RESULT(yes)],[AC_MSG_RESULT(no)])
fi
dnl Check for time function
AC_SEARCH_LIBS(clock_gettime, rt)

View File

@ -208,8 +208,10 @@ void* DlfcnModule::findSymbol(ISC_STATUS* status, const Firebird::string& symNam
bool DlfcnModule::getRealPath(Firebird::PathName& realPath)
{
#ifdef HAVE_DLINFO
char b[PATH_MAX];
/*
#ifdef HAVE_RTLD_DI_ORIGIN
if (dlinfo(module, RTLD_DI_ORIGIN, b) == 0)
{
realPath = b;
@ -222,7 +224,9 @@ bool DlfcnModule::getRealPath(Firebird::PathName& realPath)
return true;
}
}
*/
#endif
#ifdef HAVE_RTLD_DI_LINKMAP
struct link_map* lm;
if (dlinfo(module, RTLD_DI_LINKMAP, &lm) == 0)
{
@ -232,6 +236,8 @@ bool DlfcnModule::getRealPath(Firebird::PathName& realPath)
return true;
}
}
#endif
#endif
return false;
}