Permalink
Browse files

scons: Try to use 'tcmalloc' before 'tcmalloc_minimal'

tcmalloc_minimal doesn't support the heap checker on Debian, while
tcmalloc does. Instead of always linking with tcmalloc_minimal, if it
exists, we first check for tcmalloc and then use tcmalloc_minimal as a
fallback.
  • Loading branch information...
andysan committed Mar 15, 2013
1 parent 311f63d commit c31eb51d068953ba9cd0d3d22244fb7be0816290
Showing with 3 additions and 1 deletion.
  1. +3 −1 SConstruct
View
@@ -922,7 +922,9 @@ have_posix_clock = \
conf.CheckLibWithHeader('rt', 'time.h', 'C',
'clock_nanosleep(0,0,NULL,NULL);')
-if conf.CheckLib('tcmalloc_minimal'):
+if conf.CheckLib('tcmalloc'):
+ main.Append(CCFLAGS=main['TCMALLOC_CCFLAGS'])
+elif conf.CheckLib('tcmalloc_minimal'):
main.Append(CCFLAGS=main['TCMALLOC_CCFLAGS'])
else:
print termcap.Yellow + termcap.Bold + \

0 comments on commit c31eb51

Please sign in to comment.