Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

build fixes for netbsd #40

Merged
merged 2 commits into from Jul 8, 2012
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
33 changes: 33 additions & 0 deletions c_src/GNUmakefile
@@ -0,0 +1,33 @@
LINUX=$(shell uname | grep -E "(Linux|NetBSD)" | wc -l | xargs echo)
DEPS=../deps

ifeq ($(LINUX),1)
ZMQ_FLAGS=--with-pic
else
ZMQ_FLAGS=
endif

ifndef ZEROMQ_VERSION
ZEROMQ_VERSION=v2.1.11
endif

all: $(DEPS)/zeromq2/src/.libs/libzmq.a

clean:
if test -e $(DEPS)/zeromq2/Makefile; then \
cd $(DEPS)/zeromq2; make clean; \
else \
true; \
fi

distclean:
@rm -rf $(DEPS)

$(DEPS)/zeromq2:
@mkdir $(DEPS)
@git clone git://github.com/zeromq/zeromq2-x.git $(DEPS)/zeromq2
@echo $(ZEROMQ_VERSION)
@cd $(DEPS)/zeromq2 && git checkout $(ZEROMQ_VERSION)

$(DEPS)/zeromq2/src/.libs/libzmq.a: $(DEPS)/zeromq2
@cd $(DEPS)/zeromq2 && ./autogen.sh && ./configure $(ZMQ_FLAGS) && make
38 changes: 7 additions & 31 deletions c_src/Makefile
@@ -1,33 +1,9 @@
LINUX=$(shell uname | grep Linux | wc -l | xargs echo) # a stub makefile for BSD make.
DEPS=../deps # just redirect to GNU make, which is commonly available as "gmake".


ifeq ($(LINUX),1) TARGETS=all clean distclean
ZMQ_FLAGS=--with-pic
else
ZMQ_FLAGS=
endif


ifndef ZEROMQ_VERSION .for T in ${TARGETS}
ZEROMQ_VERSION=v2.1.11 ${T}:
endif @gmake ${T}

.endfor
all: $(DEPS)/zeromq2/src/.libs/libzmq.a

clean:
if test -e $(DEPS)/zeromq2/Makefile; then \
cd $(DEPS)/zeromq2; make clean; \
else \
true; \
fi

distclean:
@rm -rf $(DEPS)

$(DEPS)/zeromq2:
@mkdir $(DEPS)
@git clone git://github.com/zeromq/zeromq2-x.git $(DEPS)/zeromq2
@echo $(ZEROMQ_VERSION)
@cd $(DEPS)/zeromq2 && git checkout $(ZEROMQ_VERSION)

$(DEPS)/zeromq2/src/.libs/libzmq.a: $(DEPS)/zeromq2
@cd $(DEPS)/zeromq2 && ./autogen.sh && ./configure $(ZMQ_FLAGS) && make
1 change: 1 addition & 0 deletions rebar.config
Expand Up @@ -3,6 +3,7 @@
{port_envs, {port_envs,
[{"DRV_LDFLAGS","deps/zeromq2/src/.libs/libzmq.a -shared $ERL_LDFLAGS -lstdc++ -luuid"}, [{"DRV_LDFLAGS","deps/zeromq2/src/.libs/libzmq.a -shared $ERL_LDFLAGS -lstdc++ -luuid"},
{"darwin", "DRV_LDFLAGS", "deps/zeromq2/src/.libs/libzmq.a -bundle -flat_namespace -undefined suppress $ERL_LDFLAGS"}, {"darwin", "DRV_LDFLAGS", "deps/zeromq2/src/.libs/libzmq.a -bundle -flat_namespace -undefined suppress $ERL_LDFLAGS"},
{"netbsd", "DRV_LDFLAGS", "deps/zeromq2/src/.libs/libzmq.a -shared $ERL_LDFLAGS -lstdc++"},
{"DRV_CFLAGS","-Ic_src -Ideps/zeromq2/include -g -Wall -fPIC $ERL_CFLAGS"}]}. {"DRV_CFLAGS","-Ic_src -Ideps/zeromq2/include -g -Wall -fPIC $ERL_CFLAGS"}]}.


{pre_hooks,[{compile,"make -C c_src"}, {pre_hooks,[{compile,"make -C c_src"},
Expand Down