Issue 63376 - Mac OS X support for --enable-cups
Summary: Mac OS X support for --enable-cups
Status: CLOSED FIXED
Alias: None
Product: porting
Classification: Code
Component: MacOSX (show other issues)
Version: OOo 2.0.2
Hardware: Mac Mac OS X, all
: P3 Trivial (vote)
Target Milestone: OOo 2.0.4
Assignee: obrmac
QA Contact: issues@porting
URL:
Keywords: oooqa
Depends on: 31156
Blocks: 67331
  Show dependency tree
 
Reported: 2006-03-19 18:18 UTC by moxfox
Modified: 2008-05-16 03:27 UTC (History)
9 users (show)

See Also:
Issue Type: PATCH
Latest Confirmation in: ---
Developer Difficulty: ---


Attachments
configure - allow using --enable-cups in Mac OS X (263 bytes, patch)
2006-03-19 18:22 UTC, moxfox
no flags Details | Diff
Changes to psprint to allow compiling --enable-cups (19.12 KB, patch)
2006-03-19 18:22 UTC, moxfox
no flags Details | Diff
Patch to psprint to use correct library extension (572 bytes, patch)
2006-05-01 19:31 UTC, nospam4obr
no flags Details | Diff
The same patch, but with diff -u (1.14 KB, patch)
2006-05-01 19:43 UTC, nospam4obr
no flags Details | Diff
An even shorter version of the previous patch ;-) (921 bytes, patch)
2006-05-01 22:21 UTC, nospam4obr
no flags Details | Diff
psprint cleanup (49.28 KB, patch)
2006-05-09 22:03 UTC, obrmac
no flags Details | Diff
Full patch against m168 (49.74 KB, patch)
2006-05-12 16:30 UTC, obrmac
no flags Details | Diff
Patch now quotes CUPS_LIB_NAME correctly. (49.75 KB, patch)
2006-05-13 19:19 UTC, obrmac
no flags Details | Diff
regenerated configure script (625 bytes, patch)
2006-05-15 06:44 UTC, maho.nakata
no flags Details | Diff
screenshot or printing error (107.45 KB, image/png)
2006-05-18 14:29 UTC, eric.bachard
no flags Details

Note You need to log in before you can comment on or make changes to this issue.
Description moxfox 2006-03-19 18:18:02 UTC
The following patches add support for compiling OpenOffice.org for Mac with
system cups. The system cups is used by default in Linux distributions and thus
is a well tested code path, compared to the current Mac OS X code.

The system cups can be used with Mac OS X by specifying --enable-cups to configure.
Comment 1 moxfox 2006-03-19 18:22:02 UTC
Created attachment 35029 [details]
configure - allow using --enable-cups in Mac OS X
Comment 2 moxfox 2006-03-19 18:22:55 UTC
Created attachment 35030 [details]
Changes to psprint to allow compiling --enable-cups
Comment 3 moxfox 2006-03-19 18:37:12 UTC
The second patch enables debug messages for some files for testing purposes.

Also, some legacy 10.1 Mac OS X code is removed, as that code is not used by
current Mac OS X systems anymore.

One mutex was moved a bit up in an attempt to fix possible threading issues with
default Mac OS x printing code.
Comment 4 nospam4obr 2006-03-19 19:14:33 UTC
Good catch! And I was wondering why our cups support on MacOs X doesn't work as
good as on Linux ..

Regarding the configure patch: I believe the file to patch is configure.in. The
new configure script is actually generated by autoconf then.

@rene, can you please confirm.

@pl: please have a look at patch 2. Thanks. 
Comment 5 philipp.lohmann 2006-03-20 11:50:37 UTC
You'll want to remove those definitions for OSL_DEBUG_LEVEL; this way that is
enabled for all platforms. The easiest way to achieve OSL_DEBUG_LEVEL=2 is to
build with "debug=true" on the command line.

There is something i do not understand: if you compile with CUPS_ENABLED, does
the code in cupsmgr.cxx not come into action ? Why is it necessary to change
PrinterInfoManager at all as the work with cups should be done inside the
specialized CUPS PrinterInfoManager (see psprint/source/printer/cupsmgr.cxx) ?
Currently CUPS support is strictly confined to that file.
Comment 6 moxfox 2006-03-20 16:04:08 UTC
mox->obr: I think most patches just patch BOTH configure and configure.in... I
was just being lazy about it...

