+callgrind (0.9.10-1.1) unstable; urgency=low + + * NMU + * Patches from current CVS for new valgrind. Closes: #299498,#301970 + - update configure.in and run autoconf + - adds new Build-Depends on pkg-config + - adds #if VG_CORE_INTERFACE_MAJOR_VERSION < 7 to reflect valgrind + changes since > 2.3 : src/{main,threads,command,sim,callstack}.c + + -- Paul Brossier <[EMAIL PROTECTED]> Wed, 30 Mar 2005 16:59:51 +0100
cheers, piem
diff -u callgrind-0.9.10/debian/changelog callgrind-0.9.10/debian/changelog --- callgrind-0.9.10/debian/changelog +++ callgrind-0.9.10/debian/changelog @@ -1,3 +1,14 @@ +callgrind (0.9.10-1.1) unstable; urgency=low + + * NMU + * Patches from current CVS for new valgrind. Closes: #299498,#301970 + - update configure.in and run autoconf + - adds new Build-Depends on pkg-config + - adds #if VG_CORE_INTERFACE_MAJOR_VERSION < 7 to reflect valgrind + changes since > 2.3 : src/{main,threads,command,sim,callstack}.c + + -- Paul Brossier <[EMAIL PROTECTED]> Wed, 30 Mar 2005 16:59:51 +0100 + callgrind (0.9.10-1) unstable; urgency=low * New upstream release diff -u callgrind-0.9.10/debian/control callgrind-0.9.10/debian/control --- callgrind-0.9.10/debian/control +++ callgrind-0.9.10/debian/control @@ -2,7 +2,7 @@ Section: devel Priority: extra Maintainer: Philipp Frauenfelder <[EMAIL PROTECTED]> -Build-Depends: debhelper (>> 4), valgrind (>> 2.2) +Build-Depends: debhelper (>> 4), valgrind (>> 2.2), pkg-config Standards-Version: 3.6.1 Package: valgrind-callgrind diff -u callgrind-0.9.10/config.sub callgrind-0.9.10/config.sub --- callgrind-0.9.10/config.sub +++ callgrind-0.9.10/config.sub @@ -1,9 +1,9 @@ #! /bin/sh # Configuration validation subroutine script. # Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, -# 2000, 2001, 2002, 2003 Free Software Foundation, Inc. +# 2000, 2001, 2002, 2003, 2004 Free Software Foundation, Inc. -timestamp='2004-03-12' +timestamp='2004-11-30' # This file is (in principle) common to ALL GNU software. # The presence of a machine in this file suggests that SOME GNU software @@ -70,7 +70,7 @@ version="\ GNU config.sub ($timestamp) -Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001 +Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004 Free Software Foundation, Inc. This is free software; see the source for copying conditions. There is NO @@ -145,7 +145,7 @@ -convergent* | -ncr* | -news | -32* | -3600* | -3100* | -hitachi* |\ -c[123]* | -convex* | -sun | -crds | -omron* | -dg | -ultra | -tti* | \ -harris | -dolphin | -highlevel | -gould | -cbm | -ns | -masscomp | \ - -apple | -axis) + -apple | -axis | -knuth | -cray) os= basic_machine=$1 ;; @@ -267,7 +267,7 @@ | tahoe | thumb | tic4x | tic80 | tron \ | v850 | v850e \ | we32k \ - | x86 | xscale | xstormy16 | xtensa \ + | x86 | xscale | xscalee[bl] | xstormy16 | xtensa \ | z8k) basic_machine=$basic_machine-unknown ;; @@ -300,7 +300,7 @@ | avr-* \ | bs2000-* \ | c[123]* | c30-* | [cjt]90-* | c4x-* | c54x-* | c55x-* | c6x-* \ - | clipper-* | cydra-* \ + | clipper-* | craynv-* | cydra-* \ | d10v-* | d30v-* | dlx-* \ | elxsi-* \ | f30[01]-* | f700-* | fr30-* | frv-* | fx80-* \ @@ -326,8 +326,9 @@ | mipsisa64sb1-* | mipsisa64sb1el-* \ | mipsisa64sr71k-* | mipsisa64sr71kel-* \ | mipstx39-* | mipstx39el-* \ + | mmix-* \ | msp430-* \ - | none-* | np1-* | nv1-* | ns16k-* | ns32k-* \ + | none-* | np1-* | ns16k-* | ns32k-* \ | orion-* \ | pdp10-* | pdp11-* | pj-* | pjl-* | pn-* | power-* \ | powerpc-* | powerpc64-* | powerpc64le-* | powerpcle-* | ppcbe-* \ @@ -342,8 +343,8 @@ | tron-* \ | v850-* | v850e-* | vax-* \ | we32k-* \ - | x86-* | x86_64-* | xps100-* | xscale-* | xstormy16-* \ - | xtensa-* \ + | x86-* | x86_64-* | xps100-* | xscale-* | xscalee[bl]-* \ + | xstormy16-* | xtensa-* \ | ymp-* \ | z8k-*) ;; @@ -445,6 +446,10 @@ basic_machine=j90-cray os=-unicos ;; + craynv) + basic_machine=craynv-cray + os=-unicosmp + ;; cr16c) basic_machine=cr16c-unknown os=-elf @@ -452,6 +457,9 @@ crds | unos) basic_machine=m68k-crds ;; + crisv32 | crisv32-* | etraxfs*) + basic_machine=crisv32-axis + ;; cris | cris-* | etrax*) basic_machine=cris-axis ;; @@ -481,6 +489,10 @@ basic_machine=m88k-motorola os=-sysv3 ;; + djgpp) + basic_machine=i586-pc + os=-msdosdjgpp + ;; dpx20 | dpx20-*) basic_machine=rs6000-bull os=-bosx @@ -659,10 +671,6 @@ mips3*) basic_machine=`echo $basic_machine | sed -e 's/mips3/mips64/'`-unknown ;; - mmix*) - basic_machine=mmix-knuth - os=-mmixware - ;; monitor) basic_machine=m68k-rom68k os=-coff @@ -743,10 +751,6 @@ np1) basic_machine=np1-gould ;; - nv1) - basic_machine=nv1-cray - os=-unicosmp - ;; nsr-tandem) basic_machine=nsr-tandem ;; @@ -1029,6 +1033,10 @@ basic_machine=hppa1.1-winbond os=-proelf ;; + xbox) + basic_machine=i686-pc + os=-mingw32 + ;; xps | xps100) basic_machine=xps100-honeywell ;; @@ -1059,6 +1067,9 @@ romp) basic_machine=romp-ibm ;; + mmix) + basic_machine=mmix-knuth + ;; rs6000) basic_machine=rs6000-ibm ;; @@ -1294,6 +1305,9 @@ -kaos*) os=-kaos ;; + -zvmoe) + os=-zvmoe + ;; -none) ;; *) @@ -1374,6 +1388,9 @@ *-ibm) os=-aix ;; + *-knuth) + os=-mmixware + ;; *-wec) os=-proelf ;; diff -u callgrind-0.9.10/config.guess callgrind-0.9.10/config.guess --- callgrind-0.9.10/config.guess +++ callgrind-0.9.10/config.guess @@ -1,9 +1,9 @@ #! /bin/sh # Attempt to guess a canonical system name. # Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, -# 2000, 2001, 2002, 2003 Free Software Foundation, Inc. +# 2000, 2001, 2002, 2003, 2004 Free Software Foundation, Inc. -timestamp='2004-03-12' +timestamp='2004-11-12' # This file is free software; you can redistribute it and/or modify it # under the terms of the GNU General Public License as published by @@ -53,7 +53,7 @@ GNU config.guess ($timestamp) Originally written by Per Bothner. -Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001 +Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004 Free Software Foundation, Inc. This is free software; see the source for copying conditions. There is NO @@ -203,15 +203,15 @@ amiga:OpenBSD:*:*) echo m68k-unknown-openbsd${UNAME_RELEASE} exit 0 ;; - arc:OpenBSD:*:*) - echo mipsel-unknown-openbsd${UNAME_RELEASE} - exit 0 ;; cats:OpenBSD:*:*) echo arm-unknown-openbsd${UNAME_RELEASE} exit 0 ;; hp300:OpenBSD:*:*) echo m68k-unknown-openbsd${UNAME_RELEASE} exit 0 ;; + luna88k:OpenBSD:*:*) + echo m88k-unknown-openbsd${UNAME_RELEASE} + exit 0 ;; mac68k:OpenBSD:*:*) echo m68k-unknown-openbsd${UNAME_RELEASE} exit 0 ;; @@ -227,21 +227,12 @@ mvmeppc:OpenBSD:*:*) echo powerpc-unknown-openbsd${UNAME_RELEASE} exit 0 ;; - pegasos:OpenBSD:*:*) - echo powerpc-unknown-openbsd${UNAME_RELEASE} - exit 0 ;; - pmax:OpenBSD:*:*) - echo mipsel-unknown-openbsd${UNAME_RELEASE} - exit 0 ;; sgi:OpenBSD:*:*) - echo mipseb-unknown-openbsd${UNAME_RELEASE} + echo mips64-unknown-openbsd${UNAME_RELEASE} exit 0 ;; sun3:OpenBSD:*:*) echo m68k-unknown-openbsd${UNAME_RELEASE} exit 0 ;; - wgrisc:OpenBSD:*:*) - echo mipsel-unknown-openbsd${UNAME_RELEASE} - exit 0 ;; *:OpenBSD:*:*) echo ${UNAME_MACHINE}-unknown-openbsd${UNAME_RELEASE} exit 0 ;; @@ -307,9 +298,6 @@ # 1.2 uses "1.2" for uname -r. echo ${UNAME_MACHINE}-dec-osf`echo ${UNAME_RELEASE} | sed -e 's/^[PVTX]//' | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'` exit 0 ;; - Alpha*:OpenVMS:*:*) - echo alpha-hp-vms - exit 0 ;; Alpha\ *:Windows_NT*:*) # How do we know it's Interix rather than the generic POSIX subsystem? # Should we change UNAME_MACHINE based on the output of uname instead @@ -331,6 +319,9 @@ *:OS/390:*:*) echo i370-ibm-openedition exit 0 ;; + *:z/VM:*:*) + echo s390-ibm-zvmoe + exit 0 ;; *:OS400:*:*) echo powerpc-ibm-os400 exit 0 ;; @@ -354,7 +345,7 @@ DRS?6000:unix:4.0:6*) echo sparc-icl-nx6 exit 0 ;; - DRS?6000:UNIX_SV:4.2*:7*) + DRS?6000:UNIX_SV:4.2*:7* | DRS?6000:isis:4.2*:7*) case `/usr/bin/uname -p` in sparc) echo sparc-icl-nx7 && exit 0 ;; esac ;; @@ -764,7 +755,7 @@ echo sv1-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' exit 0 ;; *:UNICOS/mp:*:*) - echo nv1-cray-unicosmp${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' + echo craynv-cray-unicosmp${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' exit 0 ;; F30[01]:UNIX_System_V:*:* | F700:UNIX_System_V:*:*) FUJITSU_PROC=`uname -m | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'` @@ -787,21 +778,7 @@ echo ${UNAME_MACHINE}-unknown-bsdi${UNAME_RELEASE} exit 0 ;; *:FreeBSD:*:*) - # Determine whether the default compiler uses glibc. - eval $set_cc_for_build - sed 's/^ //' << EOF >$dummy.c - #include <features.h> - #if __GLIBC__ >= 2 - LIBC=gnu - #else - LIBC= - #endif -EOF - eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep ^LIBC=` - # GNU/KFreeBSD systems have a "k" prefix to indicate we are using - # FreeBSD's kernel, but not the complete OS. - case ${LIBC} in gnu) kernel_only='k' ;; esac - echo ${UNAME_MACHINE}-unknown-${kernel_only}freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'`${LIBC:+-$LIBC} + echo ${UNAME_MACHINE}-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` exit 0 ;; i*:CYGWIN*:*) echo ${UNAME_MACHINE}-pc-cygwin @@ -850,6 +827,12 @@ cris:Linux:*:*) echo cris-axis-linux-gnu exit 0 ;; + crisv32:Linux:*:*) + echo crisv32-axis-linux-gnu + exit 0 ;; + frv:Linux:*:*) + echo frv-unknown-linux-gnu + exit 0 ;; ia64:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-gnu exit 0 ;; @@ -1096,9 +1079,9 @@ M680?0:D-NIX:5.3:*) echo m68k-diab-dnix exit 0 ;; - M68*:*:R3V[567]*:*) + M68*:*:R3V[5678]*:*) test -r /sysV68 && echo 'm68k-motorola-sysv' && exit 0 ;; - 3[345]??:*:4.0:3.0 | 3[34]??A:*:4.0:3.0 | 3[34]??,*:*:4.0:3.0 | 3[34]??/*:*:4.0:3.0 | 4400:*:4.0:3.0 | 4850:*:4.0:3.0 | SKA40:*:4.0:3.0 | SDS2:*:4.0:3.0 | SHG2:*:4.0:3.0) + 3[345]??:*:4.0:3.0 | 3[34]??A:*:4.0:3.0 | 3[34]??,*:*:4.0:3.0 | 3[34]??/*:*:4.0:3.0 | 4400:*:4.0:3.0 | 4850:*:4.0:3.0 | SKA40:*:4.0:3.0 | SDS2:*:4.0:3.0 | SHG2:*:4.0:3.0 | S7501*:*:4.0:3.0) OS_REL='' test -r /etc/.relid \ && OS_REL=.`sed -n 's/[^ ]* [^ ]* \([0-9][0-9]\).*/\1/p' < /etc/.relid` @@ -1196,9 +1179,10 @@ echo ${UNAME_MACHINE}-apple-rhapsody${UNAME_RELEASE} exit 0 ;; *:Darwin:*:*) - case `uname -p` in + UNAME_PROCESSOR=`uname -p` || UNAME_PROCESSOR=unknown + case $UNAME_PROCESSOR in *86) UNAME_PROCESSOR=i686 ;; - powerpc) UNAME_PROCESSOR=powerpc ;; + unknown) UNAME_PROCESSOR=powerpc ;; esac echo ${UNAME_PROCESSOR}-apple-darwin${UNAME_RELEASE} exit 0 ;; @@ -1260,6 +1244,16 @@ *:DragonFly:*:*) echo ${UNAME_MACHINE}-unknown-dragonfly`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` exit 0 ;; + *:*VMS:*:*) + UNAME_MACHINE=`(uname -p) 2>/dev/null` + case "${UNAME_MACHINE}" in + A*) echo alpha-dec-vms && exit 0 ;; + I*) echo ia64-dec-vms && exit 0 ;; + V*) echo vax-dec-vms && exit 0 ;; + esac ;; + *:XENIX:*:SysV) + echo i386-pc-xenix + exit 0 ;; esac #echo '(No uname command or uname output not recognized.)' 1>&2 only in patch2: unchanged: --- callgrind-0.9.10.orig/src/main.c +++ callgrind-0.9.10/src/main.c @@ -605,7 +605,11 @@ #if VG_CORE_INTERFACE_MAJOR_VERSION < 3 Bool SK_(handle_client_request)(ThreadState* tst, UInt *args, UInt *ret) #else +#if VG_CORE_INTERFACE_MAJOR_VERSION < 7 Bool SK_(handle_client_request)(ThreadId tid, UInt *args, UInt *ret) +#else +Bool SK_(handle_client_request)(ThreadId tid, UWord *args, UWord *ret) +#endif #endif { if (!VG_IS_SKIN_USERREQ('C','T',args[0])) @@ -892,11 +896,14 @@ (*SK_(cachesim).post_clo_init)(); +#if VG_CORE_INTERFACE_MAJOR_VERSION < 7 + // with VG 2.3, no need to register helpers any more VG_(register_compact_helper)((Addr) SK_(cachesim).log_0D); VG_(register_compact_helper)((Addr) SK_(cachesim).log_1Dr); VG_(register_compact_helper)((Addr) SK_(cachesim).log_1Dw); VG_(register_compact_helper)((Addr) SK_(cachesim).log_2D); VG_(register_compact_helper)((Addr) & SK_(setup_bbcc)); +#endif SK_(init_eventsets)(0); SK_(init_statistics)(& SK_(stat)); only in patch2: unchanged: --- callgrind-0.9.10.orig/src/threads.c +++ callgrind-0.9.10/src/threads.c @@ -363,7 +363,11 @@ current_states.sp++; sp = current_states.sp; +#if VG_CORE_INTERFACE_MAJOR_VERSION < 7 CT_ASSERT((sigNum > 0) && (sigNum <= VKI_KNSIG)); +#else + CT_ASSERT((sigNum > 0) && (sigNum <= _VKI_NSIG)); +#endif CT_ASSERT((sp > 0) && (sp < MAX_SIGHANDLERS)); es = current_states.entry[sp]; if (!es) { only in patch2: unchanged: --- callgrind-0.9.10.orig/src/command.c +++ callgrind-0.9.10/src/command.c @@ -82,9 +82,7 @@ fd = VG_(open)(info_file, VKI_O_WRONLY|VKI_O_TRUNC, 0); if (fd<0) { fd = VG_(open)(info_file, VKI_O_CREAT|VKI_O_WRONLY, - VKI_S_IRUSR|VKI_S_IWUSR| - VKI_S_IRGRP|VKI_S_IWGRP| - VKI_S_IROTH|VKI_S_IWOTH); + VKI_S_IRUSR|VKI_S_IWUSR); if (fd <0) { VG_(message)(Vg_DebugMsg, "warning: can't write info file '%s'", info_file); only in patch2: unchanged: --- callgrind-0.9.10.orig/src/sim.c +++ callgrind-0.9.10/src/sim.c @@ -912,6 +912,10 @@ return 0; } +#if VG_CORE_INTERFACE_MAJOR_VERSION < 7 +/* older VG (<2.3) does not support VG_(has_cpuid), + * thus we need to install a signal handler for SIGILL + */ static jmp_buf cpuid_jmpbuf; static @@ -919,12 +923,15 @@ { __builtin_longjmp(cpuid_jmpbuf, 1); } +#endif static Int get_caches_from_CPUID(cache_t* I1c, cache_t* D1c, cache_t* L2c) { Int level, res, ret; Char vendor_id[13]; + +#if VG_CORE_INTERFACE_MAJOR_VERSION < 7 vki_ksigaction sigill_new, sigill_saved; /* Install own SIGILL handler */ @@ -957,6 +964,16 @@ return -1; } +#else + if (!VG_(has_cpuid)()) { + VG_(message)(Vg_DebugMsg, "CPUID instruction not supported"); + return -1; + } + VG_(cpuid)(0, &level, (int*)&vendor_id[0], + (int*)&vendor_id[8], (int*)&vendor_id[4]); + vendor_id[12] = '\0'; +#endif + if (0 == level) { VG_(message)(Vg_DebugMsg, "CPUID level is 0, early Pentium?\n"); return -1; only in patch2: unchanged: --- callgrind-0.9.10.orig/src/callstack.c +++ callgrind-0.9.10/src/callstack.c @@ -202,7 +202,12 @@ UInt* sp = (Int*) VG_(get_stack_pointer)(); UInt v0 = sp ? sp[0]:0; UInt v1 = sp ? sp[1]:0; - UInt eax = VG_(get_archreg)(R_EAX); +#if VG_CORE_INTERFACE_MAJOR_VERSION < 7 + UInt eax = VG_(get_archreg)(R_EAX); +#else + /* VG 2.3 gets rid of baseblock with current arch regs */ + UInt eax = VG_(get_thread_archreg)(VG_(get_running_tid)(), R_EAX); +#endif CT_DEBUG(3," leaving malloc (sp %x, eax=%x, [0]=%x, [1]=%x)\n", sp, eax, v0, v1); if (SK_(clo).collect_data) only in patch2: unchanged: --- callgrind-0.9.10.orig/configure +++ callgrind-0.9.10/configure @@ -272,7 +272,7 @@ PACKAGE_BUGREPORT= ac_unique_file="src/main.c" -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 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 RANLIB ac_ct_RANLIB VG_INCDIR VG_BINDIR CT_INCDIR CT_OPTIONS PREFERRED_STACK_BOUNDARY 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 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 RANLIB ac_ct_RANLIB VG_BINDIR CT_OPTIONS PREFERRED_STACK_BOUNDARY LIBOBJS LTLIBOBJS' ac_subst_files='' # Initialize some variables set by options. @@ -916,7 +916,7 @@ else echo "$as_me: WARNING: no configuration information is in $ac_dir" >&2 fi - cd $ac_popdir + cd "$ac_popdir" done fi @@ -1570,7 +1570,7 @@ # Define the identity of the package. PACKAGE=callgrind - VERSION=0.9.10 + VERSION=0.9.11 cat >>confdefs.h <<_ACEOF @@ -2268,8 +2268,7 @@ cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' + { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? @@ -2327,8 +2326,7 @@ cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' + { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? @@ -2444,8 +2442,7 @@ cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' + { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? @@ -2499,8 +2496,7 @@ cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' + { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? @@ -2545,8 +2541,7 @@ cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' + { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? @@ -2590,8 +2585,7 @@ cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' + { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? @@ -2949,8 +2943,7 @@ 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' + { 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=$? @@ -3008,8 +3001,7 @@ 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' + { 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=$? @@ -3080,8 +3072,7 @@ 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' + { 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=$? @@ -3125,8 +3116,7 @@ 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' + { 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=$? @@ -3428,29 +3418,30 @@ fi -# set default PREFIX to existing valgrind installation +# set default PREFIX / check given PREFIX echo "$as_me:$LINENO: checking for valgrind installation" >&5 echo $ECHO_N "checking for valgrind installation... $ECHO_C" >&6 -vg_exec=`which valgrind` -if test "x$vg_exec" = "x"; then - echo "$as_me:$LINENO: result: not found in PATH" >&5 -echo "${ECHO_T}not found in PATH" >&6 - { { echo "$as_me:$LINENO: error: Needs Valgrind 2.0.x/2.2.x" >&5 -echo "$as_me: error: Needs Valgrind 2.0.x/2.2.x" >&2;} +if test "x$prefix" = "xNONE"; then + vg_exec=`which valgrind` + if test "x$vg_exec" = "x"; then + echo "$as_me:$LINENO: result: not found in $PATH" >&5 +echo "${ECHO_T}not found in $PATH" >&6 + { { echo "$as_me:$LINENO: error: Please install Valgrind" >&5 +echo "$as_me: error: Please install Valgrind" >&2;} + { (exit 1); exit 1; }; } + fi +else + vg_exec=`which $prefix/bin/valgrind` + if test "x$vg_exec" = "x"; then + echo "$as_me:$LINENO: result: not found in $prefix/bin" >&5 +echo "${ECHO_T}not found in $prefix/bin" >&6 + { { echo "$as_me:$LINENO: error: Valgrind has to be installed in the specified prefix!" >&5 +echo "$as_me: error: Valgrind has to be installed in the specified prefix!" >&2;} { (exit 1); exit 1; }; } + fi fi vg_binpath=`dirname $vg_exec` ac_default_prefix=`dirname $vg_binpath` -echo "$as_me:$LINENO: result: in ${ac_default_prefix}" >&5 -echo "${ECHO_T}in ${ac_default_prefix}" >&6 - -# Even if a user defined a prefix other than the Valgrind installation -# directory of this system, we need to find valgrind.h - -VG_INCDIR="$ac_default_prefix/include/valgrind" - -VG_BINDIR="$ac_default_prefix/bin" - if test "x$prefix" = "xNONE"; then prefix=$ac_default_prefix ac_configure_args="$ac_configure_args --prefix=$prefix" @@ -3458,14 +3449,65 @@ # 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,/$,,'` +echo "$as_me:$LINENO: result: in ${prefix}" >&5 +echo "${ECHO_T}in ${prefix}" >&6 -# to be set to skin interface header file (internal or valgrind installed) +VG_BINDIR="$prefix/bin" -# check if there is a vg_skin.h installed -echo "$as_me:$LINENO: checking if vg_skin.h is available" >&5 -echo $ECHO_N "checking if vg_skin.h is available... $ECHO_C" >&6 -CFLAGS="-I $VG_INCDIR" + +# Check for Valgrind version + +CT_OPTIONS="--tool=callgrind" +use_pkg_config="no" +echo "$as_me:$LINENO: checking for valgrind version" >&5 +echo $ECHO_N "checking for valgrind version... $ECHO_C" >&6 +vg_version=`$prefix/bin/valgrind --version` +case "${vg_version}" in + valgrind-2.0.*) + CT_OPTIONS="--skin=callgrind" + ;; + valgrind-2.2.*) + ;; + valgrind-2.1.*) + echo "$as_me:$LINENO: result: ${vg_version}" >&5 +echo "${ECHO_T}${vg_version}" >&6 + { { echo "$as_me:$LINENO: error: Please update to Valgrind 2.2.x" >&5 +echo "$as_me: error: Please update to Valgrind 2.2.x" >&2;} + { (exit 1); exit 1; }; } + ;; + valgrind-2.3.*) + use_pkg_config="yes" + +cat >>confdefs.h <<\_ACEOF +#define VG_UNSTABLE 1 +_ACEOF + + ;; + valgrind-2.4.*) + use_pkg_config="yes" + ;; + *) + echo "$as_me:$LINENO: result: ${vg_version}" >&5 +echo "${ECHO_T}${vg_version}" >&6 + { { echo "$as_me:$LINENO: error: Unsupported version. Please use 2.0.x/2.2.x" >&5 +echo "$as_me: error: Unsupported version. Please use 2.0.x/2.2.x" >&2;} + { (exit 1); exit 1; }; } + ;; +esac +echo "$as_me:$LINENO: result: ${vg_version}" >&5 +echo "${ECHO_T}${vg_version}" >&6 + + +# check for CFLAGS to use +PREFERRED_STACK_BOUNDARY="" +if test "$use_pkg_config" = "no"; then + + # copied from configure.in of valgrind distribution + # does this compiler support -mpreferred-stack-boundary=2 ? + echo "$as_me:$LINENO: checking if gcc accepts -mpreferred-stack-boundary" >&5 +echo $ECHO_N "checking if gcc accepts -mpreferred-stack-boundary... $ECHO_C" >&6 + CFLAGS="-mpreferred-stack-boundary=2" cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ @@ -3478,8 +3520,7 @@ main () { -#include "vg_skin.h" -int main() { return 0 ; } + int main () { return 0 ; } ; return 0; @@ -3494,8 +3535,7 @@ cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' + { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? @@ -3508,114 +3548,104 @@ echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then -# No need for additional directory -CT_INCDIR="" -echo "$as_me:$LINENO: result: Yes" >&5 -echo "${ECHO_T}Yes" >&6 + PREFERRED_STACK_BOUNDARY="-mpreferred-stack-boundary=2" + echo "$as_me:$LINENO: result: $PREFERRED_STACK_BOUNDARY" >&5 +echo "${ECHO_T}$PREFERRED_STACK_BOUNDARY" >&6 else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 -{ { echo "$as_me:$LINENO: error: No. Needs header files from Valgrind (2.0.x/2.2.x). -Perhaps a valgrind-dev package is missing in your installation?" >&5 -echo "$as_me: error: No. Needs header files from Valgrind (2.0.x/2.2.x). -Perhaps a valgrind-dev package is missing in your installation?" >&2;} - { (exit 1); exit 1; }; } + PREFERRED_STACK_BOUNDARY="" + echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6 fi rm -f conftest.err conftest.$ac_objext conftest.$ac_ext -# Check for Valgrind version - -echo "$as_me:$LINENO: checking for valgrind version" >&5 -echo $ECHO_N "checking for valgrind version... $ECHO_C" >&6 -vg_version=`valgrind --version` -case "${vg_version}" in - valgrind-2.0.*) - echo "$as_me:$LINENO: result: ${vg_version} (stable)" >&5 -echo "${ECHO_T}${vg_version} (stable)" >&6 - CT_OPTIONS="--skin=callgrind" - ;; - valgrind-2.135.*) - echo "$as_me:$LINENO: result: ${vg_version} (unstable)" >&5 -echo "${ECHO_T}${vg_version} (unstable)" >&6 - -cat >>confdefs.h <<\_ACEOF -#define VG_UNSTABLE 1 -_ACEOF - - vg_unstable="yes" - CT_OPTIONS="--tool=callgrind" - ;; - *) - echo "$as_me:$LINENO: result: ${vg_version}" >&5 -echo "${ECHO_T}${vg_version}" >&6 - CT_OPTIONS="--tool=callgrind" - ;; -esac +fi -# check if we support skin version of installed valgrind -# -# Note that versions used in VG releases 2.y.x, with y odd, -# are *not* reliable, so we define UNSTABLE to distinguish -# unstable VG releases from stable ones reusing versions. -echo "$as_me:$LINENO: checking if skin version is supported" >&5 -echo $ECHO_N "checking if skin version is supported... $ECHO_C" >&6 -CFLAGS="-I $VG_INCDIR" -if test "x$vg_unstable" = "x"; then - if test "$cross_compiling" = yes; then +echo "$as_me:$LINENO: checking for CFLAGS to use for valgrind tools" >&5 +echo $ECHO_N "checking for CFLAGS to use for valgrind tools... $ECHO_C" >&6 +if test "$use_pkg_config" = "yes"; then + CFLAGS=`pkg-config valgrind --cflags` +else + CFLAGS="-I$prefix/include/valgrind -fomit-frame-pointer $PREFERRED_STACK_BOUNDARY" +fi +echo "$as_me:$LINENO: result: ${CFLAGS}" >&5 +echo "${ECHO_T}${CFLAGS}" >&6 - echo "$as_me:$LINENO: result: Assuming yes (cross-compiling)" >&5 -echo "${ECHO_T}Assuming yes (cross-compiling)" >&6 -else - cat >conftest.$ac_ext <<_ACEOF +# check if there is a vg_skin.h installed +echo "$as_me:$LINENO: checking if compiling a valgrind tool is possible" >&5 +echo $ECHO_N "checking if compiling a valgrind tool is possible... $ECHO_C" >&6 +cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ +#include "vg_skin.h" +int +main () +{ - #include "vg_skin.h" - int main() { return (VG_CORE_INTERFACE_MAJOR_VERSION > 6) ? 1:0; } - + ; + return 0; +} _ACEOF -rm -f conftest$ac_exeext -if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 - (eval $ac_link) 2>&5 +rm -f conftest.$ac_objext +if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 + (eval $ac_compile) 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='./conftest$ac_exeext' + (exit $ac_status); } && + { ac_try='test -z "$ac_c_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_objext' { (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 - echo "$as_me:$LINENO: result: Yes" >&5 +# No need for additional directory +echo "$as_me:$LINENO: result: Yes" >&5 echo "${ECHO_T}Yes" >&6 else - echo "$as_me: program exited with status $ac_status" >&5 -echo "$as_me: failed program was:" >&5 + echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 -( exit $ac_status ) - { { echo "$as_me:$LINENO: error: The installed stable Valgrind is too new for this package. Please update this package!" >&5 -echo "$as_me: error: The installed stable Valgrind is too new for this package. Please update this package!" >&2;} +{ { echo "$as_me:$LINENO: error: No. Is a valgrind-dev package missing?" >&5 +echo "$as_me: error: No. Is a valgrind-dev package missing?" >&2;} { (exit 1); exit 1; }; } fi -rm -f core *.core gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext -fi -else - if test "$cross_compiling" = yes; then +rm -f conftest.err conftest.$ac_objext conftest.$ac_ext + - echo "$as_me:$LINENO: result: Assuming yes (cross-compiling)" >&5 +# check if we support skin version of installed valgrind +# +# Note that versions used in VG releases 2.y.x, with y odd, +# are *not* reliable, so we define UNSTABLE to distinguish +# unstable VG releases from stable ones reusing versions. + +echo "$as_me:$LINENO: checking if tool API version is supported" >&5 +echo $ECHO_N "checking if tool API version is supported... $ECHO_C" >&6 +if test "$cross_compiling" = yes; then + +echo "$as_me:$LINENO: result: Assuming yes (cross-compiling)" >&5 echo "${ECHO_T}Assuming yes (cross-compiling)" >&6 else @@ -3626,8 +3656,8 @@ cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ - #include "vg_skin.h" - int main() { return (VG_CORE_INTERFACE_MAJOR_VERSION > 6) ? 1:0; } +#include "vg_skin.h" +int main() { return (VG_CORE_INTERFACE_MAJOR_VERSION > 7) ? 1:0; } _ACEOF rm -f conftest$ac_exeext @@ -3642,7 +3672,7 @@ echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then - echo "$as_me:$LINENO: result: Yes" >&5 +echo "$as_me:$LINENO: result: Yes" >&5 echo "${ECHO_T}Yes" >&6 else @@ -3652,78 +3682,13 @@ ( exit $ac_status ) - { { echo "$as_me:$LINENO: error: The installed unstable Valgrind is too new for this package. Please update this package!" >&5 -echo "$as_me: error: The installed unstable Valgrind is too new for this package. Please update this package!" >&2;} +{ { echo "$as_me:$LINENO: error: Installed valgrind version too new. Please update this package!" >&5 +echo "$as_me: error: Installed valgrind version too new. Please update this package!" >&2;} { (exit 1); exit 1; }; } fi rm -f core *.core gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext fi -fi - - -# copied from configure.in of valgrind distribution -# does this compiler support -mpreferred-stack-boundary=2 ? -echo "$as_me:$LINENO: checking if gcc accepts -mpreferred-stack-boundary" >&5 -echo $ECHO_N "checking if gcc accepts -mpreferred-stack-boundary... $ECHO_C" >&6 -CFLAGS="-mpreferred-stack-boundary=2" -cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ - -int -main () -{ - -int main () { return 0 ; } - - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext -if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 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_c_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_objext' - { (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 - -PREFERRED_STACK_BOUNDARY="-mpreferred-stack-boundary=2" -echo "$as_me:$LINENO: result: $PREFERRED_STACK_BOUNDARY" >&5 -echo "${ECHO_T}$PREFERRED_STACK_BOUNDARY" >&6 - -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - -PREFERRED_STACK_BOUNDARY="" -echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6 - -fi -rm -f conftest.err conftest.$ac_objext conftest.$ac_ext - - ac_config_files="$ac_config_files Makefile src/Makefile docs/Makefile man/Makefile tests/Makefile callgrind callgrind_control callgrind_annotate" @@ -4448,9 +4413,7 @@ s,@am__fastdepCXX_FALSE@,$am__fastdepCXX_FALSE,;t t s,@RANLIB@,$RANLIB,;t t s,@ac_ct_RANLIB@,$ac_ct_RANLIB,;t t -s,@VG_INCDIR@,$VG_INCDIR,;t t s,@VG_BINDIR@,$VG_BINDIR,;t t -s,@CT_INCDIR@,$CT_INCDIR,;t t s,@CT_OPTIONS@,$CT_OPTIONS,;t t s,@PREFERRED_STACK_BOUNDARY@,$PREFERRED_STACK_BOUNDARY,;t t s,@LIBOBJS@,$LIBOBJS,;t t @@ -4621,11 +4584,6 @@ *) ac_INSTALL=$ac_top_builddir$INSTALL ;; esac - if test x"$ac_file" != x-; then - { echo "$as_me:$LINENO: creating $ac_file" >&5 -echo "$as_me: creating $ac_file" >&6;} - rm -f "$ac_file" - fi # Let's still pretend it is `configure' which instantiates (i.e., don't # use $as_me), people would be surprised to read: # /* config.h. Generated by config.status. */ @@ -4664,6 +4622,12 @@ fi;; esac done` || { (exit 1); exit 1; } + + if test x"$ac_file" != x-; then + { echo "$as_me:$LINENO: creating $ac_file" >&5 +echo "$as_me: creating $ac_file" >&6;} + rm -f "$ac_file" + fi _ACEOF cat >>$CONFIG_STATUS <<_ACEOF sed "$ac_vpsub only in patch2: unchanged: --- callgrind-0.9.10.orig/configure.in +++ callgrind-0.9.10/configure.in @@ -1,28 +1,27 @@ AC_INIT(src/main.c) -AM_INIT_AUTOMAKE(callgrind,0.9.10) +AM_INIT_AUTOMAKE(callgrind,0.9.11) AC_PROG_CC AC_PROG_CXX AC_PROG_INSTALL AC_PROG_RANLIB -# set default PREFIX to existing valgrind installation +# set default PREFIX / check given PREFIX AC_MSG_CHECKING([for valgrind installation]) -vg_exec=`which valgrind` -if test "x$vg_exec" = "x"; then - AC_MSG_RESULT([not found in PATH]) - AC_MSG_ERROR([Needs Valgrind 2.0.x/2.2.x]) +if test "x$prefix" = "xNONE"; then + vg_exec=`which valgrind` + if test "x$vg_exec" = "x"; then + AC_MSG_RESULT([not found in $PATH]) + AC_MSG_ERROR([Please install Valgrind]) + fi +else + 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` -AC_MSG_RESULT([in ${ac_default_prefix}]) - -# Even if a user defined a prefix other than the Valgrind installation -# directory of this system, we need to find valgrind.h -AC_SUBST(VG_INCDIR) -VG_INCDIR="$ac_default_prefix/include/valgrind" -AC_SUBST(VG_BINDIR) -VG_BINDIR="$ac_default_prefix/bin" - if test "x$prefix" = "xNONE"; then prefix=$ac_default_prefix ac_configure_args="$ac_configure_args --prefix=$prefix" @@ -30,97 +29,105 @@ # 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,/$,,'` +AC_MSG_RESULT([in ${prefix}]) -# to be set to skin interface header file (internal or valgrind installed) -AC_SUBST(CT_INCDIR) +AC_SUBST(VG_BINDIR) +VG_BINDIR="$prefix/bin" -# check if there is a vg_skin.h installed -AC_MSG_CHECKING([if vg_skin.h is available]) -CFLAGS="-I $VG_INCDIR" -AC_TRY_COMPILE(, [ -#include "vg_skin.h" -int main() { return 0 ; } -], -[ -# No need for additional directory -CT_INCDIR="" -AC_MSG_RESULT([Yes]) -], [ -AC_MSG_ERROR([No. Needs header files from Valgrind (2.0.x/2.2.x). -Perhaps a valgrind-dev package is missing in your installation?]) -]) # Check for Valgrind version AC_SUBST(CT_OPTIONS) +CT_OPTIONS="--tool=callgrind" +use_pkg_config="no" AC_MSG_CHECKING([for valgrind version]) -vg_version=`valgrind --version` +vg_version=`$prefix/bin/valgrind --version` case "${vg_version}" in valgrind-2.0.*) - AC_MSG_RESULT([${vg_version} (stable)]) CT_OPTIONS="--skin=callgrind" ;; - valgrind-2.[135].*) - AC_MSG_RESULT([${vg_version} (unstable)]) + valgrind-2.2.*) + ;; + valgrind-2.1.*) + AC_MSG_RESULT([${vg_version}]) + AC_MSG_ERROR([Please update to Valgrind 2.2.x]) + ;; + valgrind-2.3.*) + use_pkg_config="yes" AC_DEFINE(VG_UNSTABLE,1,[Unstable Valgrind]) - vg_unstable="yes" - CT_OPTIONS="--tool=callgrind" + ;; + valgrind-2.4.*) + use_pkg_config="yes" ;; *) AC_MSG_RESULT([${vg_version}]) - CT_OPTIONS="--tool=callgrind" + AC_MSG_ERROR([Unsupported version. Please use 2.0.x/2.2.x]) ;; esac +AC_MSG_RESULT([${vg_version}]) -# check if we support skin version of installed valgrind -# -# Note that versions used in VG releases 2.y.x, with y odd, -# are *not* reliable, so we define UNSTABLE to distinguish -# unstable VG releases from stable ones reusing versions. -AC_MSG_CHECKING([if skin version is supported]) -CFLAGS="-I $VG_INCDIR" -if test "x$vg_unstable" = "x"; then - AC_TRY_RUN([ - #include "vg_skin.h" - int main() { return (VG_CORE_INTERFACE_MAJOR_VERSION > 6) ? 1:0; } - ], [ - AC_MSG_RESULT([Yes]) - ], [ - AC_MSG_ERROR([The installed stable Valgrind is too new for this package. Please update this package!]) - ], [ - AC_MSG_RESULT([Assuming yes (cross-compiling)]) - ]) +# check for CFLAGS to use +PREFERRED_STACK_BOUNDARY="" +if test "$use_pkg_config" = "no"; then + + # copied from configure.in of valgrind distribution + # does this compiler support -mpreferred-stack-boundary=2 ? + AC_MSG_CHECKING([if gcc accepts -mpreferred-stack-boundary]) + CFLAGS="-mpreferred-stack-boundary=2" + AC_TRY_COMPILE(, [ + int main () { return 0 ; } + ], + [ + PREFERRED_STACK_BOUNDARY="-mpreferred-stack-boundary=2" + AC_MSG_RESULT([$PREFERRED_STACK_BOUNDARY]) + ], [ + PREFERRED_STACK_BOUNDARY="" + AC_MSG_RESULT([no]) + ]) + AC_SUBST(PREFERRED_STACK_BOUNDARY) +fi + + +AC_MSG_CHECKING([for CFLAGS to use for valgrind tools]) +if test "$use_pkg_config" = "yes"; then + CFLAGS=`pkg-config valgrind --cflags` else - AC_TRY_RUN([ - #include "vg_skin.h" - int main() { return (VG_CORE_INTERFACE_MAJOR_VERSION > 6) ? 1:0; } - ], [ - AC_MSG_RESULT([Yes]) - ], [ - AC_MSG_ERROR([The installed unstable Valgrind is too new for this package. Please update this package!]) - ], [ - AC_MSG_RESULT([Assuming yes (cross-compiling)]) - ]) + CFLAGS="-I$prefix/include/valgrind -fomit-frame-pointer $PREFERRED_STACK_BOUNDARY" fi +AC_MSG_RESULT([${CFLAGS}]) -# copied from configure.in of valgrind distribution -# does this compiler support -mpreferred-stack-boundary=2 ? -AC_MSG_CHECKING([if gcc accepts -mpreferred-stack-boundary]) -CFLAGS="-mpreferred-stack-boundary=2" -AC_TRY_COMPILE(, [ -int main () { return 0 ; } -], +# check if there is a vg_skin.h installed +AC_MSG_CHECKING([if compiling a valgrind tool is possible]) +AC_TRY_COMPILE( +[#include "vg_skin.h"], +[], [ -PREFERRED_STACK_BOUNDARY="-mpreferred-stack-boundary=2" -AC_MSG_RESULT([$PREFERRED_STACK_BOUNDARY]) +# No need for additional directory +AC_MSG_RESULT([Yes]) ], [ -PREFERRED_STACK_BOUNDARY="" -AC_MSG_RESULT([no]) +AC_MSG_ERROR([No. Is a valgrind-dev package missing?]) ]) -AC_SUBST(PREFERRED_STACK_BOUNDARY) +# check if we support skin version of installed valgrind +# +# Note that versions used in VG releases 2.y.x, with y odd, +# are *not* reliable, so we define UNSTABLE to distinguish +# unstable VG releases from stable ones reusing versions. + +AC_MSG_CHECKING([if tool API version is supported]) +AC_TRY_RUN([ +#include "vg_skin.h" +int main() { return (VG_CORE_INTERFACE_MAJOR_VERSION > 7) ? 1:0; } +], [ +AC_MSG_RESULT([Yes]) +], [ +AC_MSG_ERROR([Installed valgrind version too new. Please update this package!]) +], [ +AC_MSG_RESULT([Assuming yes (cross-compiling)]) +]) + AC_OUTPUT( Makefile \
signature.asc
Description: Digital signature