Skip to content

Commit

Permalink
Fix some build issues with the "core" component selection (rdar:https://473…
Browse files Browse the repository at this point in the history
…94086)

- Availability macros were incorrect.
- Some driver headers/definitions were installed even when the core library
  does not contain them.
- Fix up the macOS/iOS detection of keychain/API availability - just need to
  use the TARGET_OS_xxx macros instead.
- When installing private headers, install config.h so that the private
  headers actually work.
  • Loading branch information
Michael R Sweet committed Jan 23, 2019
1 parent e13e173 commit ffbf1e6
Show file tree
Hide file tree
Showing 14 changed files with 110 additions and 135 deletions.
2 changes: 2 additions & 0 deletions Makedefs.in
Original file line number Diff line number Diff line change
Expand Up @@ -96,6 +96,8 @@ LIBCUPSIMAGE = @LIBCUPSIMAGE@
LIBCUPSOBJS = @LIBCUPSOBJS@
LIBCUPSSTATIC = @LIBCUPSSTATIC@
LIBGSSAPI = @LIBGSSAPI@
LIBHEADERS = @LIBHEADERS@
LIBHEADERSPRIV = @LIBHEADERSPRIV@
LIBMALLOC = @LIBMALLOC@
LIBMXML = @LIBMXML@
LIBPAPER = @LIBPAPER@
Expand Down
7 changes: 7 additions & 0 deletions config-scripts/cups-common.m4
Original file line number Diff line number Diff line change
Expand Up @@ -440,6 +440,9 @@ AC_ARG_WITH(components, [ --with-components set components to build:

cupsimagebase="cupsimage"
LIBCUPSOBJS="\$(COREOBJS) \$(DRIVEROBJS)"
LIBHEADERS="\$(COREHEADERS) \$(DRIVERHEADERS)"
LIBHEADERSPRIV="\$(COREHEADERSPRIV) \$(DRIVERHEADERSPRIV)"

case "$COMPONENTS" in
all)
BUILDDIRS="test filter backend berkeley cgi-bin monitor notifier ppdc scheduler systemv conf data desktop locale man doc examples templates"
Expand All @@ -458,6 +461,8 @@ case "$COMPONENTS" in
BUILDDIRS="locale"
cupsimagebase=""
LIBCUPSOBJS="\$(COREOBJS)"
LIBHEADERS="\$(COREHEADERS)"
LIBHEADERSPRIV="\$(COREHEADERSPRIV)"
;;

*)
Expand All @@ -467,3 +472,5 @@ esac

AC_SUBST(BUILDDIRS)
AC_SUBST(LIBCUPSOBJS)
AC_SUBST(LIBHEADERS)
AC_SUBST(LIBHEADERSPRIV)
9 changes: 1 addition & 8 deletions config-scripts/cups-ssl.m4
Original file line number Diff line number Diff line change
Expand Up @@ -43,14 +43,7 @@ if test x$enable_ssl != xno; then
AC_CHECK_HEADER(Security/SecBasePriv.h,
AC_DEFINE(HAVE_SECBASEPRIV_H))
AC_CHECK_HEADER(Security/SecIdentitySearchPriv.h,
AC_DEFINE(HAVE_SECIDENTITYSEARCHPRIV_H))
AC_DEFINE(HAVE_CSSMERRORSTRING)
AC_DEFINE(HAVE_SECKEYCHAINOPEN)])

if test $host_os_version -ge 150; then
AC_DEFINE(HAVE_SSLSETENABLEDCIPHERS)
fi
AC_DEFINE(HAVE_SECIDENTITYSEARCHPRIV_H))])
fi
fi

Expand Down
21 changes: 0 additions & 21 deletions config.h.in
Original file line number Diff line number Diff line change
Expand Up @@ -328,34 +328,13 @@
#undef HAVE_SECURETRANSPORTPRIV_H


/*
* Do we have the cssmErrorString function?
*/

#undef HAVE_CSSMERRORSTRING


/*
* Do we have the SecGenerateSelfSignedCertificate function?
*/

#undef HAVE_SECGENERATESELFSIGNEDCERTIFICATE


/*
* Do we have the SecKeychainOpen function?
*/

#undef HAVE_SECKEYCHAINOPEN


/*
* Do we have (a working) SSLSetEnabledCiphers function?
*/

#undef HAVE_SSLSETENABLEDCIPHERS


/*
* Do we have libpaper?
*/
Expand Down
19 changes: 9 additions & 10 deletions configure
Original file line number Diff line number Diff line change
Expand Up @@ -717,6 +717,8 @@ CUPS_DATADIR
CUPS_CACHEDIR
PRIVATEINCLUDE
privateinclude
LIBHEADERSPRIV
LIBHEADERS
LIBCUPSOBJS
BUILDDIRS
INSTALLXPC
Expand Down Expand Up @@ -6106,6 +6108,9 @@ fi

