From 171c38f22438a3a2e088c2d6515587b074c19d3c Mon Sep 17 00:00:00 2001 From: Michael R Sweet Date: Mon, 29 Oct 2018 16:36:11 -0400 Subject: [PATCH] Add libcups component name, localization bundle support for iOS. --- Makefile | 9 +++++---- config-scripts/cups-common.m4 | 15 ++++++++++----- config-scripts/cups-defaults.m4 | 17 +++++++++++++---- configure | 32 +++++++++++++++++++++++++++----- xcode/config.h | 8 +++++--- 5 files changed, 60 insertions(+), 21 deletions(-) diff --git a/Makefile b/Makefile index 5ba0de332..df8d6c394 100644 --- a/Makefile +++ b/Makefile @@ -1,10 +1,11 @@ # # Top-level Makefile for CUPS. # -# Copyright 2007-2016 by Apple Inc. -# Copyright 1997-2007 by Easy Software Products, all rights reserved. +# Copyright © 2007-2018 by Apple Inc. +# Copyright © 1997-2007 by Easy Software Products, all rights reserved. # -# Licensed under Apache License v2.0. See the file "LICENSE" for more information. +# Licensed under Apache License v2.0. See the file "LICENSE" for more +# information. # include Makedefs @@ -14,7 +15,7 @@ include Makedefs # Directories to make... # -DIRS = cups test $(BUILDDIRS) +DIRS = cups $(BUILDDIRS) # diff --git a/config-scripts/cups-common.m4 b/config-scripts/cups-common.m4 index 0da303e8f..df1b1549a 100644 --- a/config-scripts/cups-common.m4 +++ b/config-scripts/cups-common.m4 @@ -1,8 +1,8 @@ dnl dnl Common configuration stuff for CUPS. dnl -dnl Copyright 2007-2018 by Apple Inc. -dnl Copyright 1997-2007 by Easy Software Products, all rights reserved. +dnl Copyright © 2007-2018 by Apple Inc. +dnl Copyright © 1997-2007 by Easy Software Products, all rights reserved. dnl dnl Licensed under Apache License v2.0. See the file "LICENSE" for more dnl information. @@ -433,16 +433,21 @@ COMPONENTS="all" AC_ARG_WITH(components, [ --with-components set components to build: - "all" (default) builds everything - - "core" builds libcups and ipptool], + - "core" builds libcups and ipptool + - "libcups" builds just libcups], COMPONENTS="$withval") case "$COMPONENTS" in all) - BUILDDIRS="filter backend berkeley cgi-bin monitor notifier ppdc scheduler systemv conf data desktop locale man doc examples templates" + BUILDDIRS="test filter backend berkeley cgi-bin monitor notifier ppdc scheduler systemv conf data desktop locale man doc examples templates" ;; core) - BUILDDIRS="data locale" + BUILDDIRS="test locale" + ;; + + libcups) + BUILDDIRS="locale" ;; *) diff --git a/config-scripts/cups-defaults.m4 b/config-scripts/cups-defaults.m4 index ab0322b1a..43f034d7b 100644 --- a/config-scripts/cups-defaults.m4 +++ b/config-scripts/cups-defaults.m4 @@ -20,7 +20,7 @@ AC_ARG_WITH(languages, [ --with-languages set installed languages, defau AC_SUBST(LANGUAGES) dnl macOS bundle-based localization support -AC_ARG_WITH(bundledir, [ --with-bundledir set macOS localization bundle directory ], +AC_ARG_WITH(bundledir, [ --with-bundledir set localization bundle directory ], CUPS_BUNDLEDIR="$withval",[ if test "x$host_os_name" = xdarwin -a $host_os_version -ge 100; then CUPS_BUNDLEDIR="/System/Library/Frameworks/ApplicationServices.framework/Versions/A/Frameworks/PrintCore.framework/Versions/A" @@ -32,12 +32,21 @@ AC_ARG_WITH(bundledir, [ --with-bundledir set macOS localization bundle AC_SUBST(CUPS_BUNDLEDIR) if test "x$CUPS_BUNDLEDIR" != x; then AC_DEFINE_UNQUOTED(CUPS_BUNDLEDIR, "$CUPS_BUNDLEDIR") +fi +AC_ARG_WITH(bundlelang, [ --with-bundlelang set localization bundle base language (English or en) ], + cups_bundlelang="$withval",[ if test $host_os_version -ge 190; then - CUPS_RESOURCEDIR="$CUPS_BUNDLEDIR/Resources/en.lproj" + cups_bundlelang="en" else - CUPS_RESOURCEDIR="$CUPS_BUNDLEDIR/Resources/English.lproj" - fi + cups_bundlelang="English" + fi]) +else + cups_bundlelang="" +fi + +if test "x$cups_bundlelang" != x -a "x$CUPS_BUNDLEDIR" != x; then + CUPS_RESOURCEDIR="$CUPS_BUNDLEDIR/Resources/$cups_bundlelang.lproj" else CUPS_RESOURCEDIR="" fi diff --git a/configure b/configure index 0ad647752..e2ae90f87 100755 --- a/configure +++ b/configure @@ -876,6 +876,7 @@ with_rcstop with_xinetd with_languages with_bundledir +with_bundlelang with_exe_file_perm with_config_file_perm with_cupsd_file_perm @@ -1571,6 +1572,7 @@ Optional Packages: --with-components set components to build: - "all" (default) builds everything - "core" builds libcups and ipptool + - "libcups" builds just libcups --with-privateinclude set path for private include files, default=none --with-lpdconfig set URI for LPD config file --with-smbconfig set URI for Samba config file @@ -1597,7 +1599,8 @@ Optional Packages: --with-rcstop set stop number for rc scripts --with-xinetd set path for xinetd config files --with-languages set installed languages, default=all - --with-bundledir set macOS localization bundle directory + --with-bundledir set localization bundle directory + --with-bundlelang set localization bundle base language (English or en) --with-exe-file-perm set default executable permissions value, default=0555 --with-config-file-perm set default ConfigFilePerm value, default=0640 --with-cupsd-file-perm set default cupsd permissions, default=0500 @@ -6104,11 +6107,15 @@ fi case "$COMPONENTS" in all) - BUILDDIRS="filter backend berkeley cgi-bin monitor notifier ppdc scheduler systemv conf data desktop locale man doc examples templates" + BUILDDIRS="test filter backend berkeley cgi-bin monitor notifier ppdc scheduler systemv conf data desktop locale man doc examples templates" ;; core) - BUILDDIRS="data locale" + BUILDDIRS="test locale" + ;; + + libcups) + BUILDDIRS="locale" ;; *) @@ -9496,12 +9503,27 @@ if test "x$CUPS_BUNDLEDIR" != x; then #define CUPS_BUNDLEDIR "$CUPS_BUNDLEDIR" _ACEOF +fi + + +# Check whether --with-bundlelang was given. +if test "${with_bundlelang+set}" = set; then : + withval=$with_bundlelang; cups_bundlelang="$withval" +else if test $host_os_version -ge 190; then - CUPS_RESOURCEDIR="$CUPS_BUNDLEDIR/Resources/en.lproj" + cups_bundlelang="en" else - CUPS_RESOURCEDIR="$CUPS_BUNDLEDIR/Resources/English.lproj" + cups_bundlelang="English" fi +fi + +else + cups_bundlelang="" +fi + +if test "x$cups_bundlelang" != x -a "x$CUPS_BUNDLEDIR" != x; then + CUPS_RESOURCEDIR="$CUPS_BUNDLEDIR/Resources/$cups_bundlelang.lproj" else CUPS_RESOURCEDIR="" fi diff --git a/xcode/config.h b/xcode/config.h index 458770de0..534445ea8 100644 --- a/xcode/config.h +++ b/xcode/config.h @@ -695,12 +695,14 @@ /* - * Location of macOS localization bundle, if any. + * Location of localization bundle, if any. */ -#if !TARGET_OS_IOS +#if TARGET_OS_IOS +# define CUPS_BUNDLEDIR "/System/Library/PrivateFrameworks/PrintKit.framework/Versions/A" +#else # define CUPS_BUNDLEDIR "/System/Library/Frameworks/ApplicationServices.framework/Versions/A/Frameworks/PrintCore.framework/Versions/A" -#endif /* !TARGET_OS_IOS */ +#endif /* TARGET_OS_IOS */ /* -- 2.39.2