Skip to content

Commit 42a7296

Browse files
committed
refactor: move windres fix to hosts/mingw32.mk
The current fix applies only to one package and assumes a fixed HOST, neither is ideal. Propagate the fix instead.
1 parent 33f0931 commit 42a7296

File tree

6 files changed

+12
-3
lines changed

6 files changed

+12
-3
lines changed

depends/Makefile

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -231,6 +231,7 @@ $(host_prefix)/share/config.site : config.site.in $(host_prefix)/.stamp_$(final_
231231
-e 's|@STRIP@|$(host_STRIP)|' \
232232
-e 's|@OBJDUMP@|$(host_OBJDUMP)|' \
233233
-e 's|@DSYMUTIL@|$(host_DSYMUTIL)|' \
234+
-e 's|@WINDRES@|$(host_WINDRES)|' \
234235
-e 's|@build_os@|$(build_os)|' \
235236
-e 's|@host_os@|$(host_os)|' \
236237
-e 's|@CFLAGS@|$(strip $(host_CFLAGS) $(host_$(release_type)_CFLAGS))|' \

depends/config.site.in

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -131,6 +131,13 @@ if test "@host_os@" = darwin; then
131131
fi
132132
fi
133133

134+
if test "@host_os@" = mingw32; then
135+
if test -n "@WINDRES@"; then
136+
WINDRES="@WINDRES@"
137+
ac_cv_path_WINDRES="${WINDRES}"
138+
fi
139+
fi
140+
134141
if test -n "@debug@"; then
135142
enable_reduce_exports=no
136143
fi

depends/hosts/default.mk

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,5 +38,5 @@ host_$1 = $$($(host_arch)_$(host_os)_$1)
3838
host_$(release_type)_$1 = $$($(host_arch)_$(host_os)_$(release_type)_$1)
3939
endef
4040

41-
$(foreach tool,CC CXX AR RANLIB STRIP NM OBJCOPY OBJDUMP DSYMUTIL,$(eval $(call add_host_tool_func,$(tool))))
41+
$(foreach tool,CC CXX AR RANLIB STRIP NM OBJCOPY OBJDUMP DSYMUTIL WINDRES,$(eval $(call add_host_tool_func,$(tool))))
4242
$(foreach flags,CFLAGS CXXFLAGS CPPFLAGS LDFLAGS, $(eval $(call add_host_flags_func,$(flags))))

depends/hosts/mingw32.mk

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,8 @@ mingw32_NM = $(host_toolchain)gcc-nm
1111
mingw32_RANLIB = $(host_toolchain)gcc-ranlib
1212
endif
1313

14+
mingw32_WINDRES = $(host_toolchain)windres
15+
1416
mingw32_release_CFLAGS=-O2
1517
mingw32_release_CXXFLAGS=$(mingw32_release_CFLAGS)
1618

depends/packages/zeromq.mk

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,6 @@ define $(package)_set_vars
2121
$(package)_config_opts += -DENABLE_DRAFTS=OFF -DZMQ_BUILD_TESTS=OFF
2222
$(package)_cxxflags += -ffile-prefix-map=$($(package)_extract_dir)=/usr
2323
$(package)_config_opts_mingw32 += -DZMQ_WIN32_WINNT=0x0601 -DZMQ_HAVE_IPC=OFF
24-
$(package)_config_opts_mingw32 += -DCMAKE_RC_COMPILER=x86_64-w64-mingw32-windres
2524
endef
2625

2726
define $(package)_preprocess_cmds

src/Makefile.am

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1162,7 +1162,7 @@ clean-local:
11621162
-rm -rf *.dSYM test/*.dSYM bench/*.dSYM qt/*.dSYM qt/test/*.dSYM
11631163

11641164
.rc.o:
1165-
@test -f $(WINDRES) || (echo "windres $(WINDRES) not found, but is required to compile windows resource files"; exit 1)
1165+
@command -v $(WINDRES) || (echo "windres $(WINDRES) not found, but is required to compile windows resource files"; exit 1)
11661166
## FIXME: How to get the appropriate modulename_CPPFLAGS in here?
11671167
$(AM_V_GEN) $(WINDRES) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(CPPFLAGS) -DWINDRES_PREPROC -i $< -o $@
11681168

0 commit comments

Comments
 (0)