diff --git a/Makefile.am b/Makefile.am index a7c74b06a..73bd37899 100644 --- a/Makefile.am +++ b/Makefile.am @@ -164,7 +164,7 @@ pylint: $(top_builddir)/ipapython/version.py ipasetup.py -name '*.py' -print -o \ -type f -exec grep -qsm1 '^#!.*\bpython' '{}' \; -print`; \ echo "Pylint is running, please wait ..."; \ - PYTHONPATH=$(top_srcdir) $(PYLINT) \ + PYTHONPATH=$(top_srcdir) $(PYTHON) -m pylint \ --rcfile=$(top_srcdir)/pylintrc $${FILES} .PHONY: jslint jslint-ui jslint-ui-test jslint-html \ diff --git a/configure.ac b/configure.ac index c02a672f7..cf4392bfe 100644 --- a/configure.ac +++ b/configure.ac @@ -435,16 +435,19 @@ AC_ARG_ENABLE([i18ntests], AC_SUBST([i18ntests]) AM_CONDITIONAL([WITH_POLINT], [test "x${enable_i18ntests}" == "xyes"]) -AC_ARG_WITH([pylint], - AS_HELP_STRING([--with-pylint=path], - [path to Pylint]), -dnl --without-pylint will set PYLINT=no - [PYLINT=$with_pylint], - [AC_PATH_PROG([PYLINT], [pylint])] +AC_ARG_ENABLE([pylint], + AS_HELP_STRING([--disable-pylint], + [skip Pylint in make lint target]), + [PYLINT=no], + [PYLINT=yes + AC_MSG_CHECKING([for Pylint]) + $PYTHON -m pylint --version > /dev/null + if test "$?" != "0"; then + AC_MSG_ERROR([cannot find pylint for $PYTHON]) + fi + AC_MSG_RESULT([yes]) + ] ) -if test "x${PYLINT}" == "x"; then - AC_MSG_ERROR([cannot find Pylint]) -fi AC_SUBST([PYLINT]) AM_CONDITIONAL([WITH_PYLINT], [test "x${PYLINT}" != "xno"])