summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorwohali <joant@ieee.org>2012-10-03 04:48:03 -0400
committerwohali <joant@ieee.org>2012-10-03 04:48:03 -0400
commit3d1812d5ef567a023e68458b1c040b3aac8176e7 (patch)
treeae9fa0bb61422589b8a004c313d7ae1af97602f0
parentce2fc13730266b220e7afd6809b0b1aa2123bd49 (diff)
Support multiarch library paths on Linux.
-rw-r--r--couchjs/c_src/SConscript10
1 files changed, 8 insertions, 2 deletions
diff --git a/couchjs/c_src/SConscript b/couchjs/c_src/SConscript
index 3f6a0cc7..ea78c587 100644
--- a/couchjs/c_src/SConscript
+++ b/couchjs/c_src/SConscript
@@ -1,4 +1,4 @@
-# Copyright 2010 Cloudant
+# Copyright 2010-2012 Cloudant
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may not
# use this file except in compliance with the License. You may obtain a copy of
@@ -11,8 +11,9 @@
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
# License for the specific language governing permissions and limitations under
# the License.
-import os
import commands
+import os
+import platform
def require_lib(name):
if not conf.CheckLib(name):
@@ -25,6 +26,11 @@ def runcmd(cmd):
env = Environment(CC="c++", CCFLAGS='-g -O2 -DXP_UNIX',
CPPPATH=os.getenv("CPPPATH"))
+if os.uname()[0] == 'Linux':
+ platlibpath = "/usr/lib/%s-linux-gnu" % platform.machine()
+ if os.path.exists(platlibpath):
+ env.Append(LINKFLAGS="-L%s" % platlibpath)
+
if os.uname()[0] == 'SunOS':
env['CC'] = '/usr/sfw/bin/gcc'
env['CCFLAGS'] += ' -I/opt/local/include'