Bug 355 - For compiling on Solaris the macro SYSV should be defined so that lpstat will be used
For compiling on Solaris the macro SYSV should be defined so that lpstat will...
Status: RESOLVED DUPLICATE of bug 230
Product: Samba 3.0
Classification: Unclassified
Component: Build environment
3.0.0preX
All Solaris
: P3 normal
: none
Assigned To: Tim Potter
:
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2003-08-26 09:33 UTC by Edgar Hoch
Modified: 2005-11-14 09:27 UTC (History)
0 users

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Edgar Hoch 2003-08-26 09:33:53 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-logfilebase=/var/log --with-privatedir=/var/samba/private
--with-swatdir=/opt/samba/swat --with-automount --with-pam --with-quotas
--with-acl-support --with-libiconv=/usr/local

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-lockdir=/var/run --with-logfilebase=/var/log
--with-privatedir=/var/samba/private --with-swatdir=/opt/samba/swat
--with-automount --with-pam --with-quotas --with-acl-support
--with-libiconv=/usr/local


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
same problem.

Thanks, and best regards

Edgar Hoch
Comment 1 Tim Potter 2003-08-26 21:27:54 UTC
Putting something in configure.in is the right thing to do.  I am just wondering
whether defining SYSV will break anything else in Solaris.
Comment 2 Tim Potter 2003-08-26 22:07:47 UTC
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?
Comment 3 Gerald (Jerry) Carter 2003-08-26 22:28:45 UTC
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.
Comment 4 Tim Potter 2003-08-26 23:28:44 UTC
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.
Comment 5 Tim Potter 2003-08-26 23:29:28 UTC
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 ***
Comment 6 Gerald (Jerry) Carter 2005-02-07 09:05:50 UTC
originally reported against one of the 3.0.0rc[1-4] releases.
Cleaning up non-production versions.
Comment 7 Gerald (Jerry) Carter 2005-11-14 09:27:00 UTC
database cleanup