summaryrefslogtreecommitdiff
path: root/acinclude.m4
diff options
context:
space:
mode:
authorTim Pierce <twp@skepsis.com>1997-11-21 19:39:23 +0000
committerTim Pierce <twp@skepsis.com>1997-11-21 19:39:23 +0000
commit2a0d71767f66bb8dd41dd2f4cd4503858891868e (patch)
treeaa7e984116e7d3840acc20c871ed66899db66fa7 /acinclude.m4
parente41530ba095f461acd05973a1d148e0cfc44e509 (diff)
Added support for leading dlsym underscore.
Diffstat (limited to 'acinclude.m4')
-rw-r--r--acinclude.m438
1 files changed, 38 insertions, 0 deletions
diff --git a/acinclude.m4 b/acinclude.m4
index c40eee99d..6a56d2696 100644
--- a/acinclude.m4
+++ b/acinclude.m4
@@ -102,3 +102,41 @@ ifelse([$4], , , [$4
])dnl
fi
])
+
+
+
+dnl Check checks whether dlsym (if present) requires a leading underscore.
+dnl Written by Dan Hagerty <hag@ai.mit.edu> for scsh-0.5.0.
+AC_DEFUN(GUILE_DLSYM_USCORE, [
+ AC_MSG_CHECKING(for underscore before symbols)
+ AC_CACHE_VAL(guile_cv_uscore,[
+ echo "main(){int i=1;}
+ fnord(){int i=23; int ltuae=42;}" > conftest.c
+ ${CC} conftest.c > /dev/null
+ if (nm a.out | grep _fnord) > /dev/null; then
+ guile_cv_uscore=yes
+ else
+ guile_cv_uscore=no
+ fi])
+ AC_MSG_RESULT($guile_cv_uscore)
+ rm -f conftest.c a.out
+
+ if test $guile_cv_uscore = yes; then
+ AC_DEFINE(USCORE)
+
+ if test $ac_cv_func_dlopen = yes -o $ac_cv_lib_dl_dlopen = yes ; then
+ AC_MSG_CHECKING(whether dlsym always adds an underscore for us)
+ AC_CACHE_VAL(guile_cv_dlsym_adds_uscore,AC_TRY_RUN( [
+#include <dlfcn.h>
+#include <stdio.h>
+fnord() { int i=42;}
+main() { void *self, *ptr1, *ptr2; self=dlopen(NULL,RTLD_LAZY);
+ if(self) { ptr1=dlsym(self,"fnord"); ptr2=dlsym(self,"_fnord");
+ if(ptr1 && !ptr2) exit(0); } exit(1); }
+], [guile_cv_dlsym_adds_uscore=yes
+ AC_DEFINE(DLSYM_ADDS_USCORE) ], guile_cv_dlsym_adds_uscore=no))
+
+ AC_MSG_RESULT($guile_cv_dlsym_adds_uscore)
+ fi
+ fi
+])