From 3d1812d5ef567a023e68458b1c040b3aac8176e7 Mon Sep 17 00:00:00 2001 From: wohali Date: Wed, 3 Oct 2012 04:48:03 -0400 Subject: Support multiarch library paths on Linux. --- couchjs/c_src/SConscript | 10 ++++++++-- 1 file 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' -- cgit v1.2.3