summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRoland McGrath <roland@redhat.com>2005-11-17 02:32:03 +0000
committerRoland McGrath <roland@redhat.com>2005-11-17 02:32:03 +0000
commitd7f8d0caa7a357f9f4765e5dc93255f5057eba2e (patch)
tree6bb8e84c8234d3ee13e506f1de85a9d3a73a64cf
parent2f39dfa20fb4b1e4a53af3b112b9bc42fdbc2ecb (diff)
downloadelfutils-d7f8d0caa7a357f9f4765e5dc93255f5057eba2e.tar.gz
2005-11-16 Roland McGrath <roland@redhat.com>
* configure.ac: Define HAVE_LIBASM and STANDALONE conditionals. In config.h, define ELFUTILS_HEADER macro. tests/ 2005-11-16 Roland McGrath <roland@redhat.com> * configure.ac: New file, for standalone build/dist of test suite. * Makefile.am [!STANDALONE] (INCLUDES): Don't define it. (asm_TESTS): New variable, broken out of ... (TESTS): ... here. Also remove msg_tst. [!STANDALONE] (TESTS, noinst_PROGRAMS): Add in $(asm_TESTS), msg_tst. (installed_TESTS_ENVIRONMENT): New variable. [STANDALONE] (TESTS_ENVIRONMENT): Use that. [!STANDALONE] (installcheck-local): Likewise. [STANDALONE] (libdw, libelf, libasm, libebl): Define using -lfoo. * addrscopes.c: Include <config.h>. Use ELFUTILS_HEADER macro in #include of installed elfutils/ headers. * allfcts.c: Likewise. * asm-tst1.c: Likewise. * asm-tst2.c: Likewise. * asm-tst3.c: Likewise. * asm-tst4.c: Likewise. * asm-tst5.c: Likewise. * asm-tst6.c: Likewise. * asm-tst7.c: Likewise. * asm-tst8.c: Likewise. * asm-tst9.c: Likewise. * dwflmodtest.c: Likewise. * find-prologues.c: Likewise. * funcscopes.c: Likewise. * get-aranges.c: Likewise. * get-files.c: Likewise. * get-lines.c: Likewise. * get-pubnames.c: Likewise. * line2addr.c: Likewise. * newscn.c: Likewise. * show-abbrev.c: Likewise. * show-die-info.c: Likewise. * update3.c: Likewise. * update4.c: Likewise. * dwflmodtest.c (print_instance): Don't use INTUSE. (options): Don't use N_ macro.
-rw-r--r--ChangeLog5
-rw-r--r--configure.ac5
-rw-r--r--tests/ChangeLog40
-rw-r--r--tests/Makefile.am45
-rw-r--r--tests/addrscopes.c2
-rw-r--r--tests/allfcts.c18
-rw-r--r--tests/asm-tst1.c6
-rw-r--r--tests/asm-tst2.c6
-rw-r--r--tests/asm-tst3.c6
-rw-r--r--tests/asm-tst4.c6
-rw-r--r--tests/asm-tst5.c6
-rw-r--r--tests/asm-tst6.c6
-rw-r--r--tests/asm-tst7.c6
-rw-r--r--tests/asm-tst8.c6
-rw-r--r--tests/asm-tst9.c6
-rw-r--r--tests/configure.ac59
-rw-r--r--tests/dwflmodtest.c11
-rw-r--r--tests/find-prologues.c2
-rw-r--r--tests/funcscopes.c2
-rw-r--r--tests/get-aranges.c6
-rw-r--r--tests/get-files.c6
-rw-r--r--tests/get-lines.c6
-rw-r--r--tests/get-pubnames.c6
-rw-r--r--tests/line2addr.c18
-rw-r--r--tests/newscn.c4
-rw-r--r--tests/show-abbrev.c2
-rw-r--r--tests/show-die-info.c2
-rw-r--r--tests/update3.c2
-rw-r--r--tests/update4.c2
29 files changed, 261 insertions, 36 deletions
diff --git a/ChangeLog b/ChangeLog
index ff169d67..ae80f975 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+2005-11-16 Roland McGrath <roland@redhat.com>
+
+ * configure.ac: Define HAVE_LIBASM and STANDALONE conditionals.
+ In config.h, define ELFUTILS_HEADER macro.
+
2005-11-15 Roland McGrath <roland@redhat.com>
* configure.ac: Add --enable-tests-rpath option.
diff --git a/configure.ac b/configure.ac
index 3d30a031..53e33ea2 100644
--- a/configure.ac
+++ b/configure.ac
@@ -191,12 +191,14 @@ dnl CPU handling library.
AC_CONFIG_FILES([libcpu/Makefile])
dnl Assembler library.
+AM_CONDITIONAL(HAVE_LIBASM, true)dnl Used in tests/Makefile.am, which see.
AC_CONFIG_FILES([libasm/Makefile])
dnl Tools.
AC_CONFIG_FILES([src/Makefile po/Makefile.in])
dnl Test suite.
+AM_CONDITIONAL(STANDALONE, false)dnl Used in tests/Makefile.am, which see.
AC_CONFIG_FILES([tests/Makefile])
# Get the definitions necessary to create the Makefiles in the po
@@ -299,6 +301,9 @@ AH_BOTTOM([
# define INTDEF(name) /* empty */
# define INTDECL(name) /* empty */
#endif
+
+/* This macro is used by the tests conditionalize for standalone building. */
+#define ELFUTILS_HEADER(name) <lib##name.h>
])
AC_OUTPUT
diff --git a/tests/ChangeLog b/tests/ChangeLog
index 6243ff42..e74b639c 100644
--- a/tests/ChangeLog
+++ b/tests/ChangeLog
@@ -1,3 +1,43 @@
+2005-11-16 Roland McGrath <roland@redhat.com>
+
+ * configure.ac: New file, for standalone build/dist of test suite.
+ * Makefile.am [!STANDALONE] (INCLUDES): Don't define it.
+ (asm_TESTS): New variable, broken out of ...
+ (TESTS): ... here. Also remove msg_tst.
+ [!STANDALONE] (TESTS, noinst_PROGRAMS): Add in $(asm_TESTS), msg_tst.
+ (installed_TESTS_ENVIRONMENT): New variable.
+ [STANDALONE] (TESTS_ENVIRONMENT): Use that.
+ [!STANDALONE] (installcheck-local): Likewise.
+ [STANDALONE] (libdw, libelf, libasm, libebl): Define using -lfoo.
+ * addrscopes.c: Include <config.h>.
+ Use ELFUTILS_HEADER macro in #include of installed elfutils/ headers.
+ * allfcts.c: Likewise.
+ * asm-tst1.c: Likewise.
+ * asm-tst2.c: Likewise.
+ * asm-tst3.c: Likewise.
+ * asm-tst4.c: Likewise.
+ * asm-tst5.c: Likewise.
+ * asm-tst6.c: Likewise.
+ * asm-tst7.c: Likewise.
+ * asm-tst8.c: Likewise.
+ * asm-tst9.c: Likewise.
+ * dwflmodtest.c: Likewise.
+ * find-prologues.c: Likewise.
+ * funcscopes.c: Likewise.
+ * get-aranges.c: Likewise.
+ * get-files.c: Likewise.
+ * get-lines.c: Likewise.
+ * get-pubnames.c: Likewise.
+ * line2addr.c: Likewise.
+ * newscn.c: Likewise.
+ * show-abbrev.c: Likewise.
+ * show-die-info.c: Likewise.
+ * update3.c: Likewise.
+ * update4.c: Likewise.
+
+ * dwflmodtest.c (print_instance): Don't use INTUSE.
+ (options): Don't use N_ macro.
+
2005-11-15 Roland McGrath <roland@redhat.com>
* Makefile.am (BUILD_RPATH): New variable.
diff --git a/tests/Makefile.am b/tests/Makefile.am
index 0a80f634..98e6f035 100644
--- a/tests/Makefile.am
+++ b/tests/Makefile.am
@@ -22,10 +22,13 @@ AM_CFLAGS = -Wall -Werror -Wextra -std=gnu99 \
$(if $($(*F)_no_Wformat),-Wno-format,-Wformat=2)
BUILT_RPATH = \$$ORIGIN/../libasm:\$$ORIGIN/../libdw:\$$ORIGIN/../libebl:\$$ORIGIN/../libelf
endif
+
+if !STANDALONE
INCLUDES = -I$(top_srcdir)/libasm -I$(top_srcdir)/libdw \
-I$(top_srcdir)/libdwfl \
-I$(top_srcdir)/libebl -I$(top_srcdir)/libelf \
-I$(top_srcdir)/lib -I..
+endif !STANDALONE
if TESTS_RPATH
AM_LDFLAGS = -Wl,-rpath,$(BUILT_RPATH)
@@ -38,18 +41,17 @@ noinst_PROGRAMS = arextract arsymtest newfile saridx scnnames sectiondump \
showptable update1 update2 update3 update4 test-nlist \
show-die-info get-files get-lines get-pubnames \
get-aranges allfcts line2addr addrscopes funcscopes \
- show-abbrev hash asm-tst1 asm-tst2 asm-tst3 \
- asm-tst4 asm-tst5 asm-tst6 asm-tst7 asm-tst8 asm-tst9 \
- msg_tst newscn ecp dwflmodtest find-prologues
+ show-abbrev hash newscn ecp dwflmodtest find-prologues
# get-ciefde
+asm_TESTS = asm-tst1 asm-tst2 asm-tst3 asm-tst4 asm-tst5 \
+ asm-tst6 asm-tst7 asm-tst8 asm-tst9
TESTS = run-arextract.sh run-arsymtest.sh newfile test-nlist \
update1 update2 update3 update4 \
run-show-die-info.sh run-get-files.sh run-get-lines.sh \
run-get-pubnames.sh run-get-aranges.sh run-allfcts.sh \
- run-show-abbrev.sh run-line2addr.sh hash asm-tst1 asm-tst2 \
- asm-tst3 asm-tst4 asm-tst5 asm-tst6 asm-tst7 asm-tst8 asm-tst9 \
- msg_tst newscn run-strip-test.sh run-strip-test2.sh \
+ run-show-abbrev.sh run-line2addr.sh hash \
+ newscn run-strip-test.sh run-strip-test2.sh \
run-strip-test3.sh run-strip-test4.sh run-strip-test5.sh \
run-strip-test6.sh run-ecp-test.sh run-ecp-test2.sh \
run-elflint-test.sh run-elflint-self.sh run-ranlib-test.sh \
@@ -58,6 +60,17 @@ TESTS = run-arextract.sh run-arsymtest.sh newfile test-nlist \
run-find-prologues.sh
# run-show-ciefde.sh
+if !STANDALONE
+noinst_PROGRAMS += msg_tst
+TESTS += msg_tst
+endif
+
+if HAVE_LIBASM
+noinst_PROGRAMS += $(asm_TESTS)
+TESTS += $(asm_TESTS)
+endif
+
+
EXTRA_DIST = run-arextract.sh run-arsymtest.sh \
run-show-die-info.sh run-get-files.sh run-get-lines.sh \
run-get-pubnames.sh run-get-aranges.sh \
@@ -82,20 +95,31 @@ EXTRA_DIST = run-arextract.sh run-arsymtest.sh \
testfile22.bz2 testfile23.bz2 testfile24.bz2 testfile25.bz2 \
coverage.sh test-subr.sh test-wrapper.sh
+installed_TESTS_ENVIRONMENT = $(srcdir)/test-wrapper.sh \
+ installed $(tests_rpath) \
+ $(program_transform_name)
+if STANDALONE
+TESTS_ENVIRONMENT = $(installed_TESTS_ENVIRONMENT)
+else !STANDALONE
TESTS_ENVIRONMENT = $(srcdir)/test-wrapper.sh \
../libdw:../libebl:../libelf:../libasm
installcheck-local:
- $(MAKE) $(AM_MAKEFLAGS) TESTS_ENVIRONMENT='$(srcdir)/test-wrapper.sh \
- installed $(tests_rpath) \
- $(program_transform_name)' \
- check-TESTS
+ $(MAKE) $(AM_MAKEFLAGS) \
+ TESTS_ENVIRONMENT='$(installed_TESTS_ENVIRONMENT' check-TESTS
+endif !STANDALONE
if MUDFLAP
static_build=yes
libmudflap = -lmudflap
endif
+if STANDALONE
+libdw = -ldw
+libelf = -lelf
+libasm = -lasm
+libebl = -lebl
+else !STANDALONE
if BUILD_STATIC
libdw = ../libdw/libdw.a $(libelf) $(libebl) -ldl
libelf = ../libelf/libelf.a
@@ -106,6 +130,7 @@ libelf = ../libelf/libelf.so
libasm = ../libasm/libasm.so
endif
libebl = ../libebl/libebl.a
+endif !STANDALONE
arextract_LDADD = $(libelf) $(libmudflap)
arsymtest_LDADD = $(libelf) $(libmudflap)
diff --git a/tests/addrscopes.c b/tests/addrscopes.c
index 1526f02a..33c3586d 100644
--- a/tests/addrscopes.c
+++ b/tests/addrscopes.c
@@ -14,7 +14,7 @@
#include <config.h>
#include <assert.h>
#include <inttypes.h>
-#include <libdwfl.h>
+#include ELFUTILS_HEADER(dwfl)
#include <dwarf.h>
#include <argp.h>
#include <stdio.h>
diff --git a/tests/allfcts.c b/tests/allfcts.c
index f414983c..d9ba4384 100644
--- a/tests/allfcts.c
+++ b/tests/allfcts.c
@@ -1,5 +1,21 @@
+/* Copyright (C) 2005 Red Hat, Inc.
+
+ This program is Open Source software; you can redistribute it and/or
+ modify it under the terms of the Open Software License version 1.0 as
+ published by the Open Source Initiative.
+
+ You should have received a copy of the Open Software License along
+ with this program; if not, you may obtain a copy of the Open Software
+ License version 1.0 from http://www.opensource.org/licenses/osl.php or
+ by writing the Open Source Initiative c/o Lawrence Rosen, Esq.,
+ 3001 King Ranch Road, Ukiah, CA 95482. */
+
+#ifdef HAVE_CONFIG_H
+# include <config.h>
+#endif
+
#include <fcntl.h>
-#include <libdw.h>
+#include ELFUTILS_HEADER(dw)
#include <stdio.h>
#include <unistd.h>
diff --git a/tests/asm-tst1.c b/tests/asm-tst1.c
index cfaae345..3b3bf063 100644
--- a/tests/asm-tst1.c
+++ b/tests/asm-tst1.c
@@ -11,8 +11,12 @@
by writing the Open Source Initiative c/o Lawrence Rosen, Esq.,
3001 King Ranch Road, Ukiah, CA 95482. */
+#ifdef HAVE_CONFIG_H
+# include <config.h>
+#endif
+
#include <fcntl.h>
-#include <libasm.h>
+#include ELFUTILS_HEADER(asm)
#include <libelf.h>
#include <stdio.h>
#include <string.h>
diff --git a/tests/asm-tst2.c b/tests/asm-tst2.c
index b9a1037f..aac5b6ae 100644
--- a/tests/asm-tst2.c
+++ b/tests/asm-tst2.c
@@ -11,8 +11,12 @@
by writing the Open Source Initiative c/o Lawrence Rosen, Esq.,
3001 King Ranch Road, Ukiah, CA 95482. */
+#ifdef HAVE_CONFIG_H
+# include <config.h>
+#endif
+
#include <fcntl.h>
-#include <libasm.h>
+#include ELFUTILS_HEADER(asm)
#include <libelf.h>
#include <stdio.h>
#include <string.h>
diff --git a/tests/asm-tst3.c b/tests/asm-tst3.c
index 155613c5..1b4714e4 100644
--- a/tests/asm-tst3.c
+++ b/tests/asm-tst3.c
@@ -11,8 +11,12 @@
by writing the Open Source Initiative c/o Lawrence Rosen, Esq.,
3001 King Ranch Road, Ukiah, CA 95482. */
+#ifdef HAVE_CONFIG_H
+# include <config.h>
+#endif
+
#include <fcntl.h>
-#include <libasm.h>
+#include ELFUTILS_HEADER(asm)
#include <libelf.h>
#include <stdio.h>
#include <string.h>
diff --git a/tests/asm-tst4.c b/tests/asm-tst4.c
index 50c3c5a5..affc0c90 100644
--- a/tests/asm-tst4.c
+++ b/tests/asm-tst4.c
@@ -11,8 +11,12 @@
by writing the Open Source Initiative c/o Lawrence Rosen, Esq.,
3001 King Ranch Road, Ukiah, CA 95482. */
+#ifdef HAVE_CONFIG_H
+# include <config.h>
+#endif
+
#include <fcntl.h>
-#include <libasm.h>
+#include ELFUTILS_HEADER(asm)
#include <libelf.h>
#include <stdio.h>
#include <stdlib.h>
diff --git a/tests/asm-tst5.c b/tests/asm-tst5.c
index e5881a53..629ec67f 100644
--- a/tests/asm-tst5.c
+++ b/tests/asm-tst5.c
@@ -11,8 +11,12 @@
by writing the Open Source Initiative c/o Lawrence Rosen, Esq.,
3001 King Ranch Road, Ukiah, CA 95482. */
+#ifdef HAVE_CONFIG_H
+# include <config.h>
+#endif
+
#include <fcntl.h>
-#include <libasm.h>
+#include ELFUTILS_HEADER(asm)
#include <libelf.h>
#include <stdio.h>
#include <stdlib.h>
diff --git a/tests/asm-tst6.c b/tests/asm-tst6.c
index 5ceded65..9e913572 100644
--- a/tests/asm-tst6.c
+++ b/tests/asm-tst6.c
@@ -11,7 +11,11 @@
by writing the Open Source Initiative c/o Lawrence Rosen, Esq.,
3001 King Ranch Road, Ukiah, CA 95482. */
-#include <libasm.h>
+#ifdef HAVE_CONFIG_H
+# include <config.h>
+#endif
+
+#include ELFUTILS_HEADER(asm)
#include <libelf.h>
#include <stdio.h>
#include <stdlib.h>
diff --git a/tests/asm-tst7.c b/tests/asm-tst7.c
index 5c94d895..28fedf6c 100644
--- a/tests/asm-tst7.c
+++ b/tests/asm-tst7.c
@@ -11,9 +11,13 @@
by writing the Open Source Initiative c/o Lawrence Rosen, Esq.,
3001 King Ranch Road, Ukiah, CA 95482. */
+#ifdef HAVE_CONFIG_H
+# include <config.h>
+#endif
+
#include <fcntl.h>
#include <inttypes.h>
-#include <libasm.h>
+#include ELFUTILS_HEADER(asm)
#include <libelf.h>
#include <stdio.h>
#include <unistd.h>
diff --git a/tests/asm-tst8.c b/tests/asm-tst8.c
index cfe53fca..19d687d9 100644
--- a/tests/asm-tst8.c
+++ b/tests/asm-tst8.c
@@ -11,9 +11,13 @@
by writing the Open Source Initiative c/o Lawrence Rosen, Esq.,
3001 King Ranch Road, Ukiah, CA 95482. */
+#ifdef HAVE_CONFIG_H
+# include <config.h>
+#endif
+
#include <fcntl.h>
#include <inttypes.h>
-#include <libasm.h>
+#include ELFUTILS_HEADER(asm)
#include <libelf.h>
#include <stdio.h>
#include <unistd.h>
diff --git a/tests/asm-tst9.c b/tests/asm-tst9.c
index 1f03d8d7..2c1880f5 100644
--- a/tests/asm-tst9.c
+++ b/tests/asm-tst9.c
@@ -11,9 +11,13 @@
by writing the Open Source Initiative c/o Lawrence Rosen, Esq.,
3001 King Ranch Road, Ukiah, CA 95482. */
+#ifdef HAVE_CONFIG_H
+# include <config.h>
+#endif
+
#include <fcntl.h>
#include <inttypes.h>
-#include <libasm.h>
+#include ELFUTILS_HEADER(asm)
#include <libelf.h>
#include <stdio.h>
#include <string.h>
diff --git a/tests/configure.ac b/tests/configure.ac
new file mode 100644
index 00000000..8d515c7f
--- /dev/null
+++ b/tests/configure.ac
@@ -0,0 +1,59 @@
+dnl Process this file with autoconf to produce a configure script.
+dnl Configure input file for elfutils test suite. -*-autoconf-*-
+dnl
+dnl Copyright (C) 2005 Red Hat, Inc.
+dnl
+dnl This program is free software; you can redistribute it and/or modify
+dnl it under the terms of the GNU General Public License as published by
+dnl the Free Software Foundation, version 2.
+dnl
+dnl This program is distributed in the hope that it will be useful,
+dnl but WITHOUT ANY WARRANTY; without even the implied warranty of
+dnl MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+dnl GNU General Public License for more details.
+dnl
+dnl You should have received a copy of the GNU General Public License
+dnl along with this program; if not, write to the Free Software Foundation,
+dnl Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+dnl
+AC_INIT([Red Hat elfutils tests],[0.117],
+ [http://bugzilla.redhat.com/bugzilla/],
+ [elfutils-tests])
+
+AC_COPYRIGHT([Copyright (C) 2005 Red Hat, Inc.])
+AC_PREREQ(2.59) dnl Minimum Autoconf version required.
+
+AM_INIT_AUTOMAKE([foreign 1.7])
+
+AC_CONFIG_SRCDIR([allfcts.c])
+AC_CONFIG_FILES([Makefile])
+AC_CONFIG_HEADERS([config.h])
+
+AC_PROG_CC
+
+AC_CACHE_CHECK([for gcc with C99 support], ac_cv_c99, [dnl
+old_CFLAGS="$CFLAGS"
+CFLAGS="$CFLAGS -std=gnu99"
+AC_COMPILE_IFELSE([dnl
+int foo (int a) { for (int i = 0; i < a; ++i) if (i % 4) break; int s = a; }],
+ ac_cv_c99=yes, ac_cv_c99=no)
+CFLAGS="$old_CFLAGS"])
+AS_IF([test "x$ac_cv_c99" != xyes],
+ AC_MSG_ERROR([gcc with C99 support required]))
+
+AC_CHECK_HEADERS([libelf.h elfutils/libdw.h],,
+[AC_MSG_ERROR([elfutils-devel package not installed])])
+
+AC_CHECK_LIB([asm], [asm_begin], [have_libasm=yes], [have_libasm=no])
+AM_CONDITIONAL(HAVE_LIBASM, [test $have_libasm = yes])
+
+AM_CONDITIONAL(STANDALONE, true)
+AM_CONDITIONAL(BUILD_STATIC, false)
+AM_CONDITIONAL(TESTS_RPATH, false)
+AM_CONDITIONAL(MUDFLAP, false)
+AM_CONDITIONAL(GCOV, false)
+
+dnl Text of the config.h file.
+AH_BOTTOM([#define ELFUTILS_HEADER(name) <elfutils/lib##name.h>])
+
+AC_OUTPUT
diff --git a/tests/dwflmodtest.c b/tests/dwflmodtest.c
index 77d437aa..52b9454f 100644
--- a/tests/dwflmodtest.c
+++ b/tests/dwflmodtest.c
@@ -22,7 +22,7 @@
#include <error.h>
#include <locale.h>
#include <argp.h>
-#include <libdwfl.h>
+#include ELFUTILS_HEADER(dwfl)
#include <dwarf.h>
static bool show_inlines;
@@ -79,11 +79,10 @@ print_instance (Dwarf_Die *instance, void *arg)
printf (" (highpc => %s)", dwarf_errmsg (-1));
Dwarf_Attribute attr_mem;
- Dwarf_Attribute *attr = INTUSE(dwarf_attr) (instance, DW_AT_entry_pc,
- &attr_mem);
+ Dwarf_Attribute *attr = dwarf_attr (instance, DW_AT_entry_pc, &attr_mem);
if (attr != NULL)
{
- if (INTUSE(dwarf_formaddr) (attr, &entry) == 0)
+ if (dwarf_formaddr (attr, &entry) == 0)
entry += info->dwbias;
else
printf (" (entrypc => %s)", dwarf_errmsg (-1));
@@ -182,6 +181,10 @@ print_module (Dwfl_Module *mod __attribute__ ((unused)),
static bool show_functions;
+/* gettext helper macro. */
+#undef N_
+#define N_(Str) Str
+
static const struct argp_option options[] =
{
{ "functions", 'f', NULL, 0, N_("Additionally show function names"), 0 },
diff --git a/tests/find-prologues.c b/tests/find-prologues.c
index 0a2e86e0..ad668cdd 100644
--- a/tests/find-prologues.c
+++ b/tests/find-prologues.c
@@ -14,7 +14,7 @@
#include <config.h>
#include <assert.h>
#include <inttypes.h>
-#include <libdwfl.h>
+#include ELFUTILS_HEADER(dwfl)
#include <dwarf.h>
#include <argp.h>
#include <stdio.h>
diff --git a/tests/funcscopes.c b/tests/funcscopes.c
index 3318f311..4cdb79bc 100644
--- a/tests/funcscopes.c
+++ b/tests/funcscopes.c
@@ -14,7 +14,7 @@
#include <config.h>
#include <assert.h>
#include <inttypes.h>
-#include <libdwfl.h>
+#include ELFUTILS_HEADER(dwfl)
#include <dwarf.h>
#include <argp.h>
#include <stdio.h>
diff --git a/tests/get-aranges.c b/tests/get-aranges.c
index 1be76b2d..705646c3 100644
--- a/tests/get-aranges.c
+++ b/tests/get-aranges.c
@@ -11,9 +11,13 @@
by writing the Open Source Initiative c/o Lawrence Rosen, Esq.,
3001 King Ranch Road, Ukiah, CA 95482. */
+#ifdef HAVE_CONFIG_H
+# include <config.h>
+#endif
+
#include <fcntl.h>
#include <libelf.h>
-#include <libdw.h>
+#include ELFUTILS_HEADER(dw)
#include <stdio.h>
#include <unistd.h>
diff --git a/tests/get-files.c b/tests/get-files.c
index 1294342c..b29213de 100644
--- a/tests/get-files.c
+++ b/tests/get-files.c
@@ -11,9 +11,13 @@
by writing the Open Source Initiative c/o Lawrence Rosen, Esq.,
3001 King Ranch Road, Ukiah, CA 95482. */
+#ifdef HAVE_CONFIG_H
+# include <config.h>
+#endif
+
#include <fcntl.h>
#include <libelf.h>
-#include <libdw.h>
+#include ELFUTILS_HEADER(dw)
#include <stdio.h>
#include <unistd.h>
diff --git a/tests/get-lines.c b/tests/get-lines.c
index 6a8c0764..f5c58db8 100644
--- a/tests/get-lines.c
+++ b/tests/get-lines.c
@@ -11,10 +11,14 @@
by writing the Open Source Initiative c/o Lawrence Rosen, Esq.,
3001 King Ranch Road, Ukiah, CA 95482. */
+#ifdef HAVE_CONFIG_H
+# include <config.h>
+#endif
+
#include <fcntl.h>
#include <inttypes.h>
#include <libelf.h>
-#include <libdw.h>
+#include ELFUTILS_HEADER(dw)
#include <stdio.h>
#include <unistd.h>
diff --git a/tests/get-pubnames.c b/tests/get-pubnames.c
index e2791a29..8bb68252 100644
--- a/tests/get-pubnames.c
+++ b/tests/get-pubnames.c
@@ -11,9 +11,13 @@
by writing the Open Source Initiative c/o Lawrence Rosen, Esq.,
3001 King Ranch Road, Ukiah, CA 95482. */
+#ifdef HAVE_CONFIG_H
+# include <config.h>
+#endif
+
#include <fcntl.h>
#include <libelf.h>
-#include <libdw.h>
+#include ELFUTILS_HEADER(dw)
#include <stdio.h>
#include <unistd.h>
diff --git a/tests/line2addr.c b/tests/line2addr.c
index 2b92af25..7b10be82 100644
--- a/tests/line2addr.c
+++ b/tests/line2addr.c
@@ -1,6 +1,22 @@
+/* Copyright (C) 2005 Red Hat, Inc.
+
+ This program is Open Source software; you can redistribute it and/or
+ modify it under the terms of the Open Software License version 1.0 as
+ published by the Open Source Initiative.
+
+ You should have received a copy of the Open Software License along
+ with this program; if not, you may obtain a copy of the Open Software
+ License version 1.0 from http://www.opensource.org/licenses/osl.php or
+ by writing the Open Source Initiative c/o Lawrence Rosen, Esq.,
+ 3001 King Ranch Road, Ukiah, CA 95482. */
+
+#ifdef HAVE_CONFIG_H
+# include <config.h>
+#endif
+
#include <inttypes.h>
#include <assert.h>
-#include <libdwfl.h>
+#include ELFUTILS_HEADER(dwfl)
#include <argp.h>
#include <stdio.h>
#include <locale.h>
diff --git a/tests/newscn.c b/tests/newscn.c
index 8c8b335a..f651e99f 100644
--- a/tests/newscn.c
+++ b/tests/newscn.c
@@ -10,6 +10,10 @@
by writing the Open Source Initiative c/o Lawrence Rosen, Esq.,
3001 King Ranch Road, Ukiah, CA 95482. */
+#ifdef HAVE_CONFIG_H
+# include <config.h>
+#endif
+
#include <assert.h>
#include <fcntl.h>
#include <libelf.h>
diff --git a/tests/show-abbrev.c b/tests/show-abbrev.c
index fba73759..cf6eabbf 100644
--- a/tests/show-abbrev.c
+++ b/tests/show-abbrev.c
@@ -15,7 +15,7 @@
#include <fcntl.h>
#include <inttypes.h>
-#include <libdw.h>
+#include ELFUTILS_HEADER(dw)
#include <stdio.h>
#include <unistd.h>
diff --git a/tests/show-die-info.c b/tests/show-die-info.c
index d4f992f3..a48f9387 100644
--- a/tests/show-die-info.c
+++ b/tests/show-die-info.c
@@ -16,7 +16,7 @@
#include <dwarf.h>
#include <inttypes.h>
#include <libelf.h>
-#include <libdw.h>
+#include ELFUTILS_HEADER(dw)
#include <fcntl.h>
#include <stdio.h>
#include <string.h>
diff --git a/tests/update3.c b/tests/update3.c
index 160adf1e..85f7ab68 100644
--- a/tests/update3.c
+++ b/tests/update3.c
@@ -23,7 +23,7 @@
#include <stdlib.h>
#include <string.h>
-#include <libebl.h>
+#include ELFUTILS_HEADER(ebl)
int
diff --git a/tests/update4.c b/tests/update4.c
index 30f3a07d..835857f0 100644
--- a/tests/update4.c
+++ b/tests/update4.c
@@ -24,7 +24,7 @@
#include <string.h>
#include <unistd.h>
-#include <libebl.h>
+#include ELFUTILS_HEADER(ebl)
int