pl: The debug messages are not meant to appear in the final patch. The current
patch is for testing stuff. 

As for cupsmgr, I think the cupsmgr IS used with the patch (have to check
carefully, though). The problems is, that the current MACOSX code _bypasses_
much of the default cups codepaths. Thus, my patch mostly de-bypasses that code
for --enable-cups, so that the default code paths are used again on MACOSX.
Comment 7 florian 2006-03-20 18:54:21 UTC
Adding myself to CC
Comment 8 moxfox 2006-03-27 06:52:20 UTC
obr, pjanik, others: 
could you make a test build with the patch and post it to a website so that
users with printers could test it. I think it would be good to have the debug
messages, that I enable in the patch, set on.

I have tested this with my USB printer, but more testing is needed and I don't
have the equipment...
Comment 9 nospam4obr 2006-05-01 17:51:33 UTC
Trying to update the patch to m165 on Panther, I stumbled over the fact that
Panther does not come with /usr/include/cups/cups.h. I even needs manual
interaction to get this build on Tiger with Panther SDK:

http://lists.apple.com/archives/printing/2005/Dec/msg00035.html

How do we want to proceed ?
Comment 10 nospam4obr 2006-05-01 19:31:58 UTC
Created attachment 36198 [details]
Patch to psprint to use correct library extension
Comment 11 nospam4obr 2006-05-01 19:41:35 UTC
I think we should leave the non-cups printing code paths as they are - we can
probably remove the #ifdef MACOSX sections entirely as soon as we drop support
for panther - however, as I understand it, they wont hurt CUPS support.

After manually copying the cups headers to /usr/include/cups, I was able to
compile and run OOo with CUPS support on Panther with the minimal patch to
psprint that I have attached.

So, should configure advice to download and install the headers manually on
Panther (or to install the corresponding fink/darwinports/etc. package) ? If so,
I would be glad if someone with more experience in configure would jump in ..

Comment 12 nospam4obr 2006-05-01 19:43:10 UTC
Created attachment 36199 [details]
The same patch, but with diff -u
Comment 13 nospam4obr 2006-05-01 22:21:14 UTC
Created attachment 36200 [details]
An even shorter version of the previous patch ;-)
Comment 14 moxfox 2006-05-02 13:53:27 UTC
obr: your patch looks nice and simple :) however, even though the OOo compiles
and runs with that patch, I'm not fully confident that the native cups is fully
used. 

Looking at the code in OOo, there seems to be many places, where #ifdef MACOSX
-defines explicitly direct Mac OS X to use different code than other unixes. So,
I think there needs to be several places, where #ifdef MACOSX is changed to #if
defined(MACOSX) && !defined(ENABLE_CUPS). (look at my original patch) 

For other things, I agree that it is not necessary to change the old
(Mac-specific) code. 

As for config_office -stuff, I think the only necessary thing is to make sure
darwin*) -sections have enable_cups=yes (both configure and configure.in). The
current code already checks for cups/cups.h and issues warning if it is not
found. I think that is enough. Mac OS X build instructions on the web can then
specifically inform that building on Panther and --enable-cups, requires
manually adding the headers.

I wish I had more time to work on this stuff, but unfortunately not.
Comment 15 nospam4obr 2006-05-02 21:34:00 UTC
Mox: I was hoping I could get around looking at every #ifdef MACOSX individually
;-). Your patch definitly has at least one or two instances replaced, which
should IMO stay as they are. I will get back to look at all instances.

On the configure part: the error message on panther is:

configure: error: cups/cups.h could not be found. libcupsys2-dev or
cups???-devel missing?

After installing "cups-dev" via fink, I still get the same error message,
because the headers are installed to /sw/include/cups, not in /usr/include/cups.
So at least we need a way to tell configure where to look for cups headers.
Comment 16 moxfox 2006-05-03 20:08:06 UTC
> After installing "cups-dev" via fink, I still get the same error message,
> because the headers are installed to /sw/include/cups, not in /usr/include/cups.
> So at least we need a way to tell configure where to look for cups headers.

