Permalink
Browse files

Support multiarch library paths on Linux.

  • Loading branch information...
1 parent ce2fc13 commit 3d1812d5ef567a023e68458b1c040b3aac8176e7 wohali committed Oct 3, 2012
Showing with 8 additions and 2 deletions.
  1. +8 −2 couchjs/c_src/SConscript
View
@@ -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'

0 comments on commit 3d1812d

Please sign in to comment.