cupsimagebase="cupsimage"
LIBCUPSOBJS="\$(COREOBJS) \$(DRIVEROBJS)"
LIBHEADERS="\$(COREHEADERS) \$(DRIVERHEADERS)"
LIBHEADERSPRIV="\$(COREHEADERSPRIV) \$(DRIVERHEADERSPRIV)"

case "$COMPONENTS" in
all)
BUILDDIRS="test filter backend berkeley cgi-bin monitor notifier ppdc scheduler systemv conf data desktop locale man doc examples templates"
Expand All @@ -6124,6 +6129,8 @@ case "$COMPONENTS" in
BUILDDIRS="locale"
cupsimagebase=""
LIBCUPSOBJS="\$(COREOBJS)"
LIBHEADERS="\$(COREHEADERS)"
LIBHEADERSPRIV="\$(COREHEADERSPRIV)"
;;

*)
Expand All @@ -6137,6 +6144,8 @@ esac





if test "$prefix" = "NONE"; then
prefix="/"
fi
Expand Down Expand Up @@ -8353,19 +8362,9 @@ if test "x$ac_cv_header_Security_SecIdentitySearchPriv_h" = xyes; then :
fi



$as_echo "#define HAVE_CSSMERRORSTRING 1" >>confdefs.h

$as_echo "#define HAVE_SECKEYCHAINOPEN 1" >>confdefs.h

fi



if test $host_os_version -ge 150; then
$as_echo "#define HAVE_SSLSETENABLEDCIPHERS 1" >>confdefs.h

fi
fi
fi

Expand Down
27 changes: 18 additions & 9 deletions cups/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -117,39 +117,48 @@ OBJS = \
# Header files to install...
#

HEADERS = \
adminutil.h \
COREHEADERS = \
array.h \
backend.h \
cups.h \
dir.h \
file.h \
http.h \
ipp.h \
language.h \
ppd.h \
pwg.h \
raster.h \
sidechannel.h \
transcode.h \
versioning.h

HEADERSPRIV = \
../config.h \
DRIVERHEADERS = \
adminutil.h \
backend.h \
ppd.h \
sidechannel.h

HEADERS = \
$(LIBHEADERS)

COREHEADERSPRIV = \
array-private.h \
cups-private.h \
debug-private.h \
file-private.h \
http-private.h \
ipp-private.h \
language-private.h \
ppd-private.h \
pwg-private.h \
raster-private.h \
snmp-private.h \
string-private.h \
thread-private.h

DRIVERHEADERSPRIV = \
ppd-private.h \
snmp-private.h

HEADERSPRIV = \
$(LIBHEADERSPRIV)


#
# Targets in this directory...
Expand Down
11 changes: 4 additions & 7 deletions cups/cups.h
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
/*
* API definitions for CUPS.
*
* Copyright 2007-2017 by Apple Inc.
* Copyright 1997-2007 by Easy Software Products.
* 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.
* Licensed under Apache License v2.0. See the file "LICENSE" for more
* information.
*/

#ifndef _CUPS_CUPS_H_
Expand Down Expand Up @@ -410,10 +411,6 @@ extern int cupsSetDests2(http_t *http, int num_dests,
cups_dest_t *dests) _CUPS_API_1_1_21;

/**** New in CUPS 1.2/macOS 10.5 ****/
extern ssize_t cupsBackChannelRead(char *buffer, size_t bytes,
double timeout) _CUPS_API_1_2;
extern ssize_t cupsBackChannelWrite(const char *buffer, size_t bytes,
double timeout) _CUPS_API_1_2;
extern void cupsEncodeOptions2(ipp_t *ipp, int num_options,
cups_option_t *options,
ipp_tag_t group_tag) _CUPS_API_1_2;
Expand Down
3 changes: 0 additions & 3 deletions cups/http-private.h
Original file line number Diff line number Diff line change
Expand Up @@ -154,9 +154,6 @@ typedef gnutls_certificate_credentials_t *http_tls_credentials_t;
* for its IO and protocol management...
*/

