~ubuntu-branches/ubuntu/trusty/pitivi/trusty

« back to all changes in this revision

Viewing changes to common/m4/gst-doc.m4

  • Committer: Bazaar Package Importer
  • Author(s): Daniel Holbach
  • Date: 2006-02-04 14:42:30 UTC
  • Revision ID: james.westby@ubuntu.com-20060204144230-9ihvyas6lhgn81k1
Tags: upstream-0.9.9.2
ImportĀ upstreamĀ versionĀ 0.9.9.2

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
AC_DEFUN([GST_DOCBOOK_CHECK],
 
2
[
 
3
  dnl choose a location to install docbook docs in
 
4
  docdir="\$(datadir)/doc/$PACKAGE-$GST_MAJORMINOR"
 
5
 
 
6
  dnl enable/disable docbook documentation building
 
7
  AC_ARG_ENABLE(docbook,
 
8
  AC_HELP_STRING([--enable-docbook],
 
9
                 [use docbook to build documentation [default=no]]),,
 
10
                 enable_docbook=no)
 
11
 
 
12
  have_docbook=no
 
13
 
 
14
  if test x$enable_docbook = xyes; then
 
15
    dnl check if we actually have everything we need
 
16
 
 
17
    dnl check for docbook tools
 
18
    AC_CHECK_PROG(HAVE_DOCBOOK2PS, docbook2ps, yes, no)
 
19
    AC_CHECK_PROG(HAVE_DOCBOOK2HTML, docbook2html, yes, no)
 
20
    AC_CHECK_PROG(HAVE_JADETEX, jadetex, yes, no)
 
21
    AC_CHECK_PROG(HAVE_PS2PDF, ps2pdf, yes, no)
 
22
 
 
23
    # -V option appeared in 0.6.10
 
24
    docbook2html_min_version=0.6.10
 
25
    if test "x$HAVE_DOCBOOK2HTML" != "xno"; then
 
26
      docbook2html_version=`docbook2html --version`
 
27
      AC_MSG_CHECKING([docbook2html version ($docbook2html_version) >= $docbook2html_min_version])
 
28
      if perl -w <<EOF
 
29
        (\$min_version_major, \$min_version_minor, \$min_version_micro ) = "$docbook2html_min_version" =~ /(\d+)\.(\d+)\.(\d+)/;
 
30
        (\$docbook2html_version_major, \$docbook2html_version_minor, \$docbook2html_version_micro ) = "$docbook2html_version" =~ /(\d+)\.(\d+)\.(\d+)/;
 
31
        exit (((\$docbook2html_version_major > \$min_version_major) ||
 
32
             ((\$docbook2html_version_major == \$min_version_major) &&
 
33
              (\$docbook2html_version_minor >= \$min_version_minor)) ||
 
34
             ((\$docbook2html_version_major == \$min_version_major) &&
 
35
              (\$docbook2html_version_minor >= \$min_version_minor) &&
 
36
              (\$docbook2html_version_micro >= \$min_version_micro)))
 
37
             ? 0 : 1);
 
38
EOF
 
39
      then
 
40
        AC_MSG_RESULT(yes)
 
41
      else
 
42
        AC_MSG_RESULT(no)
 
43
        HAVE_DOCBOOK2HTML=no
 
44
      fi
 
45
    fi
 
46
 
 
47
    dnl check if we can process docbook stuff
 
48
    AS_DOCBOOK(have_docbook=yes, have_docbook=no)
 
49
 
 
50
    dnl check for extra tools
 
51
    AC_CHECK_PROG(HAVE_DVIPS, dvips, yes, no)
 
52
    AC_CHECK_PROG(HAVE_XMLLINT, xmllint, yes, no)
 
53
 
 
54
    dnl check for image conversion tools
 
55
    AC_CHECK_PROG(HAVE_FIG2DEV, fig2dev, yes, no)
 
56
    if test "x$HAVE_FIG2DEV" = "xno" ; then
 
57
      AC_MSG_WARN([Did not find fig2dev (from xfig), images will not be generated.])
 
58
    fi
 
59
 
 
60
    dnl The following is a hack: if fig2dev doesn't display an error message
 
61
    dnl for the desired type, we assume it supports it.
 
62
    HAVE_FIG2DEV_EPS=no
 
63
    if test "x$HAVE_FIG2DEV" = "xyes" ; then
 
64
      fig2dev_quiet=`fig2dev -L eps </dev/null 2>&1 >/dev/null`
 
65
      if test "x$fig2dev_quiet" = "x" ; then
 
66
        HAVE_FIG2DEV_EPS=yes
 
67
      fi
 
68
    fi
 
69
    HAVE_FIG2DEV_PNG=no
 
70
    if test "x$HAVE_FIG2DEV" = "xyes" ; then
 
71
      fig2dev_quiet=`fig2dev -L png </dev/null 2>&1 >/dev/null`
 
72
      if test "x$fig2dev_quiet" = "x" ; then
 
73
        HAVE_FIG2DEV_PNG=yes
 
74
      fi
 
75
    fi
 
76
    HAVE_FIG2DEV_PDF=no
 
77
    if test "x$HAVE_FIG2DEV" = "xyes" ; then
 
78
      fig2dev_quiet=`fig2dev -L pdf </dev/null 2>&1 >/dev/null`
 
79
      if test "x$fig2dev_quiet" = "x" ; then
 
80
        HAVE_FIG2DEV_PDF=yes
 
81
      fi
 
82
    fi
 
83
  
 
84
    AC_CHECK_PROG(HAVE_PNGTOPNM, pngtopnm, yes, no)
 
85
    AC_CHECK_PROG(HAVE_PNMTOPS,  pnmtops,  yes, no)
 
86
    AC_CHECK_PROG(HAVE_EPSTOPDF, epstopdf, yes, no)
 
87
  
 
88
    dnl check if we can generate HTML
 
89
    if test "x$HAVE_DOCBOOK2HTML" = "xyes" && \
 
90
       test "x$enable_docbook" = "xyes" && \
 
91
       test "x$HAVE_XMLLINT" = "xyes" && \
 
92
       test "x$HAVE_FIG2DEV_PNG" = "xyes"; then
 
93
      DOC_HTML=yes
 
94
      AC_MSG_NOTICE(Will output HTML documentation)
 
95
     else
 
96
      DOC_HTML=no
 
97
      AC_MSG_NOTICE(Will not output HTML documentation)
 
98
    fi
 
99
    
 
100
    dnl check if we can generate PS
 
101
    if test "x$HAVE_DOCBOOK2PS" = "xyes" && \
 
102
       test "x$enable_docbook" = "xyes" && \
 
103
       test "x$HAVE_XMLLINT" = "xyes" && \
 
104
       test "x$HAVE_JADETEX" = "xyes" && \
 
105
       test "x$HAVE_FIG2DEV_EPS" = "xyes" && \
 
106
       test "x$HAVE_DVIPS" = "xyes" && \
 
107
       test "x$HAVE_PNGTOPNM" = "xyes" && \
 
108
       test "x$HAVE_PNMTOPS" = "xyes"; then
 
109
      DOC_PS=yes
 
110
      AC_MSG_NOTICE(Will output PS documentation)
 
111
    else
 
112
      DOC_PS=no
 
113
      AC_MSG_NOTICE(Will not output PS documentation)
 
114
    fi
 
115
    
 
116
    dnl check if we can generate PDF - using only ps2pdf
 
117
    if test "x$DOC_PS" = "xyes" && \
 
118
       test "x$enable_docbook" = "xyes" && \
 
119
       test "x$HAVE_XMLLINT" = "xyes" && \
 
120
       test "x$HAVE_PS2PDF" = "xyes"; then
 
121
      DOC_PDF=yes
 
122
      AC_MSG_NOTICE(Will output PDF documentation)
 
123
    else
 
124
      DOC_PDF=no
 
125
      AC_MSG_NOTICE(Will not output PDF documentation)
 
126
    fi
 
127
 
 
128
    dnl if we don't have everything, we should disable
 
129
    if test "x$have_docbook" != "xyes"; then
 
130
      enable_docbook=no
 
131
    fi
 
132
  fi
 
133
 
 
134
  dnl if we're going to install documentation, tell us where
 
135
  if test "x$have_docbook" = "xyes"; then
 
136
    AC_MSG_NOTICE(Installing documentation in $docdir)
 
137
    AC_SUBST(docdir)
 
138
  fi
 
139
 
 
140
  AM_CONDITIONAL(ENABLE_DOCBOOK,      test x$enable_docbook = xyes)
 
141
  AM_CONDITIONAL(DOC_HTML,            test x$DOC_HTML = xyes)
 
142
  AM_CONDITIONAL(DOC_PDF,             test x$DOC_PDF = xyes)
 
143
  AM_CONDITIONAL(DOC_PS,              test x$DOC_PS = xyes)
 
144
])