diff options
author | Jerome Soumagne <jsoumagne@hdfgroup.org> | 2013-12-11 18:44:53 (GMT) |
---|---|---|
committer | Jerome Soumagne <jsoumagne@hdfgroup.org> | 2013-12-11 18:44:53 (GMT) |
commit | 27cea5d68b4e04f11fab075d82b0d771b845c4f8 (patch) | |
tree | 9b2c0bba365722ecf6827d8ede681d98f54a071f /configure | |
parent | c8764ab29b3d952052a899c85bfe0dd65339e3c8 (diff) | |
download | hdf5-27cea5d68b4e04f11fab075d82b0d771b845c4f8.zip hdf5-27cea5d68b4e04f11fab075d82b0d771b845c4f8.tar.gz hdf5-27cea5d68b4e04f11fab075d82b0d771b845c4f8.tar.bz2 |
[svn-r24530] Fix autotools to find/include numpy headers
Diffstat (limited to 'configure')
-rwxr-xr-x | configure | 238 |
1 files changed, 238 insertions, 0 deletions
@@ -693,6 +693,9 @@ PYTHON_SITE_PKG PYTHON_LDFLAGS PYTHON_CPPFLAGS PYTHON_VERSION +PYTHON_LIB +PYTHON_INCLUDE_DIR +PYTHON_BIN CLEARFILEBUF INSTRUMENT_LIBRARY TRACE_API @@ -28997,6 +29000,185 @@ fi case "X-$enableval" in X-yes) + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for python build information" >&5 +$as_echo_n "checking for python build information... " >&6; } +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: " >&5 +$as_echo "" >&6; } +for python in python3.3 python3.2 python3.1 python3.0 python2.7 python2.6 python2.5 python2.4 python2.3 python2.2 python2.1 python; do +for ac_prog in $python +do + # Extract the first word of "$ac_prog", so it can be a program name with args. +set dummy $ac_prog; 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_prog_PYTHON_BIN+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$PYTHON_BIN"; then + ac_cv_prog_PYTHON_BIN="$PYTHON_BIN" # Let the user override the test. +else +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_prog_PYTHON_BIN="$ac_prog" + $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 + +fi +fi +PYTHON_BIN=$ac_cv_prog_PYTHON_BIN +if test -n "$PYTHON_BIN"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $PYTHON_BIN" >&5 +$as_echo "$PYTHON_BIN" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + + test -n "$PYTHON_BIN" && break +done + +ax_python_bin=$PYTHON_BIN +if test x$ax_python_bin != x; then + as_ac_Lib=`$as_echo "ac_cv_lib_$ax_python_bin''_main" | $as_tr_sh` +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for main in -l$ax_python_bin" >&5 +$as_echo_n "checking for main in -l$ax_python_bin... " >&6; } +if eval \${$as_ac_Lib+:} false; then : + $as_echo_n "(cached) " >&6 +else + ac_check_lib_save_LIBS=$LIBS +LIBS="-l$ax_python_bin $LIBS" +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + + +#ifdef FC_DUMMY_MAIN +#ifndef FC_DUMMY_MAIN_EQ_F77 +# ifdef __cplusplus + extern "C" +# endif + int FC_DUMMY_MAIN() { return 1; } +#endif +#endif +int +main () +{ +return main (); + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO"; then : + eval "$as_ac_Lib=yes" +else + eval "$as_ac_Lib=no" +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext +LIBS=$ac_check_lib_save_LIBS +fi +eval ac_res=\$$as_ac_Lib + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 +$as_echo "$ac_res" >&6; } +if eval test \"x\$"$as_ac_Lib"\" = x"yes"; then : + ax_python_lib=$ax_python_bin +else + ax_python_lib=no +fi + + if test x$ax_python_lib == xno; then + as_ac_Lib=`$as_echo "ac_cv_lib_${ax_python_bin}m''_main" | $as_tr_sh` +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for main in -l${ax_python_bin}m" >&5 +$as_echo_n "checking for main in -l${ax_python_bin}m... " >&6; } +if eval \${$as_ac_Lib+:} false; then : + $as_echo_n "(cached) " >&6 +else + ac_check_lib_save_LIBS=$LIBS +LIBS="-l${ax_python_bin}m $LIBS" +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + + +#ifdef FC_DUMMY_MAIN +#ifndef FC_DUMMY_MAIN_EQ_F77 +# ifdef __cplusplus + extern "C" +# endif + int FC_DUMMY_MAIN() { return 1; } +#endif +#endif +int +main () +{ +return main (); + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO"; then : + eval "$as_ac_Lib=yes" +else + eval "$as_ac_Lib=no" +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext +LIBS=$ac_check_lib_save_LIBS +fi +eval ac_res=\$$as_ac_Lib + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 +$as_echo "$ac_res" >&6; } +if eval test \"x\$"$as_ac_Lib"\" = x"yes"; then : + ax_python_lib=${ax_python_bin}m +else + ax_python_lib=no +fi + + fi + if test x$ax_python_lib != xno; then + ax_python_header=`$ax_python_bin -c "from distutils.sysconfig import *; print(get_config_var('CONFINCLUDEPY'))"` + if test x$ax_python_header != x; then + break; + fi + fi +fi +done +if test x$ax_python_bin = x; then + ax_python_bin=no +fi +if test x$ax_python_header = x; then + ax_python_header=no +fi +if test x$ax_python_lib = x; then + ax_python_lib=no +fi + +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: results of the Python check:" >&5 +$as_echo " results of the Python check:" >&6; } +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: Binary: $ax_python_bin" >&5 +$as_echo " Binary: $ax_python_bin" >&6; } +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: Library: $ax_python_lib" >&5 +$as_echo " Library: $ax_python_lib" >&6; } +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: Include Dir: $ax_python_header" >&5 +$as_echo " Include Dir: $ax_python_header" >&6; } + +if test x$ax_python_header != xno; then + PYTHON_INCLUDE_DIR=$ax_python_header + +fi +if test x$ax_python_lib != xno; then + PYTHON_LIB=$ax_python_lib + +fi + # # Allow the use of a (user set) custom python version @@ -29367,6 +29549,7 @@ $as_echo_n "checking for Python support... " >&6; } cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include <Python.h> + #ifdef FC_DUMMY_MAIN #ifndef FC_DUMMY_MAIN_EQ_F77 # ifdef __cplusplus @@ -29400,6 +29583,61 @@ fi done + # Get NumPy header + PYTHON_NUMPY_INCLUDE_DIR=`$PYTHON_BIN -c 'import numpy; print numpy.get_include()'` + CPPFLAGS="$CPPFLAGS -I$PYTHON_NUMPY_INCLUDE_DIR" + AM_CPPFLAGS="$AM_CPPFLAGS -I$PYTHON_NUMPY_INCLUDE_DIR" + for ac_header in numpy/ndarrayobject.h +do : + ac_fn_c_check_header_compile "$LINENO" "numpy/ndarrayobject.h" "ac_cv_header_numpy_ndarrayobject_h" "#include <Python.h> + +" +if test "x$ac_cv_header_numpy_ndarrayobject_h" = xyes; then : + cat >>confdefs.h <<_ACEOF +#define HAVE_NUMPY_NDARRAYOBJECT_H 1 +_ACEOF + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for Python NumPy support" >&5 +$as_echo_n "checking for Python NumPy support... " >&6; } + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include <Python.h> + #include <numpy/ndarrayobject.h> + +#ifdef FC_DUMMY_MAIN +#ifndef FC_DUMMY_MAIN_EQ_F77 +# ifdef __cplusplus + extern "C" +# endif + int FC_DUMMY_MAIN() { return 1; } +#endif +#endif +int +main () +{ +Py_Initialize(); import_array(); Py_Finalize(); + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + +$as_echo "#define HAVE_PYTHON_NUMPY 1" >>confdefs.h + + { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +$as_echo "yes" >&6; } + PYTHON_NUMPY="yes" +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } + PYTHON_NUMPY="no" +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +else + as_fn_error $? "Could not find or include numpy/ndarrayobject.h" "$LINENO" 5 +fi + +done + ;; X-no|*) { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 |