From 582e1f9f93d8d6896320edad103a8027bdaf8006 Mon Sep 17 00:00:00 2001 From: benoitc Date: Sat, 18 Dec 2010 01:56:40 +0100 Subject: freebsd compat --- apps/couch/rebar.config | 4 +++- configure | 3 +-- 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"} ]}. diff --git a/configure b/configure index b9119ea1..75770cfb 100755 --- a/configure +++ b/configure @@ -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') -- cgit v1.2.3