Bug 8571 - Detected Kerberos CFLAGS leads to inclusion of os-installed samba headers instead of newly build ones
Summary: Detected Kerberos CFLAGS leads to inclusion of os-installed samba headers ins...
Status: RESOLVED FIXED
Alias: None
Product: Samba 3.6
Classification: Unclassified
Component: Build environment (show other bugs)
Version: 3.6.1
Hardware: Sparc Solaris
: P5 normal
Target Milestone: ---
Assignee: Stefan Metzmacher
QA Contact: Samba QA Contact
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2011-11-03 20:37 UTC by Dagobert Michelsen
Modified: 2020-12-11 08:29 UTC (History)
3 users (show)

See Also:


Attachments
git patch for 4.0 (989 bytes, patch)
2013-09-19 13:47 UTC, Björn Jacke
no flags Details

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:
   LIB_REMOVE_USR_LIB(KRB5_LIBS)
   LIB_REMOVE_USR_LIB(KRB5_LDFLAGS)
-  CFLAGS="$KRB5_CFLAGS $CFLAGS"
-  CPPFLAGS="$KRB5_CPPFLAGS $CPPFLAGS"
-  LDFLAGS="$KRB5_LDFLAGS $LDFLAGS"
+  CFLAGS="$CFLAGS $KRB5_CFLAGS"
+  CPPFLAGS="$CPPFLAGS $KRB5_CPPFLAGS"
+  LDFLAGS="$LDFLAGS $KRB5_LDFLAGS"
 
   KRB5_LIBS="$KRB5_LDFLAGS $KRB5_LIBS"
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?
Comment 2 Stefan Metzmacher 2017-04-07 15:36:30 UTC
I hope this is fixed with the waf based buildsystem in 4.0.0 and highwe.