Skip to content
Browse files

Merge pull request #40 from yamt/netbsd

build fixes for netbsd
  • Loading branch information...
2 parents a3c5720 + 3e59df8 commit 5179c87dbdbca6b6eb98e1e77e68d72ccb071960 @yrashk yrashk committed Jul 8, 2012
Showing with 41 additions and 31 deletions.
  1. +33 −0 c_src/GNUmakefile
  2. +7 −31 c_src/Makefile
  3. +1 −0 rebar.config
View
33 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
View
38 c_src/Makefile
@@ -1,33 +1,9 @@
-LINUX=$(shell uname | grep Linux | wc -l | xargs echo)
-DEPS=../deps
+# a stub makefile for BSD make.
+# just redirect to GNU make, which is commonly available as "gmake".
-ifeq ($(LINUX),1)
-ZMQ_FLAGS=--with-pic
-else
-ZMQ_FLAGS=
-endif
+TARGETS=all clean distclean
-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
+.for T in ${TARGETS}
+${T}:
+ @gmake ${T}
+.endfor
View
1 rebar.config
@@ -3,6 +3,7 @@
{port_envs,
[{"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"},
+ {"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"}]}.
{pre_hooks,[{compile,"make -C c_src"},

0 comments on commit 5179c87

Please sign in to comment.
Something went wrong with that request. Please try again.