]> git.lyx.org Git - features.git/commitdiff
Provide our own patched AM_PYTHON_CHECK_VERSION that requires python <3.0
authorJulien Rioux <jrioux@lyx.org>
Tue, 29 Nov 2011 23:03:08 +0000 (23:03 +0000)
committerJulien Rioux <jrioux@lyx.org>
Tue, 29 Nov 2011 23:03:08 +0000 (23:03 +0000)
Use the python found by configure to build po files.

git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/branches/BRANCH_2_0_X@40319 a592a061-630c-0410-9148-cb99ea01b6c8

config/lyxinclude.m4
po/Makefile.in.in
po/Rules-lyx
status.20x

index c62960ad88bb659084126ad9650e084af0d2a3bc..940a4af20270135803cef75e12bb4f4831e8a605 100644 (file)
@@ -635,3 +635,24 @@ AC_DEFUN([LYX_SET_VERSION_INFO],
  AC_SUBST(LYX_DIR_VER,"$lyx_dir_ver")
  AC_SUBST(LYX_USERDIR_VER,"$lyx_userdir_ver")
 ])
+
+# AM_PYTHON_CHECK_VERSION(PROG, VERSION, [ACTION-IF-TRUE], [ACTION-IF-FALSE])
+# ---------------------------------------------------------------------------
+# Copied from autoconf 2.68, added a check that python version is < 3.0
+# Run ACTION-IF-TRUE if the Python interpreter PROG has version >= VERSION.
+# Run ACTION-IF-FALSE otherwise.
+# This test uses sys.hexversion instead of the string equivalent (first
+# word of sys.version), in order to cope with versions such as 2.2c1.
+# This supports Python 2.0 or higher. (2.0 was released on October 16, 2000).
+AC_DEFUN([AM_PYTHON_CHECK_VERSION],
+ [prog="import sys
+# split strings by '.' and convert to numeric.  Append some zeros
+# because we need at least 4 digits for the hex conversion.
+# map returns an iterator in Python 3.0 and a list in 2.x
+minver = list(map(int, '$2'.split('.'))) + [[0, 0, 0]]
+minverhex = 0
+maxverhex = 50331648 # = 3.0.0.0
+# xrange is not present in Python 3.0 and range returns an iterator
+for i in list(range(0, 4)): minverhex = (minverhex << 8) + minver[[i]]
+sys.exit(sys.hexversion < minverhex or sys.hexversion >= maxverhex)"
+  AS_IF([AM_RUN_LOG([$1 -c "$prog"])], [$3], [$4])])
index 6306477bd3ab5f71744ad32fac0ddb0d4c5695bd..33534f93140225f4b81cb2997dcf9540ec00bf6f 100644 (file)
@@ -14,6 +14,8 @@ PACKAGE = @PACKAGE@
 VERSION = @VERSION@
 PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
 
+PYTHON = @PYTHON@
+
 SHELL = /bin/sh
 @SET_MAKE@
 
