diff options
author | Jeffrey Yasskin <jyasskin@google.com> | 2009-10-07 23:22:42 +0000 |
---|---|---|
committer | Jeffrey Yasskin <jyasskin@google.com> | 2009-10-07 23:22:42 +0000 |
commit | fe897b2b328e144ae4b389c01a3ce3bf28fff80e (patch) | |
tree | 0011269266a49e24b5d1efaa77945c98fc270c80 /autoconf/configure.ac | |
parent | a4288080e62c6ecf94ebeafe84ab33a3b627d209 (diff) | |
download | external_llvm-fe897b2b328e144ae4b389c01a3ce3bf28fff80e.zip external_llvm-fe897b2b328e144ae4b389c01a3ce3bf28fff80e.tar.gz external_llvm-fe897b2b328e144ae4b389c01a3ce3bf28fff80e.tar.bz2 |
Fix the OProfile part of PR5018. This fixes --without-oprofile, makes
it the default, and works around a broken libopagent on some Debian
systems.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@83503 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'autoconf/configure.ac')
-rw-r--r-- | autoconf/configure.ac | 39 |
1 files changed, 19 insertions, 20 deletions
diff --git a/autoconf/configure.ac b/autoconf/configure.ac index dee9037..e24edf5 100644 --- a/autoconf/configure.ac +++ b/autoconf/configure.ac @@ -999,31 +999,30 @@ AC_ARG_WITH(oprofile, AC_SUBST(USE_OPROFILE, [1]) case "$withval" in /usr|yes) llvm_cv_oppath=/usr/lib/oprofile ;; + no) llvm_cv_oppath= + AC_SUBST(USE_OPROFILE, [0]) ;; *) llvm_cv_oppath="${withval}/lib/oprofile" CPPFLAGS="-I${withval}/include";; esac - LIBS="$LIBS -L${llvm_cv_oppath} -Wl,-rpath,${llvm_cv_oppath}" - AC_SEARCH_LIBS(op_open_agent, opagent, [], [ - echo "Error! You need to have libopagent around." - exit -1 - ]) - AC_CHECK_HEADER([opagent.h], [], [ - echo "Error! You need to have opagent.h around." - exit -1 - ]) + if test -n "$llvm_cv_oppath" ; then + LIBS="$LIBS -L${llvm_cv_oppath} -Wl,-rpath,${llvm_cv_oppath}" + dnl Work around http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=537744: + dnl libbfd is not included properly in libopagent in some Debian + dnl versions. If libbfd isn't found at all, we assume opagent works + dnl anyway. + AC_SEARCH_LIBS(bfd_init, bfd, [], []) + AC_SEARCH_LIBS(op_open_agent, opagent, [], [ + echo "Error! You need to have libopagent around." + exit -1 + ]) + AC_CHECK_HEADER([opagent.h], [], [ + echo "Error! You need to have opagent.h around." + exit -1 + ]) + fi ], [ - llvm_cv_old_LIBS="$LIBS" - LIBS="$LIBS -L/usr/lib/oprofile -Wl,-rpath,/usr/lib/oprofile" - dnl If either the library or header aren't present, omit oprofile support. - AC_SEARCH_LIBS(op_open_agent, opagent, - [AC_SUBST(USE_OPROFILE, [1])], - [LIBS="$llvm_cv_old_LIBS" - AC_SUBST(USE_OPROFILE, [0])]) - AC_CHECK_HEADER([opagent.h], [], [ - LIBS="$llvm_cv_old_LIBS" - AC_SUBST(USE_OPROFILE, [0]) - ]) + AC_SUBST(USE_OPROFILE, [0]) ]) AC_DEFINE_UNQUOTED([USE_OPROFILE],$USE_OPROFILE, [Define if we have the oprofile JIT-support library]) |