diff options
author | Alasdair G Kergon <agk@redhat.com> | 2016-02-18 02:10:35 +0000 |
---|---|---|
committer | Alasdair G Kergon <agk@redhat.com> | 2016-02-18 02:10:35 +0000 |
commit | e5fc48411a5e872eb7c34dff51aa7e0910812119 (patch) | |
tree | 31f99f0a64f77f9377c0551f19eca3e07a685af6 | |
parent | 7dce72ee182d80d85d5292c85877d826c283cf33 (diff) | |
download | lvm2-e5fc48411a5e872eb7c34dff51aa7e0910812119.tar.gz |
configure: Use python-config if python2-config not found.
Assume that's good enough for older systems.
-rwxr-xr-x | configure | 98 | ||||
-rw-r--r-- | configure.in | 1 |
2 files changed, 99 insertions, 0 deletions
@@ -12827,6 +12827,104 @@ else PYTHON2_CONFIG="$ac_cv_path_PYTHON2_CONFIG" fi + test -z "$PYTHON2_CONFIG" && if test -n "$ac_tool_prefix"; then + # Extract the first word of "${ac_tool_prefix}python-config", so it can be a program name with args. +set dummy ${ac_tool_prefix}python-config; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_path_PYTHON2_CONFIG+:} false; then : + $as_echo_n "(cached) " >&6 +else + case $PYTHON2_CONFIG in + [\\/]* | ?:[\\/]*) + ac_cv_path_PYTHON2_CONFIG="$PYTHON2_CONFIG" # Let the user override the test with a path. + ;; + *) + as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_path_PYTHON2_CONFIG="$as_dir/$ac_word$ac_exec_ext" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + + ;; +esac +fi +PYTHON2_CONFIG=$ac_cv_path_PYTHON2_CONFIG +if test -n "$PYTHON2_CONFIG"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $PYTHON2_CONFIG" >&5 +$as_echo "$PYTHON2_CONFIG" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + +fi +if test -z "$ac_cv_path_PYTHON2_CONFIG"; then + ac_pt_PYTHON2_CONFIG=$PYTHON2_CONFIG + # Extract the first word of "python-config", so it can be a program name with args. +set dummy python-config; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_path_ac_pt_PYTHON2_CONFIG+:} false; then : + $as_echo_n "(cached) " >&6 +else + case $ac_pt_PYTHON2_CONFIG in + [\\/]* | ?:[\\/]*) + ac_cv_path_ac_pt_PYTHON2_CONFIG="$ac_pt_PYTHON2_CONFIG" # Let the user override the test with a path. + ;; + *) + as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_path_ac_pt_PYTHON2_CONFIG="$as_dir/$ac_word$ac_exec_ext" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + + ;; +esac +fi +ac_pt_PYTHON2_CONFIG=$ac_cv_path_ac_pt_PYTHON2_CONFIG +if test -n "$ac_pt_PYTHON2_CONFIG"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_pt_PYTHON2_CONFIG" >&5 +$as_echo "$ac_pt_PYTHON2_CONFIG" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + if test "x$ac_pt_PYTHON2_CONFIG" = x; then + PYTHON2_CONFIG="" + else + case $cross_compiling:$ac_tool_warned in +yes:) +{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 +$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} +ac_tool_warned=yes ;; +esac + PYTHON2_CONFIG=$ac_pt_PYTHON2_CONFIG + fi +else + PYTHON2_CONFIG="$ac_cv_path_PYTHON2_CONFIG" +fi + test -z "$PYTHON2_CONFIG" && as_fn_error $? "python headers are required for --enable-python2_bindings but cannot be found" "$LINENO" 5 PYTHON2_INCDIRS=`"$PYTHON2_CONFIG" --includes` PYTHON2_LIBDIRS=`"$PYTHON2_CONFIG" --libs` diff --git a/configure.in b/configure.in index 22ba81264..7a5aa5d3e 100644 --- a/configure.in +++ b/configure.in @@ -1476,6 +1476,7 @@ if test "$PYTHON2_BINDINGS" = yes; then AC_PATH_TOOL(PYTHON2, python2) test -z "$PYTHON2" && AC_MSG_ERROR([python2 is required for --enable-python2_bindings but cannot be found]) AC_PATH_TOOL(PYTHON2_CONFIG, python2-config) + test -z "$PYTHON2_CONFIG" && AC_PATH_TOOL(PYTHON2_CONFIG, python-config) test -z "$PYTHON2_CONFIG" && AC_MSG_ERROR([python headers are required for --enable-python2_bindings but cannot be found]) PYTHON2_INCDIRS=`"$PYTHON2_CONFIG" --includes` PYTHON2_LIBDIRS=`"$PYTHON2_CONFIG" --libs` |