From: Niels Möller Date: Wed, 5 Oct 2005 21:16:45 +0000 (+0200) Subject: * configure.ac (NM): Use AC_CHECK_TOOL to check for nm. X-Git-Tag: nettle_1.13_release_20051006~8 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=768bcd1da3fdc02fbfa374b4ec25994931207177;p=thirdparty%2Fnettle.git * configure.ac (NM): Use AC_CHECK_TOOL to check for nm. (ASM_SYMBOL_PREFIX): Use $NM when examining the object file. (ASM_ELF_STYLE): New variable. Set to 'yes' if assembling a file with ELF-style .type and .size pseudo ops works. Rev: src/nettle/configure.ac:1.59 --- diff --git a/configure.ac b/configure.ac index 705d0afe..e5776f41 100644 --- a/configure.ac +++ b/configure.ac @@ -77,6 +77,7 @@ fi AC_PROG_MAKE_SET AC_PROG_RANLIB +AC_CHECK_TOOL(NM, nm, strings) if test "x$ac_cv_prog_cc_stdc" = xno ; then AC_ERROR([the C compiler doesn't handle ANSI-C]) @@ -171,6 +172,7 @@ fi AC_SUBST([CCPIC_MAYBE]) ASM_SYMBOL_PREFIX='' +ASM_ELF_STYLE='no' if test x$enable_assembler = xyes ; then AC_CACHE_CHECK([if globals are prefixed by underscore], @@ -179,7 +181,7 @@ if test x$enable_assembler = xyes ; then nettle_cv_asm_underscore=no AC_COMPILE_IFELSE( [int a_global_symbol;], - [ nm conftest.$OBJEXT >conftest.out + [ $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 @@ -190,10 +192,37 @@ if test x$enable_assembler = xyes ; then [AC_MSG_WARN([test program with a single global could not be compiled!?])])]) if test x$nettle_cv_asm_underscore = xyes ; then ASM_SYMBOL_PREFIX='_' - fi + fi + # With inspiration from GMP_TRY_ASSEMBLE + AC_CACHE_CHECK([for ELF-style pseudo-ops], + nettle_cv_asm_elf_style_pseudo_ops, + [cat >conftest.s <&AC_FD_CC + nettle_cv_asm_elf_style_pseudo_ops=yes + else + cat conftest.out >&AC_FD_CC + echo "configure: failed program was:" >&AC_FD_CC + cat conftest.s >&AC_FD_CC + nettle_cv_asm_elf_style_pseudo_ops=no + fi + rm -f conftest.*]) + if test x$nettle_cv_asm_elf_style_pseudo_ops = xyes ; then + ASM_ELF_STYLE='yes' + fi fi AC_SUBST(ASM_SYMBOL_PREFIX) +AC_SUBST(ASM_ELF_STYLE) AC_SUBST(SHLIBCFLAGS) AC_SUBST(SHLIBMAJOR)