* 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.
+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.
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
# 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
+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.
$(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)
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 \
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 \
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
libasm = ../libasm/libasm.so
endif
libebl = ../libebl/libebl.a
+endif !STANDALONE
arextract_LDADD = $(libelf) $(libmudflap)
arsymtest_LDADD = $(libelf) $(libmudflap)
#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>
+/* 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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
--- /dev/null
+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
#include <error.h>
#include <locale.h>
#include <argp.h>
-#include <libdwfl.h>
+#include ELFUTILS_HEADER(dwfl)
#include <dwarf.h>
static bool show_inlines;
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));
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 },
#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>
#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>
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>
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>
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>
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>
+/* 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>
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>
#include <fcntl.h>
#include <inttypes.h>
-#include <libdw.h>
+#include ELFUTILS_HEADER(dw)
#include <stdio.h>
#include <unistd.h>
#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>
#include <stdlib.h>
#include <string.h>
-#include <libebl.h>
+#include ELFUTILS_HEADER(ebl)
int
#include <string.h>
#include <unistd.h>
-#include <libebl.h>
+#include ELFUTILS_HEADER(ebl)
int