Yes, this is normal procedure for any fink -library used with OOo (GTK et al.) I
see no need for extra instructions (in code) for the cups case. Including fink
goes like:
export CFLAGS="$CFLAGS -I/sw/include"
export LDFLAGS="$LDFLAGS -L/sw/lib"
Comment 17 obrmac 2006-05-08 22:23:12 UTC
Not ready in 2.0.3 time frame :(
Comment 18 obrmac 2006-05-09 21:58:11 UTC
> Including fink goes like:
> export CFLAGS="$CFLAGS -I/sw/include"

Actually I think gtk+ et al. are handled by fink's pkgconfig instance, which is
found in PATH. However, I would be fine with the minimal approach.

What do others think ? Is it acceptable to require a manual "export CFLAGS" on
Panther ?
Comment 19 obrmac 2006-05-09 22:03:29 UTC
Created attachment 36351 [details]
psprint cleanup
Comment 20 obrmac 2006-05-09 22:09:33 UTC
After going through all the #ifdef MACOSX places, I removed all occurances that
seemed to be obsoleted by the move to the CUPS printerinfomanager implementation:
parsing of /etc/cups ppds directly is not what I would expect when using
--disable-cups in configure.
Comment 21 moxfox 2006-05-10 20:44:54 UTC
The patch looks very nice, cleans up lot's of stuff. The SAL library naming has
an issue recently filed by pjanik or somebody else. Can't remember the issue
number though...
Comment 22 obrmac 2006-05-10 22:36:45 UTC
mox: you probably mean Issue 65011, which is about SAL_MODULENAME_WITH_VERSION.
Comment 23 eric.bachard 2006-05-11 10:00:47 UTC
ericb->obr

What do you think about propose patch Maho for 2.0.3 ?

If needed, I propose to build a installset, and provide this experimental build for tests.


Comment 24 obrmac 2006-05-11 13:27:04 UTC
-> ericb:

I am fine with this. However, I could need some help to generate a complete diff
(psprint + config_office), since autoconf 2.57 (Panther) produces a several
hundred lines diff for configure from a single line change in configure.in and
autoconf 2.59 (Tiger) encounters an error >>Can't locate object method "path"
via package "Request" at ..<<.

Or should I go ahead and changing configure (+ configure.in) manually ?
Comment 25 pavel 2006-05-11 19:47:12 UTC
obrmac: change only configure.in, configure can be generated by someone else and
it is re-generated by Hamburg RE on integration anyway.
Comment 26 obrmac 2006-05-12 16:30:04 UTC
Created attachment 36428 [details]
Full patch against m168
Comment 27 maho.nakata 2006-05-13 03:29:18 UTC
ericb:
I'd like not to include not integrated patches for
release packages, if it is not a show stopper or build breaker.
and patch itself is not targeted at 2.0.3.


Comment 28 eric.bachard 2006-05-13 13:59:23 UTC
ericb->maho

I have been contacted by several people, for installing from 200 to 600
machines, and printing is obviously a showstopper for them.

Of course, I perfectly understand your point of view, but what is the best ?

ericb-> obr : they are ok to test if everything works in experimental builds
I'll provide them, but official build would be the best may

Just my opinion
Comment 29 nospam4obr 2006-05-13 16:39:53 UTC
obr->ericb: I hope to create a CWS for this (based on m168) this evening. 

If you have the time to do the QA build, provide it to the users for testing and
it fixes their problem, we should declare this a stopper for 2.0.3. I doubt we
could get a better QA for this patch.

If it does not fix their problem, the patch is probably not ready for
integration yet.
Comment 30 eric.bachard 2006-05-13 16:47:38 UTC
ericb->obr 

m168 checkout started : I'll do the build on Panther, and ask for tests.

If it starts this evening (let say 22:30) , the build wont be available for tests before tomorrow afternoon 
~17:00

I'll advertise my testers.



Comment 31 obrmac 2006-05-13 19:19:41 UTC
Created attachment 36445 [details]
Patch now quotes CUPS_LIB_NAME correctly.
Comment 32 obrmac 2006-05-13 19:22:22 UTC
@ericb: I have commited the patch to CWS macosxcups. Please make sure to
regenerate configure before building. Also compiling and a basic CUPS test on
Linux would probably be appropriate.
Comment 33 maho.nakata 2006-05-13 21:59:12 UTC
obr: please use autoconf 2.59 for regeneration of configure
Comment 34 maho.nakata 2006-05-13 22:02:45 UTC
ericb:
> Of course, I perfectly understand your point of view, but what is the best ?
Please do a thorough tests and convince authorities for integration.                           
currently this patch is even not very well tested. I can provide a build test of course.
Comment 35 nospam4obr 2006-05-14 09:35:58 UTC
maho: as mentioned above, autoconf 2.59 on Tiger fails for me for some reason.
If it works for you, please attach the diff for configure as well.
Comment 36 maho.nakata 2006-05-15 06:44:43 UTC
Created attachment 36466 [details]
regenerated configure script
Comment 37 eric.bachard 2006-05-17 23:46:22 UTC
ericb->obr

Since I build with recent cups headers, it works fine. 

FYI; slopez already reported a success, and will probably confirm here. Waiting for other return (soon).

About code, I just wonder what is the link between CUPS_LIB_NAME and  
SAL_MODULENAME_WITH_VERSION ? I found one in sal/osl/inc/module.h. What is the exact problem ?
Comment 38 slopez 2006-05-18 01:09:37 UTC
Hi,
I've tryed ericb's OpenOffice.org version - [680m169(Build:9026)] - with a HP
PSC 1215 (PSC 121x serie) and it works fine. 
I've made this test with a mac mini with MacOS X 10.4.3 with the printer
connected on usb port.
I'll try if I can with a "network printer" as soon as possible.
Comment 39 nospam4obr 2006-05-18 06:14:34 UTC
@ericb: SAL_MODULENAME_WITH_VERSION expands to libcups.dylib.2 instead of
libcups.2.dylib. Unfortunatly I can not easily change this as there are at least
three places where the macro is used and a bunch or libraries that need to get
renamed to comply to the Apple versioning scheme. See issue 65011.

@slopez: thanks for testing.
Comment 40 eric.bachard 2006-05-18 14:29:18 UTC
ericb->obr

Thank you very much, this is clear now.

FYI, one tester reported a problem :

Don't know wether this is a bad configuration or ..  

Printer : AL-C900, Epson laser 

When printing starts, nothing happens, and after opening the Printer Manager,
the task can be started, but stops in the middle. I'll attach the screenshot of
the error

To know more, I'll ask this tester the ppd file associated to this printer.  

Comment 41 eric.bachard 2006-05-18 14:29:56 UTC
Created attachment 36572 [details]
screenshot or printing error
Comment 42 nospam4obr 2006-05-18 14:38:45 UTC
obr -> ericb: IIRC pstopdffilter is a component of CUPS, so it seems it can not
handle the ps file OOo generates. To know whether this is a regression compared
to the old behavior, please ask whether the tester was able to print to this
printer before and also if (s)he runs Tiger or Panther.
Comment 43 eric.bachard 2006-05-18 14:43:06 UTC
ericb->obr 

I already asked :-)    Waiting for the answer

