From 3c2cb8228e5a90fe93b938f55cfbfa538e313d40 Mon Sep 17 00:00:00 2001 From: Michael R Sweet Date: Thu, 21 Mar 2019 18:20:40 -0400 Subject: [PATCH] Clean up some build issues on certain platforms. --- config-scripts/cups-common.m4 | 8 +- config-scripts/cups-dnssd.m4 | 6 +- configure | 241 ++++++++++++++++++---------------- cups/dest.c | 6 +- cups/http-addr.c | 9 +- cups/tls-darwin.c | 212 +++++++++++++++--------------- cups/usersys.c | 27 ++-- cups/versioning.h | 4 +- test/ippeveprinter.c | 2 +- xcode/config.h | 30 ++--- 10 files changed, 283 insertions(+), 262 deletions(-) diff --git a/config-scripts/cups-common.m4 b/config-scripts/cups-common.m4 index 6a457b508..665770544 100644 --- a/config-scripts/cups-common.m4 +++ b/config-scripts/cups-common.m4 @@ -339,14 +339,18 @@ case $host_os_name in darwin*) BACKLIBS="$BACKLIBS -framework IOKit" SERVERLIBS="$SERVERLIBS -framework IOKit -weak_framework ApplicationServices" - LIBS="-framework SystemConfiguration -framework CoreFoundation -framework Security $LIBS" + LIBS="-framework CoreFoundation -framework Security $LIBS" dnl Check for framework headers... AC_CHECK_HEADER(ApplicationServices/ApplicationServices.h,AC_DEFINE(HAVE_APPLICATIONSERVICES_H)) AC_CHECK_HEADER(CoreFoundation/CoreFoundation.h,AC_DEFINE(HAVE_COREFOUNDATION_H)) dnl Check for dynamic store function... - AC_CHECK_FUNCS(SCDynamicStoreCopyComputerName) + SAVELIBS="$LIBS" + LIBS="-framework SystemConfiguration $LIBS" + AC_CHECK_FUNCS(SCDynamicStoreCopyComputerName,[ + AC_DEFINE(HAVE_SCDYNAMICSTORECOPYCOMPUTERNAME)],[ + LIBS="$SAVELIBS"]) dnl Check for the new membership functions in MacOSX 10.4... AC_CHECK_HEADER(membership.h,AC_DEFINE(HAVE_MEMBERSHIP_H)) diff --git a/config-scripts/cups-dnssd.m4 b/config-scripts/cups-dnssd.m4 index 71f9f21eb..daa398fd7 100644 --- a/config-scripts/cups-dnssd.m4 +++ b/config-scripts/cups-dnssd.m4 @@ -1,9 +1,10 @@ dnl dnl DNS Service Discovery (aka Bonjour) stuff for CUPS. dnl -dnl Copyright 2007-2017 by Apple Inc. +dnl Copyright © 2007-2019 by Apple Inc. dnl -dnl Licensed under Apache License v2.0. See the file "LICENSE" for more information. +dnl Licensed under Apache License v2.0. See the file "LICENSE" for more +dnl information. dnl AC_ARG_ENABLE(avahi, [ --disable-avahi disable DNS Service Discovery support using Avahi]) @@ -41,7 +42,6 @@ if test "x$DNSSD_BACKEND" = x -a x$enable_dnssd != xno; then darwin*) # Darwin and macOS... AC_DEFINE(HAVE_DNSSD) - DNSSDLIBS="-framework CoreFoundation -framework SystemConfiguration" DNSSD_BACKEND="dnssd" IPPFIND_BIN="ippfind" IPPFIND_MAN="ippfind.\$(MAN1EXT)" diff --git a/configure b/configure index ced6641e9..e5e5a882d 100755 --- a/configure +++ b/configure @@ -1,13 +1,11 @@ #! /bin/sh # Guess values for system-dependent variables and create Makefiles. -# Generated by GNU Autoconf 2.68 for CUPS 2.3b7. +# Generated by GNU Autoconf 2.69 for CUPS 2.3b7. # # Report bugs to . # # -# Copyright (C) 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001, -# 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010 Free Software -# Foundation, Inc. +# Copyright (C) 1992-1996, 1998-2012 Free Software Foundation, Inc. # # # This configure script is free software; the Free Software Foundation @@ -136,6 +134,31 @@ export LANGUAGE # CDPATH. (unset CDPATH) >/dev/null 2>&1 && unset CDPATH +# Use a proper internal environment variable to ensure we don't fall + # into an infinite loop, continuously re-executing ourselves. + if test x"${_as_can_reexec}" != xno && test "x$CONFIG_SHELL" != x; then + _as_can_reexec=no; export _as_can_reexec; + # We cannot yet assume a decent shell, so we have to provide a +# neutralization value for shells without unset; and this also +# works around shells that cannot unset nonexistent variables. +# Preserve -v and -x to the replacement shell. +BASH_ENV=/dev/null +ENV=/dev/null +(unset BASH_ENV) >/dev/null 2>&1 && unset BASH_ENV ENV +case $- in # (((( + *v*x* | *x*v* ) as_opts=-vx ;; + *v* ) as_opts=-v ;; + *x* ) as_opts=-x ;; + * ) as_opts= ;; +esac +exec $CONFIG_SHELL $as_opts "$as_myself" ${1+"$@"} +# Admittedly, this is quite paranoid, since all the known shells bail +# out after a failed `exec'. +$as_echo "$0: could not re-execute with $CONFIG_SHELL" >&2 +as_fn_exit 255 + fi + # We don't want this to propagate to other subprocesses. + { _as_can_reexec=; unset _as_can_reexec;} if test "x$CONFIG_SHELL" = x; then as_bourne_compatible="if test -n \"\${ZSH_VERSION+set}\" && (emulate sh) >/dev/null 2>&1; then : emulate sh @@ -169,7 +192,8 @@ if ( set x; as_fn_ret_success y && test x = \"\$1\" ); then : else exitcode=1; echo positional parameters were not saved. fi -test x\$exitcode = x0 || exit 1" +test x\$exitcode = x0 || exit 1 +test -x / || exit 1" as_suggested=" as_lineno_1=";as_suggested=$as_suggested$LINENO;as_suggested=$as_suggested" as_lineno_1a=\$LINENO as_lineno_2=";as_suggested=$as_suggested$LINENO;as_suggested=$as_suggested" as_lineno_2a=\$LINENO eval 'test \"x\$as_lineno_1'\$as_run'\" != \"x\$as_lineno_2'\$as_run'\" && @@ -214,21 +238,25 @@ IFS=$as_save_IFS if test "x$CONFIG_SHELL" != x; then : - # We cannot yet assume a decent shell, so we have to provide a - # neutralization value for shells without unset; and this also - # works around shells that cannot unset nonexistent variables. - # Preserve -v and -x to the replacement shell. - BASH_ENV=/dev/null - ENV=/dev/null - (unset BASH_ENV) >/dev/null 2>&1 && unset BASH_ENV ENV - export CONFIG_SHELL - case $- in # (((( - *v*x* | *x*v* ) as_opts=-vx ;; - *v* ) as_opts=-v ;; - *x* ) as_opts=-x ;; - * ) as_opts= ;; - esac - exec "$CONFIG_SHELL" $as_opts "$as_myself" ${1+"$@"} + export CONFIG_SHELL + # We cannot yet assume a decent shell, so we have to provide a +# neutralization value for shells without unset; and this also +# works around shells that cannot unset nonexistent variables. +# Preserve -v and -x to the replacement shell. +BASH_ENV=/dev/null +ENV=/dev/null +(unset BASH_ENV) >/dev/null 2>&1 && unset BASH_ENV ENV +case $- in # (((( + *v*x* | *x*v* ) as_opts=-vx ;; + *v* ) as_opts=-v ;; + *x* ) as_opts=-x ;; + * ) as_opts= ;; +esac +exec $CONFIG_SHELL $as_opts "$as_myself" ${1+"$@"} +# Admittedly, this is quite paranoid, since all the known shells bail +# out after a failed `exec'. +$as_echo "$0: could not re-execute with $CONFIG_SHELL" >&2 +exit 255 fi if test x$as_have_required = xno; then : @@ -331,6 +359,14 @@ $as_echo X"$as_dir" | } # as_fn_mkdir_p + +# as_fn_executable_p FILE +# ----------------------- +# Test if FILE is an executable regular file. +as_fn_executable_p () +{ + test -f "$1" && test -x "$1" +} # as_fn_executable_p # as_fn_append VAR VALUE # ---------------------- # Append the text in VALUE to the end of the definition contained in VAR. Take @@ -452,6 +488,10 @@ as_cr_alnum=$as_cr_Letters$as_cr_digits chmod +x "$as_me.lineno" || { $as_echo "$as_me: error: cannot create $as_me.lineno; rerun with a POSIX shell" >&2; as_fn_exit 1; } + # If we had to re-execute with $CONFIG_SHELL, we're ensured to have + # already done that, so ensure we don't try to do so again and fall + # in an infinite loop. This has already happened in practice. + _as_can_reexec=no; export _as_can_reexec # Don't try to exec as it changes $[0], causing all sort of problems # (the dirname of $[0] is not the place where we might find the # original and so on. Autoconf is especially sensitive to this). @@ -486,16 +526,16 @@ if (echo >conf$$.file) 2>/dev/null; then # ... but there are two gotchas: # 1) On MSYS, both `ln -s file dir' and `ln file dir' fail. # 2) DJGPP < 2.04 has no symlinks; `ln -s' creates a wrapper executable. - # In both cases, we have to default to `cp -p'. + # In both cases, we have to default to `cp -pR'. ln -s conf$$.file conf$$.dir 2>/dev/null && test ! -f conf$$.exe || - as_ln_s='cp -p' + as_ln_s='cp -pR' elif ln conf$$.file conf$$ 2>/dev/null; then as_ln_s=ln else - as_ln_s='cp -p' + as_ln_s='cp -pR' fi else - as_ln_s='cp -p' + as_ln_s='cp -pR' fi rm -f conf$$ conf$$.exe conf$$.dir/conf$$.file conf$$.file rmdir conf$$.dir 2>/dev/null @@ -507,28 +547,8 @@ else as_mkdir_p=false fi -if test -x / >/dev/null 2>&1; then - as_test_x='test -x' -else - if ls -dL / >/dev/null 2>&1; then - as_ls_L_option=L - else - as_ls_L_option= - fi - as_test_x=' - eval sh -c '\'' - if test -d "$1"; then - test -d "$1/."; - else - case $1 in #( - -*)set "./$1";; - esac; - case `ls -ld'$as_ls_L_option' "$1" 2>/dev/null` in #(( - ???[sx]*):;;*)false;;esac;fi - '\'' sh - ' -fi -as_executable_p=$as_test_x +as_test_x='test -x' +as_executable_p=as_fn_executable_p # Sed expression to map a string onto a valid CPP name. as_tr_cpp="eval sed 'y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g'" @@ -1372,8 +1392,6 @@ target=$target_alias if test "x$host_alias" != x; then if test "x$build_alias" = x; then cross_compiling=maybe - $as_echo "$as_me: WARNING: if you wanted to set the --build type, don't use --host. - If a cross compiler is detected then cross compile mode will be used" >&2 elif test "x$build_alias" != "x$host_alias"; then cross_compiling=yes fi @@ -1706,9 +1724,9 @@ test -n "$ac_init_help" && exit $ac_status if $ac_init_version; then cat <<\_ACEOF CUPS configure 2.3b7 -generated by GNU Autoconf 2.68 +generated by GNU Autoconf 2.69 -Copyright (C) 2010 Free Software Foundation, Inc. +Copyright (C) 2012 Free Software Foundation, Inc. This configure script is free software; the Free Software Foundation gives unlimited permission to copy, distribute and modify it. _ACEOF @@ -1859,7 +1877,7 @@ $as_echo "$ac_try_echo"; } >&5 test ! -s conftest.err } && test -s conftest$ac_exeext && { test "$cross_compiling" = yes || - $as_test_x conftest$ac_exeext + test -x conftest$ac_exeext }; then : ac_retval=0 else @@ -2170,7 +2188,7 @@ This file contains any messages produced by compilers while running configure, to aid debugging if configure makes a mistake. It was created by CUPS $as_me 2.3b7, which was -generated by GNU Autoconf 2.68. Invocation command line was +generated by GNU Autoconf 2.69. Invocation command line was $ $0 $@ @@ -2656,7 +2674,7 @@ do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do - if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_path_CODE_SIGN="$as_dir/$ac_word$ac_exec_ext" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 @@ -2732,7 +2750,7 @@ do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do - if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_AWK="$ac_prog" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 @@ -2780,7 +2798,7 @@ do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do - if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_CC="$ac_tool_prefix$ac_prog" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 @@ -2824,7 +2842,7 @@ do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do - if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_CC="$ac_prog" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 @@ -3268,8 +3286,7 @@ cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include #include -#include -#include +struct stat; /* Most of the following tests are stolen from RCS 5.7's src/conf.sh. */ struct buf { int x; }; FILE * (*rcsopen) (struct buf *, struct stat *, int); @@ -3519,7 +3536,7 @@ do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do - if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_CXX="$ac_tool_prefix$ac_prog" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 @@ -3563,7 +3580,7 @@ do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do - if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_CXX="$ac_prog" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 @@ -3765,7 +3782,7 @@ do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do - if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_RANLIB="${ac_tool_prefix}ranlib" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 @@ -3805,7 +3822,7 @@ do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do - if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_RANLIB="ranlib" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 @@ -3858,7 +3875,7 @@ do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do - if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_path_AR="$as_dir/$ac_word$ac_exec_ext" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 @@ -3898,7 +3915,7 @@ do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do - if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_path_CHMOD="$as_dir/$ac_word$ac_exec_ext" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 @@ -3938,7 +3955,7 @@ do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do - if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_path_GZIP="$as_dir/$ac_word$ac_exec_ext" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 @@ -3978,7 +3995,7 @@ do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do - if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_path_LD="$as_dir/$ac_word$ac_exec_ext" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 @@ -4018,7 +4035,7 @@ do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do - if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_path_LN="$as_dir/$ac_word$ac_exec_ext" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 @@ -4058,7 +4075,7 @@ do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do - if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_path_MKDIR="$as_dir/$ac_word$ac_exec_ext" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 @@ -4098,7 +4115,7 @@ do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do - if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_path_MV="$as_dir/$ac_word$ac_exec_ext" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 @@ -4138,7 +4155,7 @@ do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do - if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_path_RM="$as_dir/$ac_word$ac_exec_ext" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 @@ -4178,7 +4195,7 @@ do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do - if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_path_RMDIR="$as_dir/$ac_word$ac_exec_ext" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 @@ -4218,7 +4235,7 @@ do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do - if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_path_SED="$as_dir/$ac_word$ac_exec_ext" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 @@ -4258,7 +4275,7 @@ do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do - if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_path_XDGOPEN="$as_dir/$ac_word$ac_exec_ext" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 @@ -4334,7 +4351,7 @@ do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do - if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_path_PKGCONFIG="$as_dir/$ac_word$ac_exec_ext" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 @@ -4377,7 +4394,7 @@ do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do - if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_path_ac_pt_PKGCONFIG="$as_dir/$ac_word$ac_exec_ext" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 @@ -4787,7 +4804,7 @@ do for ac_prog in grep ggrep; do for ac_exec_ext in '' $ac_executable_extensions; do ac_path_GREP="$as_dir/$ac_prog$ac_exec_ext" - { test -f "$ac_path_GREP" && $as_test_x "$ac_path_GREP"; } || continue + as_fn_executable_p "$ac_path_GREP" || continue # Check for GNU ac_path_GREP and select it if it is found. # Check for GNU $ac_path_GREP case `"$ac_path_GREP" --version 2>&1` in @@ -4853,7 +4870,7 @@ do for ac_prog in egrep; do for ac_exec_ext in '' $ac_executable_extensions; do ac_path_EGREP="$as_dir/$ac_prog$ac_exec_ext" - { test -f "$ac_path_EGREP" && $as_test_x "$ac_path_EGREP"; } || continue + as_fn_executable_p "$ac_path_EGREP" || continue # Check for GNU ac_path_EGREP and select it if it is found. # Check for GNU $ac_path_EGREP case `"$ac_path_EGREP" --version 2>&1` in @@ -5832,7 +5849,7 @@ case $host_os_name in darwin*) BACKLIBS="$BACKLIBS -framework IOKit" SERVERLIBS="$SERVERLIBS -framework IOKit -weak_framework ApplicationServices" - LIBS="-framework SystemConfiguration -framework CoreFoundation -framework Security $LIBS" + LIBS="-framework CoreFoundation -framework Security $LIBS" ac_fn_c_check_header_mongrel "$LINENO" "ApplicationServices/ApplicationServices.h" "ac_cv_header_ApplicationServices_ApplicationServices_h" "$ac_includes_default" if test "x$ac_cv_header_ApplicationServices_ApplicationServices_h" = xyes; then : @@ -5849,7 +5866,9 @@ fi - for ac_func in SCDynamicStoreCopyComputerName + SAVELIBS="$LIBS" + LIBS="-framework SystemConfiguration $LIBS" + for ac_func in SCDynamicStoreCopyComputerName do : ac_fn_c_check_func "$LINENO" "SCDynamicStoreCopyComputerName" "ac_cv_func_SCDynamicStoreCopyComputerName" if test "x$ac_cv_func_SCDynamicStoreCopyComputerName" = xyes; then : @@ -5857,6 +5876,11 @@ if test "x$ac_cv_func_SCDynamicStoreCopyComputerName" = xyes; then : #define HAVE_SCDYNAMICSTORECOPYCOMPUTERNAME 1 _ACEOF + $as_echo "#define HAVE_SCDYNAMICSTORECOPYCOMPUTERNAME 1" >>confdefs.h + +else + + LIBS="$SAVELIBS" fi done @@ -7699,7 +7723,7 @@ do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do - if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_path_KRB5CONFIG="$as_dir/$ac_word$ac_exec_ext" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 @@ -7742,7 +7766,7 @@ do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do - if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_path_ac_pt_KRB5CONFIG="$as_dir/$ac_word$ac_exec_ext" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 @@ -8248,7 +8272,7 @@ do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do - if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_path_LIBGNUTLSCONFIG="$as_dir/$ac_word$ac_exec_ext" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 @@ -8291,7 +8315,7 @@ do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do - if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_path_ac_pt_LIBGNUTLSCONFIG="$as_dir/$ac_word$ac_exec_ext" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 @@ -8862,6 +8886,8 @@ _ACEOF esac rm -rf conftest* fi + + fi @@ -8980,7 +9006,6 @@ if test "x$ac_cv_header_dns_sd_h" = xyes; then : # Darwin and macOS... $as_echo "#define HAVE_DNSSD 1" >>confdefs.h - DNSSDLIBS="-framework CoreFoundation -framework SystemConfiguration" DNSSD_BACKEND="dnssd" IPPFIND_BIN="ippfind" IPPFIND_MAN="ippfind.\$(MAN1EXT)" @@ -10329,16 +10354,16 @@ if (echo >conf$$.file) 2>/dev/null; then # ... but there are two gotchas: # 1) On MSYS, both `ln -s file dir' and `ln file dir' fail. # 2) DJGPP < 2.04 has no symlinks; `ln -s' creates a wrapper executable. - # In both cases, we have to default to `cp -p'. + # In both cases, we have to default to `cp -pR'. ln -s conf$$.file conf$$.dir 2>/dev/null && test ! -f conf$$.exe || - as_ln_s='cp -p' + as_ln_s='cp -pR' elif ln conf$$.file conf$$ 2>/dev/null; then as_ln_s=ln else - as_ln_s='cp -p' + as_ln_s='cp -pR' fi else - as_ln_s='cp -p' + as_ln_s='cp -pR' fi rm -f conf$$ conf$$.exe conf$$.dir/conf$$.file conf$$.file rmdir conf$$.dir 2>/dev/null @@ -10398,28 +10423,16 @@ else as_mkdir_p=false fi -if test -x / >/dev/null 2>&1; then - as_test_x='test -x' -else - if ls -dL / >/dev/null 2>&1; then - as_ls_L_option=L - else - as_ls_L_option= - fi - as_test_x=' - eval sh -c '\'' - if test -d "$1"; then - test -d "$1/."; - else - case $1 in #( - -*)set "./$1";; - esac; - case `ls -ld'$as_ls_L_option' "$1" 2>/dev/null` in #(( - ???[sx]*):;;*)false;;esac;fi - '\'' sh - ' -fi -as_executable_p=$as_test_x + +# as_fn_executable_p FILE +# ----------------------- +# Test if FILE is an executable regular file. +as_fn_executable_p () +{ + test -f "$1" && test -x "$1" +} # as_fn_executable_p +as_test_x='test -x' +as_executable_p=as_fn_executable_p # Sed expression to map a string onto a valid CPP name. as_tr_cpp="eval sed 'y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g'" @@ -10441,7 +10454,7 @@ cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 # values after options handling. ac_log=" This file was extended by CUPS $as_me 2.3b7, which was -generated by GNU Autoconf 2.68. Invocation command line was +generated by GNU Autoconf 2.69. Invocation command line was CONFIG_FILES = $CONFIG_FILES CONFIG_HEADERS = $CONFIG_HEADERS @@ -10504,10 +10517,10 @@ cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 ac_cs_config="`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`" ac_cs_version="\\ CUPS config.status 2.3b7 -configured by $0, generated by GNU Autoconf 2.68, +configured by $0, generated by GNU Autoconf 2.69, with options \\"\$ac_cs_config\\" -Copyright (C) 2010 Free Software Foundation, Inc. +Copyright (C) 2012 Free Software Foundation, Inc. This config.status script is free software; the Free Software Foundation gives unlimited permission to copy, distribute and modify it." @@ -10596,7 +10609,7 @@ fi _ACEOF cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 if \$ac_cs_recheck; then - set X '$SHELL' '$0' $ac_configure_args \$ac_configure_extra_args --no-create --no-recursion + set X $SHELL '$0' $ac_configure_args \$ac_configure_extra_args --no-create --no-recursion shift \$as_echo "running CONFIG_SHELL=$SHELL \$*" >&6 CONFIG_SHELL='$SHELL' diff --git a/cups/dest.c b/cups/dest.c index 9b7ccbd33..17d96fe4a 100644 --- a/cups/dest.c +++ b/cups/dest.c @@ -1,7 +1,7 @@ /* * User-defined destination (and option) support for CUPS. * - * Copyright © 2007-2018 by Apple Inc. + * Copyright © 2007-2019 by Apple Inc. * Copyright © 1997-2007 by Easy Software Products. * * Licensed under Apache License v2.0. See the file "LICENSE" for more @@ -44,10 +44,10 @@ */ #ifdef __APPLE__ -# if !TARGET_OS_IOS +# if HAVE_SCDYNAMICSTORECOPYCOMPUTERNAME # include # define _CUPS_LOCATION_DEFAULTS 1 -# endif /* !TARGET_OS_IOS */ +# endif /* HAVE_SCDYNAMICSTORECOPYCOMPUTERNAME */ # define kCUPSPrintingPrefs CFSTR("org.cups.PrintingPrefs") # define kDefaultPaperIDKey CFSTR("DefaultPaperID") # define kLastUsedPrintersKey CFSTR("LastUsedPrinters") diff --git a/cups/http-addr.c b/cups/http-addr.c index 677c7a682..86749c848 100644 --- a/cups/http-addr.c +++ b/cups/http-addr.c @@ -1,10 +1,11 @@ /* * HTTP address routines for CUPS. * - * Copyright 2007-2014 by Apple Inc. + * Copyright 2007-2019 by Apple Inc. * Copyright 1997-2006 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. */ /* @@ -19,7 +20,9 @@ #endif /* HAVE_RESOLV_H */ #ifdef __APPLE__ # include -# include +# ifdef HAVE_SCDYNAMICSTORECOPYCOMPUTERNAME +# include +# endif /* HAVE_SCDYNAMICSTORECOPYCOMPUTERNAME */ #endif /* __APPLE__ */ diff --git a/cups/tls-darwin.c b/cups/tls-darwin.c index 73447da7f..cec08f53f 100644 --- a/cups/tls-darwin.c +++ b/cups/tls-darwin.c @@ -105,7 +105,107 @@ cupsMakeServerCredentials( const char **alt_names, /* I - Subject Alternate Names */ time_t expiration_date) /* I - Expiration date */ { -#if TARGET_OS_IOS +#if TARGET_OS_OSX + int pid, /* Process ID of command */ + status, /* Status of command */ + i; /* Looping var */ + char command[1024], /* Command */ + *argv[5], /* Command-line arguments */ + *envp[1000], /* Environment variables */ + days[32], /* CERTTOOL_EXPIRATION_DAYS env var */ + keychain[1024], /* Keychain argument */ + infofile[1024], /* Type-in information for cert */ + filename[1024]; /* Default keychain path */ + cups_file_t *fp; /* Seed/info file */ + + + DEBUG_printf(("cupsMakeServerCredentials(path=\"%s\", common_name=\"%s\", num_alt_names=%d, alt_names=%p, expiration_date=%d)", path, common_name, num_alt_names, (void *)alt_names, (int)expiration_date)); + + (void)num_alt_names; + (void)alt_names; + + if (!path) + path = http_cdsa_default_path(filename, sizeof(filename)); + + /* + * Run the "certtool" command to generate a self-signed certificate... + */ + + if (!cupsFileFind("certtool", getenv("PATH"), 1, command, sizeof(command))) + return (-1); + + /* + * Create a file with the certificate information fields... + * + * Note: This assumes that the default questions are asked by the certtool + * command... + */ + + if ((fp = cupsTempFile2(infofile, sizeof(infofile))) == NULL) + return (-1); + + cupsFilePrintf(fp, + "CUPS Self-Signed Certificate\n" + /* Enter key and certificate label */ + "r\n" /* Generate RSA key pair */ + "2048\n" /* 2048 bit encryption key */ + "y\n" /* OK (y = yes) */ + "b\n" /* Usage (b=signing/encryption) */ + "2\n" /* Sign with SHA256 */ + "y\n" /* OK (y = yes) */ + "%s\n" /* Common name */ + "\n" /* Country (default) */ + "\n" /* Organization (default) */ + "\n" /* Organizational unit (default) */ + "\n" /* State/Province (default) */ + "\n" /* Email address */ + "y\n", /* OK (y = yes) */ + common_name); + cupsFileClose(fp); + + snprintf(keychain, sizeof(keychain), "k=%s", path); + + argv[0] = "certtool"; + argv[1] = "c"; + argv[2] = keychain; + argv[3] = NULL; + + snprintf(days, sizeof(days), "CERTTOOL_EXPIRATION_DAYS=%d", (int)((expiration_date - time(NULL) + 86399) / 86400)); + envp[0] = days; + for (i = 0; i < (int)(sizeof(envp) / sizeof(envp[0]) - 2) && environ[i]; i ++) + envp[i + 1] = environ[i]; + envp[i] = NULL; + + posix_spawn_file_actions_t actions; /* File actions */ + + posix_spawn_file_actions_init(&actions); + posix_spawn_file_actions_addclose(&actions, 0); + posix_spawn_file_actions_addopen(&actions, 0, infofile, O_RDONLY, 0); + posix_spawn_file_actions_addclose(&actions, 1); + posix_spawn_file_actions_addopen(&actions, 1, "/dev/null", O_WRONLY, 0); + posix_spawn_file_actions_addclose(&actions, 2); + posix_spawn_file_actions_addopen(&actions, 2, "/dev/null", O_WRONLY, 0); + + if (posix_spawn(&pid, command, &actions, NULL, argv, envp)) + { + unlink(infofile); + return (-1); + } + + posix_spawn_file_actions_destroy(&actions); + + unlink(infofile); + + while (waitpid(pid, &status, 0) < 0) + if (errno != EINTR) + { + status = -1; + break; + } + + return (!status); + +#else int status = 0; /* Return status */ OSStatus err; /* Error code (if any) */ CFStringRef cfcommon_name = NULL; @@ -263,107 +363,7 @@ cleanup: DEBUG_printf(("1cupsMakeServerCredentials: Returning %d.", status)); return (status); - -#else /* !TARGET_OS_IOS */ - int pid, /* Process ID of command */ - status, /* Status of command */ - i; /* Looping var */ - char command[1024], /* Command */ - *argv[5], /* Command-line arguments */ - *envp[1000], /* Environment variables */ - days[32], /* CERTTOOL_EXPIRATION_DAYS env var */ - keychain[1024], /* Keychain argument */ - infofile[1024], /* Type-in information for cert */ - filename[1024]; /* Default keychain path */ - cups_file_t *fp; /* Seed/info file */ - - - DEBUG_printf(("cupsMakeServerCredentials(path=\"%s\", common_name=\"%s\", num_alt_names=%d, alt_names=%p, expiration_date=%d)", path, common_name, num_alt_names, (void *)alt_names, (int)expiration_date)); - - (void)num_alt_names; - (void)alt_names; - - if (!path) - path = http_cdsa_default_path(filename, sizeof(filename)); - - /* - * Run the "certtool" command to generate a self-signed certificate... - */ - - if (!cupsFileFind("certtool", getenv("PATH"), 1, command, sizeof(command))) - return (-1); - - /* - * Create a file with the certificate information fields... - * - * Note: This assumes that the default questions are asked by the certtool - * command... - */ - - if ((fp = cupsTempFile2(infofile, sizeof(infofile))) == NULL) - return (-1); - - cupsFilePrintf(fp, - "CUPS Self-Signed Certificate\n" - /* Enter key and certificate label */ - "r\n" /* Generate RSA key pair */ - "2048\n" /* 2048 bit encryption key */ - "y\n" /* OK (y = yes) */ - "b\n" /* Usage (b=signing/encryption) */ - "2\n" /* Sign with SHA256 */ - "y\n" /* OK (y = yes) */ - "%s\n" /* Common name */ - "\n" /* Country (default) */ - "\n" /* Organization (default) */ - "\n" /* Organizational unit (default) */ - "\n" /* State/Province (default) */ - "\n" /* Email address */ - "y\n", /* OK (y = yes) */ - common_name); - cupsFileClose(fp); - - snprintf(keychain, sizeof(keychain), "k=%s", path); - - argv[0] = "certtool"; - argv[1] = "c"; - argv[2] = keychain; - argv[3] = NULL; - - snprintf(days, sizeof(days), "CERTTOOL_EXPIRATION_DAYS=%d", (int)((expiration_date - time(NULL) + 86399) / 86400)); - envp[0] = days; - for (i = 0; i < (int)(sizeof(envp) / sizeof(envp[0]) - 2) && environ[i]; i ++) - envp[i + 1] = environ[i]; - envp[i] = NULL; - - posix_spawn_file_actions_t actions; /* File actions */ - - posix_spawn_file_actions_init(&actions); - posix_spawn_file_actions_addclose(&actions, 0); - posix_spawn_file_actions_addopen(&actions, 0, infofile, O_RDONLY, 0); - posix_spawn_file_actions_addclose(&actions, 1); - posix_spawn_file_actions_addopen(&actions, 1, "/dev/null", O_WRONLY, 0); - posix_spawn_file_actions_addclose(&actions, 2); - posix_spawn_file_actions_addopen(&actions, 2, "/dev/null", O_WRONLY, 0); - - if (posix_spawn(&pid, command, &actions, NULL, argv, envp)) - { - unlink(infofile); - return (-1); - } - - posix_spawn_file_actions_destroy(&actions); - - unlink(infofile); - - while (waitpid(pid, &status, 0) < 0) - if (errno != EINTR) - { - status = -1; - break; - } - - return (!status); -#endif /* TARGET_OS_IOS */ +#endif /* TARGET_OS_OSX */ } @@ -829,9 +829,9 @@ httpCredentialsString( * issuer name is, um, "interesting"... */ -# if !TARGET_OS_IOS +# if TARGET_OS_OSX CFDictionaryRef cf_dict; /* Dictionary for certificate */ -# endif /* !TARGET_OS_IOS */ +# endif /* TARGET_OS_OSX */ CFStringRef cf_string; /* CF string */ char commonName[256],/* Common name associated with cert */ issuer[256], /* Issuer name */ @@ -852,7 +852,7 @@ httpCredentialsString( strlcpy(issuer, "unknown", sizeof(issuer)); strlcpy(sigalg, "UnknownSignature", sizeof(sigalg)); -# if !TARGET_OS_IOS +# if TARGET_OS_OSX if ((cf_dict = SecCertificateCopyValues(secCert, NULL, NULL)) != NULL) { CFDictionaryRef cf_issuer = CFDictionaryGetValue(cf_dict, kSecOIDX509V1IssuerName); @@ -899,7 +899,7 @@ httpCredentialsString( CFRelease(cf_dict); } -# endif /* !TARGET_OS_IOS */ +# endif /* TARGET_OS_OSX */ expiration = (time_t)(SecCertificateNotValidAfter(secCert) + kCFAbsoluteTimeIntervalSince1970); diff --git a/cups/usersys.c b/cups/usersys.c index b56b892b4..4a65236e5 100644 --- a/cups/usersys.c +++ b/cups/usersys.c @@ -1,10 +1,11 @@ /* * User, system, and password routines for CUPS. * - * Copyright 2007-2017 by Apple Inc. + * Copyright 2007-2019 by Apple Inc. * Copyright 1997-2006 by Easy Software Products. * - * 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. */ /* @@ -32,13 +33,13 @@ */ #ifdef __APPLE__ -# if TARGET_OS_IOS -# define kCUPSPrintingPrefs CFSTR(".GlobalPreferences") -# define kPREFIX "AirPrint" -# else +# if TARGET_OS_OSX # define kCUPSPrintingPrefs CFSTR("org.cups.PrintingPrefs") # define kPREFIX "" -# endif /* TARGET_OS_IOS */ +# else +# define kCUPSPrintingPrefs CFSTR(".GlobalPreferences") +# define kPREFIX "AirPrint" +# endif /* TARGET_OS_OSX */ # define kAllowAnyRootKey CFSTR(kPREFIX "AllowAnyRoot") # define kAllowExpiredCertsKey CFSTR(kPREFIX "AllowExpiredCerts") # define kEncryptionKey CFSTR(kPREFIX "Encryption") @@ -564,11 +565,11 @@ cupsSetUserAgent(const char *user_agent)/* I - User-Agent string or @code NULL@ else strlcpy(version, "unknown", sizeof(version)); -# if TARGET_OS_IOS - snprintf(cg->user_agent, sizeof(cg->user_agent), CUPS_MINIMAL " (iOS %s; %s) IPP/2.0", version, name.machine); -# else +# if TARGET_OS_OSX snprintf(cg->user_agent, sizeof(cg->user_agent), CUPS_MINIMAL " (macOS %s; %s) IPP/2.0", version, name.machine); -# endif /* TARGET_OS_IOS */ +# else + snprintf(cg->user_agent, sizeof(cg->user_agent), CUPS_MINIMAL " (iOS %s; %s) IPP/2.0", version, name.machine); +# endif /* TARGET_OS_OSX */ #else /* @@ -1216,9 +1217,9 @@ cups_init_client_conf( memset(cc, 0, sizeof(_cups_client_conf_t)); -#if TARGET_OS_IOS +#if defined(__APPLE__) && !TARGET_OS_OSX cups_set_user(cc, "mobile"); -#endif /* TARGET_OS_IOS */ +#endif /* __APPLE__ && !TARGET_OS_OSX */ #ifdef HAVE_SSL cc->ssl_min_version = _HTTP_TLS_1_0; diff --git a/cups/versioning.h b/cups/versioning.h index 0a4199b02..aae2138e8 100644 --- a/cups/versioning.h +++ b/cups/versioning.h @@ -1,7 +1,7 @@ /* * API versioning definitions for CUPS. * - * Copyright © 2007-2018 by Apple Inc. + * Copyright © 2007-2019 by Apple Inc. * * Licensed under Apache License v2.0. See the file "LICENSE" for more * information. @@ -96,7 +96,7 @@ * Note: Using any of the _CUPS_API macros automatically adds _CUPS_PUBLIC. */ -# if defined(__APPLE__) && !defined(_CUPS_SOURCE) && !TARGET_OS_IOS +# if defined(__APPLE__) && !defined(_CUPS_SOURCE) && TARGET_OS_OSX /* * On Apple operating systems, the _CUPS_API_* constants are defined using the * API_ macros in . diff --git a/test/ippeveprinter.c b/test/ippeveprinter.c index d24a6e8dc..b10165208 100644 --- a/test/ippeveprinter.c +++ b/test/ippeveprinter.c @@ -694,7 +694,7 @@ main(int argc, /* I - Number of command-line args */ #ifdef _WIN32 if ((tmpdir = getenv("TEMP")) == NULL) tmpdir = "C:/TEMP"; -#elif defined(__APPLE__) && !TARGET_OS_IOS +#elif defined(__APPLE__) && TARGET_OS_OSX if ((tmpdir = getenv("TMPDIR")) == NULL) tmpdir = "/private/tmp"; #else diff --git a/xcode/config.h b/xcode/config.h index 4fc686566..b8684d9d5 100644 --- a/xcode/config.h +++ b/xcode/config.h @@ -1,7 +1,7 @@ /* * Configuration file for CUPS and Xcode. * - * Copyright 2007-2017 by Apple Inc. + * Copyright 2007-2019 by Apple Inc. * Copyright 1997-2007 by Easy Software Products. * * Licensed under Apache License v2.0. See the file "LICENSE" for more information. @@ -323,9 +323,9 @@ * What Security framework headers do we have? */ -#if !TARGET_OS_IOS +#if TARGET_OS_OSX # define HAVE_AUTHORIZATION_H 1 -#endif /* !TARGET_OS_IOS */ +#endif /* TARGET_OS_OSX */ #define HAVE_SECCERTIFICATE_H 1 #define HAVE_SECITEM_H 1 @@ -336,9 +336,9 @@ * Do we have the SecGenerateSelfSignedCertificate function? */ -#if TARGET_OS_IOS +#if !TARGET_OS_OSX # define HAVE_SECGENERATESELFSIGNEDCERTIFICATE 1 -#endif /* TARGET_OS_IOS */ +#endif /* !TARGET_OS_OSX */ /* @@ -493,18 +493,18 @@ * Do we have ApplicationServices public headers? */ -#if !TARGET_OS_IOS +#if TARGET_OS_OSX # define HAVE_APPLICATIONSERVICES_H 1 -#endif /* !TARGET_OS_IOS */ +#endif /* TARGET_OS_OSX */ /* * Do we have the SCDynamicStoreCopyComputerName function? */ -#if !TARGET_OS_IOS +#if TARGET_OS_OSX # define HAVE_SCDYNAMICSTORECOPYCOMPUTERNAME 1 -#endif /* !TARGET_OS_IOS */ +#endif /* TARGET_OS_OSX */ /* @@ -543,7 +543,7 @@ * Do we have the GSSAPI support library (for Kerberos support)? */ -#if !TARGET_OS_IOS +#if TARGET_OS_OSX # define HAVE_GSS_ACQUIRED_CRED_EX_F 1 # define HAVE_GSS_C_NT_HOSTBASED_SERVICE 1 # define HAVE_GSS_GSSAPI_H 1 @@ -551,7 +551,7 @@ # define HAVE_GSSAPI 1 /* #undef HAVE_GSSAPI_GSSAPI_H */ /* #undef HAVE_GSSAPI_H */ -#endif /* !TARGET_OS_IOS */ +#endif /* TARGET_OS_OSX */ /* @@ -665,11 +665,11 @@ * Location of localization bundle, if any. */ -#if TARGET_OS_IOS -# define CUPS_BUNDLEDIR "/System/Library/PrivateFrameworks/PrintKit.framework/Versions/A" -#else +#if TARGET_OS_OSX # define CUPS_BUNDLEDIR "/System/Library/Frameworks/ApplicationServices.framework/Versions/A/Frameworks/PrintCore.framework/Versions/A" -#endif /* TARGET_OS_IOS */ +#else +# define CUPS_BUNDLEDIR "/System/Library/PrivateFrameworks/PrintKit.framework/Versions/A" +#endif /* TARGET_OS_OSX */ /* -- 2.39.2