summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorViktor Szakats <commit@vsz.me>2022-09-18 12:05:35 +0000
committerViktor Szakats <commit@vsz.me>2022-09-18 12:05:35 +0000
commit6de7322c03d5b4d91576a7d9fc893e03cc9d1057 (patch)
treec53655c1b60dc9d686ada44d5fcefa32dec25530 /src
parente3a533f51b138b588ff04a2fb59f4b6539d82228 (diff)
downloadcurl-6de7322c03d5b4d91576a7d9fc893e03cc9d1057.tar.gz
windows: add .rc support to autotools builds
After this update autotools builds will compile and link `.rc` resources to Windows executables. Bringing this feature on par with CMake and Makefile.m32 builds. And also making it unnecessary to improvise these steps manually, while monkey patching build files, e.g. [0]. You can customize the resource compiler via the `RC` envvar, and its options via `RCFLAGS`. This harmless warning may appear throughout the build, even though the autotools manual documents [1] `RC` as a valid tag, and it fails when omitting one: `libtool: error: ignoring unknown tag RC` [0] https://github.com/curl/curl-for-win/blob/535f19060d4b708f72e75dd849409ce50baa1b84/curl-autotools.sh#L376-L382 [1] https://www.gnu.org/software/libtool/manual/html_node/Tags.html Closes #9521
Diffstat (limited to 'src')
-rw-r--r--src/Makefile.am12
1 files changed, 11 insertions, 1 deletions
diff --git a/src/Makefile.am b/src/Makefile.am
index 5d093da20..d9180b0b1 100644
--- a/src/Makefile.am
+++ b/src/Makefile.am
@@ -55,6 +55,10 @@ include Makefile.inc
# CURL_FILES comes from Makefile.inc
curl_SOURCES = $(CURL_FILES)
+if OS_WINDOWS
+curl_SOURCES += $(CURL_RCFILES)
+$(CURL_RCFILES): tool_version.h
+endif
# This might hold -Werror
CFLAGS += @CURL_CFLAG_EXTRAS@
@@ -75,7 +79,7 @@ libcurltool_la_CPPFLAGS = $(AM_CPPFLAGS) \
-DCURL_STATICLIB -DUNITTESTS
libcurltool_la_CFLAGS =
libcurltool_la_LDFLAGS = -static $(LINKFLAGS)
-libcurltool_la_SOURCES = $(curl_SOURCES)
+libcurltool_la_SOURCES = $(CURL_FILES)
endif
CLEANFILES = tool_hugehelp.c
@@ -151,3 +155,9 @@ tidy:
listhelp:
(cd $(top_srcdir)/docs/cmdline-opts && ./gen.pl listhelp *.d) > tool_listhelp.c
+
+if OS_WINDOWS
+# Warning is "normal": libtool: error: ignoring unknown tag RC
+.rc.o:
+ $(LIBTOOL) --tag=RC --mode=compile $(RC) -I$(top_srcdir)/include -DCURL_EMBED_MANIFEST $(RCFLAGS) -i $< -o $@
+endif