samba-technical Digest, Vol 130, Issue 25

Chris Cowan cc at us.ibm.com
Tue Oct 29 12:34:29 MDT 2013



samba-technical-bounces at lists.samba.org wrote on 10/23/2013 01:00:06 PM:

>
> ----- Message from John P Janosik <jpjanosi at us.ibm.com> on Tue, 22
> Oct 2013 19:40:00 -0500 -----
>
> To:
>
> Amitay Isaacs <amitay at gmail.com>
>
> cc:
>
> Samba Technical <samba-technical at lists.samba.org>
>
> Subject:
>
> Re: Problem Building Samba 4.1.0 with CTDB 2.4 on AIX with IBM XL C 11
>
> Amitay Isaacs <amitay at gmail.com> wrote on 10/22/2013 06:20:10 PM:
>
> > On Wed, Oct 23, 2013 at 9:57 AM, Michael Adam <obnox at samba.org> wrote:
> > Hi,
> >
> > On 2013-10-22 at 14:53 -0500, John P Janosik wrote:
> > > I get the following error when running configure:
> > >
> > > Cluster support not available: ctdb_private.h is required for cluster
> > > support
> > > /usr/src/samba-4.1.0/source3/wscript:1668: error: Cluster support not
> > > found, but --with-cluster-support was specified
> > >
> > > config.log says:
> > >
> > > [1/2] Compiling test.c
> > > "/usr/smb_cluster/include/ctdb_client.h", line 484.33: 1506-046 (S)
> Syntax
> > > error.
> > > ['cc', '-I/usr/afsws/include', '-I', '/usr/smb_cluster/include',
> > > '-I/usr/src/samba-4.1.0/source3',
'-I/usr/src/samba-4.1.0/lib/talloc',
> > > '-I/usr/src/samba-4.1.0/lib/tdb/include',
> '-I/usr/src/samba-4.1.0/lib',
> > > '-I/usr/src/samba-4.1.0/lib/replace',
> '-I/usr/src/samba-4.1.0/include',
> > > '-I/usr/src/samba-4.1.0/source4/include',
> > > '-I/usr/src/samba-4.1.0/source4/lib',
> '-I/usr/src/samba-4.1.0/source4',
> > > '-I/usr/src/samba-4.1.0/include/public', '-I/usr/local/include',
> > > '-D_SAMBA_BUILD_=4', '-DHAVE_CONFIG_H=1', '-D_ALL_SOURCE=1',
> > > '-D_GNU_SOURCE=1', '-D_XOPEN_SOURCE_EXTENDED=1', '../test.c', '-c',
> '-o',
> > > 'default/test_1.o']
> > > command returned 'Build failed:  -> task failed (err #1): \n\t{task:
> cc
> > > test.c -> test_1.o}'not found
> > >
> > > The problem seems to be the C++ style comments in ctdb_client.h:
> > >
> > > struct ctdb_control_tcp {
> > >         struct sockaddr_in src; // samba uses this
> > >         struct sockaddr_in dest;// samba uses this
> > > };
> > >
> > > Is there some setting I should be doing for configure so that the
> comments
> > > are allowed, or should I open a bug against the CTDB header file?
>
> > I am not certain about settings, but I just pushed a change
> > to master which replaces these C++ comments by proper C-style comments.
> >
> > There are more C++ style comments around, but these were at least
> > the only ones in headers.
> >
> > I don't think you should open a bug, since this will be contained
> > in the next release from master anyways.
> >
> > Cheers - Michael
>
> >
> > Hi Michael,
>
> > The problem might not have gone away. I have tested CTDB 2.4 build
> > on AIX with XLC 11 and it builds without any problem.  John is
> > trying to build Samba and that is failing.  Question is if waf is
> > adding any extra flags that prevents the build?
>
> > John, what is the exact compiler version you are using? (cc -qversion)
>
> > Amitay.
>
> Hi Amitay -
>
> If I modify the header file to use C style comments the configure
> completes ok, so I'm happy with Michael's answer.  Here is my compiler
> version:
>
> cc -qversion
> IBM XL C/C++ for AIX, V11.1 (5724-X13)
> Version: 11.01.0000.0010
>
> John Janosik
> jpjanosi at us.ibm.com

There's two ways I typically work around this problem with XLC (regardless
of the version)

1. Add -qcpluscmt to CFLAGS
2. Use CC=c99 or xlc. These aliases just adds -qcpluscmt as a default.
You can look at /etc/vac.cfg.61 or /etc/vac.cfg.71 to see what the defaults
are for each alias.

You can also explore gcc emulation mode with gxlc.  I don't use it much,
but find the config file /etc/gxlc.cfg handy as a porting reference, when
trying code originally targeted for gcc.

--
Chris


More information about the samba-technical mailing list