Comment 44 mlooo1 2006-05-18 19:06:15 UTC
Hi,

I have tested 680m169(Build:9026) - with 2 printer on my Mac mini PPC MacOS X 10.4.6

Document tested is a Writer document with black and color text + draw with color
and bitmap fill.

HP Photosmart is connected on network
HP 845 C is connected on usb

It works fine.

I have just a little problem : fax printer (HP Photosmart FAX) is normaly
disable on Mac OSX dialog box and it is visible on OOo printer dialog box.
Comment 45 alex.thurgood 2006-05-19 08:48:45 UTC
Hi all,

I shall test a Panther/m169 setup with 2 networked HPLJ printers tomorrow. I
haven't got access to the machine until then.

Alex
Comment 46 alex.thurgood 2006-05-21 11:04:36 UTC
Tested printing to two different colour networked laser printers, HPLaserjet 
Color 2500 and a HP Color MultiFunction 2840 Printer, using CUPS protocol.

Both printers accept b&w and colour print jobs.

Alex
Comment 47 eric.bachard 2006-05-21 20:52:39 UTC
Verified fixed. A big step forward !
Comment 48 Martin Hollmichel 2006-05-24 11:22:54 UTC
set target to 2.0.4
Comment 49 maho.nakata 2006-07-14 08:34:20 UTC
As a build bit for Panther, please have a look at
http://www.openoffice.org/issues/show_bug.cgi?id=67253
Comment 50 ace_dent 2008-05-16 03:27:25 UTC
This Issue is 'Verified' and not updated in 1yr+, so Closing.
A Closed Issue is a Happy Issue (TM).

Regards,
Andrew
 
Cleaning-up and Closing old Issues as part of:
~ The Grand Bug Squash, pre v3 ~