]> git.ipfire.org Git - thirdparty/elfutils.git/commitdiff
Check for prefixed ar, readelf, and nm
authorMichael Forney <mforney@mforney.org>
Fri, 1 Nov 2013 07:51:04 +0000 (00:51 -0700)
committerMark Wielaard <mjw@redhat.com>
Tue, 5 Nov 2013 16:07:10 +0000 (17:07 +0100)
Sometimes with cross-compile toolchains, the tools are prefixed with the
target arch. Using AC_CHECK_TOOL looks for tools named like this.

Signed-off-by: Michael Forney <mforney@mforney.org>
Signed-off-by: Mark Wielaard <mjw@redhat.com>
12 files changed:
ChangeLog
config/ChangeLog
config/eu.am
configure.ac
libasm/Makefile.am
libdw/ChangeLog
libdw/Makefile.am
libelf/ChangeLog
libelf/Makefile.am
tests/ChangeLog
tests/Makefile.am
tests/run-arsymtest.sh

index 433450d3ca08afb7c1bd4f3f642046a73e1b85a8..026ce1e8b56b961305254bc37401602d19f3f295 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,7 @@
+2013-11-01  Michael Forney  <mforney@mforney.org>
+
+       * configure.ac: Call AM_PROG_AR and AC_CHECK_TOOL for readelf and nm.
+
 2013-10-30  Jan Kratochvil  <jan.kratochvil@redhat.com>
 
        * NEWS (Version 0.158): New.
index 3b1877d7dc3389d83dbde7036a0280a5d37224ba..98bf86fbb9d6c55ec82fae3375f888c4f0a69d7b 100644 (file)
@@ -1,3 +1,7 @@
+2013-11-01  Michael Forney  <mforney@mforney.org>
+
+       * eu.am: Use READELF.
+
 2013-09-30  Mark Wielaard  <mjw@redhat.com>
 
        * elfutils.spec.in: Update for readelf NT_SIGINFO and NT_FILE
index 86e5a4e90073e6f025de4e3d4c2a3a9ca127729e..38718c7f3efa9cfc458ad143aeb8383a9193aee8 100644 (file)
@@ -61,4 +61,4 @@ endif
 
 CLEANFILES = *.gcno *.gcda
 
-textrel_check = if readelf -d $@ | fgrep -q TEXTREL; then exit 1; fi
+textrel_check = if $(READELF) -d $@ | fgrep -q TEXTREL; then exit 1; fi
index b4c249c34468f9926f1d1bba48771642f1bd3d9b..ee2ce263b120a46a2d5cc8906ce4d7f63ba1131f 100644 (file)
@@ -79,6 +79,10 @@ AC_PROG_CC
 AC_PROG_RANLIB
 AC_PROG_YACC
 AM_PROG_LEX
