forked from python/cpython
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
bpo-32598: Use autoconf to detect usable OpenSSL (python#5242)
Add https://www.gnu.org/software/autoconf-archive/ax_check_openssl.html to auto-detect compiler flags, linker flags and libraries to compile OpenSSL extensions. The M4 macro uses pkg-config and falls back to manual detection. Add autoconf magic to detect usable X509_VERIFY_PARAM_set1_host() and related functions. Refactor setup.py to use new config vars to compile _ssl and _hashlib modules. Signed-off-by: Christian Heimes <[email protected]>
- Loading branch information
Showing
9 changed files
with
585 additions
and
83 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
3 changes: 3 additions & 0 deletions
3
Misc/NEWS.d/next/Build/2018-01-19-14-50-19.bpo-32598.hP7bMV.rst
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
Use autoconf to detect OpenSSL libs, headers and supported features. The | ||
ax_check_openssl M4 macro uses pkg-config to locate OpenSSL and falls back | ||
to manual search. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -12,9 +12,9 @@ | |
# PARTICULAR PURPOSE. | ||
|
||
m4_ifndef([AC_CONFIG_MACRO_DIRS], [m4_defun([_AM_CONFIG_MACRO_DIRS], [])m4_defun([AC_CONFIG_MACRO_DIRS], [_AM_CONFIG_MACRO_DIRS($@)])]) | ||
dnl pkg.m4 - Macros to locate and utilise pkg-config. -*- Autoconf -*- | ||
dnl serial 11 (pkg-config-0.29) | ||
dnl | ||
# pkg.m4 - Macros to locate and utilise pkg-config. -*- Autoconf -*- | ||
# serial 11 (pkg-config-0.29.1) | ||
|
||
dnl Copyright © 2004 Scott James Remnant <[email protected]>. | ||
dnl Copyright © 2012-2015 Dan Nicholson <[email protected]> | ||
dnl | ||
|
@@ -55,7 +55,7 @@ dnl | |
dnl See the "Since" comment for each macro you use to see what version | ||
dnl of the macros you require. | ||
m4_defun([PKG_PREREQ], | ||
[m4_define([PKG_MACROS_VERSION], [0.29]) | ||
[m4_define([PKG_MACROS_VERSION], [0.29.1]) | ||
m4_if(m4_version_compare(PKG_MACROS_VERSION, [$1]), -1, | ||
[m4_fatal([pkg.m4 version $1 or higher is required but ]PKG_MACROS_VERSION[ found])]) | ||
])dnl PKG_PREREQ | ||
|
@@ -288,3 +288,72 @@ AS_VAR_COPY([$1], [pkg_cv_][$1]) | |
AS_VAR_IF([$1], [""], [$5], [$4])dnl | ||
])dnl PKG_CHECK_VAR | ||
|
||
dnl PKG_WITH_MODULES(VARIABLE-PREFIX, MODULES, | ||
dnl [ACTION-IF-FOUND],[ACTION-IF-NOT-FOUND], | ||
dnl [DESCRIPTION], [DEFAULT]) | ||
dnl ------------------------------------------ | ||
dnl | ||
dnl Prepare a "--with-" configure option using the lowercase | ||
dnl [VARIABLE-PREFIX] name, merging the behaviour of AC_ARG_WITH and | ||
dnl PKG_CHECK_MODULES in a single macro. | ||
AC_DEFUN([PKG_WITH_MODULES], | ||
[ | ||
m4_pushdef([with_arg], m4_tolower([$1])) | ||
m4_pushdef([description], | ||
[m4_default([$5], [build with ]with_arg[ support])]) | ||
m4_pushdef([def_arg], [m4_default([$6], [auto])]) | ||
m4_pushdef([def_action_if_found], [AS_TR_SH([with_]with_arg)=yes]) | ||
m4_pushdef([def_action_if_not_found], [AS_TR_SH([with_]with_arg)=no]) | ||
m4_case(def_arg, | ||
[yes],[m4_pushdef([with_without], [--without-]with_arg)], | ||
[m4_pushdef([with_without],[--with-]with_arg)]) | ||
AC_ARG_WITH(with_arg, | ||
AS_HELP_STRING(with_without, description[ @<:@default=]def_arg[@:>@]),, | ||
[AS_TR_SH([with_]with_arg)=def_arg]) | ||
AS_CASE([$AS_TR_SH([with_]with_arg)], | ||
[yes],[PKG_CHECK_MODULES([$1],[$2],$3,$4)], | ||
[auto],[PKG_CHECK_MODULES([$1],[$2], | ||
[m4_n([def_action_if_found]) $3], | ||
[m4_n([def_action_if_not_found]) $4])]) | ||
m4_popdef([with_arg]) | ||
m4_popdef([description]) | ||
m4_popdef([def_arg]) | ||
])dnl PKG_WITH_MODULES | ||
|
||
dnl PKG_HAVE_WITH_MODULES(VARIABLE-PREFIX, MODULES, | ||
dnl [DESCRIPTION], [DEFAULT]) | ||
dnl ----------------------------------------------- | ||
dnl | ||
dnl Convenience macro to trigger AM_CONDITIONAL after PKG_WITH_MODULES | ||
dnl check._[VARIABLE-PREFIX] is exported as make variable. | ||
AC_DEFUN([PKG_HAVE_WITH_MODULES], | ||
[ | ||
PKG_WITH_MODULES([$1],[$2],,,[$3],[$4]) | ||
AM_CONDITIONAL([HAVE_][$1], | ||
[test "$AS_TR_SH([with_]m4_tolower([$1]))" = "yes"]) | ||
])dnl PKG_HAVE_WITH_MODULES | ||
|
||
dnl PKG_HAVE_DEFINE_WITH_MODULES(VARIABLE-PREFIX, MODULES, | ||
dnl [DESCRIPTION], [DEFAULT]) | ||
dnl ------------------------------------------------------ | ||
dnl | ||
dnl Convenience macro to run AM_CONDITIONAL and AC_DEFINE after | ||
dnl PKG_WITH_MODULES check. HAVE_[VARIABLE-PREFIX] is exported as make | ||
dnl and preprocessor variable. | ||
AC_DEFUN([PKG_HAVE_DEFINE_WITH_MODULES], | ||
[ | ||
PKG_HAVE_WITH_MODULES([$1],[$2],[$3],[$4]) | ||
AS_IF([test "$AS_TR_SH([with_]m4_tolower([$1]))" = "yes"], | ||
[AC_DEFINE([HAVE_][$1], 1, [Enable ]m4_tolower([$1])[ support])]) | ||
])dnl PKG_HAVE_DEFINE_WITH_MODULES | ||
|
||
m4_include([m4/ax_check_openssl.m4]) |
Oops, something went wrong.