Paul Rosenfeld has uploaded this change for review. ( https://gem5-review.googlesource.com/4500

Change subject: scons: detect tcmalloc using pkg-config (if available)
......................................................................

scons: detect tcmalloc using pkg-config (if available)

For users of gem5 who do not have permissions to install packages to
system locations, pkg-config makes it much easier to detect libraries
in custom locations. This patch adds pkg-config library include paths
to for non-standard tcmalloc locations.

Change-Id: I08241e7fd4299a38d964475af3a7cff0f4cd257e
---
M SConstruct
1 file changed, 6 insertions(+), 1 deletion(-)



diff --git a/SConstruct b/SConstruct
index e4880e1..eda5966 100755
--- a/SConstruct
+++ b/SConstruct
@@ -888,6 +888,8 @@
     # cygwin has some header file issues...
     main.Append(CCFLAGS=["-Wno-uninitialized"])

+has_pkg_config = readCommand(['pkg-config', '--version'], exception='')
+
 # Check for the protobuf compiler
 protoc_version = readCommand([main['PROTOC'], '--version'],
                              exception='').split()
@@ -917,7 +919,7 @@
         # protobuf without the involvement of pkg-config. Later on we
         # check go a library config check and at that point the test
         # will fail if libprotobuf cannot be found.
-        if readCommand(['pkg-config', '--version'], exception=''):
+        if has_pkg_config:
             try:
# Attempt to establish what linking flags to add for protobuf
                 # using pkg-config
@@ -1096,6 +1098,9 @@
                             'timer_create(CLOCK_MONOTONIC, NULL, NULL);')

 if not GetOption('without_tcmalloc'):
+    if has_pkg_config:
+        main.ParseConfig('pkg-config --libs-only-L libtcmalloc')
+        main.ParseConfig('pkg-config --libs-only-L libtcmalloc_minimal')
     if conf.CheckLib('tcmalloc'):
         main.Append(CCFLAGS=main['TCMALLOC_CCFLAGS'])
     elif conf.CheckLib('tcmalloc_minimal'):

--
To view, visit https://gem5-review.googlesource.com/4500
To unsubscribe, or for help writing mail filters, visit https://gem5-review.googlesource.com/settings

Gerrit-Project: public/gem5
Gerrit-Branch: master
Gerrit-MessageType: newchange
Gerrit-Change-Id: I08241e7fd4299a38d964475af3a7cff0f4cd257e
Gerrit-Change-Number: 4500
Gerrit-PatchSet: 1
Gerrit-Owner: Paul Rosenfeld <[email protected]>
Gerrit-Reviewer: Curtis Dunham <[email protected]>
Gerrit-Reviewer: Jason Lowe-Power <[email protected]>
Gerrit-Reviewer: Joe Gross <[email protected]>
Gerrit-Reviewer: Paul Rosenfeld <[email protected]>
_______________________________________________
gem5-dev mailing list
[email protected]
http://m5sim.org/mailman/listinfo/gem5-dev

Reply via email to