[dots] configure.in: check for python modules. Change order for help topics in yelp pages



commit 047b77a08efb520b1771770940a0033363669eb3
Author: Fernando Herrera <fherrera onirica com>
Date:   Fri Jul 16 18:09:36 2010 +0200

    configure.in: check for python modules. Change order for help topics in yelp pages

 autogen.sh               |    2 +-
 configure.ac             |   21 ++++-----------
 dots/host_settings.py.in |    4 ---
 help/C/format.page       |    2 +-
 help/C/index.page        |    3 +-
 help/C/printing.page     |    2 +-
 help/C/translating.page  |    2 +-
 help/C/view.page         |    2 +-
 help/Makefile.am         |    3 +-
 m4/python.m4             |   62 ++++++++++++++++++++++++++++++++++++++++++++++
 10 files changed, 77 insertions(+), 26 deletions(-)
---
diff --git a/autogen.sh b/autogen.sh
index 74df883..62da71f 100755
--- a/autogen.sh
+++ b/autogen.sh
@@ -4,4 +4,4 @@ srcdir=`dirname $0`
 test -z "$srcdir" && srcdir=.
 
 REQUIRED_AUTOMAKE_VERSION=1.7.2
-USE_GNOME2_MACROS=1 USE_COMMON_DOC_BUILD=yes . gnome-autogen.sh
+ACLOCAL_FLAGS="$ACLOCAL_FLAGS -I m4" USE_GNOME2_MACROS=1 USE_COMMON_DOC_BUILD=yes . gnome-autogen.sh
diff --git a/configure.ac b/configure.ac
index c65b4f9..1c2125b 100644
--- a/configure.ac
+++ b/configure.ac
@@ -7,26 +7,17 @@ dnl == check for python ==
 AM_PATH_PYTHON(2.4)
 
 dnl == Check for liblouis and liblouisxml
-PKG_CHECK_MODULES(LIBLOUIS, [liblouis >= 1.6.2 liblouisxml >= 1.9.1])
+PKG_CHECK_MODULES(LIBLOUIS, [liblouis >= 1.6.2 liblouisxml >= 2.1.0])
+
+dnl == check for python modules ==
+AM_CHECK_PYMOD(louisxml,translateString, [], AC_MSG_ERROR([You need python bindings for liblouisxml file. Please read the INSTALL file.]))
+AM_CHECK_PYMOD(odf.odf2xhtml, ODF2XHTML, [], AC_MSG_ERROR([You need pyodf python package. Please read the INSTALL file.]))
+
 
 dnl Find tables dir
 TABLES_DIR=`pkg-config --variable=tablesdir liblouis`
 AC_SUBST(TABLES_DIR)
 
-dnl == check for xml2brl ==
-AC_PATH_PROG(XML2BRL, xml2brl)
-test -z "$XML2BRL" && AC_MSG_ERROR([
-You need xml2brl which is bundled with liblouisxml.
-])
-AC_SUBST(XML2BRL)
-
-dnl == check for xml2brl ==
-AC_PATH_PROG(ANTIWORD, antiword)
-test -z "$ANTIWORD" && AC_MSG_ERROR([
-You need antiword for MS Word document support.
-])
-AC_SUBST(ANTIWORD)
-
 dnl == i18n ==
 GETTEXT_PACKAGE=dots
 AC_SUBST(GETTEXT_PACKAGE)
diff --git a/dots/host_settings.py.in b/dots/host_settings.py.in
index 7663d11..74c534f 100644
--- a/dots/host_settings.py.in
+++ b/dots/host_settings.py.in
@@ -19,10 +19,6 @@
 
 import os, sys
 
-antiword = "@ANTIWORD@"
-
-xml2brl = "@XML2BRL@"
-
 tablesdir = "@TABLES_DIR@"
 
 gtkbuilder_dir = os.path.join("@prefix@", 'share', 'dots')
diff --git a/help/C/format.page b/help/C/format.page
index 6bf05e3..ec64463 100644
--- a/help/C/format.page
+++ b/help/C/format.page
@@ -2,7 +2,7 @@
       type="topic"
       id="format">
 <info>
-  <link type="guide" xref="index"/>
+  <link type="guide" xref="index" group="third"/>
 </info>
 <title>Output format</title>
 <p>You can use the Translation menu to change the translation table and the output format</p>
diff --git a/help/C/index.page b/help/C/index.page
index d19f488..f6d4ac4 100644
--- a/help/C/index.page
+++ b/help/C/index.page
@@ -1,5 +1,6 @@
 <page xmlns="http://projectmallard.org/1.0/";
       type="guide"
-      id="index">
+      id="index"
+      groups="first second third fourth fith">
 <title>Dots Help</title>
 </page>
diff --git a/help/C/printing.page b/help/C/printing.page
index 90c13dd..f5c32d1 100644
--- a/help/C/printing.page
+++ b/help/C/printing.page
@@ -2,7 +2,7 @@
       type="topic"
       id="printing">
 <info>