# if !defined(HAVE_SECBASEPRIV_H) && defined(HAVE_CSSMERRORSTRING) /* Declare prototype for function in that header... */
extern const char *cssmErrorString(int error);
# endif /* !HAVE_SECBASEPRIV_H && HAVE_CSSMERRORSTRING */
# if !defined(HAVE_SECIDENTITYSEARCHPRIV_H) && defined(HAVE_SECIDENTITYSEARCHCREATEWITHPOLICY) /* Declare prototype for function in that header... */
extern OSStatus SecIdentitySearchCreateWithPolicy(SecPolicyRef policy,
CFStringRef idString, CSSM_KEYUSE keyUsage,
Expand Down
3 changes: 2 additions & 1 deletion cups/ppd-private.h
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/*
* Private PPD definitions for CUPS.
*
* Copyright © 2007-2018 by Apple Inc.
* Copyright © 2007-2019 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
Expand Down Expand Up @@ -156,6 +156,7 @@ struct _ppd_cache_s /**** PPD cache and PWG conversion data ****/
*/

extern int _cupsConvertOptions(ipp_t *request, ppd_file_t *ppd, _ppd_cache_t *pc, ipp_attribute_t *media_col_sup, ipp_attribute_t *doc_handling_sup, ipp_attribute_t *print_color_mode_sup, const char *user, const char *format, int copies, int num_options, cups_option_t *options) _CUPS_PRIVATE;
extern int _cupsRasterExecPS(cups_page_header2_t *h, int *preferred_bits, const char *code) _CUPS_NONNULL(3) _CUPS_PRIVATE;
extern int _cupsRasterInterpretPPD(cups_page_header2_t *h, ppd_file_t *ppd, int num_options, cups_option_t *options, cups_interpret_cb_t func) _CUPS_PRIVATE;

extern _ppd_cache_t *_ppdCacheCreateWithFile(const char *filename,
Expand Down
3 changes: 1 addition & 2 deletions cups/raster-private.h
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/*
* Private image library definitions for CUPS.
*
* Copyright © 2007-2018 by Apple Inc.
* Copyright © 2007-2019 by Apple Inc.
* Copyright © 1993-2006 by Easy Software Products.
*
* Licensed under Apache License v2.0. See the file "LICENSE" for more
Expand Down Expand Up @@ -87,7 +87,6 @@ extern void _cupsRasterClearError(void) _CUPS_PRIVATE;
extern const char *_cupsRasterColorSpaceString(cups_cspace_t cspace) _CUPS_PRIVATE;
extern void _cupsRasterDelete(cups_raster_t *r) _CUPS_PRIVATE;
extern const char *_cupsRasterErrorString(void) _CUPS_PRIVATE;
extern int _cupsRasterExecPS(cups_page_header2_t *h, int *preferred_bits, const char *code) _CUPS_NONNULL(3) _CUPS_PRIVATE;
extern int _cupsRasterInitPWGHeader(cups_page_header2_t *h, pwg_media_t *media, const char *type, int xdpi, int ydpi, const char *sides, const char *sheet_back) _CUPS_PRIVATE;
extern cups_raster_t *_cupsRasterNew(cups_raster_iocb_t iocb, void *ctx, cups_mode_t mode) _CUPS_PRIVATE;
extern unsigned _cupsRasterReadHeader(cups_raster_t *r) _CUPS_PRIVATE;
Expand Down
20 changes: 17 additions & 3 deletions cups/sidechannel.h
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
/*
* Side-channel API definitions for CUPS.
*
* Copyright 2007-2012 by Apple Inc.
* Copyright 2006 by Easy Software Products.
* Copyright © 2007-2019 by Apple Inc.
* Copyright © 2006 by Easy Software Products.
*
* Licensed under Apache License v2.0. See the file "LICENSE" for more information.
*/
Expand All @@ -15,6 +15,13 @@
*/

# include "versioning.h"
# include <sys/types.h>
# if defined(_WIN32) && !defined(__CUPS_SSIZE_T_DEFINED)
# define __CUPS_SSIZE_T_DEFINED
# include <stddef.h>
/* Windows does not support the ssize_t type, so map it to long... */
typedef long ssize_t; /* @private@ */
# endif /* _WIN32 && !__CUPS_SSIZE_T_DEFINED */


/*
Expand Down Expand Up @@ -107,6 +114,13 @@ typedef void (*cups_sc_walk_func_t)(const char *oid, const char *data,
* Prototypes...
*/

/**** New in CUPS 1.2/macOS 10.5 ****/
extern ssize_t cupsBackChannelRead(char *buffer, size_t bytes,
double timeout) _CUPS_API_1_2;
extern ssize_t cupsBackChannelWrite(const char *buffer, size_t bytes,
double timeout) _CUPS_API_1_2;

/**** New in CUPS 1.3/macOS 10.5 ****/
extern cups_sc_status_t cupsSideChannelDoRequest(cups_sc_command_t command,
char *data, int *datalen,
double timeout) _CUPS_API_1_3;
Expand All @@ -119,7 +133,7 @@ extern int cupsSideChannelWrite(cups_sc_command_t command,
const char *data, int datalen,
double timeout) _CUPS_API_1_3;

/**** New in CUPS 1.4 ****/
/**** New in CUPS 1.4/macOS 10.6 ****/
extern cups_sc_status_t cupsSideChannelSNMPGet(const char *oid, char *data,
int *datalen, double timeout)
_CUPS_API_1_4;
Expand Down

0 comments on commit ffbf1e6

Please sign in to comment.