Skip to content

Commit

Permalink
Mac cloud print proxy work.
Browse files Browse the repository at this point in the history
Turn on use_cups for the Mac, add in the required library, and tweak the code
to get it linking.  There is still more work to do; this is just a gyp-oriented
change to get things started.

BUG=none
TEST=All targets still build on all platforms.

Review URL: http://codereview.chromium.org/4167006

git-svn-id: svn://svn.chromium.org/chrome/trunk/src@64441 0039d316-1c4b-4281-b951-d872f2087c98
  • Loading branch information
scottbyer@chromium.org committed Oct 29, 2010
1 parent cf7e077 commit 71be19b
Show file tree
Hide file tree
Showing 5 changed files with 39 additions and 14 deletions.
2 changes: 1 addition & 1 deletion build/common.gypi
Original file line number Diff line number Diff line change
Expand Up @@ -392,7 +392,7 @@
'NACL_WIN64',
],
}],
['OS=="linux" and chromeos==0 and target_arch!="arm"', {
['OS=="mac" or (OS=="linux" and chromeos==0 and target_arch!="arm")', {
'use_cups%': 1,
}, {
'use_cups%': 0,
Expand Down
22 changes: 16 additions & 6 deletions chrome/chrome.gyp
Original file line number Diff line number Diff line change
Expand Up @@ -1165,12 +1165,6 @@
],
}],
['use_cups==1', {
'link_settings': {
'libraries': [
'-lcups',
'-lgcrypt',
],
},
'defines': [
# CP_PRINT_SYSTEM_AVAILABLE disables default dummy implementation
# of cloud print system, and allows to use custom implementaiton.
Expand All @@ -1179,6 +1173,22 @@
'sources': [
'service/cloud_print/print_system_cups.cc',
],
'conditions': [
['OS=="mac"', {
'link_settings': {
'libraries': [
'$(SDKROOT)/usr/lib/libcups.dylib',
]
},
}, {
'link_settings': {
'libraries': [
'-lcups',
'-lgcrypt',
],
},
}],
],
}],
['remoting==1', {
'dependencies': [
Expand Down
1 change: 0 additions & 1 deletion chrome/service/cloud_print/print_system_cups.cc
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@
#include <cups/cups.h>
#include <dlfcn.h>
#include <errno.h>
#include <gcrypt.h>
#include <pthread.h>

#include <list>
Expand Down
6 changes: 6 additions & 0 deletions printing/backend/print_backend_cups.cc
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,9 @@

#include <dlfcn.h>
#include <errno.h>
#if !defined(OS_MACOSX)
#include <gcrypt.h>
#endif
#include <pthread.h>

#include "base/file_util.h"
Expand All @@ -18,6 +20,7 @@
#include "googleurl/src/gurl.h"
#include "printing/backend/cups_helper.h"

#if !defined(OS_MACOSX)
GCRY_THREAD_OPTION_PTHREAD_IMPL;

namespace {
Expand Down Expand Up @@ -64,6 +67,7 @@ class GcryptInitializer {
};

} // namespace
#endif

namespace printing {

Expand Down Expand Up @@ -182,8 +186,10 @@ bool PrintBackendCUPS::IsValidPrinter(const std::string& printer_name) {

scoped_refptr<PrintBackend> PrintBackend::CreateInstance(
const DictionaryValue* print_backend_settings) {
#if !defined(OS_MACOSX)
// Initialize gcrypt library.
Singleton<GcryptInitializer>::get();
#endif

std::string print_server_url_str;
if (print_backend_settings) {
Expand Down
22 changes: 16 additions & 6 deletions printing/printing.gyp
Original file line number Diff line number Diff line change
Expand Up @@ -112,12 +112,6 @@
],
}],
['use_cups==1', {
'link_settings': {
'libraries': [
'-lcups',
'-lgcrypt',
],
},
'defines': [
# PRINT_BACKEND_AVAILABLE disables the default dummy implementation
# of the print backend and enables a custom implementation instead.
Expand All @@ -128,6 +122,22 @@
'backend/cups_helper.h',
'backend/print_backend_cups.cc',
],
'conditions': [
['OS=="mac"', {
'link_settings': {
'libraries': [
'$(SDKROOT)/usr/lib/libcups.dylib',
]
},
}, {
'link_settings': {
'libraries': [
'-lcups',
'-lgcrypt',
],
},
}],
],
}],
],
},
Expand Down

0 comments on commit 71be19b

Please sign in to comment.