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 | ed8f6834c213d06f4b31cf1747d8900d346b461f (patch) | |
tree | 0011269266a49e24b5d1efaa77945c98fc270c80 /autoconf | |
parent | 8c3be587276cc116d834bf213f80149e40add2b9 (diff) | |
download | external_llvm-ed8f6834c213d06f4b31cf1747d8900d346b461f.zip external_llvm-ed8f6834c213d06f4b31cf1747d8900d346b461f.tar.gz external_llvm-ed8f6834c213d06f4b31cf1747d8900d346b461f.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')
-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]) |