diff options
-rwxr-xr-x | source4/heimdal_build/wscript_configure | 55 |
1 files changed, 29 insertions, 26 deletions
diff --git a/source4/heimdal_build/wscript_configure b/source4/heimdal_build/wscript_configure index ea854f2e88..168be6d0e4 100755 --- a/source4/heimdal_build/wscript_configure +++ b/source4/heimdal_build/wscript_configure @@ -203,26 +203,31 @@ if check_system_heimdal_lib("roken", "rk_socket_set_reuseaddr", "roken.h"): conf.env.LIBPATH_ROKEN_HOSTCC = conf.env.LIBPATH_ROKEN conf.env.LIB_ROKEN_HOSTCC = "roken" conf.SET_TARGET_TYPE("ROKEN_HOSTCC", 'SYSLIB') -check_system_heimdal_lib("wind", "wind_stringprep", "wind.h", onlyif="roken") -check_system_heimdal_lib("hx509", "hx509_bitstring_print", "hx509.h", onlyif="roken wind") -check_system_heimdal_lib("asn1", "initialize_asn1_error_table", "asn1_err.h", onlyif="roken com_err") -check_system_heimdal_lib("heimbase", "heim_cmp", "heimbase.h", onlyif="roken") -check_system_heimdal_lib("hcrypto", "MD4_Init", "hcrypto/md4.h", - onlyif="asn1 roken com_err") -if check_system_heimdal_lib("krb5", "krb5_anyaddr", "krb5.h", - onlyif="roken wind asn1 hx509 hcrypto com_err heimbase"): - conf.CHECK_FUNCS_IN('krb5_free_unparsed_name', 'krb5', headers="krb5.h") -check_system_heimdal_lib("gssapi", "gss_oid_to_name", "gssapi.h", - onlyif="hcrypto asn1 roken krb5 com_err wind") -check_system_heimdal_lib("heimntlm", "heim_ntlm_ntlmv2_key", "heimntlm.h", - onlyif="roken hcrypto krb5") -if check_system_heimdal_lib("hdb", "hdb_db_dir", "krb5.h hdb.h", - onlyif="roken krb5 hcrypto com_err wind"): - CCDEFINES = list(conf.env.CCDEFINES) - conf.undefine("HAVE_CONFIG_H") - while "HAVE_CONFIG_H=1" in conf.env.CCDEFINES: - conf.env.CCDEFINES.remove("HAVE_CONFIG_H=1") - try: + +# Make sure HAVE_CONFIG_H is unset, as the system Heimdal headers use it +# and include config.h if it is set, resulting in failure (since config.h +# doesn't yet exist) + +CCDEFINES = list(conf.env.CCDEFINES) +conf.undefine("HAVE_CONFIG_H") +while "HAVE_CONFIG_H=1" in conf.env.CCDEFINES: + conf.env.CCDEFINES.remove("HAVE_CONFIG_H=1") +try: + check_system_heimdal_lib("wind", "wind_stringprep", "wind.h", onlyif="roken") + check_system_heimdal_lib("hx509", "hx509_bitstring_print", "hx509.h", onlyif="roken wind") + check_system_heimdal_lib("asn1", "initialize_asn1_error_table", "asn1_err.h", onlyif="roken com_err") + check_system_heimdal_lib("heimbase", "heim_cmp", "heimbase.h", onlyif="roken") + check_system_heimdal_lib("hcrypto", "MD4_Init", "hcrypto/md4.h", + onlyif="asn1 roken com_err") + if check_system_heimdal_lib("krb5", "krb5_anyaddr", "krb5.h", + onlyif="roken wind asn1 hx509 hcrypto com_err heimbase"): + conf.CHECK_FUNCS_IN('krb5_free_unparsed_name', 'krb5', headers="krb5.h") + check_system_heimdal_lib("gssapi", "gss_oid_to_name", "gssapi.h", + onlyif="hcrypto asn1 roken krb5 com_err wind") + check_system_heimdal_lib("heimntlm", "heim_ntlm_ntlmv2_key", "heimntlm.h", + onlyif="roken hcrypto krb5") + if check_system_heimdal_lib("hdb", "hdb_db_dir", "krb5.h hdb.h", + onlyif="roken krb5 hcrypto com_err wind"): conf.CHECK_CODE(''' #include <hdb.h> int main(void) { hdb_enctype2key(NULL, NULL, NULL, 0, NULL); } @@ -232,13 +237,11 @@ if check_system_heimdal_lib("hdb", "hdb_db_dir", "krb5.h hdb.h", lib='hdb', msg='Checking whether hdb_enctype2key takes a keyset argument', local_include=False) - finally: - conf.env.CCDEFINES = CCDEFINES - conf.define("HAVE_CONFIG_H", "1") - -check_system_heimdal_lib("kdc", "kdc_log", "kdc.h", - onlyif="roken krb5 hdb asn1 heimntlm hcrypto com_err wind heimbase") + check_system_heimdal_lib("kdc", "kdc_log", "kdc.h", + onlyif="roken krb5 hdb asn1 heimntlm hcrypto com_err wind heimbase") +finally: + conf.env.CCDEFINES = CCDEFINES # With the proper checks in place we should be able to build against the system libtommath. #if conf.CHECK_BUNDLED_SYSTEM('tommath', checkfunctions='mp_init', headers='tommath.h'): |