diff -r 92b3ce7ca95c configure.ac --- a/configure.ac Sat Jul 30 11:36:32 2016 +0200 +++ b/configure.ac Sun Jul 31 03:21:27 2016 +0800 @@ -3432,6 +3432,13 @@ [AC_MSG_RESULT(no) ]) +AC_MSG_CHECKING(for crypt) +AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include ]], [[void *x=crypt]])], + [AC_DEFINE(HAVE_CRYPT, 1, Define if you have the 'crypt' function.) + AC_MSG_RESULT(yes)], + [AC_MSG_RESULT(no) +]) + AC_MSG_CHECKING(for broken unsetenv) AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[ #include diff -r 92b3ce7ca95c setup.py --- a/setup.py Sat Jul 30 11:36:32 2016 +0200 +++ b/setup.py Sun Jul 31 03:21:27 2016 +0800 @@ -792,11 +792,15 @@ # crypt module. - if self.compiler.find_library_file(lib_dirs, 'crypt'): - libs = ['crypt'] + if config_h_vars.get('HAVE_CRYPT'): + if self.compiler.find_library_file(lib_dirs, 'crypt'): + libs = ['crypt'] + else: + libs = [] + exts.append( Extension('_crypt', ['_cryptmodule.c'], + libraries=libs) ) else: - libs = [] - exts.append( Extension('_crypt', ['_cryptmodule.c'], libraries=libs) ) + missing.append('_crypt') # CSV files exts.append( Extension('_csv', ['_csv.c']) )