diff options
author | Michele Calgaro <michele.calgaro@yahoo.it> | 2022-07-11 17:12:39 +0900 |
---|---|---|
committer | Michele Calgaro <michele.calgaro@yahoo.it> | 2022-07-11 22:06:00 +0900 |
commit | 38d735962dc18ce299f1cc47b2d02314ef623f24 (patch) | |
tree | 37f38b2e478a9d6f1c46bab97eff45ff536d6d32 | |
parent | 9dfcf38a3e4fbd14f15a6bb687fc85fd5ca34fd4 (diff) | |
download | kgtk-qt3-38d735962dc18ce299f1cc47b2d02314ef623f24.tar.gz kgtk-qt3-38d735962dc18ce299f1cc47b2d02314ef623f24.zip |
This resolves issue #3.
Signed-off-by: Michele Calgaro <michele.calgaro@yahoo.it>
(cherry picked from commit b7e7bb99e1c85325ff55866434f797dfb5c91187)
-rw-r--r-- | ConfigureChecks.cmake | 4 | ||||
-rw-r--r-- | config.h.cmake | 3 | ||||
-rw-r--r-- | gtk2/kgtk2.c | 6 |
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) |