Salome HOME
1c1cdc62129866681d26076b9f122e130df9d20e
[modules/yacs.git] / adm / unix / config_files / check_htmlgen.m4
1 dnl Copyright (C) 2006-2021  CEA/DEN, EDF R&D
2 dnl
3 dnl This library is free software; you can redistribute it and/or
4 dnl modify it under the terms of the GNU Lesser General Public
5 dnl License as published by the Free Software Foundation; either
6 dnl version 2.1 of the License, or (at your option) any later version.
7 dnl
8 dnl This library is distributed in the hope that it will be useful,
9 dnl but WITHOUT ANY WARRANTY; without even the implied warranty of
10 dnl MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
11 dnl Lesser General Public License for more details.
12 dnl
13 dnl You should have received a copy of the GNU Lesser General Public
14 dnl License along with this library; if not, write to the Free Software
15 dnl Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
16 dnl
17 dnl See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
18 dnl
19
20 AC_DEFUN([CHECK_HTML_GENERATORS],[
21
22 AC_CHECKING(for html generators)
23
24 doxygen_ok=yes
25 dnl were is doxygen ?
26 AC_PATH_PROG(DOXYGEN,doxygen) 
27 if test "x$DOXYGEN" = "x"
28 then
29   AC_MSG_WARN(doxygen not found)
30   doxygen_ok=no
31 fi
32 if test "x$doxygen_ok" = "xyes"
33 then
34   version=`$DOXYGEN --version`
35   AC_MSG_RESULT(doxygen version $version)
36   case "$version" in
37         1.4.4*)
38           DOXYGEN_WITH_PYTHON=yes
39           DOXYGEN_WITH_STL=no
40           ;;
41         1.4.5*)
42           DOXYGEN_WITH_PYTHON=yes
43           DOXYGEN_WITH_STL=yes
44           ;;
45         1.4.6*)
46           DOXYGEN_WITH_PYTHON=yes
47           DOXYGEN_WITH_STL=yes
48           ;;
49         1.4.7*)
50           DOXYGEN_WITH_PYTHON=yes
51           DOXYGEN_WITH_STL=yes
52           ;;
53         1.4.8*)
54           DOXYGEN_WITH_PYTHON=yes
55           DOXYGEN_WITH_STL=yes
56           ;;
57         1.4.9*)
58           DOXYGEN_WITH_PYTHON=yes
59           DOXYGEN_WITH_STL=yes
60           ;;
61         [[1-9]].[[5-9]]*)
62           DOXYGEN_WITH_PYTHON=yes
63           DOXYGEN_WITH_STL=yes
64           ;;
65         *)
66           DOXYGEN_WITH_PYTHON=no
67           DOXYGEN_WITH_STL=no
68           ;;
69   esac
70   AC_MSG_RESULT(doxygen with support STL    - $DOXYGEN_WITH_STL)
71   AC_MSG_RESULT(doxygen with support PYTHON - $DOXYGEN_WITH_PYTHON)
72   AC_SUBST(DOXYGEN_WITH_PYTHON)
73   AC_SUBST(DOXYGEN_WITH_STL)
74 fi
75 AM_CONDITIONAL(DOXYGEN_IS_OK, [test x"$doxygen_ok" = xyes])
76 dnl AC_SUBST(DOXYGEN)
77
78 AC_SUBST(GRAPHVIZHOME)
79 AC_SUBST(GRAPHVIZ_CPPFLAGS)
80 AC_SUBST(GRAPHVIZ_LDFLAGS)
81 AC_SUBST(GRAPHVIZ_LIBADD)
82 GRAPHVIZ_CPPFLAGS=""
83 GRAPHVIZ_LDFLAGS=""
84 GRAPHVIZ_LIBADD=""
85
86 AC_CHECKING([graphviz configuration])
87
88 graphviz_ok=yes
89 dnl were is graphviz ?
90 AC_PATH_PROG(DOT,dot) 
91 if test "x$DOT" = "x" ; then
92   AC_MSG_WARN(graphviz not found)
93   graphviz_ok=no
94 else
95   GRAPHVIZ_PREFIX=`echo $DOT | sed -e "s,[[^/]]*$,,;s,/$,,;s,^$,.,"`
96   GRAPHVIZ_PREFIX=`echo $GRAPHVIZ_PREFIX | sed -e "s,[[^/]]*$,,;s,/$,,;s,^$,.,"`
97   GRAPHVIZHOME=$GRAPHVIZ_PREFIX
98
99   GRAPHVIZ_CPPFLAGS="-I${GRAPHVIZHOME}/include/graphviz"
100   if test "x$GRAPHVIZHOME" = "x/usr" ; then
101     GRAPHVIZ_LDFLAGS="-L${GRAPHVIZHOME}/lib/graphviz"
102   else
103     GRAPHVIZ_LDFLAGS="-L${GRAPHVIZHOME}/lib -L${GRAPHVIZHOME}/lib/graphviz"
104   fi
105 fi
106 dnl AC_SUBST(DOT)
107 CPPFLAGS_old=$CPPFLAGS
108 CPPFLAGS="$CPPFLAGS $GRAPHVIZ_CPPFLAGS"
109 old_graphviz="yes"
110 AC_CHECK_HEADERS(dotneato.h, old_graphviz="yes", old_graphviz="no")
111 if test "x$old_graphviz" = "xyes" ; then
112   GRAPHVIZ_LIBADD="-ldotneato"
113 else
114   GRAPHVIZ_LIBADD="-lgvc"
115 fi
116 CPPFLAGS=$CPPFLAGS_old
117
118 AC_PATH_PROG(LATEX,latex) 
119 if test "x$LATEX" = "x" ; then
120   AC_MSG_WARN(latex not found)
121 fi
122 AC_SUBST(LATEX)
123
124 AC_PATH_PROG(DVIPS,dvips)
125 if test "x$DVIPS" = "x" ; then
126   AC_MSG_WARN(dvips not found)
127 fi
128 AC_SUBST(DVIPS)
129
130 AC_PATH_PROG(PDFLATEX,pdflatex)
131 if test "x$PDFLATEX" = "x" ; then
132   AC_MSG_WARN(pdflatex not found)
133 fi
134 AC_SUBST(PDFLATEX)
135
136 rst2html_ok=yes
137 dnl were is rst2html ?
138 AC_PATH_PROG(RST2HTML,rst2html) 
139 if test "x$RST2HTML" = "x"; then
140   AC_PATH_PROG(RST2HTML,rst2html.py)
141 fi
142
143 if test "x$RST2HTML" = "x"; then
144   AC_MSG_WARN(rst2html not found)
145   rst2html_ok=no
146 fi
147 AC_SUBST(RST2HTML)
148
149 AM_CONDITIONAL(RST2HTML_IS_OK, [test x"$rst2html_ok" = xyes])
150
151 ])dnl
152 dnl