--- callgrind-0.9.13-VG30-alpha/configure.in.withsource 2005-08-31 01:01:40.000000000 +0100 +++ callgrind-0.9.13-VG30-alpha/configure.in 2005-08-31 16:35:14.000000000 +0100 @@ -17,19 +17,17 @@ AC_MSG_RESULT([not found in $PATH]) AC_MSG_ERROR([Please install Valgrind]) fi -else + vg_binpath=`dirname $vg_exec` + ac_default_prefix=`dirname $vg_binpath` + prefix=$ac_default_prefix + ac_configure_args="$ac_configure_args --prefix=$prefix" +elif test "x$with_valgrind_source" = "x"; then vg_exec=`which $prefix/bin/valgrind` if test "x$vg_exec" = "x"; then AC_MSG_RESULT([not found in $prefix/bin]) AC_MSG_ERROR([Valgrind has to be installed in the specified prefix!]) fi fi -vg_binpath=`dirname $vg_exec` -ac_default_prefix=`dirname $vg_binpath` -if test "x$prefix" = "xNONE"; then - prefix=$ac_default_prefix - ac_configure_args="$ac_configure_args --prefix=$prefix" -fi # And delete superflous '/' to make compares easier prefix=`echo "$prefix" | sed 's,//*,/,g' | sed -e 's,/$,,'` exec_prefix=`echo "$exec_prefix" | sed 's,//*,/,g' | sed -e 's,/$,,'` @@ -55,19 +53,29 @@ esac AC_MSG_RESULT([${vg_version}]) +# find pkg-config file +if test "x$with_valgrind_source" = "x"; then + valgrind_pc="$prefix/lib/pkgconfig/valgrind.pc" +else + valgrind_pc="$with_valgrind_source/valgrind.pc" +fi + # get architecture from .pc file AC_MSG_CHECKING([for arch/os used in valgrind installation]) AC_SUBST(VG_ARCH_ALL) VG_ARCH_ALL="amd64 x86" AC_SUBST(VG_ARCH) -VG_ARCH=`perl pkg-extract arch $prefix/lib/pkgconfig/valgrind.pc` +VG_ARCH=`perl pkg-extract arch $valgrind_pc` AC_SUBST(VG_OS) -VG_OS=`perl pkg-extract os $prefix/lib/pkgconfig/valgrind.pc` +VG_OS=`perl pkg-extract os $valgrind_pc` AC_MSG_RESULT([${VG_ARCH}/${VG_OS}]) # check for CFLAGS to use AC_MSG_CHECKING([for CFLAGS to use for valgrind tools]) -AM_CFLAGS=`perl pkg-extract Cflags $prefix/lib/pkgconfig/valgrind.pc` +AM_CFLAGS=`perl pkg-extract Cflags $valgrind_pc` +if test "x$with_valgrind_source" != "x"; then + AM_CFLAGS=`echo "$AM_CFLAGS" | sed -e "s|-I$prefix/include/valgrind|-I$with_valgrind_source/include -I$with_valgrind_source/VEX/pub|g"` +fi AC_MSG_RESULT([${AM_CFLAGS}]) # check if there valgrind headers are installed