1
0
mirror of https://github.com/samba-team/samba.git synced 2024-12-22 13:34:15 +03:00

heimdal: Fix build with system provided heimdal library

Trying to compile with a system provided heimdal library
results in this compile error:

[ 876/3043] Compiling source4/auth/kerberos/srv_keytab.c
In file included from /usr/include/heimdal/krb5.h:949:0,
                 from ../lib/replace/system/kerberos.h:33,
                 from ../source4/auth/kerberos/srv_keytab.c:31:
/usr/include/heimdal/krb5-protos.h:3894:1: error: unknown type name ‘HEIMDAL_WARN_UNUSED_RESULT_ATTRIBUTE’; did you mean ‘_WARN_UNUSED_RESULT_’?
 HEIMDAL_WARN_UNUSED_RESULT_ATTRIBUTE KRB5_LIB_FUNCTION krb5_error_code KRB5_LIB_CALL
 ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
 _WARN_UNUSED_RESULT_
/usr/include/heimdal/krb5-protos.h:3895:1: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘krb5_generate_random’
 krb5_generate_random (

The problem is that Samba provides a minimal krb5-types.h file
for the internal build that gets used during the build with
the system provided heimdal library. As the minimal file
does not provide all definitions, the build fails.

Fix this by having the krb-types.h file simply include the
include file from the system library, if the build is done
using the system provided heimdal library.

Signed-off-by: Christof Schmitt <cs@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>

Autobuild-User(master): Andrew Bartlett <abartlet@samba.org>
Autobuild-Date(master): Tue Jul 10 07:30:26 CEST 2018 on sn-devel-144
This commit is contained in:
Christof Schmitt 2018-06-26 13:32:28 -07:00 committed by Andrew Bartlett
parent c8f0b88571
commit b84c0a896f
2 changed files with 11 additions and 4 deletions

View File

@ -1,14 +1,18 @@
/* krb5-types.h -- this file was generated for i686-pc-linux-gnu by
$Id: bits.c,v 1.23 2005/01/05 15:22:02 lha Exp $ */
#ifndef __krb5_types_h__
#define __krb5_types_h__
#ifndef __samba_krb5_types_h__
#define __samba_krb5_types_h__
#include "replace.h"
#include "system/network.h"
#if defined USING_SYSTEM_KRB5 && defined HEIMDAL_KRB5_TYPES_PATH
#include HEIMDAL_KRB5_TYPES_PATH
#else
typedef socklen_t krb5_socklen_t;
typedef int krb5_socket_t;
typedef ssize_t krb5_ssize_t;
#endif
#endif /* __krb5_types_h__ */
#endif /* __samb_krb5_types_h__ */

View File

@ -176,7 +176,10 @@ if krb5_config:
if l.startswith("libdir="):
heimdal_libdirs.append(l.strip()[len("libdir="):])
elif l.startswith("includedir="):
heimdal_includedirs.append(l.strip()[len("includedir="):])
include_path = l.strip()[len("includedir="):]
heimdal_includedirs.append(include_path)
conf.define('HEIMDAL_KRB5_TYPES_PATH',
include_path + "/krb5-types.h")
finally:
f.close()