Skip to content

Commit b2c3fc7

Browse files
committed
More win32 libuv build tweaks
1 parent f6d5c56 commit b2c3fc7

File tree

2 files changed

+8
-3
lines changed

2 files changed

+8
-3
lines changed

mk/platform.mk

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -84,6 +84,7 @@ ifdef CFG_UNIXY
8484
CFG_RUN_TARG=$(call CFG_RUN,$(CFG_BUILD_DIR)/$(1),$(2))
8585
CFG_RUN_TEST=$(call CFG_RUN,$(call CFG_TESTLIB,$(1)),\
8686
$(CFG_VALGRIND) $(1))
87+
CFG_LIBUV_LINK_FLAGS=-lpthread
8788

8889
ifdef CFG_ENABLE_MINGW_CROSS
8990
CFG_WINDOWSY := 1
@@ -123,6 +124,7 @@ ifdef CFG_WINDOWSY
123124
CFG_RUN=PATH="$(CFG_LDPATH):$(1)" $(2)
124125
CFG_RUN_TARG=$(call CFG_RUN,,$(2))
125126
CFG_RUN_TEST=$(call CFG_RUN,$(call CFG_TESTLIB,$(1)),$(1))
127+
CFG_LIBUV_LINK_FLAGS=-lWs2_32
126128

127129
ifndef CFG_ENABLE_MINGW_CROSS
128130
CFG_PATH_MUNGE := $(strip perl -i.bak -p \

mk/rt.mk

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,6 @@ RUNTIME_INCS := -I $(S)src/rt/isaac -I $(S)src/rt/uthash \
7070
RUNTIME_OBJS := $(RUNTIME_CS:.cpp=.o) $(RUNTIME_LL:.ll=.o) $(RUNTIME_S:.s=.o)
7171
RUNTIME_LIBS := $(S)src/rt/libuv/uv.a
7272

73-
7473
rt/%.o: rt/%.cpp $(MKFILES)
7574
@$(call E, compile: $@)
7675
$(Q)$(call CFG_COMPILE_C, $@, $(RUNTIME_INCS)) $<
@@ -96,10 +95,14 @@ rt/%.o: rt/%.ll $(MKFILES)
9695
rt/$(CFG_RUNTIME): $(RUNTIME_OBJS) $(MKFILES) $(RUNTIME_HDR) $(RUNTIME_DEF) $(RUNTIME_LIBS)
9796
@$(call E, link: $@)
9897
$(Q)$(call CFG_LINK_C,$@, $(RUNTIME_OBJS) \
99-
$(CFG_GCCISH_POST_LIB_FLAGS) $(RUNTIME_LIBS) -lpthread,$(RUNTIME_DEF))
98+
$(CFG_GCCISH_POST_LIB_FLAGS) $(RUNTIME_LIBS) \
99+
$(CFG_LIBUV_LINK_FLAGS),$(RUNTIME_DEF))
100100

101+
# FIXME: For some reason libuv's makefiles can't figure out the correct definition
102+
# of CC on the mingw I'm using, so we are explicitly using gcc. Also, we
103+
# have to list environment variables first on windows... mysterious
101104
$(S)src/rt/libuv/uv.a: $(S)src/rt/libuv/LIBUV_REVISION
102-
$(Q)$(MAKE) -C $(S)src/rt/libuv CFLAGS=\"-m32\" LDFLAGS=\"-m32\"
105+
$(Q)CFLAGS=\"-m32\" LDFLAGS=\"-m32\" CC=gcc $(MAKE) -C $(S)src/rt/libuv
103106
$(Q)mkdir -p rt/libuv
104107
$(Q)cp $(S)src/rt/libuv/uv.a rt/libuv/uv.a
105108

0 commit comments

Comments
 (0)