diff options
author | Adam Kocoloski <adam@cloudant.com> | 2011-01-04 15:14:58 -0500 |
---|---|---|
committer | Adam Kocoloski <adam@cloudant.com> | 2011-01-04 15:19:06 -0500 |
commit | 0ddca37246a5541b38a266809fb77cfeeeb174f7 (patch) | |
tree | 7c438999b10eaeeb7f573b6212765aada3ea2cdc | |
parent | 11af04ba67499a5aa3e85076b223c5ae8a9b500b (diff) | |
parent | 582e1f9f93d8d6896320edad103a8027bdaf8006 (diff) |
Merge pull request #29 for FreeBSD compatibility
-rw-r--r-- | apps/couch/rebar.config | 4 | ||||
-rwxr-xr-x | configure | 3 | ||||
-rw-r--r-- | couchjs/c_src/SConscript | 9 |
3 files changed, 13 insertions, 3 deletions
diff --git a/apps/couch/rebar.config b/apps/couch/rebar.config index 9f34967d..94291c70 100644 --- a/apps/couch/rebar.config +++ b/apps/couch/rebar.config @@ -2,5 +2,7 @@ {port_envs, [ {"DRV_CFLAGS", "$DRV_CFLAGS -DPIC -O2 -fno-common"}, {"DRV_LDFLAGS", "$DRV_LDFLAGS -lm -licuuc -licudata -licui18n -lpthread"}, - {"linux", "DRV_LDFLAGS", "$DRV_LDFLAGS -lcrypt"} + {"linux", "DRV_LDFLAGS", "$DRV_LDFLAGS -lcrypt"}, + {"freebsd", "DRV_CFLAGS", "$DRV_CFLAGS -I/usr/local/include"}, + {"freebsd", "DRV_LDFLAGS", "$DRV_LDFLAGS -L/usr/local/lib"} ]}. @@ -1,5 +1,4 @@ -#!/bin/bash - +#!/bin/sh # Copyright 2010 Cloudant # # Licensed under the Apache License, Version 2.0 (the "License"); you may not diff --git a/couchjs/c_src/SConscript b/couchjs/c_src/SConscript index 757e0289..f61cdf8b 100644 --- a/couchjs/c_src/SConscript +++ b/couchjs/c_src/SConscript @@ -11,6 +11,7 @@ # 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 def require_lib(name): if not conf.CheckLib(name): @@ -18,6 +19,14 @@ def require_lib(name): Exit(1) env = Environment(CCFLAGS='-g -O2 -DXP_UNIX') + +if os.uname()[0] == 'FreeBSD': + env['CCFLAGS'] += ' -I/usr/local/include' + env.Append(LINKFLAGS=['-L/usr/local/lib']) + env['LIB_DL'] = env['LIB_RT'] = '' + env['LIB_COMPAT'] = 'compat' + + if not env.GetOption('clean'): conf = Configure(env, config_h='config.h') |