[PATCH] better ldap,krb5,ads detection (fix bug #125)

Alexander Bokovoy a.bokovoy at sam-solutions.net
Mon Jul 7 14:42:13 GMT 2003


On Mon, Jul 07, 2003 at 09:34:24AM -0500, Steve Langasek wrote:
> On Mon, Jul 07, 2003 at 02:15:02PM +0200, Stefan (metze) Metzmacher wrote:
> > >If you mean the CFLAGS issue, it's this: if CFLAGS is set in the
> > >environment when running ./configure (it is for us), the contents of
> > >CFLAGS are copied into the output of krb5-config.  This gives:
> > >
> > >KRB5LIBS= -L/usr/lib -gstabs -Wall -O2 -lgssapi_krb5 -lkrb5 -lk5crypto 
> > >-lcom_err -lresolv
> > >
> > >which is clearly wrong; none of the -gstabs -Wall -O2 belong in this
> > >list.  The fix is to use the line I mentioned above, which clears the
> > >CFLAGS variable when calling krb5-config.
> > 
> > ac_save_CFLAGS=$CFLAGS
> > CFLAGS=""
> > KRB5_LIBS="$KRB5-CONFIG --libs gssapi"
> > CFLAGS=$ac_sava_CFLAGS
> 
> > will do the trick right?
> 
> with an export CFLAGS first, it should.
> 
> ac_save_CFLAGS="$CFLAGS"
> CFLAGS=""
> export CFLAGS
> KRB5_LIBS="`$KRB5-CONFIG --libs gssapi`"
> CFLAGS="$ac_save_CFLAGS"
> 
> I don't think the other flags (LDFLAGS, etc.) should matter.
$ fgrep -n FLAGS /usr/bin/krb5-config 
34:CC_LINK='$(CC) $(PROG_LIBPATH) $(RPATH_FLAG)$(PROG_RPATH) $(CFLAGS) $(LDFLAGS)'
37:LDFLAGS=''
120:    echo "        [--cflags]        Compile time CFLAGS"
178:        -e 's#\$(LDFLAGS)#'"$LDFLAGS"'#' \
179:        -e 's#\$(CFLAGS)#'"$CFLAGS"'#'`

This is for MIT KRB5 1.2.7 and above. As it cleans up LDFLAG and does not
clean up CFLAGS, we are safe.
-- 
/ Alexander Bokovoy
---
Conversation, n.:
	A vocal competition in which the one who is catching his breath
	is called the listener.



More information about the samba-technical mailing list