endif
endif
-ifeq ($(shell grep -c -E '^Build-Depends:(.*,)?[[:space:]]*libgoogle-perftools-dev([[:space:]]|,|$$)' debian/control),0)
+ifeq ($(shell perl -n -e 'BEGIN{$$/=""}' -e '/Build-Depends:.*libgoogle-perftools-dev/ && exit 1' debian/control),0)
# if Build-Deps have been edited to skip libgoogle-perftools-dev (as
# we do for Debian lenny), tell configure it's ok to not have
# tcmalloc.
+ $(warning skipping -ltcmalloc because of no libgoogle-perftools-dev)
extraopts += --without-tcmalloc
endif