index 8aefa41eb2977356f723434698990e32774b5055..7e747efdc96ab7b91bc1745a9a7235c87b7b1846 100644 (file)
@@ -23,34 +23,34 @@ l10n_pots: qt4_l10n.pot layouts_l10n.pot languages_l10n.pot encodings_l10n.pot u
 
 qt4_l10n.pot: $(top_srcdir)/src/frontends/qt4/ui/*.ui
        LC_ALL=C ; export LC_ALL ; \
-       python $(srcdir)/lyx_pot.py -b $(top_srcdir) -o $@ -t qt4 ${top_srcdir}/src/frontends/qt4/ui/*.ui 
+       $(PYTHON) $(srcdir)/lyx_pot.py -b $(top_srcdir) -o $@ -t qt4 ${top_srcdir}/src/frontends/qt4/ui/*.ui 
 
 layouts_l10n.pot: $(top_srcdir)/lib/layouts/*.layout $(top_srcdir)/lib/layouts/*.inc \
                $(top_srcdir)/lib/layouts/*.module
        LC_ALL=C ; export LC_ALL ; \
-       python $(srcdir)/lyx_pot.py -b $(top_srcdir) -o $@ -t layouts ${top_srcdir}/lib/layouts/*.layout ${top_srcdir}/lib/layouts/*.inc ${top_srcdir}/lib/layouts/*.module
+       $(PYTHON) $(srcdir)/lyx_pot.py -b $(top_srcdir) -o $@ -t layouts ${top_srcdir}/lib/layouts/*.layout ${top_srcdir}/lib/layouts/*.inc ${top_srcdir}/lib/layouts/*.module
 
 $(top_srcdir)/lib/layouttranslations: $(POFILES) $(top_srcdir)/lib/layouts/*.layout \
                $(top_srcdir)/lib/layouts/*.inc $(top_srcdir)/lib/layouts/*.module
        LC_ALL=C ; export LC_ALL ; \
-       python $(srcdir)/lyx_pot.py -b $(top_srcdir) -o $@ -t layouttranslations ${top_srcdir}/lib/layouts/*.layout ${top_srcdir}/lib/layouts/*.inc ${top_srcdir}/lib/layouts/*.module
+       $(PYTHON) $(srcdir)/lyx_pot.py -b $(top_srcdir) -o $@ -t layouttranslations ${top_srcdir}/lib/layouts/*.layout ${top_srcdir}/lib/layouts/*.inc ${top_srcdir}/lib/layouts/*.module
 
 languages_l10n.pot: $(top_srcdir)/lib/languages
-       python $(srcdir)/lyx_pot.py -b $(top_srcdir) -o $@ -t languages ${top_srcdir}/lib/languages
+       $(PYTHON) $(srcdir)/lyx_pot.py -b $(top_srcdir) -o $@ -t languages ${top_srcdir}/lib/languages
 
 encodings_l10n.pot: $(top_srcdir)/lib/encodings
-       python $(srcdir)/lyx_pot.py -b $(top_srcdir) -o $@ -t encodings ${top_srcdir}/lib/encodings
+       $(PYTHON) $(srcdir)/lyx_pot.py -b $(top_srcdir) -o $@ -t encodings ${top_srcdir}/lib/encodings
 
 ui_l10n.pot: $(top_srcdir)/lib/ui/*.ui $(top_srcdir)/lib/ui/*.inc
        LC_ALL=C ; export LC_ALL ; \
-       python $(srcdir)/lyx_pot.py -b $(top_srcdir) -o $@ -t ui ${top_srcdir}/lib/ui/*.ui ${top_srcdir}/lib/ui/*.inc
+       $(PYTHON) $(srcdir)/lyx_pot.py -b $(top_srcdir) -o $@ -t ui ${top_srcdir}/lib/ui/*.ui ${top_srcdir}/lib/ui/*.inc
 
 external_l10n.pot: $(top_srcdir)/lib/external_templates
-       python $(srcdir)/lyx_pot.py -b $(top_srcdir) -o $@ -t external ${top_srcdir}/lib/external_templates
+       $(PYTHON) $(srcdir)/lyx_pot.py -b $(top_srcdir) -o $@ -t external ${top_srcdir}/lib/external_templates
 
 formats_l10n.pot: $(top_srcdir)/lib/configure.py
-       python $(srcdir)/lyx_pot.py -b $(top_srcdir) -o $@ -t formats ${top_srcdir}/lib/configure.py
+       $(PYTHON) $(srcdir)/lyx_pot.py -b $(top_srcdir) -o $@ -t formats ${top_srcdir}/lib/configure.py
 
 # LyX specific code to generate l10n statistics for the web site
 i18n.inc: $(POFILES) postats.py
-       (cd $(srcdir) ; python postats.py "$(VERSION)" $(POFILES)) >$@
+       (cd $(srcdir) ; $(PYTHON) postats.py "$(VERSION)" $(POFILES)) >$@
index faba583d52fb9f53c6107d1482df8cc47a45c31f..0cb661343e1fc6a065c0b206cac80e5c816ca600 100644 (file)
@@ -38,6 +38,8 @@ What's new
 
 * BUILD/INSTALLATION
 
+- Make sure that we detect and use python 2 on systems where python 3
+  is the default python interpreter.
 
 
 ** Bug fixes: