fi
AM_CONDITIONAL(WITH_PYTHON25, [test "x$use_python25" = "xYes"])
+dnl -----------------------------------
+dnl INCLUDES and LIBS for PYTHON26
+
+AC_ARG_ENABLE(python26,
+ [AS_HELP_STRING([--enable-python26=no],[python26 language bindings])],
+ [], [enable_python26=no])
+
+if test "x$enable_python26" != "xyes"; then
+ use_python26="No (disabled by default - for multiversion installs)"
+else
+ if test "x$use_swig" != "xYes"; then
+ use_python26="No (swig not available)"
+ else
+ if test `$SWIG -help 2>&1 | $GREP -c '\-python *- Generate'` = 0; then
+ use_python26="No (swig does not support -python option)"
+ else
+ AC_CHECK_PROG(PYTHON26,python2.6,python2.6)
+ if test "x$PYTHON26" = "x"; then
+ use_python26="No (python26 not available)"
+ else
+ PYTHON26_VERSION=`$PYTHON26 -V 2>&1 | $GREP Python | cut -d ' ' -f 2`
+ if test "x$PYTHON26_VERSION" = "x"; then
+ PYTHON26=
+ else
+ PYTHON26_VERSION_MAJOR=`echo $PYTHON26_VERSION | cut -d '.' -f 1`
+ PYTHON26_VERSION_MINOR=`echo $PYTHON26_VERSION | cut -d '.' -f 2`
+ PYTHON26_VERSION_SHORT=$PYTHON26_VERSION_MAJOR.$PYTHON26_VERSION_MINOR
+ if test $PYTHON26_VERSION_MAJOR -lt 3; then
+ if test $PYTHON26_VERSION_MAJOR -lt 2; then
+ PYTHON26=
+ else
+ if test $PYTHON26_VERSION_MINOR -lt 5; then
+ PYTHON26=
+ fi
+ fi
+ fi
+ fi
+ fi
+ if test "x$PYTHON26" = "x"; then
+ use_python26="No (python2.6 is too old)"
+ else
+ PYTHON26_PREFIX=`$PYTHON26 -c "import sys; print sys.prefix"`
+ PYTHON26_INCLUDES=-I$PYTHON26_PREFIX/include/python$PYTHON26_VERSION_SHORT
+ PYTHON24_LIBS="-lpython$PYTHON_VERSION_SHORT"
+ PYTHON26_INSTALL_DIR="`$PYTHON26 $srcdir/config/config_python.py archsitelib`"
+ save_CPPFLAGS=$CPPFLAGS
+ CPPFLAGS="$CPPFLAGS $PYTHON26_INCLUDES"
+ AC_CHECK_HEADER(Python.h,,[
+ use_python26="No (missing header)"
+ PYTHON26=
+ ])
+ CPPFLAGS=$save_CPPFLAGS
+ if test "x$PYTHON26" != "x"; then
+ use_python26="Yes"
+ AC_SUBST(PYTHON26_INSTALL_DIR)
+ AC_SUBST(PYTHON26_INCLUDES)
+ AC_SUBST(PYTHON26_LIBS)
+ fi
+ fi
+ fi
+ fi
+fi
+AM_CONDITIONAL(WITH_PYTHON26, [test "x$use_python26" = "xYes"])
+
dnl -----------------------------------
dnl INCLUDES and LIBS for R
echo " gv_python23: $use_python23"
echo " gv_python24: $use_python24"
echo " gv_python25: $use_python25"
+echo " gv_python26: $use_python26"
echo " gv_R: $use_r"
echo " gv_ruby: $use_ruby"
echo " gv_tcl: $use_gv_tcl"
$(SWIG) -c++ -python -o gv_python.cpp $(srcdir)/gv.i
pkgpython23dir = $(pkglibdir)/python23
-nodist_libgv_python23_la_SOURCES = $(nodist_libgv_python_la_SOURCES)
+PYTHON23_data = gv.py
+nodist_libgv_python23_la_SOURCES = gv_python23.cpp $(PYTHON23_data)
libgv_python23_la_SOURCES = $(BASESOURCES) gv_dummy_init.c
libgv_python23_la_LIBADD = $(BASELIBS) $(PYTHON23_LIBS)
libgv_python23_la_LDFLAGS = -module -avoid-version
libgv_python23_la_CPPFLAGS = $(BASECPPFLAGS) $(PYTHON23_INCLUDES)
+# $(PYTHON23_data): gv_python.cpp
+gv_python23.cpp: gv.i
+ $(SWIG) -c++ -python -classic -o gv_python23.cpp $(srcdir)/gv.i
pkgpython24dir = $(pkglibdir)/python24
-nodist_libgv_python24_la_SOURCES = $(nodist_libgv_python_la_SOURCES)
+PYTHON24_data = gv.py
+nodist_libgv_python24_la_SOURCES = gv_python24.cpp $(PYTHON24_data)
libgv_python24_la_SOURCES = $(BASESOURCES) gv_dummy_init.c
libgv_python24_la_LIBADD = $(BASELIBS) $(PYTHON24_LIBS)
libgv_python24_la_LDFLAGS = -module -avoid-version
libgv_python24_la_CPPFLAGS = $(BASECPPFLAGS) $(PYTHON24_INCLUDES)
+# $(PYTHON_data): gv_python.cpp
+gv_python24.cpp: gv.i
+ $(SWIG) -c++ -python -classic -o gv_python24.cpp $(srcdir)/gv.i
pkgpython25dir = $(pkglibdir)/python25
-nodist_libgv_python25_la_SOURCES = $(nodist_libgv_python_la_SOURCES)
+PYTHON25_data = gv.py
+nodist_libgv_python25_la_SOURCES = gv_python25.cpp $(PYTHON25_data)
libgv_python25_la_SOURCES = $(BASESOURCES) gv_dummy_init.c
libgv_python25_la_LIBADD = $(BASELIBS) $(PYTHON25_LIBS)
libgv_python25_la_LDFLAGS = -module -avoid-version
libgv_python25_la_CPPFLAGS = $(BASECPPFLAGS) $(PYTHON25_INCLUDES)
+# $(PYTHON_data): gv_python.cpp
+gv_python25.cpp: gv.i
+ $(SWIG) -c++ -python -o gv_python25.cpp $(srcdir)/gv.i
+
+pkgpython26dir = $(pkglibdir)/python26
+PYTHON26_data = gv.py
+nodist_libgv_python26_la_SOURCES = gv_python26.cpp $(PYTHON26_data)
+libgv_python26_la_SOURCES = $(BASESOURCES) gv_dummy_init.c
+libgv_python26_la_LIBADD = $(BASELIBS) $(PYTHON26_LIBS)
+libgv_python26_la_LDFLAGS = -module -avoid-version
+libgv_python26_la_CPPFLAGS = $(BASECPPFLAGS) $(PYTHON26_INCLUDES)
+# $(PYTHON_data): gv_python.cpp
+gv_python26.cpp: gv.i
+ $(SWIG) -c++ -python -o gv_python26.cpp $(srcdir)/gv.i
pkgRdir = $(pkglibdir)/R
R_data =
pkgpython25_LTLIBRARIES = libgv_python25.la
#DEVTSTS += test_python25
endif
+if WITH_PYTHON26
+pkgpython26_DATA = $(PYTHON26_data)
+man_MANS += gv.3python
+pdf_DATA += gv.3python.pdf
+pkgpython26_LTLIBRARIES = libgv_python26.la
+#DEVTSTS += test_python26
+endif
if WITH_R
pkgR_DATA = $(R_data)
man_MANS += gv.3r
if WITH_PYTHON25
(cd $(DESTDIR)$(pkgpython25dir); rm -f _gv.so; $(LN_S) libgv_python25.so _gv.so;)
endif
+if WITH_PYTHON26
+ (cd $(DESTDIR)$(pkgpython26dir); rm -f _gv.so; $(LN_S) libgv_python26.so _gv.so;)
+endif
if WITH_R
(cd $(DESTDIR)$(pkgRdir); rm -f gv.so; $(LN_S) libgv_R.so gv.so;)
endif
rm -rf $(DESTDIR)$(pkgpython23dir);
rm -rf $(DESTDIR)$(pkgpython24dir);
rm -rf $(DESTDIR)$(pkgpython25dir);
+ rm -rf $(DESTDIR)$(pkgpython26dir);
rm -rf $(DESTDIR)$(pkgRdir);
rm -rf $(DESTDIR)$(pkgrubydir);
rm -rf $(DESTDIR)$(pkgtcldir);
gv_python23.cpp $(PYTHON23_data) gv.pyc \
gv_python24.cpp $(PYTHON24_data) gv.pyc \
gv_python25.cpp $(PYTHON25_data) gv.pyc \
+ gv_python26.cpp $(PYTHON26_data) gv.pyc \
gv_R.cpp $(R_data) \
gv_ruby.cpp $(RUBY_data) \
gv_tcl.cpp $(TCL_data) pkgIndex.tcl