autotools: fix --with-ca-embed build rule

Add missing rule dependency on the user-specified CA bundle. This fixes
including it when using the curl distro tarball, and other cases.

Also:
- fix the internal name of the CA bundle to avoid nested quotes.
  It broke broke the rule dependency for the make tool.
- exclude the generated (empty) `tool_ca_embed.c` file from the distro
  tarball.
  Patch-by: Daniel Stenberg

Follow-up to 8a3740bc8e #14059
Reported-by: rampageX on github
Fixes #14879
Closes #14882
This commit is contained in:
Viktor Szakats 2024-09-12 15:08:05 +02:00
parent 79f0007c25
commit 28fa417bf0
No known key found for this signature in database
GPG Key ID: B5ABD165E2AEF201
2 changed files with 5 additions and 2 deletions

View File

@ -1360,7 +1360,7 @@ AS_HELP_STRING([--without-ca-embed], [Don't embed a default CA bundle]),
CURL_CA_EMBED=''
if test "x$want_ca_embed" != "xno" -a "x$want_ca_embed" != "xunset" -a -f "$want_ca_embed"; then
CURL_CA_EMBED='"'$want_ca_embed'"'
CURL_CA_EMBED="$want_ca_embed"
AC_SUBST(CURL_CA_EMBED)
AC_MSG_RESULT([$want_ca_embed])
else

View File

@ -140,7 +140,7 @@ CLEANFILES += $(CA_EMBED_CSOURCE)
if CURL_CA_EMBED_SET
AM_CPPFLAGS += -DCURL_CA_EMBED
MK_FILE_EMBED = $(top_srcdir)/src/mk-file-embed.pl
$(CA_EMBED_CSOURCE): $(MK_FILE_EMBED)
$(CA_EMBED_CSOURCE): $(MK_FILE_EMBED) $(CURL_CA_EMBED)
$(PERL) $(MK_FILE_EMBED) --var curl_ca_embed < $(CURL_CA_EMBED) > $(CA_EMBED_CSOURCE)
else
$(CA_EMBED_CSOURCE):
@ -174,3 +174,6 @@ if HAVE_WINDRES
.rc.o:
$(RC) -I$(top_srcdir)/include -DCURL_EMBED_MANIFEST $(RCFLAGS) -i $< -o $@
endif
dist-hook:
rm -f $(distdir)/$(CA_EMBED_CSOURCE)