Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

build on mingw - part 1 #149

Closed
wants to merge 6 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions gssapi/raw/python_gssapi.h
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
#ifdef OSX_HAS_GSS_FRAMEWORK
#include <GSS/GSS.h>
#elif __MINGW32__
#include <gss.h>
#else
#include <gssapi/gssapi.h>
#endif
4 changes: 4 additions & 0 deletions gssapi/raw/python_gssapi_ext.h
Original file line number Diff line number Diff line change
@@ -1,9 +1,13 @@
#ifdef OSX_HAS_GSS_FRAMEWORK
#include <GSS/GSS.h>
#else
#ifdef __MINGW32__
#include <gss.h>
#else
#ifdef HAS_GSSAPI_EXT_H
#include <gssapi/gssapi_ext.h>
#else
#include <gssapi/gssapi.h>
#endif
#endif
#endif
2 changes: 2 additions & 0 deletions gssapi/raw/python_gssapi_krb5.h
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
#ifdef OSX_HAS_GSS_FRAMEWORK
#include <GSS/gssapi_krb5.h>
#elif __MINGW32__
#include <gss.h>
#else
#include <gssapi/gssapi_krb5.h>
#endif
11 changes: 10 additions & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -52,20 +52,27 @@ def _get_output(*args, **kwargs):
if link_args is None:
if osx_has_gss_framework:
link_args = '-framework GSS'
elif os.environ.get('MINGW_PREFIX'):
link_args = '-lgss'
else:
link_args = get_output('krb5-config --libs gssapi')

if compile_args is None:
if osx_has_gss_framework:
compile_args = '-framework GSS -DOSX_HAS_GSS_FRAMEWORK'
elif os.environ.get('MINGW_PREFIX'):
compile_args = '-fPIC'
else:
compile_args = get_output('krb5-config --cflags gssapi')

link_args = link_args.split()
compile_args = compile_args.split()

# add in the extra workarounds for different include structures
prefix = get_output('krb5-config gssapi --prefix')
try:
prefix = get_output('krb5-config gssapi --prefix')
except Exception:
prefix = sys.prefix
gssapi_ext_h = os.path.join(prefix, 'include/gssapi/gssapi_ext.h')
if os.path.exists(gssapi_ext_h):
compile_args.append("-DHAS_GSSAPI_EXT_H")
Expand All @@ -85,6 +92,8 @@ def _get_output(*args, **kwargs):
main_path = ""
if main_lib is None and osx_has_gss_framework:
main_lib = ctypes.util.find_library('GSS')
elif os.environ.get('MINGW_PREFIX'):
main_lib = os.environ.get('MINGW_PREFIX')+'/bin/libgss-3.dll'
elif main_lib is None:
for opt in link_args:
if opt.startswith('-lgssapi'):
Expand Down