From 0455ce27823b37825b220b864cec56501089ddb2 Mon Sep 17 00:00:00 2001 From: Michael R Sweet Date: Sat, 19 Oct 2024 15:09:54 -0400 Subject: [PATCH] configure and pkg-config changes: - Revert default prefix to autoconf default (/usr/local) - Fix pkg-config libraries when just building static libraries --- CHANGES.md | 3 ++- config-scripts/cups-common.m4 | 1 + config-scripts/cups-directories.m4 | 4 +--- configure | 14 ++++++++++---- configure.ac | 6 ++++++ cups.pc.in | 3 +-- 6 files changed, 21 insertions(+), 10 deletions(-) diff --git a/CHANGES.md b/CHANGES.md index f2b9a26ad0..246a268c55 100644 --- a/CHANGES.md +++ b/CHANGES.md @@ -33,7 +33,8 @@ Changes in CUPS v2.5b1 (TBA) - Added localizations for deprecated IPP attributes/options (Issue #1020) - Added support for specifying permissions with the `cupsFileOpen` API. - Added new `cupsParseOptions2` API with "end" argument. -- Updated documents (Issue #984) +- Updated documentation (Issue #984) +- Updated the configure script to default to installing to /usr/local. - Updated CUPS to require TLS support - OpenSSL, GNUTLS and LibreSSL are supported. - Updated CUPS to require ZLIB. diff --git a/config-scripts/cups-common.m4 b/config-scripts/cups-common.m4 index e445230844..b42220906b 100644 --- a/config-scripts/cups-common.m4 +++ b/config-scripts/cups-common.m4 @@ -145,6 +145,7 @@ AC_CHECK_HEADER([iconv.h], [ AC_DEFINE([HAVE_ICONV_H], [1], [Have header?]) SAVELIBS="$SAVELIBS $LIBS" ]) + PKGCONFIG_LIBS_STATIC="$PKGCONFIG_LIBS_STATIC $LIBS" LIBS="$SAVELIBS" ]) diff --git a/config-scripts/cups-directories.m4 b/config-scripts/cups-directories.m4 index 069ee7bab1..4c57370e07 100644 --- a/config-scripts/cups-directories.m4 +++ b/config-scripts/cups-directories.m4 @@ -8,11 +8,9 @@ dnl dnl Licensed under Apache License v2.0. See the file "LICENSE" for more information. dnl -AC_PREFIX_DEFAULT(/) - dnl Fix "prefix" variable if it hasn't been specified... AS_IF([test "$prefix" = "NONE"], [ - prefix="/" + prefix="/usr/local" ]) dnl Fix "exec_prefix" variable if it hasn't been specified... diff --git a/configure b/configure index dfcd416c8b..b26b1b3153 100755 --- a/configure +++ b/configure @@ -647,7 +647,6 @@ ac_includes_default="\ #endif" ac_header_c_list= -ac_default_prefix=/ ac_subst_vars='LTLIBOBJS LIBOBJS UNINSTALL_LANGUAGES @@ -6177,6 +6176,7 @@ printf "%s\n" "#define HAVE_ICONV_H 1" >>confdefs.h fi + PKGCONFIG_LIBS_STATIC="$PKGCONFIG_LIBS_STATIC $LIBS" LIBS="$SAVELIBS" fi @@ -7018,12 +7018,10 @@ esac - - if test "$prefix" = "NONE" then : - prefix="/" + prefix="/usr/local" fi @@ -11851,6 +11849,14 @@ fi +if test x$enable_shared = xno +then : + + PKGCONFIG_LIBS="$PKGCONFIG_LIBS $PKGCONFIG_LIBS_STATIC" + PKGCONFIG_LIBS_STATIC="" + +fi + INSTALL_LANGUAGES="" UNINSTALL_LANGUAGES="" LANGFILES="" diff --git a/configure.ac b/configure.ac index 608c0499ed..fe2e252e4b 100644 --- a/configure.ac +++ b/configure.ac @@ -39,6 +39,12 @@ sinclude(config-scripts/cups-container.m4) sinclude(config-scripts/cups-startup.m4) sinclude(config-scripts/cups-defaults.m4) +dnl Add static libraries when not building shared libraries... +AS_IF([test x$enable_shared = xno], [ + PKGCONFIG_LIBS="$PKGCONFIG_LIBS $PKGCONFIG_LIBS_STATIC" + PKGCONFIG_LIBS_STATIC="" +]) + dnl See what languages are available and make sure we generate the localization dnl files as needed... INSTALL_LANGUAGES="" diff --git a/cups.pc.in b/cups.pc.in index 9781b8b326..56f17f8cff 100644 --- a/cups.pc.in +++ b/cups.pc.in @@ -24,6 +24,5 @@ Version: @CUPS_VERSION@ URL: https://openprinting.github.io/cups/ Cflags: @PKGCONFIG_CFLAGS@ Libs: @PKGCONFIG_LIBS@ - -Requires.private: @PKGCONFIG_REQUIRES@ Libs.private: @PKGCONFIG_LIBS_STATIC@ +Requires: @PKGCONFIG_REQUIRES@