## [Unreleased (7.0.6)]
+### Changed
+
+- The Autotools build system no longer looks for `python` binaries. The Python
+ interpreter is unconditionally assumed to be `python3`. The configure option
+ `--enable-python` is now an alias for `--enable-python3`.
+
### Fixed
- The modgraph.php example no longer includes gv.php, which is no longer
dnl -----------------------------------
dnl INCLUDES and LIBS for PYTHON
+# alias for `--enable-python3`
AC_ARG_ENABLE(python,
[AS_HELP_STRING([--enable-python=yes],[python language bindings])],
- [], [enable_python=yes])
-
-if test "x$enable_python" != "xyes"; then
- use_python="No (disabled)"
-else
- if test "x$use_swig" != "xYes"; then
- use_python="No (swig not available)"
- else
- if test `$SWIG -help 2>&1 | $EGREP -c '\-python *- Generate'` = 0; then
- use_python="No (swig does not support -python option)"
- else
- AC_CHECK_PROG(PYTHON,python,python)
- if test "x$PYTHON" = "x"; then
- use_python="No (python not available)"
- else
- PYTHON_VERSION=`$PYTHON -c "import sys; print('%d.%d' % sys.version_info[[0:2]])"`
- if test "x$PYTHON_VERSION" = "x"; then
- PYTHON=
- else
- AX_COMPARE_VERSION([$PYTHON_VERSION], [lt], [3], [PYTHON=])
- fi
- fi
- if test "x$PYTHON" = "x"; then
- use_python="No (python is too old)"
- else
- PYTHON_PREFIX=`$PYTHON -c "import sys; print(sys.prefix)"`
- PYTHON_INCLUDES=-I$PYTHON_PREFIX/include/python$PYTHON_VERSION
- PYTHON_LIBS="-undefined dynamic_lookup"
- PYTHON_INSTALL_DIR="`$PYTHON -c 'from distutils import sysconfig; print(sysconfig.get_python_lib(1,0))'`"
- save_CPPFLAGS=$CPPFLAGS
- CPPFLAGS="$CPPFLAGS $PYTHON_INCLUDES"
- AC_CHECK_HEADER(Python.h,,[
- use_python="No (missing header)"
- PYTHON=
- ])
- CPPFLAGS=$save_CPPFLAGS
- if test "x$PYTHON" != "x"; then
- use_python="Yes"
- AC_SUBST([PYTHON_INSTALL_DIR])
- AC_SUBST([PYTHON_INCLUDES])
- AC_SUBST([PYTHON_LIBS])
- fi
- fi
- fi
- fi
-fi
-AM_CONDITIONAL(WITH_PYTHON, [test "x$use_python" = "xYes"])
-
-dnl -----------------------------------
-dnl INCLUDES and LIBS for PYTHON3
+ [], [enable_python3=yes])
AC_ARG_ENABLE(python3,
[AS_HELP_STRING([--enable-python3=yes],[python3 language bindings])],
echo " gv_ocaml: $use_ocaml"
echo " gv_perl: $use_perl"
echo " gv_php: $use_php"
-echo " gv_python: $use_python"
echo " gv_python3: $use_python3"
echo " gv_R: $use_r"
echo " gv_ruby: $use_ruby"
pkgocamldir = $(pkglibdir)/ocaml
pkgperldir = $(pkglibdir)/perl
pkgphpdir = $(pkglibdir)/php
-pkgpythondir = $(pkglibdir)/python
pkgpython3dir = $(pkglibdir)/python3
pkgRdir = $(pkglibdir)/R
pkgrubydir = $(pkglibdir)/ruby
fi
endif
endif
-if WITH_PYTHON
- -mkdir -p $(DESTDIR)$(PYTHON_INSTALL_DIR);
- if test -w $(DESTDIR)$(PYTHON_INSTALL_DIR); then \
- (cd $(DESTDIR)$(PYTHON_INSTALL_DIR); \
- cp -f $(DESTDIR)$(pkgpythondir)/libgv_python.so _gv.so; \
- cp -f $(DESTDIR)$(pkgpythondir)/gv.py gv.py;) \
- else \
- echo "Warning: $(PYTHON_INSTALL_DIR) is not writable."; \
- echo "Skipping system installation of python binding."; \
- fi
-endif
if WITH_PYTHON3
-mkdir -p $(DESTDIR)$(PYTHON3_INSTALL_DIR);
if test -w $(DESTDIR)$(PYTHON3_INSTALL_DIR); then \
-rm -rf $(DESTDIR)$(PERL_INSTALL_DIR)/gv.so $(DESTDIR)$(PERL_INSTALL_DIR)/gv.pm;
-rm -rf $(DESTDIR)$(pkgphpdir);
-rm -rf $(DESTDIR)$(PHP_INSTALL_DIR)/gv.so $(DESTDIR)$(PHP_INSTALL_DATADIR)/gv.php;
- -rm -rf $(DESTDIR)$(pkgpythondir);
- -rm -rf $(DESTDIR)$(PYTHON_INSTALL_DIR)/_gv.so $(DESTDIR)$(PYTHON_INSTALL_DIR)/gv.py;
-rm -rf $(DESTDIR)$(pkgpython3dir);
-rm -rf $(DESTDIR)$(PYTHON3_INSTALL_DIR)/_gv.so $(DESTDIR)$(PYTHON3_INSTALL_DIR)/gv.py;
-rm -rf $(DESTDIR)$(pkgRdir);
gv_php.cpp: gv.i
$(SWIG) -c++ $(SWIG_PHP_OPT) -o $@ $(srcdir)/gv.i
-pkgpythondir = $(pkglibdir)/python
-PYTHON_data = gv.py
-nodist_libgv_python_la_SOURCES = gv_python.cpp $(PYTHON_data)
-libgv_python_la_SOURCES = $(BASESOURCES) gv_dummy_init.c
-libgv_python_la_LIBADD = $(BASELIBS) $(PYTHON_LIBS)
-libgv_python_la_LDFLAGS = -module -avoid-version
-libgv_python_la_CPPFLAGS = $(BASECPPFLAGS) $(PYTHON_INCLUDES)
-$(PYTHON_data): gv_python.cpp
-gv_python.cpp: gv.i
- $(SWIG) -c++ -python -o $@ $(srcdir)/gv.i
-
pkgpython3dir = $(pkglibdir)/python3
PYTHON3_data = gv.py
nodist_libgv_python3_la_SOURCES = gv_python3.cpp $(PYTHON3_data)
pkgphp_LTLIBRARIES = libgv_php.la
DEVTSTS += test_php
endif
-if WITH_PYTHON
-pkgpython_DATA = $(PYTHON_data)
-pkgpython_LTLIBRARIES = libgv_python.la
-DEVTSTS += test_python
-endif
if WITH_PYTHON3
pkgpython3_DATA = $(PYTHON3_data)
pkgpython3_LTLIBRARIES = libgv_python3.la
if WITH_PHP
(cd $(DESTDIR)$(pkgphpdir); rm -f gv.so; $(LN_S) libgv_php.so gv.so;)
endif
-if WITH_PYTHON
- (cd $(DESTDIR)$(pkgpythondir); rm -f _gv.so; $(LN_S) libgv_python.so _gv.so;)
-endif
if WITH_PYTHON3
(cd $(DESTDIR)$(pkgpython3dir); rm -f _gv.so; $(LN_S) libgv_python3.so _gv.so;)
endif
ln -fs ../$(srcdir)/*.gv ../$(srcdir)/*.php .; \
$(PHP) ./test.php)
-.PHONY: test_python
-test_python: libgv_python.la
- -(mkdir -p test_python; cd test_python; \
- ln -fs ../.libs/libgv_python.so _gv.so; \
- ln -fs ../$(srcdir)/*.gv ../$(srcdir)/*.py .; \
- PYTHONPATH=. $(PYTHON) test.py)
-
.PHONY: test_python3
test_python3: libgv_python3.la
-(mkdir -p test_python3; cd test_python3; \
demoocamldir = $(demodir)
demoperldir = $(demodir)
demophpdir = $(demodir)
-demopythondir = $(demodir)
demopython3dir = $(demodir)
demoRdir = $(demodir)
demorubydir = $(demodir)
if WITH_PHP
demophp_SCRIPTS = modgraph.php
endif
-if WITH_PYTHON
-demopython_SCRIPTS = modgraph.py
-endif
if WITH_PYTHON3
demopython3_SCRIPTS = modgraph.py
endif