+# Only available since automake 1.12
+m4_ifdef([AM_PROG_AR], [AM_PROG_AR])
+AC_CHECK_TOOL([READELF], [readelf])
+AC_CHECK_TOOL([NM], [nm])
 
 AC_CACHE_CHECK([for gcc with C99 support], ac_cv_c99, [dnl
 old_CFLAGS="$CFLAGS"
index e16d4be0cdbf7fa8988b0fd63b3e933d335503c0..4d81536b696ad416013c1f2cd9d47c8a83bef3ef 100644 (file)
@@ -69,7 +69,7 @@ libasm.so: libasm_pic.a libasm.map
                -Wl,--version-script,$(srcdir)/libasm.map,--no-undefined \
                -Wl,--soname,$@.$(VERSION) \
                ../libebl/libebl.a ../libelf/libelf.so  $(libasm_so_LDLIBS)
-       if readelf -d $@ | fgrep -q TEXTREL; then exit 1; fi
+       if $(READELF) -d $@ | fgrep -q TEXTREL; then exit 1; fi
        ln -fs $@ $@.$(VERSION)
 
 install: install-am libasm.so
index 3fa6c0eff55c8432e4c9341de22566a6f281e1de..7a768fca6a2a98ab4bbfdd0319661a37a68c96c2 100644 (file)
@@ -1,3 +1,7 @@
+2013-11-01  Michael Forney  <mforney@mforney.org>
+
+       * Makefile.am: Use READELF.
+
 2013-10-30  Jan Kratochvil  <jan.kratochvil@redhat.com>
 
        * libdw.map (ELFUTILS_0.158): New.
index 5fef2e1857e83a79948d4f69a75c82a5b8bec963..bf9456087e62b477f0e1d1aed87333b13fd72600 100644 (file)
@@ -113,7 +113,7 @@ libdw.so: $(srcdir)/libdw.map libdw_pic.a \
                -Wl,--version-script,$<,--no-undefined \
                -Wl,--whole-archive $(filter-out $<,$^) -Wl,--no-whole-archive\
                -ldl $(zip_LIBS)
-       if readelf -d $@ | fgrep -q TEXTREL; then exit 1; fi
+       if $(READELF) -d $@ | fgrep -q TEXTREL; then exit 1; fi
        ln -fs $@ $@.$(VERSION)
 
 install: install-am libdw.so
index d9d6421873ac83291491f1e54d4b1d9cbe2e787e..c2c5fc420d47c7bc6bf3032bc8dfcd9eba308797 100644 (file)
@@ -1,3 +1,7 @@
+2013-11-01  Michael Forney  <mforney@mforney.org>
+
+       * Makefile.am: Use READELF.
+
 2013-10-01  Petr Machata  <pmachata@redhat.com>
 
        * elf.h: Update from glibc.
index 5903ea8685c1a5388a6e82466fcb09f1edeb87b4..4646fbaebefe1b216005cd2e7a26261842c020e4 100644 (file)
@@ -106,7 +106,7 @@ libelf.so: libelf_pic.a libelf.map
        $(LINK) -shared -o $@ -Wl,--whole-archive,$<,--no-whole-archive \
                -Wl,--version-script,$(srcdir)/libelf.map,--no-undefined \
                -Wl,--soname,$@.$(VERSION),-z,defs,-z,relro $(libelf_so_LDLIBS)
-       if readelf -d $@ | fgrep -q TEXTREL; then exit 1; fi
+       if $(READELF) -d $@ | fgrep -q TEXTREL; then exit 1; fi
        ln -fs $@ $@.$(VERSION)
 
 install: install-am libelf.so
index c549fa0bcb667400eb439eca606b10f0781bc38d..5ebc1bd457013a555637ee226247417569ce31fa 100644 (file)
@@ -1,3 +1,8 @@
+2013-11-01  Michael Forney  <mforney@mforney.org>
+
+       * Makefile.am (TESTS_ENVIRONMENT): Use and export NM.
+       * run-arsymtest.sh: Use NM.
+
 2013-11-05  Mark Wielaard  <mjw@redhat.com>
 
        * allfcts.c (main): Correct dwarf_getfuncs return value check.
index d07cb0b0e4392670f887826c237f0a9042e11f1a..bc97523b8343f9a818fca81cd5d8dd00d7f38ae0 100644 (file)
@@ -231,7 +231,8 @@ installed_TESTS_ENVIRONMENT = libdir=$(DESTDIR)$(libdir); \
                              export abs_srcdir; export abs_builddir; \
                              export abs_top_builddir; \
                              export libdir; export bindir; \
-                             export LC_ALL; export LANG; export VALGRIND_CMD;
+                             export LC_ALL; export LANG; export VALGRIND_CMD; \
+                             NM=$(NM); export NM;
 installed_LOG_COMPILER = $(abs_srcdir)/test-wrapper.sh \
                         installed $(tests_rpath) \
                         '$(program_transform_name)'
@@ -244,7 +245,8 @@ TESTS_ENVIRONMENT = LC_ALL=C; LANG=C; VALGRIND_CMD=$(valgrind_cmd); \
                    abs_top_builddir=$(abs_top_builddir); \
                    export abs_srcdir; export abs_builddir; \
                    export abs_top_builddir; \
-                   export LC_ALL; export LANG; export VALGRIND_CMD;
+                   export LC_ALL; export LANG; export VALGRIND_CMD; \
+                   NM=$(NM); export NM;
 LOG_COMPILER = $(abs_srcdir)/test-wrapper.sh \
               $(abs_top_builddir)/libdw:$(abs_top_builddir)/backends:$(abs_top_builddir)/libelf:$(abs_top_builddir)/libasm
 
index dc016e1feb7be4c097d26e9bd0c7340e27435642..b0fdfcd616b66f1d5cc61d12f28eabe7604088b3 100755 (executable)
@@ -28,7 +28,7 @@ tempfiles $okfile $tmpfile $testfile
 result=77
 if test -f $lib; then
     # Generate list using `nm' we check against.
-    nm -s $lib |
+    ${NM} -s $lib |
     sed -e '1,/^Arch/d' -e '/^$/,$d' |
     sort > $okfile