From: John Ellson Date: Thu, 15 Oct 2015 05:22:07 +0000 (-0400) Subject: add support for --enable-python34 X-Git-Tag: TRAVIS_CI_BUILD_EXPERIMENTAL~100 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=746a0298d3bd6f0db8482a8dce2cbc8572401e42;p=graphviz add support for --enable-python34 --- diff --git a/configure.ac b/configure.ac index e70f874a3..cf9ad801d 100644 --- a/configure.ac +++ b/configure.ac @@ -1527,6 +1527,68 @@ else fi AM_CONDITIONAL(WITH_PYTHON27, [test "x$use_python27" = "xYes"]) +dnl ----------------------------------- +dnl INCLUDES and LIBS for PYTHON34 + +AC_ARG_ENABLE(python34, + [AS_HELP_STRING([--enable-python34=no],[python34 language bindings])], + [], [enable_python34=no]) + +if test "x$enable_python34" != "xyes"; then + use_python34="No (disabled by default - for multiversion installs)" +else + if test "x$use_swig" != "xYes"; then + use_python34="No (swig not available)" + else + if test `$SWIG -help 2>&1 | $EGREP -c '\-python *- Generate'` = 0; then + use_python34="No (swig does not support -python option)" + else + AC_CHECK_PROG(PYTHON34,python3.4,python3.4) + if test "x$PYTHON34" = "x"; then + use_python34="No (python34 not available)" + else + PYTHON34_VERSION=`$PYTHON34 -V 2>&1 | $EGREP Python | cut -d ' ' -f 2` + if test "x$PYTHON34_VERSION" = "x"; then + PYTHON34= + else + PYTHON34_VERSION_MAJOR=`echo $PYTHON34_VERSION | cut -d '.' -f 1` + PYTHON34_VERSION_MINOR=`echo $PYTHON34_VERSION | cut -d '.' -f 2` + PYTHON34_VERSION_SHORT=$PYTHON34_VERSION_MAJOR.$PYTHON34_VERSION_MINOR + if test $PYTHON34_VERSION_MAJOR -lt 3; then + if test $PYTHON34_VERSION_MINOR -lt 4; then + PYTHON34= + fi + fi + fi + fi + if test "x$PYTHON34" = "x"; then + use_python34="No (python34 is too old)" + else + PYTHON34_PREFIX=`$PYTHON3 -c "import sys; print sys.prefix"` +# PYTHON34_INCLUDES=-I$PYTHON34_PREFIX/include/python$PYTHON34_VERSION_SHORT +# FIXME - whats the stupid "m" for? + PYTHON34_INCLUDES=-I/usr/include/python3.4m + PYTHON34_LIBS="-lpython$PYTHON_VERSION_SHORT" + PYTHON34_INSTALL_DIR="`$PYTHON34 $srcdir/config/config_python.py archsitelib`" + save_CPPFLAGS=$CPPFLAGS + CPPFLAGS="$CPPFLAGS $PYTHON34_INCLUDES" + AC_CHECK_HEADER(Python.h,,[ + use_python34="No (missing header)" + PYTHON34= + ]) + CPPFLAGS=$save_CPPFLAGS + if test "x$PYTHON34" != "x"; then + use_python34="Yes" + AC_SUBST([PYTHON34_INSTALL_DIR]) + AC_SUBST([PYTHON34_INCLUDES]) + AC_SUBST([PYTHON34_LIBS]) + fi + fi + fi + fi +fi +AM_CONDITIONAL(WITH_PYTHON34, [test "x$use_python34" = "xYes"]) + dnl ----------------------------------- dnl INCLUDES and LIBS for R @@ -3258,6 +3320,7 @@ echo " gv_python24: $use_python24" echo " gv_python25: $use_python25" echo " gv_python26: $use_python26" echo " gv_python27: $use_python27" +echo " gv_python34: $use_python34" echo " gv_R: $use_r" echo " gv_ruby: $use_ruby" echo " gv_tcl: $use_gv_tcl" diff --git a/tclpkg/gv/Makefile.am b/tclpkg/gv/Makefile.am index 0d5dfa467..bd4f0f5b0 100644 --- a/tclpkg/gv/Makefile.am +++ b/tclpkg/gv/Makefile.am @@ -251,6 +251,17 @@ libgv_python27_la_CPPFLAGS = $(BASECPPFLAGS) $(PYTHON27_INCLUDES) gv_python27.cpp: gv.i $(SWIG) -c++ -python -o gv_python27.cpp $(srcdir)/gv.i +pkgpython34dir = $(pkglibdir)/python34 +PYTHON34_data = gv.py +nodist_libgv_python34_la_SOURCES = gv_python34.cpp $(PYTHON34_data) +libgv_python34_la_SOURCES = $(BASESOURCES) gv_dummy_init.c +libgv_python34_la_LIBADD = $(BASELIBS) $(PYTHON34_LIBS) +libgv_python34_la_LDFLAGS = -module -avoid-version +libgv_python34_la_CPPFLAGS = $(BASECPPFLAGS) $(PYTHON34_INCLUDES) +# $(PYTHON34_data): gv_python34.cpp +gv_python34.cpp: gv.i + $(SWIG) -c++ -python -o gv_python34.cpp $(srcdir)/gv.i + pkgRdir = $(pkglibdir)/R R_data = nodist_libgv_R_la_SOURCES = gv_R.cpp $(R_data) @@ -395,6 +406,13 @@ py_data = gv.3python.pdf pkgpython27_LTLIBRARIES = libgv_python27.la #DEVTSTS += test_python27 endif +if WITH_PYTHON34 +pkgpython34_DATA = $(PYTHON34_data) +py_mans = gv.3python +py_data = gv.3python.pdf +pkgpython34_LTLIBRARIES = libgv_python34.la +#DEVTSTS += test_python34 +endif man_MANS += $(py_mans) pdf_DATA += $(py_data) if WITH_R @@ -506,6 +524,9 @@ endif if WITH_PYTHON27 (cd $(DESTDIR)$(pkgpython27dir); rm -f _gv.so; $(LN_S) libgv_python27.so _gv.so;) endif +if WITH_PYTHON34 + (cd $(DESTDIR)$(pkgpython34dir); rm -f _gv.so; $(LN_S) libgv_python34.so _gv.so;) +endif if WITH_R (cd $(DESTDIR)$(pkgRdir); rm -f gv.so; $(LN_S) libgv_R.so gv.so;) endif @@ -632,6 +653,7 @@ CLEANFILES = test_*/* pkgIndex.tcl \ gv_python25.cpp $(PYTHON25_data) gv.pyc \ gv_python26.cpp $(PYTHON26_data) gv.pyc \ gv_python27.cpp $(PYTHON27_data) gv.pyc \ + gv_python34.cpp $(PYTHON34_data) gv.pyc \ gv_R.cpp $(R_data) \ gv_ruby.cpp $(RUBY_data) \ gv_tcl.cpp $(TCL_data) pkgIndex.tcl