From cf29ca969651eecc1d8cb649bcd025e0fcf9d6fa Mon Sep 17 00:00:00 2001 From: Don Allingham Date: Wed, 23 May 2001 22:21:37 +0000 Subject: [PATCH] Support for autodetection of python include paths svn: r57 --- gramps/configure | 52 +++++++++++++++++++++++++++++++++--------------- 1 file changed, 36 insertions(+), 16 deletions(-) diff --git a/gramps/configure b/gramps/configure index edc94bf93..eab0d288c 100755 --- a/gramps/configure +++ b/gramps/configure @@ -596,6 +596,8 @@ else fi +PYTHON_VERSION=`$PYTHON -c "import sys; print sys.version[:3]"` + @@ -630,7 +632,7 @@ ac_configure=$ac_aux_dir/configure # This should be Cygnus configure. # SVR4 /usr/ucb/install, which tries to use the nonexistent group "staff" # ./install, which can be erroneously created by make from ./install.sh. echo $ac_n "checking for a BSD compatible install""... $ac_c" 1>&6 -echo "configure:634: checking for a BSD compatible install" >&5 +echo "configure:636: checking for a BSD compatible install" >&5 if test -z "$INSTALL"; then if eval "test \"`echo '$''{'ac_cv_path_install'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 @@ -683,7 +685,7 @@ test -z "$INSTALL_SCRIPT" && INSTALL_SCRIPT='${INSTALL_PROGRAM}' test -z "$INSTALL_DATA" && INSTALL_DATA='${INSTALL} -m 644' echo $ac_n "checking whether ${MAKE-make} sets \${MAKE}""... $ac_c" 1>&6 -echo "configure:687: checking whether ${MAKE-make} sets \${MAKE}" >&5 +echo "configure:689: checking whether ${MAKE-make} sets \${MAKE}" >&5 set dummy ${MAKE-make}; ac_make=`echo "$2" | sed 'y%./+-%__p_%'` if eval "test \"`echo '$''{'ac_cv_prog_make_${ac_make}_set'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 @@ -713,7 +715,7 @@ fi # Extract the first word of "gcc", so it can be a program name with args. set dummy gcc; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:717: checking for $ac_word" >&5 +echo "configure:719: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -743,7 +745,7 @@ if test -z "$CC"; then # Extract the first word of "cc", so it can be a program name with args. set dummy cc; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:747: checking for $ac_word" >&5 +echo "configure:749: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -794,7 +796,7 @@ fi # Extract the first word of "cl", so it can be a program name with args. set dummy cl; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:798: checking for $ac_word" >&5 +echo "configure:800: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -826,7 +828,7 @@ fi fi echo $ac_n "checking whether the C compiler ($CC $CFLAGS $LDFLAGS) works""... $ac_c" 1>&6 -echo "configure:830: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) works" >&5 +echo "configure:832: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) works" >&5 ac_ext=c # CFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options. @@ -837,12 +839,12 @@ cross_compiling=$ac_cv_prog_cc_cross cat > conftest.$ac_ext << EOF -#line 841 "configure" +#line 843 "configure" #include "confdefs.h" main(){return(0);} EOF -if { (eval echo configure:846: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:848: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then ac_cv_prog_cc_works=yes # If we can't run a trivial program, we are probably using a cross compiler. if (./conftest; exit) 2>/dev/null; then @@ -868,12 +870,12 @@ if test $ac_cv_prog_cc_works = no; then { echo "configure: error: installation or configuration problem: C compiler cannot create executables." 1>&2; exit 1; } fi echo $ac_n "checking whether the C compiler ($CC $CFLAGS $LDFLAGS) is a cross-compiler""... $ac_c" 1>&6 -echo "configure:872: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) is a cross-compiler" >&5 +echo "configure:874: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) is a cross-compiler" >&5 echo "$ac_t""$ac_cv_prog_cc_cross" 1>&6 cross_compiling=$ac_cv_prog_cc_cross echo $ac_n "checking whether we are using GNU C""... $ac_c" 1>&6 -echo "configure:877: checking whether we are using GNU C" >&5 +echo "configure:879: checking whether we are using GNU C" >&5 if eval "test \"`echo '$''{'ac_cv_prog_gcc'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -882,7 +884,7 @@ else yes; #endif EOF -if { ac_try='${CC-cc} -E conftest.c'; { (eval echo configure:886: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; } | egrep yes >/dev/null 2>&1; then +if { ac_try='${CC-cc} -E conftest.c'; { (eval echo configure:888: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; } | egrep yes >/dev/null 2>&1; then ac_cv_prog_gcc=yes else ac_cv_prog_gcc=no @@ -901,7 +903,7 @@ ac_test_CFLAGS="${CFLAGS+set}" ac_save_CFLAGS="$CFLAGS" CFLAGS= echo $ac_n "checking whether ${CC-cc} accepts -g""... $ac_c" 1>&6 -echo "configure:905: checking whether ${CC-cc} accepts -g" >&5 +echo "configure:907: checking whether ${CC-cc} accepts -g" >&5 if eval "test \"`echo '$''{'ac_cv_prog_cc_g'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -937,7 +939,7 @@ fi # Extract the first word of "gnome-config", so it can be a program name with args. set dummy gnome-config; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:941: checking for $ac_word" >&5 +echo "configure:943: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_prog_HAVE_GNOME_CONFIG'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -967,7 +969,7 @@ fi echo $ac_n "checking Python bindings for sax/xml""... $ac_c" 1>&6 -echo "configure:971: checking Python bindings for sax/xml" >&5 +echo "configure:973: checking Python bindings for sax/xml" >&5 cat > conftest.py <&6 echo $ac_n "checking Python bindings for gtk+""... $ac_c" 1>&6 -echo "configure:997: checking Python bindings for gtk+" >&5 +echo "configure:999: checking Python bindings for gtk+" >&5 cat > conftest.py <&6 echo $ac_n "checking Python bindings for GNOME""... $ac_c" 1>&6 -echo "configure:1023: checking Python bindings for GNOME" >&5 +echo "configure:1025: checking Python bindings for GNOME" >&5 cat > conftest.py <&6 +echo $ac_n "checking for headers required to compile python extensions""... $ac_c" 1>&6 +echo "configure:1053: checking for headers required to compile python extensions" >&5 +py_prefix=`$PYTHON -c "import sys; print sys.prefix"` +py_exec_prefix=`$PYTHON -c "import sys; print sys.exec_prefix"` +PYTHON_INCLUDES="-I${py_prefix}/include/python${PYTHON_VERSION}" +if test "$py_prefix" != "$py_exec_prefix"; then + PYTHON_INCLUDES="$PYTHON_INCLUDES -I${py_exec_prefix}/include/python${PYTHON_VERSION}" +fi + +echo "${py_exec_prefix}/include/python${PYTHON_VERSION}/Python.h" +if test -f "${py_exec_prefix}/include/python${PYTHON_VERSION}/Python.h" +then + echo "$ac_t""ok" 1>&6 +else + { echo "configure: error: not found" 1>&2; exit 1; } +fi + trap '' 1 2 15 @@ -1207,6 +1226,7 @@ s%@INSTALL_DATA@%$INSTALL_DATA%g s%@SET_MAKE@%$SET_MAKE%g s%@CC@%$CC%g s%@HAVE_GNOME_CONFIG@%$HAVE_GNOME_CONFIG%g +s%@PYTHON_INCLUDES@%$PYTHON_INCLUDES%g CEOF EOF