summaryrefslogtreecommitdiff
path: root/configure.ac
diff options
context:
space:
mode:
authorNiels Möller <nisse@lysator.liu.se>2004-11-17 22:16:13 +0100
committerNiels Möller <nisse@lysator.liu.se>2004-11-17 22:16:13 +0100
commit1b1a44478115b239cdfa173a5ed1a95a115dc820 (patch)
tree3323bd1403dac5db7e5259e09289f7f4e22fb924 /configure.ac
parentc7747446dfce98a83248c10547863154ce950c8e (diff)
downloadnettle-1b1a44478115b239cdfa173a5ed1a95a115dc820.tar.gz
(ASM_SYMBOL_PREFIX): Check if global symbols have a
leading underscore. Rev: src/nettle/configure.ac:1.52
Diffstat (limited to 'configure.ac')
-rw-r--r--configure.ac25
1 files changed, 24 insertions, 1 deletions
diff --git a/configure.ac b/configure.ac
index 849b2bc8..75cff5bf 100644
--- a/configure.ac
+++ b/configure.ac
@@ -168,7 +168,30 @@ else
fi
AC_SUBST([CCPIC_MAYBE])
-LSH_MAKE_CONDITIONAL([ENABLE_ASM], [test x$enable_assembler = xyes])
+ASM_SYMBOL_PREFIX=''
+
+if test x$enable_assembler = xyes ; then
+ AC_CACHE_CHECK([if globals are prefixed by underscore],
+ nettle_cv_asm_underscore,
+ [ # Default is no underscore
+ nettle_cv_asm_underscore=no
+ AC_COMPILE_IFELSE(
+ [int a_global_symbol;],
+ [ nm conftest.$OBJEXT >conftest.out
+ if grep _a_global_symbol conftest.out >/dev/null ; then
+ nettle_cv_asm_underscore=yes
+ elif grep a_global_symbol conftest.out >/dev/null ; then
+ nettle_cv_asm_underscore=no
+ else
+ AC_MSG_WARN([nm doesn't list a_global_symbol at all])
+ fi],
+ [AC_MSG_WARN([test program with a single global could not be compiled!?])])])
+ if x$nettle_cv_asm_underscore=xyes ; then
+ ASM_SYMBOL_PREFIX='_'
+ fi
+fi
+
+AC_SUBST(ASM_SYMBOL_PREFIX)
AC_SUBST(SHLIBCFLAGS)
AC_SUBST(SHLIBMAJOR)