summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--ChangeLog5
-rw-r--r--config.in6
-rwxr-xr-xconfigure77
-rw-r--r--tapsets.cxx9
4 files changed, 94 insertions, 3 deletions
diff --git a/ChangeLog b/ChangeLog
index 10613899..226db914 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+2005-06-21 Frank Ch. Eigler <fche@redhat.com>
+
+ * config.in, configure: Regenerated.
+ * tapsets.cxx: Make dwarf code conditional on new elfutils header.
+
2005-06-20 Graydon Hoare <graydon@redhat.com>
* configure.ac: Scan for libdwfl.
diff --git a/config.in b/config.in
index f6042b1e..ea913bbf 100644
--- a/config.in
+++ b/config.in
@@ -3,6 +3,9 @@
/* Configuration/build date */
#undef DATE
+/* Define to 1 if you have the <elfutils/libdwfl.h> header file. */
+#undef HAVE_ELFUTILS_LIBDWFL_H
+
/* Define to 1 if you have the <elfutils/libdw.h> header file. */
#undef HAVE_ELFUTILS_LIBDW_H
@@ -12,6 +15,9 @@
/* Define to 1 if you have the `dw' library (-ldw). */
#undef HAVE_LIBDW
+/* Define to 1 if you have the `dwfl' library (-ldwfl). */
+#undef HAVE_LIBDWFL
+
/* Define to 1 if you have the `elf' library (-lelf). */
#undef HAVE_LIBELF
diff --git a/configure b/configure
index 9ab9ade7..db2c24d3 100755
--- a/configure
+++ b/configure
@@ -5311,7 +5311,8 @@ ac_compiler_gnu=$ac_cv_cxx_compiler_gnu
-for ac_header in libelf.h elfutils/libdw.h
+
+for ac_header in libelf.h elfutils/libdw.h elfutils/libdwfl.h
do
as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh`
if eval "test \"\${$as_ac_Header+set}\" = set"; then
@@ -5609,6 +5610,80 @@ _ACEOF
fi
+echo "$as_me:$LINENO: checking for dwfl_begin in -ldwfl" >&5
+echo $ECHO_N "checking for dwfl_begin in -ldwfl... $ECHO_C" >&6
+if test "${ac_cv_lib_dwfl_dwfl_begin+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+ ac_check_lib_save_LIBS=$LIBS
+LIBS="-ldwfl $LIBS"
+cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+
+/* Override any gcc2 internal prototype to avoid an error. */
+#ifdef __cplusplus
+extern "C"
+#endif
+/* We use char because int might match the return type of a gcc2
+ builtin and then its argument prototype would still apply. */
+char dwfl_begin ();
+int
+main ()
+{
+dwfl_begin ();
+ ;
+ return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
+ (eval $ac_link) 2>conftest.er1
+ ac_status=$?
+ grep -v '^ *+' conftest.er1 >conftest.err
+ rm -f conftest.er1
+ cat conftest.err >&5
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } &&
+ { ac_try='test -z "$ac_cxx_werror_flag"
+ || test ! -s conftest.err'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; } &&
+ { ac_try='test -s conftest$ac_exeext'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; }; then
+ ac_cv_lib_dwfl_dwfl_begin=yes
+else
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ac_cv_lib_dwfl_dwfl_begin=no
+fi
+rm -f conftest.err conftest.$ac_objext \
+ conftest$ac_exeext conftest.$ac_ext
+LIBS=$ac_check_lib_save_LIBS
+fi
+echo "$as_me:$LINENO: result: $ac_cv_lib_dwfl_dwfl_begin" >&5
+echo "${ECHO_T}$ac_cv_lib_dwfl_dwfl_begin" >&6
+if test $ac_cv_lib_dwfl_dwfl_begin = yes; then
+ cat >>confdefs.h <<_ACEOF
+#define HAVE_LIBDWFL 1
+_ACEOF
+
+ LIBS="-ldwfl $LIBS"
+
+fi
+
+
date=`date +%Y-%m-%d`
cat >>confdefs.h <<_ACEOF
diff --git a/tapsets.cxx b/tapsets.cxx
index cb4f68ea..0096a3a7 100644
--- a/tapsets.cxx
+++ b/tapsets.cxx
@@ -19,9 +19,11 @@
#include <stdexcept>
#include <vector>
+#ifdef HAVE_ELFUTILS_LIBDWFL_H
extern "C" {
#include <elfutils/libdwfl.h>
}
+#endif
#include <fnmatch.h>
@@ -334,7 +336,7 @@ be_derived_probe::emit_probe_entries (translator_output* o, unsigned j)
// ------------------------------------------------------------------------
// Dwarf derived probes.
// ------------------------------------------------------------------------
-
+#ifdef HAVE_ELFUTILS_LIBDWFL_H
// Helper for dealing with selected portions of libdwfl in a more readable
// fashion, and with specific cleanup / checking / logging options.
@@ -1220,6 +1222,7 @@ dwarf_derived_probe::emit_probe_entries (translator_output* o, unsigned i)
{
}
+#endif /* HAVE_ELFUTILS_LIBDWFL_H */
// ------------------------------------------------------------------------
@@ -1232,6 +1235,8 @@ register_standard_tapsets(match_node & root)
// Rudimentary binders for begin and end targets
root.bind("begin").bind(new be_builder(true));
root.bind("end").bind(new be_builder(false));
-
+
+#ifdef HAVE_ELFUTILS_LIBDWFL_H
dwarf_derived_probe::register_patterns(root);
+#endif /* HAVE_ELFUTILS_LIBDWFL_H */
}