summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--ConfigureChecks.cmake4
-rw-r--r--config.h.cmake3
-rw-r--r--gtk2/kgtk2.c6
3 files changed, 12 insertions, 1 deletions
diff --git a/ConfigureChecks.cmake b/ConfigureChecks.cmake
index cfd9cd0..2a90541 100644
--- a/ConfigureChecks.cmake
+++ b/ConfigureChecks.cmake
@@ -53,7 +53,9 @@ if( BUILD_KGTK_GTK2 )
check_library_exists( "${CMAKE_DL_LIBS}" _dl_sym "" HAVE_DL_SYM )
if( NOT HAVE_DL_SYM )
- tde_message_fatal( "The DL library seems no longer contains _dl_sym function" )
+ message( WARNING, "_dl_sym is requested but not found on your system.\n"
+ "Some functionality may not be available unless your\n"
+ "system has glibc 2.34 or greater." )
endif()
endif()
diff --git a/config.h.cmake b/config.h.cmake
index 2f33f6d..395ba2e 100644
--- a/config.h.cmake
+++ b/config.h.cmake
@@ -13,3 +13,6 @@
#cmakedefine HAVE_STRUCT_UCRED 1
#define VERSION "@KGTK_VERSION_FULL@"
+
+/* Define if you have the '_dl_sym' function */
+#cmakedefine HAVE_DL_SYM 1
diff --git a/gtk2/kgtk2.c b/gtk2/kgtk2.c
index e8e939b..4e83191 100644
--- a/gtk2/kgtk2.c
+++ b/gtk2/kgtk2.c
@@ -76,7 +76,9 @@ TODO
/*
* For SWT apps (e.g. eclipse) we need to override dlsym.
*/
+#ifdef HAVE_DL_SYM
extern void *_dl_sym(void *, const char *, void *);
+#endif
static void * real_dlsym (void *handle, const char *name);
typedef enum
@@ -2246,7 +2248,11 @@ static void * real_dlsym(void *handle, const char *name)
if (!realFunction)
{
// Get the real dlsym function
+#ifdef HAVE_DL_SYM
realFunction = _dl_sym(RTLD_NEXT, "dlsym", dlsym);
+#else
+ realFunction = dlvsym(RTLD_NEXT, "dlsym", "GLIBC_2.2.5");
+#endif
}
if (realFunction)