]> sourceware.org Git - systemtap.git/commitdiff
2005-07-29 Roland McGrath <roland@redhat.com>
authorroland <roland>
Fri, 29 Jul 2005 08:37:14 +0000 (08:37 +0000)
committerroland <roland>
Fri, 29 Jul 2005 08:37:14 +0000 (08:37 +0000)
* configure.ac: Add AM_CONDITIONAL definition of HAVE_LIBDW.
* Makefile.am [HAVE_LIBDW] (stap_SOURCES_libdw): New variable.
(stap_SOURCES): Use it, moving loc2c.c there.
* configure, config.in: Regenerated.
* configure.ac: Don't check for libelf.h, not actually #include'd.
Update -ldw check for merged libdwfl+libdw.
(stap_LIBS): New substituted variable.  Set only this, not LIBS,
with -ldw check.
* Makefile.am (stap_LDADD): New variable, use @stap_LIBS@.

configure
configure.ac

index ce3886a9a59266c76fd2f0be5b7ec2af378d3022..84c2be221ca2808735f3446979f2ec05b80fbc78 100755 (executable)
--- a/configure
+++ b/configure
@@ -310,7 +310,7 @@ ac_includes_default="\
 # include <unistd.h>
 #endif"
 
-ac_subst_vars='SHELL PATH_SEPARATOR PACKAGE_NAME PACKAGE_TARNAME PACKAGE_VERSION PACKAGE_STRING PACKAGE_BUGREPORT exec_prefix prefix program_transform_name bindir sbindir libexecdir datadir sysconfdir sharedstatedir localstatedir libdir includedir oldincludedir infodir mandir build_alias host_alias target_alias DEFS ECHO_C ECHO_N ECHO_T LIBS INSTALL_PROGRAM INSTALL_SCRIPT INSTALL_DATA CYGPATH_W PACKAGE VERSION ACLOCAL AUTOCONF AUTOMAKE AUTOHEADER MAKEINFO install_sh STRIP ac_ct_STRIP INSTALL_STRIP_PROGRAM mkdir_p AWK SET_MAKE am__leading_dot AMTAR am__tar am__untar MAINTAINER_MODE_TRUE MAINTAINER_MODE_FALSE MAINT LN_S CC CFLAGS LDFLAGS CPPFLAGS ac_ct_CC EXEEXT OBJEXT DEPDIR am__include am__quote AMDEP_TRUE AMDEP_FALSE AMDEPBACKSLASH CCDEPMODE am__fastdepCC_TRUE am__fastdepCC_FALSE CXX CXXFLAGS ac_ct_CXX CXXDEPMODE am__fastdepCXX_TRUE am__fastdepCXX_FALSE CPP EGREP U ANSI2KNR RANLIB ac_ct_RANLIB CXXCPP DATE LIBOBJS LTLIBOBJS'
+ac_subst_vars='SHELL PATH_SEPARATOR PACKAGE_NAME PACKAGE_TARNAME PACKAGE_VERSION PACKAGE_STRING PACKAGE_BUGREPORT exec_prefix prefix program_transform_name bindir sbindir libexecdir datadir sysconfdir sharedstatedir localstatedir libdir includedir oldincludedir infodir mandir build_alias host_alias target_alias DEFS ECHO_C ECHO_N ECHO_T LIBS INSTALL_PROGRAM INSTALL_SCRIPT INSTALL_DATA CYGPATH_W PACKAGE VERSION ACLOCAL AUTOCONF AUTOMAKE AUTOHEADER MAKEINFO install_sh STRIP ac_ct_STRIP INSTALL_STRIP_PROGRAM mkdir_p AWK SET_MAKE am__leading_dot AMTAR am__tar am__untar MAINTAINER_MODE_TRUE MAINTAINER_MODE_FALSE MAINT LN_S CC CFLAGS LDFLAGS CPPFLAGS ac_ct_CC EXEEXT OBJEXT DEPDIR am__include am__quote AMDEP_TRUE AMDEP_FALSE AMDEPBACKSLASH CCDEPMODE am__fastdepCC_TRUE am__fastdepCC_FALSE CXX CXXFLAGS ac_ct_CXX CXXDEPMODE am__fastdepCXX_TRUE am__fastdepCXX_FALSE CPP EGREP U ANSI2KNR RANLIB ac_ct_RANLIB stap_LIBS CXXCPP HAVE_LIBDW_TRUE HAVE_LIBDW_FALSE DATE LIBOBJS LTLIBOBJS'
 ac_subst_files=''
 
 # Initialize some variables set by options.
