From bdcadfca80673ffa2e46f03fa5e85582f24a50cd Mon Sep 17 00:00:00 2001 From: Werner Koch Date: Fri, 29 Aug 2003 08:47:40 +0000 Subject: * acinclude.m4 (GNUPG_SYS_SYMBOL_UNDERSCORE): Re-implemented. * configure.ac: Use it here. --- ChangeLog | 5 +++++ acinclude.m4 | 65 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++- configure.ac | 4 +++- 3 files changed, 72 insertions(+), 2 deletions(-) diff --git a/ChangeLog b/ChangeLog index 556cc0a3..336ff4ed 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +2003-08-29 Werner Koch + + * acinclude.m4 (GNUPG_SYS_SYMBOL_UNDERSCORE): Re-implemented. + * configure.ac: Use it here. + 2003-08-07 Moritz Schulte * configure.ac: Fail, if libgpg-error could not be found. diff --git a/acinclude.m4 b/acinclude.m4 index b0435e88..3cafc7b9 100644 --- a/acinclude.m4 +++ b/acinclude.m4 @@ -1,5 +1,6 @@ dnl macros to configure Libgcrypt -dnl Copyright (C) 1998, 1999, 2000, 2001, 2002 Free Software Foundation, Inc. +dnl Copyright (C) 1998, 1999, 2000, 2001, 2002, +dnl 2003 Free Software Foundation, Inc. dnl dnl This file is part of Libgcrypt. dnl @@ -87,6 +88,68 @@ AC_DEFUN(GNUPG_CHECK_GNUMAKE, ]) +# +# GNUPG_SYS_SYMBOL_UNDERSCORE +# Does the compiler prefix global symbols with an underscore? +# +# Taken from GnuPG 1.2 and modified to use the libtool macros. +AC_DEFUN(GNUPG_SYS_SYMBOL_UNDERSCORE, +[tmp_do_check="no" +case "${target}" in + i386-emx-os2 | i[3456]86-pc-os2*emx | i386-pc-msdosdjgpp) + ac_cv_sys_symbol_underscore=yes + ;; + *) + if test "$cross_compiling" = yes; then + ac_cv_sys_symbol_underscore=yes + else + tmp_do_check="yes" + fi + ;; +esac +if test "$tmp_do_check" = "yes"; then + AC_REQUIRE([AC_LIBTOOL_SYS_GLOBAL_SYMBOL_PIPE]) + AC_MSG_CHECKING([for _ prefix in compiled symbols]) + AC_CACHE_VAL(ac_cv_sys_symbol_underscore, + [ac_cv_sys_symbol_underscore=no + cat > conftest.$ac_ext < $ac_nlist) && test -s "$ac_nlist"; then + # See whether the symbols have a leading underscore. + if egrep '^_nm_test_func' "$ac_nlist" >/dev/null; then + ac_cv_sys_symbol_underscore=yes + else + if egrep '^nm_test_func ' "$ac_nlist" >/dev/null; then + : + else + echo "configure: cannot find nm_test_func in $ac_nlist" >&AC_FD_CC + fi + fi + else + echo "configure: cannot run $global_symbol_pipe" >&AC_FD_CC + fi + else + echo "configure: failed program was:" >&AC_FD_CC + cat conftest.c >&AC_FD_CC + fi + rm -rf conftest* + ]) + else + AC_MSG_CHECKING([for _ prefix in compiled symbols]) + fi +AC_MSG_RESULT($ac_cv_sys_symbol_underscore) +if test x$ac_cv_sys_symbol_underscore = xyes; then + AC_DEFINE(WITH_SYMBOL_UNDERSCORE,1, + [Defined if compiled symbols have a leading underscore]) +fi +]) + + ###################################################################### # Check whether mlock is broken (hpux 10.20 raises a SIGBUS if mlock # is not called from uid 0 (not tested whether uid 0 works) diff --git a/configure.ac b/configure.ac index 66b6b558..62a3ff08 100644 --- a/configure.ac +++ b/configure.ac @@ -567,9 +567,11 @@ else fi fi -AC_MSG_RESULT() +# # Setup assembler stuff. +# +GNUPG_SYS_SYMBOL_UNDERSCORE() AC_MSG_CHECKING(for mpi assembler functions) if test -f $srcdir/mpi/config.links ; then . $srcdir/mpi/config.links -- cgit v1.2.1