Bug 8571 - Detected Kerberos CFLAGS leads to inclusion of os-installed samba headers instead of newly build ones
Detected Kerberos CFLAGS leads to inclusion of os-installed samba headers ins...
Status: NEW
Product: Samba 3.6
Classification: Unclassified
Component: Build environment
Sparc Solaris
: P5 normal
: ---
Assigned To: Stefan Metzmacher
Samba QA Contact
Depends on:
  Show dependency treegraph
Reported: 2011-11-03 20:37 UTC by Dagobert Michelsen
Modified: 2013-09-19 14:38 UTC (History)
3 users (show)

See Also:

git patch for 4.0 (989 bytes, patch)
2013-09-19 13:47 UTC, Björn Jacke
bjacke: review? (metze)

Note You need to log in before you can comment on or make changes to this bug.
Description Dagobert Michelsen 2011-11-03 20:37:15 UTC
Compilation fails with

Compiling lib/netapi/cm.c
"/opt/csw/include/client.h", line 24: #error: "Do not include this header directly"
cc: acomp failed for lib/netapi/cm.c
The following command failed:
/opt/SUNWspro/bin/cc -xc99=all -I/opt/csw/include -xO3 -m32 -xarch=sparc -lintl -I. -I/home/dam/mgar/pkg/samba/trunk/work/solaris10-sparc/build-isa-sparcv8plus/samba-3.6.1/source3 -I/home/dam/mgar/pkg/samba/trunk/work/solaris10-sparc/build-isa-sparcv8plus/samba-3.6.1/source3/../lib/iniparser/src -Iinclude -I./include  -I. -I. -I./../lib/replace -I./../lib/tevent -I./librpc -I./.. -I../lib/tdb/include -DHAVE_CONFIG_H  -I/opt/csw/include -I/opt/csw/include -D_REENTRANT -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -DLDAP_DEPRECATED -DSUNOS5  -I/home/dam/mgar/pkg/samba/trunk/work/solaris10-sparc/build-isa-sparcv8plus/samba-3.6.1/source3/lib -I.. -D_SAMBA_BUILD_=3 -D_SAMBA_BUILD_=3 -KPIC -c lib/netapi/cm.c -o lib/netapi/cm.o

as client.h is included from the system-installed /opt/csw/include/client.h instead of the header file shipped with the samba distribution. The order results from the definition of CFLAGS:

Using CFLAGS     = -I/opt/csw/include -xO3 -m32 -xarch=sparc -lintl -I. -I/home/dam/mgar/pkg/samba/trunk/work/solaris10-sparc/build-isa-sparcv8plus/samba-3.6.1/source3 -I/home/dam/mgar/pkg/samba/trunk/work/solaris10-sparc/build-isa-sparcv8plus/samba-3.6.1/source3/../lib/iniparser/src -Iinclude -I./include  -I. -I. -I./../lib/replace -I./../lib/tevent -I./librpc -I./.. -I../lib/tdb/include -DHAVE_CONFIG_H  -I/opt/csw/include -I/opt/csw/include -D_REENTRANT -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -DLDAP_DEPRECATED -DSUNOS5  -I/home/dam/mgar/pkg/samba/trunk/work/solaris10-sparc/build-isa-sparcv8plus/samba-3.6.1/source3/lib -I.. -D_SAMBA_BUILD_=3 -D_SAMBA_BUILD_=3

Further investigation showed that the -I comes from prefixing the output of krb5-config to CFLAGS instead of appending it. I suggest changing the order in which the kerberos-specific parameters are added similar to this patch:

diff --git a/source3/configure.in b/source3/configure.in
index 9b49c96..008be93 100644
--- a/source3/configure.in
+++ b/source3/configure.in
@@ -3745,9 +3745,9 @@ if test x"$with_ads_support" != x"no"; then
   # remove needless evil rpath stuff as early as possible:
Comment 1 Björn Jacke 2013-09-19 13:47:19 UTC
Created attachment 9228 [details]
git patch for 4.0

changing the order as you suggest seems to make sense here actually. Here is a patch for 4.0. In 4.1 we don't have autoconf any more. 3.6 doesn't get fixes like this any more, right?