-  <link type="guide" xref="index"/>
+  <link type="guide" xref="index" group="fourth"/>
 </info>
 <title>Printing</title>
 <p>To print a document:</p>
diff --git a/help/C/translating.page b/help/C/translating.page
index 5d18b78..8e812b6 100644
--- a/help/C/translating.page
+++ b/help/C/translating.page
@@ -2,7 +2,7 @@
       type="topic"
       id="translating">
 <info>
-  <link type="guide" xref="index"/>
+  <link type="guide" xref="index" group="first"/>
 </info>
 <title>Translating a document</title>
 <p>To translate a document:</p>
diff --git a/help/C/view.page b/help/C/view.page
index 1f9a12b..68131e1 100644
--- a/help/C/view.page
+++ b/help/C/view.page
@@ -2,7 +2,7 @@
       type="topic"
       id="view">
 <info>
-  <link type="guide" xref="index"/>
+  <link type="guide" xref="index" group="second"/>
 </info>
 <title>Viewing the document</title>
 <p>The view menu allows you to switch between ASCII and Braille on-screen representation.</p>
diff --git a/help/Makefile.am b/help/Makefile.am
index 7c3dc0a..79be6bb 100644
--- a/help/Makefile.am
+++ b/help/Makefile.am
@@ -9,7 +9,8 @@ DOC_PAGES = \
 	format.page	\
 	printing.page	\
 	translating.page	\
-	view.page
+	view.page	\
+	table.page
 
 DOC_LINGUAS = de es
 
diff --git a/m4/python.m4 b/m4/python.m4
new file mode 100644
index 0000000..a1396df
--- /dev/null
+++ b/m4/python.m4
@@ -0,0 +1,62 @@
+## this one is commonly used with AM_PATH_PYTHONDIR ...
+dnl AM_CHECK_PYMOD(MODNAME [,SYMBOL [,ACTION-IF-FOUND [,ACTION-IF-NOT-FOUND]]])
+dnl Check if a module containing a given symbol is visible to python.
+AC_DEFUN(AM_CHECK_PYMOD,
+[AC_REQUIRE([AM_PATH_PYTHON])
+py_mod_var=`echo $1['_']$2 | sed 'y%./+-%__p_%'`
+AC_MSG_CHECKING(for ifelse([$2],[],,[$2 in ])python module $1)
+AC_CACHE_VAL(py_cv_mod_$py_mod_var, [
+ifelse([$2],[], [prog="
+import sys
+try:
+        import $1
+except ImportError:
+        sys.exit(1)
+except:
+        sys.exit(0)
+sys.exit(0)"], [prog="
+import $1
+$1.$2"])
+if $PYTHON -c "$prog" 1>&AC_FD_CC 2>&AC_FD_CC
+  then
+    eval "py_cv_mod_$py_mod_var=yes"
+  else
+    eval "py_cv_mod_$py_mod_var=no"
+  fi
+])
+py_val=`eval "echo \`echo '$py_cv_mod_'$py_mod_var\`"`
+if test "x$py_val" != xno; then
+  AC_MSG_RESULT(yes)
+  ifelse([$3], [],, [$3
+])dnl
+else
+  AC_MSG_RESULT(no)
+  ifelse([$4], [],, [$4
+])dnl
+fi
+])
+
+dnl a macro to check for ability to create python extensions
+dnl  AM_CHECK_PYTHON_HEADERS([ACTION-IF-POSSIBLE], [ACTION-IF-NOT-POSSIBLE])
+dnl function also defines PYTHON_INCLUDES
+AC_DEFUN([AM_CHECK_PYTHON_HEADERS],
+[AC_REQUIRE([AM_PATH_PYTHON])
+AC_MSG_CHECKING(for headers required to compile python extensions)
+dnl deduce PYTHON_INCLUDES
+py_prefix=`$PYTHON -c "import sys; print sys.prefix"`
+py_exec_prefix=`$PYTHON -c "import sys; print sys.exec_prefix"`
+PYTHON_INCLUDES="-I${py_prefix}/include/python${PYTHON_VERSION}"
+if test "$py_prefix" != "$py_exec_prefix"; then
+  PYTHON_INCLUDES="$PYTHON_INCLUDES -I${py_exec_prefix}/include/python${PYTHON_VERSION}"
+fi
+AC_SUBST(PYTHON_INCLUDES)
+dnl check if the headers exist:
+save_CPPFLAGS="$CPPFLAGS"
+CPPFLAGS="$CPPFLAGS $PYTHON_INCLUDES"
+AC_TRY_CPP([#include <Python.h>],dnl
+[AC_MSG_RESULT(found)
+$1],dnl
+[AC_MSG_RESULT(not found)
+$2])
+CPPFLAGS="$save_CPPFLAGS"
+])



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]