Skip to content

Commit

Permalink
freebsd compat
Browse files Browse the repository at this point in the history
  • Loading branch information
benoitc committed Jan 1, 2011
1 parent fd1496a commit 582e1f9
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 3 deletions.
4 changes: 3 additions & 1 deletion apps/couch/rebar.config
Expand Up @@ -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"}
]}.
3 changes: 1 addition & 2 deletions 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
Expand Down
9 changes: 9 additions & 0 deletions couchjs/c_src/SConscript
Expand Up @@ -11,13 +11,22 @@
# 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):
print 'Could not find required library', 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')

Expand Down

0 comments on commit 582e1f9

Please sign in to comment.