File: detect_tcmalloc.sh

package info (click to toggle)
yrmcds 1.1.8-1.1
  • links: PTS
  • area: main
  • in suites: buster, sid
  • size: 1,000 kB
  • sloc: cpp: 11,157; sh: 148; makefile: 117
file content (19 lines) | stat: -rwxr-xr-x 274 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
#!/bin/sh

CXX=$1
shift
CPPFLAGS="$@"

T=$(mktemp --suffix=.cpp)
trap "rm -f $T" INT QUIT TERM HUP 0

f() {
    echo "#include <$1>" >$T
    if $CXX "$CPPFLAGS" -E $T >/dev/null 2>&1; then
        echo $1
        exit 0
    fi
}

f gperftools/tcmalloc.h
f google/tcmalloc.h