aboutsummaryrefslogtreecommitdiffstats
path: root/configure.in
diff options
context:
space:
mode:
Diffstat (limited to 'configure.in')
-rw-r--r--configure.in35
1 files changed, 35 insertions, 0 deletions
diff --git a/configure.in b/configure.in
index 75ad236a73..d110126399 100644
--- a/configure.in
+++ b/configure.in
@@ -676,6 +676,41 @@ else
have_plugins=no
fi
+#
+# Check whether we can use dladdr to find the pathname of an executable.
+#
+AC_MSG_CHECKING(whether dladdr can be used to find the pathname of an executable)
+ac_save_CFLAGS="$CFLAGS"
+ac_save_LIBS="$LIBS"
+CFLAGS="$CFLAGS $GLIB_CFLAGS"
+LIBS="$GLIB_LIBS $LIBS"
+AC_TRY_RUN([
+#include <stdio.h>
+#include <dlfcn.h>
+
+int
+main(void)
+{
+ Dl_info info;
+
+ if (!dladdr((const void *)main, &info))
+ return 1; /* failure */
+ if (info.dli_fname[0] != '/')
+ return 1; /* not an absolute path - failure */
+ return 0; /* assume success */
+}
+], ac_cv_dladdr_finds_executable_path=yes, ac_cv_dladdr_finds_executable_path=no,
+ [echo $ac_n "cross compiling; assumed OK... $ac_c"
+ ac_cv_dladdr_finds_executable_path=yes])
+CFLAGS="$ac_save_CFLAGS"
+LIBS="$ac_save_LIBS"
+if test x$ac_cv_dladdr_finds_executable_path = xyes
+then
+ AC_DEFINE(DLADDR_FINDS_EXECUTABLE_PATH, 1, [Define if dladdr can be used to find the path of the executable])
+fi
+AC_MSG_RESULT($ac_cv_dladdr_finds_executable_path)
+
+
dnl IGE Mac integration check
AC_MSG_CHECKING(whether to use IGE Mac integration functions)