summaryrefslogtreecommitdiff
path: root/couchjs
diff options
context:
space:
mode:
Diffstat (limited to 'couchjs')
-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'