| %% -*- mode: erlang;erlang-indent-level: 2;indent-tabs-mode: nil -*- |
| {so_specs, |
| [{"priv/bcrypt_nif.so", |
| ["c_src/blowfish.c", "c_src/bcrypt.c", "c_src/bcrypt_nif.c"]}]}. |
| |
| {erl_opts, [debug_info]}. |
| |
| % This ugly hack is necessary because rebar's supported pre and post hooks |
| % don't include the environment vars necessary for building port programs. |
| {port_pre_script, {"echo -e \"#!/bin/sh\\n$CC $CFLAGS $ERL_CFLAGS " |
| "c_src/bcrypt_port.c c_src/bcrypt.o c_src/blowfish.o " |
| "$LDFLAGS $ERL_LDFLAGS -lpthread " |
| "-o priv/bcrypt\" > build_port.sh", |
| "build_port.sh"}}. |
| {port_cleanup_script, "rm -f build_port.sh"}. |
| {pre_hooks, [{clean, "rm -f priv/bcrypt c_src/bcrypt_port.o"}]}. |
| {post_hooks, [{compile, "sh build_port.sh"}]}. |