From: Aaron Merey Date: Thu, 9 Oct 2025 00:31:20 +0000 (-0400) Subject: configure.ac: Add option --with-libarchive X-Git-Tag: elfutils-0.194~9 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=c5fa0eb29c1d8b818ee48796042f292c3a80e288;p=thirdparty%2Felfutils.git configure.ac: Add option --with-libarchive libarchive is required to build debuginfod server and optional for eu-srcfiles (it enables the --zip option). If neither debuginfod server nor eu-srcfiles --zip are needed, libarchive can be excluded from the build. Currently there is no way to exclude libarchive from the build if PKG_CHECK_MODULES finds it at configure time. While debuginfod server can be disabled with --disable-debuginfod, eu-srcfiles is unconditionally built with libarchive if it is found. Add configure option --with-libarchive so that this behavior can be overridden. --without-libarchive and --enable-debuginfod cannot be used together. https://sourceware.org/bugzilla/show_bug.cgi?id=33521 Signed-off-by: Aaron Merey --- diff --git a/configure.ac b/configure.ac index b8531aa7..84635cd0 100644 --- a/configure.ac +++ b/configure.ac @@ -892,7 +892,21 @@ fi PKG_CHECK_MODULES([libmicrohttpd],[libmicrohttpd >= 0.9.33],[],[enable_debuginfod=no]) PKG_CHECK_MODULES([oldlibmicrohttpd],[libmicrohttpd < 0.9.51],[old_libmicrohttpd=yes],[old_libmicrohttpd=no]) PKG_CHECK_MODULES([sqlite3],[sqlite3 >= 3.7.17],[have_sqlite3=yes],[have_sqlite3=no]) -PKG_CHECK_MODULES([libarchive],[libarchive >= 3.1.2],[have_libarchive=yes],[have_libarchive=no]) +# +# Check for libarchive unless its usage is disabled. +AC_ARG_WITH([libarchive], + [AS_HELP_STRING([--with-libarchive], + [use libarchive])], + [], [with_libarchive=auto]) +have_libarchive=no +AS_IF([test "x$with_libarchive" != "xno"], [ + PKG_CHECK_MODULES([libarchive], [libarchive >= 3.1.2], + [have_libarchive=yes], + [have_libarchive=no]) +]) +AS_IF([test "x$with_libarchive" = "xyes" -a "x$have_libarchive" != "xyes"], [ + AC_MSG_ERROR([--with-libarchive was given, but libarchive >= 3.1.2 not found]) +]) # # pronounce judgement on ability to build server, overridden by =yes/=no if test "x$enable_debuginfod" = "xno"; then