windows: fail early with a missing windres in autotools
`windres` is not always auto-detected by autotools when building for
Windows. When this happened, the build failed with a confusing error due
to the empty `RC` command:
```
/bin/bash ../libtool --tag=RC --mode=compile -I../include -DCURL_EMBED_MANIFEST -i curl.rc -o curl.o
[...]
Usage: /sandbox/curl/libtool [OPTION]... [MODE-ARG]...
Try 'libtool --help' for more information.
libtool: error: unrecognised option: '-I../include'
```
Improve this by verifying if `RC` is set, and fail with a clear error
otherwise.
Follow-up to 6de7322c03
Ref: https://curl.se/mail/lib-2022-10/0049.html
Reported-by: Thomas Glanzmann
Closes #9781
This commit is contained in:
parent
edae6c66c7
commit
3390ef0af0
@ -570,7 +570,13 @@ CURL_DARWIN_CFLAGS
|
|||||||
CURL_DARWIN_SYSTEMCONFIGURATION
|
CURL_DARWIN_SYSTEMCONFIGURATION
|
||||||
CURL_SUPPORTS_BUILTIN_AVAILABLE
|
CURL_SUPPORTS_BUILTIN_AVAILABLE
|
||||||
|
|
||||||
AM_CONDITIONAL([OS_WINDOWS], [test "$curl_cv_native_windows" = "yes"])
|
AM_CONDITIONAL([HAVE_WINDRES],
|
||||||
|
[test "$curl_cv_native_windows" = "yes" && test -n "${RC}"])
|
||||||
|
|
||||||
|
if test "$curl_cv_native_windows" = "yes"; then
|
||||||
|
AM_COND_IF([HAVE_WINDRES],,
|
||||||
|
[AC_MSG_ERROR([windres not found in PATH. Windows builds require windres. Cannot continue.])])
|
||||||
|
fi
|
||||||
|
|
||||||
dnl ************************************************************
|
dnl ************************************************************
|
||||||
dnl switch off particular protocols
|
dnl switch off particular protocols
|
||||||
|
|||||||
@ -109,7 +109,7 @@ endif
|
|||||||
if USE_CPPFLAG_CURL_STATICLIB
|
if USE_CPPFLAG_CURL_STATICLIB
|
||||||
libcurl_la_CPPFLAGS_EXTRA += -DCURL_STATICLIB
|
libcurl_la_CPPFLAGS_EXTRA += -DCURL_STATICLIB
|
||||||
else
|
else
|
||||||
if OS_WINDOWS
|
if HAVE_WINDRES
|
||||||
libcurl_la_SOURCES += $(LIB_RCFILES)
|
libcurl_la_SOURCES += $(LIB_RCFILES)
|
||||||
$(LIB_RCFILES): $(top_srcdir)/include/curl/curlver.h
|
$(LIB_RCFILES): $(top_srcdir)/include/curl/curlver.h
|
||||||
endif
|
endif
|
||||||
@ -154,7 +154,7 @@ tidy:
|
|||||||
optiontable:
|
optiontable:
|
||||||
perl optiontable.pl < $(top_srcdir)/include/curl/curl.h > easyoptions.c
|
perl optiontable.pl < $(top_srcdir)/include/curl/curl.h > easyoptions.c
|
||||||
|
|
||||||
if OS_WINDOWS
|
if HAVE_WINDRES
|
||||||
.rc.lo:
|
.rc.lo:
|
||||||
$(LIBTOOL) --tag=RC --mode=compile $(RC) -I$(top_srcdir)/include $(RCFLAGS) -i $< -o $@
|
$(LIBTOOL) --tag=RC --mode=compile $(RC) -I$(top_srcdir)/include $(RCFLAGS) -i $< -o $@
|
||||||
endif
|
endif
|
||||||
|
|||||||
@ -55,7 +55,7 @@ include Makefile.inc
|
|||||||
|
|
||||||
# CURL_FILES comes from Makefile.inc
|
# CURL_FILES comes from Makefile.inc
|
||||||
curl_SOURCES = $(CURL_FILES)
|
curl_SOURCES = $(CURL_FILES)
|
||||||
if OS_WINDOWS
|
if HAVE_WINDRES
|
||||||
curl_SOURCES += $(CURL_RCFILES)
|
curl_SOURCES += $(CURL_RCFILES)
|
||||||
$(CURL_RCFILES): tool_version.h
|
$(CURL_RCFILES): tool_version.h
|
||||||
endif
|
endif
|
||||||
@ -156,7 +156,7 @@ tidy:
|
|||||||
listhelp:
|
listhelp:
|
||||||
(cd $(top_srcdir)/docs/cmdline-opts && ./gen.pl listhelp *.d) > tool_listhelp.c
|
(cd $(top_srcdir)/docs/cmdline-opts && ./gen.pl listhelp *.d) > tool_listhelp.c
|
||||||
|
|
||||||
if OS_WINDOWS
|
if HAVE_WINDRES
|
||||||
.rc.o:
|
.rc.o:
|
||||||
$(RC) -I$(top_srcdir)/include -DCURL_EMBED_MANIFEST $(RCFLAGS) -i $< -o $@
|
$(RC) -I$(top_srcdir)/include -DCURL_EMBED_MANIFEST $(RCFLAGS) -i $< -o $@
|
||||||
endif
|
endif
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user