diff options
-rw-r--r-- | ChangeLog | 10 | ||||
-rw-r--r-- | acsite.m4 | 57 | ||||
-rwxr-xr-x | configure | 201 | ||||
-rw-r--r-- | configure.ac | 27 | ||||
-rw-r--r-- | systemtap.spec.in | 2 |
5 files changed, 294 insertions, 3 deletions
@@ -1,3 +1,13 @@ +2008-01-23 David Smith <dsmith@redhat.com> + + PR 5661. + * configure.ac: Checks elfutils version number. + * acsite.m4: New file containing macro to return elfutils version + number. + * configure: Regenerated. + * systemtap.spec.in: Minimum elfutils version number is now filled + in by configure. + 2008-01-23 Dave Brolley <brolley@redhat.com> * translate.cxx (var::fini): New method. diff --git a/acsite.m4 b/acsite.m4 new file mode 100644 index 00000000..27c727e1 --- /dev/null +++ b/acsite.m4 @@ -0,0 +1,57 @@ +dnl ######################################################################### +dnl Gets elfutils library version number. +dnl +dnl Result: sets ax_elfutils_get_version_ok to yes or no, +dnl sets ax_elfutils_get_version_VERSION to version. +dnl +dnl AX_ELFUTILS_GET_VERSION([ACTION-IF-FOUND], [ACTION-IF-NOT-FOUND]) +AC_DEFUN([AX_ELFUTILS_GET_VERSION], [ + dnl # Used to indicate success or failure of this function. + ax_elfutils_get_version_ok=no + ax_elfutils_get_version_VERSION='' + + dnl # save and modify environment + ax_elfutils_get_version_save_CPPFLAGS="$CPPFLAGS" + CPPFLAGS="-D_GNU_SOURCE $CPPFLAGS" + + ax_elfutils_get_version_save_LIBS="$LIBS" + LIBS="$LIBS -ldw" + + # Compile and run a program that returns the value of the library + # function dwfl_version. + AC_RUN_IFELSE([ + AC_LANG_SOURCE([[ +#include <stdio.h> +#include <elfutils/libdwfl.h> + +int main(int argc,char **argv) +{ + const char *ver = dwfl_version(NULL); + if (ver != NULL) { + if (argc > 1) + printf("%s\n", ver); + return 0; + } + else + return 1; +} + ]]) + ],[ + # Program compiled and ran, so get version by adding argument. + ax_elfutils_get_version_VERSION=`./conftest$ac_exeext x` + ax_elfutils_get_version_ok=yes + ],[],[]) + + dnl # restore environment + CPPFLAGS="$ax_elfutils_get_version_save_CPPFLAGS" + LIBS="$ax_elfutils_get_version_save_LIBS" + + dnl # Finally, execute ACTION-IF-FOUND / ACTION-IF-NOT-FOUND. + if test "$ax_elfutils_get_version_ok" = "yes" ; then + AC_MSG_RESULT([$ax_elfutils_get_version_VERSION]) + m4_ifvaln([$1],[$1])dnl + else + AC_MSG_RESULT([no]) + m4_ifvaln([$2],[$2])dnl + fi +]) dnl AX_ELFUTILS_GET_VERSION @@ -550,6 +550,66 @@ as_tr_cpp="eval sed 'y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g'" as_tr_sh="eval sed 'y%*+%pp%;s%[^_$as_cr_alnum]%_%g'" +as_awk_strverscmp=' + # Use only awk features that work with 7th edition Unix awk (1978). + # My, what an old awk you have, Mr. Solaris! + END { + while (length(v1) && length(v2)) { + # Set d1 to be the next thing to compare from v1, and likewise for d2. + # Normally this is a single character, but if v1 and v2 contain digits, + # compare them as integers and fractions as strverscmp does. + if (v1 ~ /^[0-9]/ && v2 ~ /^[0-9]/) { + # Split v1 and v2 into their leading digit string components d1 and d2, + # and advance v1 and v2 past the leading digit strings. + for (len1 = 1; substr(v1, len1 + 1) ~ /^[0-9]/; len1++) continue + for (len2 = 1; substr(v2, len2 + 1) ~ /^[0-9]/; len2++) continue + d1 = substr(v1, 1, len1); v1 = substr(v1, len1 + 1) + d2 = substr(v2, 1, len2); v2 = substr(v2, len2 + 1) + if (d1 ~ /^0/) { + if (d2 ~ /^0/) { + # Compare two fractions. + while (d1 ~ /^0/ && d2 ~ /^0/) { + d1 = substr(d1, 2); len1-- + d2 = substr(d2, 2); len2-- + } + if (len1 != len2 && ! (len1 && len2 && substr(d1, 1, 1) == substr(d2, 1, 1))) { + # The two components differ in length, and the common prefix + # contains only leading zeros. Consider the longer to be less. + d1 = -len1 + d2 = -len2 + } else { + # Otherwise, compare as strings. + d1 = "x" d1 + d2 = "x" d2 + } + } else { + # A fraction is less than an integer. + exit 1 + } + } else { + if (d2 ~ /^0/) { + # An integer is greater than a fraction. + exit 2 + } else { + # Compare two integers. + d1 += 0 + d2 += 0 + } + } + } else { + # The normal case, without worrying about digits. + d1 = substr(v1, 1, 1); v1 = substr(v1, 2) + d2 = substr(v2, 1, 1); v2 = substr(v2, 2) + } + if (d1 < d2) exit 1 + if (d1 > d2) exit 2 + } + # Beware Solaris /usr/xgp4/bin/awk (at least through Solaris 10), + # which mishandles some comparisons of empty strings to integers. + if (length(v2)) exit 1 + if (length(v1)) exit 2 + } +' exec 7<&0 </dev/null 6>&1 @@ -651,6 +711,7 @@ LIBS build_alias host_alias target_alias +ELFUTILS_REQUIRED_VERSION INSTALL_PROGRAM INSTALL_SCRIPT INSTALL_DATA @@ -1766,6 +1827,8 @@ ac_compiler_gnu=$ac_cv_c_compiler_gnu +ELFUTILS_REQUIRED_VERSION=0.127 + am__api_version='1.10' @@ -6454,6 +6517,139 @@ echo "$as_me: error: missing elfutils development headers/libraries (ebl 0.123+) { (exit 1); exit 1; }; } fi + + # Try to get the elfutils library version + { echo "$as_me:$LINENO: checking to see if we can get the elfutils version" >&5 +echo $ECHO_N "checking to see if we can get the elfutils version... $ECHO_C" >&6; } + + ax_elfutils_get_version_ok=no + ax_elfutils_get_version_VERSION='' + + ax_elfutils_get_version_save_CPPFLAGS="$CPPFLAGS" + CPPFLAGS="-D_GNU_SOURCE $CPPFLAGS" + + ax_elfutils_get_version_save_LIBS="$LIBS" + LIBS="$LIBS -ldw" + + # Compile and run a program that returns the value of the library + # function dwfl_version. + if test "$cross_compiling" = yes; then + { { echo "$as_me:$LINENO: error: cannot run test program while cross compiling +See \`config.log' for more details." >&5 +echo "$as_me: error: cannot run test program while cross compiling +See \`config.log' for more details." >&2;} + { (exit 1); exit 1; }; } +else + cat >conftest.$ac_ext <<_ACEOF + + /* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ + +#include <stdio.h> +#include <elfutils/libdwfl.h> + +int main(int argc,char **argv) +{ + const char *ver = dwfl_version(NULL); + if (ver != NULL) { + if (argc > 1) + printf("%s\n", ver); + return 0; + } + else + return 1; +} + + +_ACEOF +rm -f conftest$ac_exeext +if { (ac_try="$ac_link" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_link") 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { ac_try='./conftest$ac_exeext' + { (case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_try") 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + + # Program compiled and ran, so get version by adding argument. + ax_elfutils_get_version_VERSION=`./conftest$ac_exeext x` + ax_elfutils_get_version_ok=yes + +else + echo "$as_me: program exited with status $ac_status" >&5 +echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +fi +rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext +fi + + + + CPPFLAGS="$ax_elfutils_get_version_save_CPPFLAGS" + LIBS="$ax_elfutils_get_version_save_LIBS" + + if test "$ax_elfutils_get_version_ok" = "yes" ; then + { echo "$as_me:$LINENO: result: $ax_elfutils_get_version_VERSION" >&5 +echo "${ECHO_T}$ax_elfutils_get_version_VERSION" >&6; } + else + { echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6; } + + { { echo "$as_me:$LINENO: error: unable to get elfutils library version +See \`config.log' for more details." >&5 +echo "$as_me: error: unable to get elfutils library version +See \`config.log' for more details." >&2;} + { (exit 1); exit 1; }; } + fi + + + # Is the elfutils library version >= ELFUTILS_REQUIRED_VERSION? + { echo "$as_me:$LINENO: checking for elfutils version $ELFUTILS_REQUIRED_VERSION or higher" >&5 +echo $ECHO_N "checking for elfutils version $ELFUTILS_REQUIRED_VERSION or higher... $ECHO_C" >&6; } + current_version="`echo \"$ax_elfutils_get_version_VERSION\" | sed -e 's/^[^0-9]//g'`" + if test -z "$current_version" ; then + { { echo "$as_me:$LINENO: error: unsupported elfutils version format +See \`config.log' for more details." >&5 +echo "$as_me: error: unsupported elfutils version format +See \`config.log' for more details." >&2;} + { (exit 1); exit 1; }; } + fi + + as_arg_v1=$current_version +as_arg_v2=$ELFUTILS_REQUIRED_VERSION +awk "$as_awk_strverscmp" v1="$as_arg_v1" v2="$as_arg_v2" /dev/null +case $? in +1) bad_elfutils_version=yes;; +0) bad_elfutils_version=no;; +2) bad_elfutils_version=no;; +esac + if test $bad_elfutils_version = yes; then + { echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6; } + { { echo "$as_me:$LINENO: error: elfutils library version ($current_version) must be version $ELFUTILS_REQUIRED_VERSION or higher" >&5 +echo "$as_me: error: elfutils library version ($current_version) must be version $ELFUTILS_REQUIRED_VERSION or higher" >&2;} + { (exit 1); exit 1; }; } + else + { echo "$as_me:$LINENO: result: yes" >&5 +echo "${ECHO_T}yes" >&6; } + fi + stap_LIBS="$LIBS" LIBS="$SAVE_LIBS" else @@ -7318,6 +7514,7 @@ LIBS!$LIBS$ac_delim build_alias!$build_alias$ac_delim host_alias!$host_alias$ac_delim target_alias!$target_alias$ac_delim +ELFUTILS_REQUIRED_VERSION!$ELFUTILS_REQUIRED_VERSION$ac_delim INSTALL_PROGRAM!$INSTALL_PROGRAM$ac_delim INSTALL_SCRIPT!$INSTALL_SCRIPT$ac_delim INSTALL_DATA!$INSTALL_DATA$ac_delim @@ -7377,7 +7574,6 @@ BUILD_ELFUTILS_TRUE!$BUILD_ELFUTILS_TRUE$ac_delim BUILD_ELFUTILS_FALSE!$BUILD_ELFUTILS_FALSE$ac_delim elfutils_abs_srcdir!$elfutils_abs_srcdir$ac_delim BUILD_CRASHMOD_TRUE!$BUILD_CRASHMOD_TRUE$ac_delim -BUILD_CRASHMOD_FALSE!$BUILD_CRASHMOD_FALSE$ac_delim _ACEOF if test `sed -n "s/.*$ac_delim\$/X/p" conf$$subs.sed | grep -c X` = 97; then @@ -7419,6 +7615,7 @@ _ACEOF ac_delim='%!_!# ' for ac_last_try in false false false false false :; do cat >conf$$subs.sed <<_ACEOF +BUILD_CRASHMOD_FALSE!$BUILD_CRASHMOD_FALSE$ac_delim stap_LIBS!$stap_LIBS$ac_delim DATE!$DATE$ac_delim PROCFLAGS!$PROCFLAGS$ac_delim @@ -7428,7 +7625,7 @@ LIBOBJS!$LIBOBJS$ac_delim LTLIBOBJS!$LTLIBOBJS$ac_delim _ACEOF - if test `sed -n "s/.*$ac_delim\$/X/p" conf$$subs.sed | grep -c X` = 7; then + if test `sed -n "s/.*$ac_delim\$/X/p" conf$$subs.sed | grep -c X` = 8; then break elif $ac_last_try; then { { echo "$as_me:$LINENO: error: could not make $CONFIG_STATUS" >&5 diff --git a/configure.ac b/configure.ac index 2e9072d8..c8b43fe0 100644 --- a/configure.ac +++ b/configure.ac @@ -4,6 +4,8 @@ dnl Process this file with autoconf to produce a configure script. AC_INIT([systemtap], 0.6.1, systemtap@sources.redhat.com, systemtap) dnl ^^^ see also NEWS, testsuite/configure.ac +dnl Version number of oldest elfutils release that works with systemtap. +AC_SUBST(ELFUTILS_REQUIRED_VERSION, 0.127) AC_PREREQ(2.59) AM_INIT_AUTOMAKE @@ -122,6 +124,31 @@ if test $build_elfutils = no; then AC_MSG_ERROR([missing elfutils development headers/libraries (dw 0.123+)])]) AC_CHECK_LIB(ebl, ebl_openbackend,,[ AC_MSG_ERROR([missing elfutils development headers/libraries (ebl 0.123+)])]) + + # Try to get the elfutils library version + AC_MSG_CHECKING([to see if we can get the elfutils version]) + AX_ELFUTILS_GET_VERSION(, [ + AC_MSG_FAILURE([unable to get elfutils library version])]) + + # Is the elfutils library version >= ELFUTILS_REQUIRED_VERSION? + AC_MSG_CHECKING([for elfutils version $ELFUTILS_REQUIRED_VERSION or higher]) + [current_version="`echo \"$ax_elfutils_get_version_VERSION\" | sed -e 's/^[^0-9]//g'`"] + if test -z "$current_version" ; then + AC_MSG_FAILURE([unsupported elfutils version format]) + fi + + AS_VERSION_COMPARE($current_version, $ELFUTILS_REQUIRED_VERSION, + [bad_elfutils_version=yes], dnl ACTION-IF-LESS + [bad_elfutils_version=no], dnl ACTION-IF-EQUAL + [bad_elfutils_version=no]) dnl ACTION-IF-GREATER + + if test $bad_elfutils_version = yes; then + AC_MSG_RESULT([no]) + AC_MSG_ERROR([elfutils library version ($current_version) must be version $ELFUTILS_REQUIRED_VERSION or higher]) + else + AC_MSG_RESULT([yes]) + fi + stap_LIBS="$LIBS" LIBS="$SAVE_LIBS" else diff --git a/systemtap.spec.in b/systemtap.spec.in index 809c7e46..b8ab8652 100644 --- a/systemtap.spec.in +++ b/systemtap.spec.in @@ -1,7 +1,7 @@ # Release number for rpm build. Stays at 1 for new PACKAGE_VERSION increases. %define release 1 # Version number of oldest elfutils release that works with systemtap. -%define elfutils_version 0.127 +%define elfutils_version @ELFUTILS_REQUIRED_VERSION@ # Set bundled_elfutils to 0 on systems that have %{elfutils_version} or newer. %if 0%{?fedora} |