The Samba-Bugzilla – Bug 355
For compiling on Solaris the macro SYSV should be defined so that lpstat will be used
Last modified: 2005-11-14 09:27:00 UTC
I downloaded Samba 3.0.0rc1 and compiled it on Sun Solaris 8 with gcc 2.95.2.
I first used
env CFLAGS=-O2 LDFLAGS=-s CC=gcc ./configure --prefix=/opt/samba
--with-configdir=/etc/samba --with-piddir=/var/run --with-lockdir=/var/run
--with-swatdir=/opt/samba/swat --with-automount --with-pam --with-quotas
But when I started smbd and nmbd and tested the printers with testprns then no
printer was found. The error message was like
[2003/08/23 17:41:41, 0] printing/pcap.c:pcap_printername_ok(282)
Unable to open printcap file lpstat for read!
After checking the config file and other possibilities I looked at the code.
I found that in printing/pcap.c there are some #ifdef SYSV to activate
the code for lpstat. But I found no file where SYSV is set for system solaris!
I added CPPFLAGS='-DSYSV=1' to the environment for configure and tried it again.
Now it works.
env CFLAGS=-O2 LDFLAGS=-s CC=gcc CPPFLAGS='-DSYSV=1' ./configure
--prefix=/opt/samba --with-configdir=/etc/samba --with-piddir=/var/run
--with-automount --with-pam --with-quotas --with-acl-support
The fix should be to define SYSV when the system is solaris.
But I don't know where to do it best. May be configure.in is the file of choise.
I suppose to fix this before release version 3.0.0 so others don't will have the
Thanks, and best regards
Putting something in configure.in is the right thing to do. I am just wondering
whether defining SYSV will break anything else in Solaris.
From inspecting the source code it doesn't appear that anything untoward will
happen from defining SYSV for Solaris so I'm going to commit it.
In fact a similar patch was committed recently for IRIX.
Edgar, can you retest and reopen if there is still a problem?
Tim, This is a duplicate of 230 which I'm still trying to
figure out what Sun's take is. Are you positive that
Solaris is still using System V printing? If so, then mark
230 fixed as well.
Hmm - this was what I was afraid of. )-:
I didn't realise Solaris went BSD in 2.9 so my patch is probably wrong if this
is the case. I only have access to the 2.5 machine in the build farm so the
testing of my patch was quite limited.
I'll undo the SYSV define for Solaris and mark this guy as a duplicate of 230 as
there is more usefull commentary about the problem there.
Marking as duplicate. Edgar, I'll add you as a CC to bug 230 so you can track
what is happening.
*** This bug has been marked as a duplicate of 230 ***
originally reported against one of the 3.0.0rc[1-4] releases.
Cleaning up non-production versions.