@@ -5077,8 +5077,88 @@ fi
 
 
 
+save_LIBS="$LIBS"
 
-ac_ext=cc
+
+echo "$as_me:$LINENO: checking for dwfl_begin in -ldw" >&5
+echo $ECHO_N "checking for dwfl_begin in -ldw... $ECHO_C" >&6
+if test "${ac_cv_lib_dw_dwfl_begin+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  ac_check_lib_save_LIBS=$LIBS
+LIBS="-ldw  $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_dw_dwfl_begin=yes
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ac_cv_lib_dw_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_dw_dwfl_begin" >&5
+echo "${ECHO_T}$ac_cv_lib_dw_dwfl_begin" >&6
+if test $ac_cv_lib_dw_dwfl_begin = yes; then
+  cat >>confdefs.h <<_ACEOF
+#define HAVE_LIBDW 1
+_ACEOF
+
+  LIBS="-ldw $LIBS"
+
+fi
+
+stap_LIBS="$LIBS"
+LIBS="$SAVE_LIBS"
+
+if test $ac_cv_lib_dw_dwfl_begin = yes; then
+  # If we don't have a current library, don't define HAVE_*_H macros either.
+  ac_ext=cc
 ac_cpp='$CXXCPP $CPPFLAGS'
 ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5'
 ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
@@ -5311,8 +5391,7 @@ ac_compiler_gnu=$ac_cv_cxx_compiler_gnu
 
 
 
-
-for ac_header in libelf.h elfutils/libdw.h elfutils/libdwfl.h
+for ac_header in 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
 
 done
 
