scons: Try to use 'tcmalloc' before 'tcmalloc_minimal'
authorAndreas Sandberg <andreas@sandberg.pp.se>
Mon, 18 Mar 2013 10:24:56 +0000 (11:24 +0100)
committerAndreas Sandberg <andreas@sandberg.pp.se>
Mon, 18 Mar 2013 10:24:56 +0000 (11:24 +0100)
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.

SConstruct

index b175cb4911f1e834d93520738de34672dff5387d..6354bf0ca468633f8b2f59a111adaff8af2f2435 100755 (executable)
@@ -925,7 +925,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 + \