- cmake: Before this patch a missing perl disabled the curl manual.
After this patch, it automatically picks up a pre-built hugehelp,
if present (= when building from a release tarball).
Follow-up to
0035ff45c59437db1a8ffe960b40905c8582b149 #16081
- autotools: Rework behavior when perl is missing. Before this patch
it caused a hard error when docs/manual/ca-embed were enabled.
Of these, docs were enabled by default. After this patch, doc
generation is automatically skipped, with a warning. Manual generation
falls back to using a pre-built hugehelp, or a stub if that's missing.
CA-embed is automatically skipped, with a warning.
Slight difference from cmake: When built with no perl and no pre-built
hugehelp, the manual is enabled, but the content is empty; with cmake
it's disabled proper.
Follow-up to
137aecfbf1e933e7228a4f62cc977eabffb2afbf #13514
Follow-up to
541321507e386744c3ea1200cc83cc98338e27d7 #12857
Also:
- GHA/distcheck: verify if the pre-built hugehelp makes it into curl.
- GHA/distcheck: streamline disabling perl with autotools.
- GHA/distcheck: `--disable-docs` no longer required to build without perl.
Passing it also implicitly disables the curl manual, which is
undesired in these tests.
- cmake: drop redundant `HAVE_MANUAL_TOOLS` interim variable.
- cmake: move two `set()` lines close to their counterparts.
Follow-up to
25119fbaaa76a182d4b08d64853d0a8db9181219 #18104
Closes #18118
make test-ci
make install
curl-install/bin/curl --disable --version
- curl-install/bin/curl --manual | wc -l
+ curl-install/bin/curl --manual | wc -l | grep -v '^ *0$'
popd
scripts/checksrc-all.pl
with:
name: 'release-tgz'
- - name: 'disable preinstalled perl'
- run: sudo mv "$(command -v perl)" "$(command -v perl)"-disabled
-
- name: 'build & install'
run: |
echo "::stop-commands::$(uuidgen)"
pushd curl-99.98.97
mkdir build
pushd build
- ../configure --prefix="$PWD"/curl-install --enable-werror --without-ssl --without-libpsl --disable-docs
+ ../configure --prefix="$PWD"/curl-install --enable-werror --without-ssl --without-libpsl ac_cv_path_PERL=
make
make install
curl-install/bin/curl --disable --version
- curl-install/bin/curl --manual | wc -l
+ curl-install/bin/curl --manual | wc -l | grep -v '^ *0$'
popd
verify-in-tree-autotools:
with:
name: 'release-tgz'
- - name: 'disable preinstalled perl'
- run: sudo mv "$(command -v perl)" "$(command -v perl)"-disabled
-
- name: 'build & install'
run: |
echo "::stop-commands::$(uuidgen)"
tar xvf curl-99.98.97.tar.gz
pushd curl-99.98.97
- ./configure --prefix="$PWD"/curl-install --enable-werror --without-ssl --without-libpsl --disable-docs
+ ./configure --prefix="$PWD"/curl-install --enable-werror --without-ssl --without-libpsl ac_cv_path_PERL=
make
make install
curl-install/bin/curl --disable --version
- curl-install/bin/curl --manual | wc -l
+ curl-install/bin/curl --manual | wc -l | grep -v '^ *0$'
verify-out-of-tree-cmake:
name: 'CM out-of-tree !perl'
cmake --install build
export LD_LIBRARY_PATH="$PWD/curl-install/lib:$LD_LIBRARY_PATH"
curl-install/bin/curl --disable --version
- curl-install/bin/curl --manual | wc -l
+ curl-install/bin/curl --manual | wc -l | grep -v '^ *0$'
verify-in-tree-cmake:
name: 'CM in-tree !perl'
cmake --install .
export LD_LIBRARY_PATH="$PWD/curl-install/lib:$LD_LIBRARY_PATH"
curl-install/bin/curl --disable --version
- curl-install/bin/curl --manual | wc -l
+ curl-install/bin/curl --manual | wc -l | grep -v '^ *0$'
missing-files:
name: 'missing files'
option(BUILD_MISC_DOCS "Build misc man pages (e.g. curl-config and mk-ca-bundle)" ON)
option(ENABLE_CURL_MANUAL "Build the man page for curl and enable its -M/--manual option" ON)
-if(ENABLE_CURL_MANUAL OR BUILD_LIBCURL_DOCS)
- if(PERL_FOUND)
- set(HAVE_MANUAL_TOOLS ON)
- endif()
- if(NOT HAVE_MANUAL_TOOLS)
- message(WARNING "Perl not found. Will not build manuals.")
- endif()
+if((ENABLE_CURL_MANUAL OR BUILD_LIBCURL_DOCS) AND NOT PERL_FOUND)
+ message(WARNING "Perl not found. Will not build manuals.")
endif()
# If we are on AIX, do the _ALL_SOURCE magic
set(CURL_BUILD_TESTING OFF)
endif()
-if(HAVE_MANUAL_TOOLS)
+if(PERL_FOUND)
set(CURL_MANPAGE "${PROJECT_BINARY_DIR}/docs/cmdline-opts/curl.1")
set(CURL_ASCIIPAGE "${PROJECT_BINARY_DIR}/docs/cmdline-opts/curl.txt")
add_subdirectory(docs)
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
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]),
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
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)
set(_curl_hfiles_gen "")
set(_curl_definitions "")
-if(ENABLE_CURL_MANUAL AND HAVE_MANUAL_TOOLS)
- list(APPEND _curl_definitions "USE_MANUAL")
- add_custom_command(OUTPUT "tool_hugehelp.c"
- COMMAND ${CMAKE_COMMAND} -E echo "#include \"tool_setup.h\"" > "tool_hugehelp.c"
- COMMAND ${CMAKE_COMMAND} -E echo "/* !checksrc! disable COPYRIGHT all */" >> "tool_hugehelp.c"
- COMMAND ${CMAKE_COMMAND} -E echo "/* !checksrc! disable INCLUDEDUP all */" >> "tool_hugehelp.c"
- COMMAND ${CMAKE_COMMAND} -E echo "/* !checksrc! disable LONGLINE all */" >> "tool_hugehelp.c"
- COMMAND ${CMAKE_COMMAND} -E echo "#ifndef HAVE_LIBZ" >> "tool_hugehelp.c"
- COMMAND "${PERL_EXECUTABLE}" "${CMAKE_CURRENT_SOURCE_DIR}/mkhelp.pl" < "${CURL_ASCIIPAGE}" >> "tool_hugehelp.c"
- COMMAND ${CMAKE_COMMAND} -E echo "#else" >> "tool_hugehelp.c"
- COMMAND "${PERL_EXECUTABLE}" "${CMAKE_CURRENT_SOURCE_DIR}/mkhelp.pl" -c < "${CURL_ASCIIPAGE}" >> "tool_hugehelp.c"
- COMMAND ${CMAKE_COMMAND} -E echo "#endif /* HAVE_LIBZ */" >> "tool_hugehelp.c"
- DEPENDS
- generate-curl.1
- "${CMAKE_CURRENT_SOURCE_DIR}/mkhelp.pl"
- "${CMAKE_CURRENT_SOURCE_DIR}/tool_hugehelp.h"
- "${CURL_ASCIIPAGE}"
- VERBATIM)
+if(ENABLE_CURL_MANUAL AND (PERL_FOUND OR EXISTS "${CMAKE_CURRENT_SOURCE_DIR}/tool_hugehelp.c"))
+ if(PERL_FOUND)
+ add_custom_command(OUTPUT "tool_hugehelp.c"
+ COMMAND ${CMAKE_COMMAND} -E echo "#include \"tool_setup.h\"" > "tool_hugehelp.c"
+ COMMAND ${CMAKE_COMMAND} -E echo "/* !checksrc! disable COPYRIGHT all */" >> "tool_hugehelp.c"
+ COMMAND ${CMAKE_COMMAND} -E echo "/* !checksrc! disable INCLUDEDUP all */" >> "tool_hugehelp.c"
+ COMMAND ${CMAKE_COMMAND} -E echo "/* !checksrc! disable LONGLINE all */" >> "tool_hugehelp.c"
+ COMMAND ${CMAKE_COMMAND} -E echo "#ifndef HAVE_LIBZ" >> "tool_hugehelp.c"
+ COMMAND "${PERL_EXECUTABLE}" "${CMAKE_CURRENT_SOURCE_DIR}/mkhelp.pl" < "${CURL_ASCIIPAGE}" >> "tool_hugehelp.c"
+ COMMAND ${CMAKE_COMMAND} -E echo "#else" >> "tool_hugehelp.c"
+ COMMAND "${PERL_EXECUTABLE}" "${CMAKE_CURRENT_SOURCE_DIR}/mkhelp.pl" -c < "${CURL_ASCIIPAGE}" >> "tool_hugehelp.c"
+ COMMAND ${CMAKE_COMMAND} -E echo "#endif /* HAVE_LIBZ */" >> "tool_hugehelp.c"
+ DEPENDS
+ generate-curl.1
+ "${CMAKE_CURRENT_SOURCE_DIR}/mkhelp.pl"
+ "${CMAKE_CURRENT_SOURCE_DIR}/tool_hugehelp.h"
+ "${CURL_ASCIIPAGE}"
+ VERBATIM)
+ else()
+ message(STATUS "Perl not found. Using the pre-built tool_hugehelp.c found in the source tree.")
+ endif()
list(APPEND _curl_cfiles_gen "tool_hugehelp.c")
list(APPEND _curl_hfiles_gen "tool_hugehelp.h")
+ list(APPEND _curl_definitions "USE_MANUAL")
endif()
if(CURL_CA_EMBED_SET)
if(PERL_FOUND)
- list(APPEND _curl_definitions "CURL_CA_EMBED")
add_custom_command(OUTPUT "tool_ca_embed.c"
COMMAND "${PERL_EXECUTABLE}" "${CMAKE_CURRENT_SOURCE_DIR}/mk-file-embed.pl" --var curl_ca_embed
< "${CURL_CA_EMBED}" > "tool_ca_embed.c"
"${CURL_CA_EMBED}"
VERBATIM)
list(APPEND _curl_cfiles_gen "tool_ca_embed.c")
+ list(APPEND _curl_definitions "CURL_CA_EMBED")
else()
message(WARNING "Perl not found. Will not embed the CA bundle.")
endif()
$(ASCIIPAGE):
cd $(top_builddir)/docs && $(MAKE)
+if PERL
if HAVE_LIBZ
# This generates the tool_hugehelp.c file in both uncompressed and
# compressed formats.
echo '#include "tool_setup.h"' >> $(HUGE); \
$(PERL) $(MKHELP) < $(ASCIIPAGE) >> $(HUGE) )
endif
+else # PERL
+$(HUGE):
+ $(HUGECMD)( \
+ if test ! -f "$(srcdir)/$(HUGE)"; then \
+ 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