-
-echo "$as_me:$LINENO: checking for dwarf_begin in -ldw" >&5
-echo $ECHO_N "checking for dwarf_begin in -ldw... $ECHO_C" >&6
-if test "${ac_cv_lib_dw_dwarf_begin+set}" = set; then
-  echo $ECHO_N "(cached) $ECHO_C" >&6
-else
-  ac_check_lib_save_LIBS=$LIBS
-LIBS="-ldw  $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 dwarf_begin ();
-int
-main ()
-{
-dwarf_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_dw_dwarf_begin=yes
-else
-  echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
-ac_cv_lib_dw_dwarf_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_dw_dwarf_begin" >&5
-echo "${ECHO_T}$ac_cv_lib_dw_dwarf_begin" >&6
-if test $ac_cv_lib_dw_dwarf_begin = yes; then
-  cat >>confdefs.h <<_ACEOF
-#define HAVE_LIBDW 1
-_ACEOF
-
-  LIBS="-ldw $LIBS"
-
 fi
 
 
-echo "$as_me:$LINENO: checking for elf_begin in -lelf" >&5
-echo $ECHO_N "checking for elf_begin in -lelf... $ECHO_C" >&6
-if test "${ac_cv_lib_elf_elf_begin+set}" = set; then
-  echo $ECHO_N "(cached) $ECHO_C" >&6
-else
-  ac_check_lib_save_LIBS=$LIBS
-LIBS="-lelf  $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 elf_begin ();
-int
-main ()
-{
-elf_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_elf_elf_begin=yes
+if test $ac_cv_lib_dw_dwfl_begin = yes; then
+  HAVE_LIBDW_TRUE=
+  HAVE_LIBDW_FALSE='#'
 else
-  echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
-ac_cv_lib_elf_elf_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_elf_elf_begin" >&5
-echo "${ECHO_T}$ac_cv_lib_elf_elf_begin" >&6
-if test $ac_cv_lib_elf_elf_begin = yes; then
-  cat >>confdefs.h <<_ACEOF
-#define HAVE_LIBELF 1
-_ACEOF
-
-  LIBS="-lelf $LIBS"
-
-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"
-
+  HAVE_LIBDW_TRUE='#'
+  HAVE_LIBDW_FALSE=
 fi
 
 
@@ -5822,6 +5691,13 @@ echo "$as_me: error: conditional \"am__fastdepCC\" was never defined.
 Usually this means the macro was only invoked conditionally." >&2;}
    { (exit 1); exit 1; }; }
 fi
+if test -z "${HAVE_LIBDW_TRUE}" && test -z "${HAVE_LIBDW_FALSE}"; then
+  { { echo "$as_me:$LINENO: error: conditional \"HAVE_LIBDW\" was never defined.
+Usually this means the macro was only invoked conditionally." >&5
+echo "$as_me: error: conditional \"HAVE_LIBDW\" was never defined.
+Usually this means the macro was only invoked conditionally." >&2;}
+   { (exit 1); exit 1; }; }
+fi
 
 : ${CONFIG_STATUS=./config.status}
 ac_clean_files_save=$ac_clean_files
@@ -6409,7 +6285,10 @@ s,@U@,$U,;t t
 s,@ANSI2KNR@,$ANSI2KNR,;t t
 s,@RANLIB@,$RANLIB,;t t
 s,@ac_ct_RANLIB@,$ac_ct_RANLIB,;t t
+s,@stap_LIBS@,$stap_LIBS,;t t
 s,@CXXCPP@,$CXXCPP,;t t
+s,@HAVE_LIBDW_TRUE@,$HAVE_LIBDW_TRUE,;t t
+s,@HAVE_LIBDW_FALSE@,$HAVE_LIBDW_FALSE,;t t
 s,@DATE@,$DATE,;t t
 s,@LIBOBJS@,$LIBOBJS,;t t
 s,@LTLIBOBJS@,$LTLIBOBJS,;t t
index 05040698c1cd71bf5433112f12290adca71c5959..b90d78205c151a37c667578e3ceb6a16c265260a 100644 (file)
@@ -22,13 +22,20 @@ AC_PROG_MAKE_SET
 AC_SUBST(CFLAGS)
 AC_SUBST(CXXFLAGS)
 
-dnl Need libdwfl-capable elfutils 0.102+ from <drepper@redhat.com>
+dnl Need libdwfl-capable elfutils 0.111 or later from Fedora
 dnl ... except that these libraries are only used by stap, not
 dnl stpd.  The implicit LIBS set from these is too broadly applied.
-AC_CHECK_HEADERS([libelf.h elfutils/libdw.h elfutils/libdwfl.h])
-AC_CHECK_LIB(dw, dwarf_begin)
-AC_CHECK_LIB(elf, elf_begin)
-AC_CHECK_LIB(dwfl, dwfl_begin)
+save_LIBS="$LIBS"
+AC_CHECK_LIB(dw, dwfl_begin)
+stap_LIBS="$LIBS"
+LIBS="$SAVE_LIBS"
+AC_SUBST(stap_LIBS)
+if test $ac_cv_lib_dw_dwfl_begin = yes; then
+  # If we don't have a current library, don't define HAVE_*_H macros either.
+  AC_CHECK_HEADERS([elfutils/libdw.h elfutils/libdwfl.h])
+fi
+
+AM_CONDITIONAL(HAVE_LIBDW, test $ac_cv_lib_dw_dwfl_begin = yes)
 
 dnl Plop in the build (configure) date
 date=`date +%Y-%m-%d`
This page took 0.043871 seconds and 5 git commands to generate.