@@ -52,20 +52,29 @@ def _get_output(*args, **kwargs):
5252if link_args is None :
5353 if osx_has_gss_framework :
5454 link_args = '-framework GSS'
55+ elif os .environ .get ('MINGW_PREFIX' ):
56+ link_args = '-lgss'
5557 else :
5658 link_args = get_output ('krb5-config --libs gssapi' )
5759
5860if compile_args is None :
5961 if osx_has_gss_framework :
6062 compile_args = '-framework GSS -DOSX_HAS_GSS_FRAMEWORK'
63+ elif os .environ .get ('MINGW_PREFIX' ):
64+ compile_args = '-fPIC'
6165 else :
6266 compile_args = get_output ('krb5-config --cflags gssapi' )
6367
6468link_args = link_args .split ()
6569compile_args = compile_args .split ()
6670
6771# add in the extra workarounds for different include structures
68- prefix = get_output ('krb5-config gssapi --prefix' )
72+ try :
73+ prefix = get_output ('krb5-config gssapi --prefix' )
74+ except Exception :
75+ print ("WARNING: couldn't find krb5-config; assuming prefix of %s"
76+ % str (sys .prefix ))
77+ prefix = sys .prefix
6978gssapi_ext_h = os .path .join (prefix , 'include/gssapi/gssapi_ext.h' )
7079if os .path .exists (gssapi_ext_h ):
7180 compile_args .append ("-DHAS_GSSAPI_EXT_H" )
@@ -85,6 +94,8 @@ def _get_output(*args, **kwargs):
8594 main_path = ""
8695 if main_lib is None and osx_has_gss_framework :
8796 main_lib = ctypes .util .find_library ('GSS' )
97+ elif os .environ .get ('MINGW_PREFIX' ):
98+ main_lib = os .environ .get ('MINGW_PREFIX' )+ '/bin/libgss-3.dll'
8899 elif main_lib is None :
89100 for opt in link_args :
90101 if opt .startswith ('-lgssapi' ):
0 commit comments