From 48254f9d061d4215881a19a2896eb8947c80e5a8 Mon Sep 17 00:00:00 2001 From: Viktor Szakats Date: Fri, 1 Aug 2025 02:56:47 +0200 Subject: [PATCH] autotools try fix 2 --- acinclude.m4 | 11 ++++++++--- configure.ac | 20 +++++++++----------- src/Makefile.am | 18 +++++++++++++++++- 3 files changed, 34 insertions(+), 15 deletions(-) diff --git a/acinclude.m4 b/acinclude.m4 index e10e4a01e0..105874fbe0 100644 --- a/acinclude.m4 +++ b/acinclude.m4 @@ -1284,9 +1284,14 @@ AS_HELP_STRING([--without-ca-embed], [Don't embed a default CA bundle in the cur 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" - AC_SUBST(CURL_CA_EMBED) - AC_MSG_RESULT([$want_ca_embed]) + if test -n "$PERL"; then + CURL_CA_EMBED="$want_ca_embed" + AC_SUBST(CURL_CA_EMBED) + AC_MSG_RESULT([$want_ca_embed]) + else + AC_MSG_RESULT([no]) + AC_MSG_WARN([perl was not found. Will not do CA embed.]) + fi else AC_MSG_RESULT([no]) fi diff --git a/configure.ac b/configure.ac index 7cce097794..83b3b25a89 100644 --- a/configure.ac +++ b/configure.ac @@ -280,6 +280,11 @@ AS_HELP_STRING([--with-rustls=PATH],[where to look for Rustls, PATH points to th fi ]) +AC_PATH_PROG(PERL, perl,, + $PATH:/usr/local/bin/perl:/usr/bin/:/usr/local/bin) +AC_SUBST(PERL) +AM_CONDITIONAL(PERL, test -n "$PERL") + TEST_NGHTTPX=nghttpx AC_ARG_WITH(test-nghttpx,dnl AS_HELP_STRING([--with-test-nghttpx=PATH],[where to find nghttpx for testing]), @@ -1056,7 +1061,10 @@ AS_HELP_STRING([--disable-docs],[Disable documentation]), AC_MSG_RESULT(yes) BUILD_DOCS=1 ) - +if test -z "$PERL" -a "x$BUILD_DOCS" != "x0"; then + AC_MSG_WARN([perl was not found. Will not build documentation.]) + BUILD_DOCS=0 +fi dnl ************************************************************ dnl disable C code generation support @@ -4218,16 +4226,6 @@ fi CURL_CHECK_NONBLOCKING_SOCKET -AC_PATH_PROG(PERL, perl,, - $PATH:/usr/local/bin/perl:/usr/bin/:/usr/local/bin) -AC_SUBST(PERL) - -if test "x$BUILD_DOCS" != "x0" -o "x$USE_MANUAL" != "x0" -o "x$CURL_CA_EMBED" != "x"; then - if test -z "$PERL"; then - AC_MSG_ERROR([perl was not found, needed for docs, manual and CA embed]) - fi -fi - dnl set variable for use in automakefile(s) AM_CONDITIONAL(BUILD_DOCS, test x"$BUILD_DOCS" = x1) diff --git a/src/Makefile.am b/src/Makefile.am index f4f977bcd5..fa8afabb50 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -132,14 +132,16 @@ HUGEIT_0 = @echo " HUGE " $@; HUGEIT_1 = HUGEIT_ = $(HUGEIT_0) -curl_CPPFLAGS = $(AM_CPPFLAGS) -DUSE_MANUAL +curl_CPPFLAGS = $(AM_CPPFLAGS) if USE_MANUAL # Here are the stuff to create a built-in manual +curl_CPPFLAGS += -DUSE_MANUAL $(ASCIIPAGE): cd $(top_builddir)/docs && $(MAKE) +if PERL if HAVE_LIBZ # This generates the tool_hugehelp.c file in both uncompressed and # compressed formats. @@ -162,6 +164,20 @@ $(HUGE): $(ASCIIPAGE) $(MKHELP) echo '#include "tool_setup.h"' >> $(HUGE); \ $(PERL) $(MKHELP) < $(ASCIIPAGE) >> $(HUGE) ) endif +else # PERL +$(HUGE): + (if [ -f "$(srcdir)/tool_hugehelp.c" ]; then \ + cp -p "$(srcdir)/tool_hugehelp.c" .; \ + else \ + echo '/* !checksrc! disable COPYRIGHT all */' > $(HUGE); \ + echo '#include "tool_hugehelp.h"' >> $(HUGE); \ + echo 'void hugehelp(void) {}' >> $(HUGE); \ + echo 'void showhelp(const char *trigger, const char *arg, const char *endarg)' >> $(HUGE); \ + echo '{' >> $(HUGE); \ + echo ' (void)trigger; (void)arg; (void)endarg;' >> $(HUGE); \ + echo '}' >> $(HUGE); \ + fi) +endif else # USE_MANUAL # built-in manual has been disabled, make a blank file