~ubuntu-branches/ubuntu/precise/gnome-user-docs/precise

« back to all changes in this revision

Viewing changes to aclocal.m4

  • Committer: Package Import Robot
  • Author(s): Didier Roche
  • Date: 2011-09-12 09:23:35 UTC
  • mfrom: (1.1.5 upstream)
  • Revision ID: package-import@ubuntu.com-20110912092335-11udas9xjsi3g6n0
Tags: 3.1.1-0ubuntu1
New upstream release

Show diffs side-by-side

added added

removed removed

Lines of Context:
19
19
If you have problems, you may need to regenerate the build system entirely.
20
20
To do so, use the procedure documented by the package, typically `autoreconf'.])])
21
21
 
22
 
dnl Do not call GNOME_DOC_DEFINES directly.  It is split out from
23
 
dnl GNOME_DOC_INIT to allow gnome-doc-utils to bootstrap off itself.
24
 
AC_DEFUN([GNOME_DOC_DEFINES],
 
22
AC_DEFUN([YELP_HELP_INIT],
25
23
[
 
24
AC_REQUIRE([AC_PROG_LN_S])
 
25
m4_pattern_allow([AM_V_at])
 
26
m4_pattern_allow([AM_V_GEN])
 
27
m4_pattern_allow([AM_DEFAULT_VERBOSITY])
26
28
AC_ARG_WITH([help-dir],
27
 
  AC_HELP_STRING([--with-help-dir=DIR], [path to help docs]),,
28
 
  [with_help_dir='${datadir}/gnome/help'])
 
29
            AC_HELP_STRING([--with-help-dir=DIR],
 
30
                           [path where help files are installed]),,
 
31
            [with_help_dir='${datadir}/help'])
29
32
HELP_DIR="$with_help_dir"
30
33
AC_SUBST(HELP_DIR)
31
34
 
32
 
AC_ARG_WITH([omf-dir],
33
 
  AC_HELP_STRING([--with-omf-dir=DIR], [path to OMF files]),,
34
 
  [with_omf_dir='${datadir}/omf'])
35
 
OMF_DIR="$with_omf_dir"
36
 
AC_SUBST(OMF_DIR)
37
 
 
38
 
AC_ARG_WITH([help-formats],
39
 
  AC_HELP_STRING([--with-help-formats=FORMATS], [list of formats]),,
40
 
  [with_help_formats=''])
41
 
DOC_USER_FORMATS="$with_help_formats"
42
 
AC_SUBST(DOC_USER_FORMATS)
43
 
 
44
 
AC_ARG_ENABLE([scrollkeeper],
45
 
        [AC_HELP_STRING([--disable-scrollkeeper],
46
 
                        [do not make updates to the scrollkeeper database])],,
47
 
        enable_scrollkeeper=yes)
48
 
AM_CONDITIONAL([ENABLE_SK],[test "$gdu_cv_have_gdu" = "yes" -a "$enable_scrollkeeper" = "yes"])
49
 
 
50
 
dnl disable scrollkeeper automatically for distcheck
51
 
DISTCHECK_CONFIGURE_FLAGS="--disable-scrollkeeper $DISTCHECK_CONFIGURE_FLAGS"
52
 
AC_SUBST(DISTCHECK_CONFIGURE_FLAGS)
53
 
 
54
 
AM_CONDITIONAL([HAVE_GNOME_DOC_UTILS],[test "$gdu_cv_have_gdu" = "yes"])
55
 
])
56
 
 
57
 
# GNOME_DOC_INIT ([MINIMUM-VERSION],[ACTION-IF-FOUND],[ACTION-IF-NOT-FOUND])
58
 
#
59
 
AC_DEFUN([GNOME_DOC_INIT],
60
 
[AC_REQUIRE([AC_PROG_LN_S])dnl
61
 
 
62
 
ifelse([$1],,[gdu_cv_version_required=0.3.2],[gdu_cv_version_required=$1])
63
 
 
64
 
AC_MSG_CHECKING([gnome-doc-utils >= $gdu_cv_version_required])
65
 
PKG_CHECK_EXISTS([gnome-doc-utils >= $gdu_cv_version_required],
66
 
        [gdu_cv_have_gdu=yes],[gdu_cv_have_gdu=no])
67
 
 
68
 
if test "$gdu_cv_have_gdu" = "yes"; then
69
 
        AC_MSG_RESULT([yes])
70
 
        ifelse([$2],,[:],[$2])
71
 
else
72
 
        AC_MSG_RESULT([no])
73
 
        ifelse([$3],,[AC_MSG_ERROR([gnome-doc-utils >= $gdu_cv_version_required not found])],[$3])
74
 
fi
75
 
 
76
 
GNOME_DOC_DEFINES
77
 
])
78
 
 
79
 
# pkg.m4 - Macros to locate and utilise pkg-config.            -*- Autoconf -*-
80
 
# serial 1 (pkg-config-0.24)
81
 
82
 
# Copyright © 2004 Scott James Remnant <scott@netsplit.com>.
83
 
#
84
 
# This program is free software; you can redistribute it and/or modify
85
 
# it under the terms of the GNU General Public License as published by
86
 
# the Free Software Foundation; either version 2 of the License, or
87
 
# (at your option) any later version.
88
 
#
89
 
# This program is distributed in the hope that it will be useful, but
90
 
# WITHOUT ANY WARRANTY; without even the implied warranty of
91
 
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
92
 
# General Public License for more details.
93
 
#
94
 
# You should have received a copy of the GNU General Public License
95
 
# along with this program; if not, write to the Free Software
96
 
# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
97
 
#
98
 
# As a special exception to the GNU General Public License, if you
99
 
# distribute this file as part of a program that contains a
100
 
# configuration script generated by Autoconf, you may include it under
101
 
# the same distribution terms that you use for the rest of that program.
102
 
 
103
 
# PKG_PROG_PKG_CONFIG([MIN-VERSION])
104
 
# ----------------------------------
105
 
AC_DEFUN([PKG_PROG_PKG_CONFIG],
106
 
[m4_pattern_forbid([^_?PKG_[A-Z_]+$])
107
 
m4_pattern_allow([^PKG_CONFIG(_PATH)?$])
108
 
AC_ARG_VAR([PKG_CONFIG], [path to pkg-config utility])
109
 
AC_ARG_VAR([PKG_CONFIG_PATH], [directories to add to pkg-config's search path])
110
 
AC_ARG_VAR([PKG_CONFIG_LIBDIR], [path overriding pkg-config's built-in search path])
111
 
 
112
 
if test "x$ac_cv_env_PKG_CONFIG_set" != "xset"; then
113
 
        AC_PATH_TOOL([PKG_CONFIG], [pkg-config])
114
 
fi
115
 
if test -n "$PKG_CONFIG"; then
116
 
        _pkg_min_version=m4_default([$1], [0.9.0])
117
 
        AC_MSG_CHECKING([pkg-config is at least version $_pkg_min_version])
118
 
        if $PKG_CONFIG --atleast-pkgconfig-version $_pkg_min_version; then
119
 
                AC_MSG_RESULT([yes])
120
 
        else
121
 
                AC_MSG_RESULT([no])
122
 
                PKG_CONFIG=""
 
35
AC_ARG_VAR([ITSTOOL], [Path to the `itstool` command])
 
36
AC_CHECK_PROG([ITSTOOL], [itstool], [itstool])
 
37
if test x"$ITSTOOL" = x; then
 
38
  AC_MSG_ERROR([itstool not found])
 
39
fi
 
40
 
 
41
AC_ARG_VAR([XMLLINT], [Path to the `xmllint` command])
 
42
AC_CHECK_PROG([XMLLINT], [xmllint], [xmllint])
 
43
if test x"$XMLLINT" = x; then
 
44
  AC_MSG_ERROR([xmllint not found])
 
45
fi
 
46
 
 
47
YELP_HELP_RULES='
 
48
HELP_ID ?=
 
49
HELP_POT ?=
 
50
HELP_FILES ?=
 
51
HELP_EXTRA ?=
 
52
HELP_MEDIA ?=
 
53
HELP_LINGUAS ?=
 
54
 
 
55
_HELP_LINGUAS = $(if $(filter environment,$(origin LINGUAS)),$(filter $(LINGUAS),$(HELP_LINGUAS)),$(HELP_LINGUAS))
 
56
_HELP_POTFILE = $(if $(HELP_POT),$(HELP_POT),$(if $(HELP_ID),$(HELP_ID).pot))
 
57
_HELP_POFILES = $(if $(HELP_ID),$(foreach lc,$(_HELP_LINGUAS),$(lc)/$(lc).po))
 
58
_HELP_MOFILES = $(patsubst %.po,%.mo,$(_HELP_POFILES))
 
59
_HELP_C_FILES = $(foreach f,$(HELP_FILES),C/$(f))
 
60
_HELP_C_EXTRA = $(foreach f,$(HELP_EXTRA),C/$(f))
 
61
_HELP_C_MEDIA = $(foreach f,$(HELP_MEDIA),C/$(f))
 
62
_HELP_LC_FILES = $(foreach lc,$(_HELP_LINGUAS),$(foreach f,$(HELP_FILES),$(lc)/$(f)))
 
63
 
 
64
_HELP_DEFAULT_V = $(if $(AM_DEFAULT_VERBOSITY),$(AM_DEFAULT_VERBOSITY),1)
 
65
_HELP_V = $(if $(V),$(V),$(_HELP_DEFAULT_V))
 
66
_HELP_LC_VERBOSE = $(_HELP_LC_VERBOSE_$(_HELP_V))
 
67
_HELP_LC_VERBOSE_ = $(_HELP_LC_VERBOSE_$(_HELP_DEFAULT_V))
 
68
_HELP_LC_VERBOSE_0 = @echo "  GEN    "$(dir [$]@);
 
69
 
 
70
all: $(_HELP_C_FILES) $(_HELP_C_EXTRA) $(_HELP_C_MEDIA) $(_HELP_LC_FILES) $(_HELP_POFILES)
 
71
 
 
72
.PHONY: pot
 
73
pot: $(_HELP_POTFILE)
 
74
$(_HELP_POTFILE): $(_HELP_C_FILES) $(_HELP_C_EXTRA) $(_HELP_C_MEDIA)
 
75
        $(AM_V_GEN)$(ITSTOOL) -o "[$]@" $(_HELP_C_FILES)
 
76
 
 
77
.PHONY: repo
 
78
repo: $(_HELP_POTFILE)
 
79
        $(AM_V_at)for po in $(_HELP_POFILES); do \
 
80
          if test "x[$](_HELP_V)" = "x0"; then echo "  GEN    $${po}"; fi; \
 
81
          msgmerge -q -o "$${po}" "$${po}" "$(_HELP_POTFILE)"; \
 
82
        done
 
83
 
 
84
$(_HELP_POFILES):
 
85
        $(AM_V_at)if ! test -d "$(dir [$]@)"; then mkdir "$(dir [$]@)"; fi
 
86
        $(AM_V_at)if test ! -f "[$]@" -a -f "$(srcdir)/[$]@"; then cp "$(srcdir)/[$]@" "[$]@"; fi
 
87
        $(AM_V_GEN)if ! test -f "[$]@"; then \
 
88
          (cd "$(dir [$]@)" && \
 
89
            $(ITSTOOL) -o "$(notdir [$]@).tmp" $(_HELP_C_FILES) && \
 
90
            mv "$(notdir [$]@).tmp" "$(notdir [$]@)"); \
 
91
        else \
 
92
          (cd "$(dir [$]@)" && \
 
93
            $(ITSTOOL) -o "$(notdir [$]@).tmp" $(_HELP_C_FILES) && \
 
94
            msgmerge -o "$(notdir [$]@)" "$(notdir [$]@)" "$(notdir [$]@).tmp" && \
 
95
            rm "$(notdir [$]@).tmp"); \
123
96
        fi
124
 
fi[]dnl
125
 
])# PKG_PROG_PKG_CONFIG
126
 
 
127
 
# PKG_CHECK_EXISTS(MODULES, [ACTION-IF-FOUND], [ACTION-IF-NOT-FOUND])
128
 
#
129
 
# Check to see whether a particular set of modules exists.  Similar
130
 
# to PKG_CHECK_MODULES(), but does not set variables or print errors.
131
 
#
132
 
# Please remember that m4 expands AC_REQUIRE([PKG_PROG_PKG_CONFIG])
133
 
# only at the first occurence in configure.ac, so if the first place
134
 
# it's called might be skipped (such as if it is within an "if", you
135
 
# have to call PKG_CHECK_EXISTS manually
136
 
# --------------------------------------------------------------
137
 
AC_DEFUN([PKG_CHECK_EXISTS],
138
 
[AC_REQUIRE([PKG_PROG_PKG_CONFIG])dnl
139
 
if test -n "$PKG_CONFIG" && \
140
 
    AC_RUN_LOG([$PKG_CONFIG --exists --print-errors "$1"]); then
141
 
  m4_default([$2], [:])
142
 
m4_ifvaln([$3], [else
143
 
  $3])dnl
144
 
fi])
145
 
 
146
 
# _PKG_CONFIG([VARIABLE], [COMMAND], [MODULES])
147
 
# ---------------------------------------------
148
 
m4_define([_PKG_CONFIG],
149
 
[if test -n "$$1"; then
150
 
    pkg_cv_[]$1="$$1"
151
 
 elif test -n "$PKG_CONFIG"; then
152
 
    PKG_CHECK_EXISTS([$3],
153
 
                     [pkg_cv_[]$1=`$PKG_CONFIG --[]$2 "$3" 2>/dev/null`],
154
 
                     [pkg_failed=yes])
155
 
 else
156
 
    pkg_failed=untried
157
 
fi[]dnl
158
 
])# _PKG_CONFIG
159
 
 
160
 
# _PKG_SHORT_ERRORS_SUPPORTED
161
 
# -----------------------------
162
 
AC_DEFUN([_PKG_SHORT_ERRORS_SUPPORTED],
163
 
[AC_REQUIRE([PKG_PROG_PKG_CONFIG])
164
 
if $PKG_CONFIG --atleast-pkgconfig-version 0.20; then
165
 
        _pkg_short_errors_supported=yes
166
 
else
167
 
        _pkg_short_errors_supported=no
168
 
fi[]dnl
169
 
])# _PKG_SHORT_ERRORS_SUPPORTED
170
 
 
171
 
 
172
 
# PKG_CHECK_MODULES(VARIABLE-PREFIX, MODULES, [ACTION-IF-FOUND],
173
 
# [ACTION-IF-NOT-FOUND])
174
 
#
175
 
#
176
 
# Note that if there is a possibility the first call to
177
 
# PKG_CHECK_MODULES might not happen, you should be sure to include an
178
 
# explicit call to PKG_PROG_PKG_CONFIG in your configure.ac
179
 
#
180
 
#
181
 
# --------------------------------------------------------------
182
 
AC_DEFUN([PKG_CHECK_MODULES],
183
 
[AC_REQUIRE([PKG_PROG_PKG_CONFIG])dnl
184
 
AC_ARG_VAR([$1][_CFLAGS], [C compiler flags for $1, overriding pkg-config])dnl
185
 
AC_ARG_VAR([$1][_LIBS], [linker flags for $1, overriding pkg-config])dnl
186
 
 
187
 
pkg_failed=no
188
 
AC_MSG_CHECKING([for $1])
189
 
 
190
 
_PKG_CONFIG([$1][_CFLAGS], [cflags], [$2])
191
 
_PKG_CONFIG([$1][_LIBS], [libs], [$2])
192
 
 
193
 
m4_define([_PKG_TEXT], [Alternatively, you may set the environment variables $1[]_CFLAGS
194
 
and $1[]_LIBS to avoid the need to call pkg-config.
195
 
See the pkg-config man page for more details.])
196
 
 
197
 
if test $pkg_failed = yes; then
198
 
        AC_MSG_RESULT([no])
199
 
        _PKG_SHORT_ERRORS_SUPPORTED
200
 
        if test $_pkg_short_errors_supported = yes; then
201
 
                $1[]_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors "$2" 2>&1`
202
 
        else 
203
 
                $1[]_PKG_ERRORS=`$PKG_CONFIG --print-errors "$2" 2>&1`
204
 
        fi
205
 
        # Put the nasty error message in config.log where it belongs
206
 
        echo "$$1[]_PKG_ERRORS" >&AS_MESSAGE_LOG_FD
207
 
 
208
 
        m4_default([$4], [AC_MSG_ERROR(
209
 
[Package requirements ($2) were not met:
210
 
 
211
 
$$1_PKG_ERRORS
212
 
 
213
 
Consider adjusting the PKG_CONFIG_PATH environment variable if you
214
 
installed software in a non-standard prefix.
215
 
 
216
 
_PKG_TEXT])
217
 
        ])
218
 
elif test $pkg_failed = untried; then
219
 
        AC_MSG_RESULT([no])
220
 
        m4_default([$4], [AC_MSG_FAILURE(
221
 
[The pkg-config script could not be found or is too old.  Make sure it
222
 
is in your PATH or set the PKG_CONFIG environment variable to the full
223
 
path to pkg-config.
224
 
 
225
 
_PKG_TEXT
226
 
 
227
 
To get pkg-config, see <http://pkg-config.freedesktop.org/>.])
228
 
        ])
229
 
else
230
 
        $1[]_CFLAGS=$pkg_cv_[]$1[]_CFLAGS
231
 
        $1[]_LIBS=$pkg_cv_[]$1[]_LIBS
232
 
        AC_MSG_RESULT([yes])
233
 
        $3
234
 
fi[]dnl
235
 
])# PKG_CHECK_MODULES
 
97
 
 
98
$(_HELP_MOFILES): %.mo: %.po
 
99
        $(AM_V_at)if ! test -d "$(dir [$]@)"; then mkdir "$(dir [$]@)"; fi
 
100
        $(AM_V_GEN)msgfmt -o "[$]@" "$<"
 
101
 
 
102
$(_HELP_LC_FILES): $(_HELP_MOFILES)
 
103
$(_HELP_LC_FILES): $(_HELP_C_FILES) $(_HELP_C_EXTRA)
 
104
        $(AM_V_at)if ! test -d "$(dir [$]@)"; then mkdir "$(dir [$]@)"; fi
 
105
        $(_HELP_LC_VERBOSE)if test -f "C/$(notdir [$]@)"; then d="../"; else d="$(abs_srcdir)/"; fi; \
 
106
        mo="$(dir [$]@)$(patsubst %/$(notdir [$]@),%,[$]@).mo"; \
 
107
        if test -f "$${mo}"; then mo="../$${mo}"; else mo="$(abs_srcdir)/$${mo}"; fi; \
 
108
        (cd "$(dir [$]@)" && $(ITSTOOL) -m "$${mo}" $(foreach f,$(_HELP_C_FILES),$${d}/$(f)))
 
109
 
 
110
.PHONY: clean-help
 
111
mostlyclean-am: $(if $(HELP_ID),clean-help)
 
112
clean-help:
 
113
        rm -f $(_HELP_LC_FILES) $(_HELP_MOFILES)
 
114
 
 
115
EXTRA_DIST ?=
 
116
EXTRA_DIST += $(_HELP_C_FILES) $(_HELP_LC_FILES) $(_HELP_C_EXTRA) $(_HELP_C_MEDIA) $(_HELP_POFILES)
 
117
EXTRA_DIST += $(foreach f,$(HELP_MEDIA),$(foreach lc,$(_HELP_LINGUAS),$(wildcard $(lc)/$(f))))
 
118
 
 
119
.PHONY: check-help
 
120
check: check-help
 
121
check-help:
 
122
        for lc in C $(_HELP_LINGUAS); do \
 
123
          if test -d "$$lc"; \
 
124
            then d=; \
 
125
            xmlpath="$$lc"; \
 
126
          else \
 
127
            d="$(srcdir)/"; \
 
128
            xmlpath="$$lc:$(srcdir)/$$lc"; \
 
129
          fi; \
 
130
          for page in $(HELP_FILES); do \
 
131
            echo "$(XMLLINT) --noout --noent --path $$xmlpath --xinclude $$d$$lc/$$page"; \
 
132
            $(XMLLINT) --noout --noent --path "$$xmlpath" --xinclude "$$d$$lc/$$page"; \
 
133
          done; \
 
134
        done
 
135
 
 
136
 
 
137
.PHONY: install-help
 
138
install-data-am: $(if $(HELP_ID),install-help)
 
139
install-help:
 
140
        @for lc in C $(_HELP_LINGUAS); do \
 
141
          $(mkinstalldirs) "$(DESTDIR)$(HELP_DIR)/$$lc/$(HELP_ID)" || exit 1; \
 
142
        done
 
143
        @for f in $(_HELP_C_FILES) $(_HELP_LC_FILES) $(_HELP_C_EXTRA); do \
 
144
          lc=`dirname "$$f"`; lc=`basename "$$lc"`; \
 
145
          if test -f "$$f"; then d=; else d="$(srcdir)/"; fi; \
 
146
          helpdir="$(DESTDIR)$(HELP_DIR)/$$lc/$(HELP_ID)/"; \
 
147
          if ! test -d "$$helpdir"; then $(mkinstalldirs) "$$helpdir"; fi; \
 
148
          echo "$(INSTALL_DATA) $$d$$f $$helpdir`basename $$f`"; \
 
149
          $(INSTALL_DATA) "$$d$$f" "$$helpdir`basename $$f`" || exit 1; \
 
150
        done
 
151
        @for f in $(HELP_MEDIA); do \
 
152
          for lc in C $(_HELP_LINGUAS); do \
 
153
            if test -f "$$lc$$f"; then d=; else d="$(srcdir)/"; fi; \
 
154
            helpdir="$(DESTDIR)$(HELP_DIR)/$$lc/$(HELP_ID)/"; \
 
155
            mdir=`dirname "$$f"`; \
 
156
            if test "x$mdir" = "x."; then mdir=""; fi; \
 
157
            if ! test -d "$$helpdir$$mdir"; then $(mkinstalldirs) "$$helpdir$$mdir"; fi; \
 
158
            if test -f "$$d$$lc/$$f"; then \
 
159
              echo "$(INSTALL_DATA) $$d$$lc/$$f $$helpdir$$f"; \
 
160
              $(INSTALL_DATA) "$$d$$lc/$$f" "$$helpdir$$f" || exit 1; \
 
161
            elif test "x$$lc" != "xC"; then \
 
162
              echo "$(LN_S) -f $(DESTDIR)$(HELP_DIR)/C/$(HELP_ID)/$$f $$helpdir$$f"; \
 
163
              $(LN_S) -f "$(DESTDIR)$(HELP_DIR)/C/$(HELP_ID)/$$f" "$$helpdir$$f" || exit 1; \
 
164
            fi; \
 
165
          done; \
 
166
        done
 
167
 
 
168
.PHONY: uninstall-help
 
169
uninstall-am: $(if $(HELP_ID),uninstall-help)
 
170
uninstall-help:
 
171
        @for f in $(_HELP_C_FILES) $(_HELP_LC_FILES) $(_HELP_C_EXTRA); do \
 
172
          lc=`dirname "$$f"`; lc=`basename "$$lc"`; \
 
173
          helpdir="$(DESTDIR)$(HELP_DIR)/$$lc/$(HELP_ID)/"; \
 
174
          echo "rm -f $$helpdir`basename $$f`"; \
 
175
          rm -f "$$helpdir`basename $$f`"; \
 
176
        done
 
177
        @for f in $(HELP_MEDIA); do \
 
178
          for lc in C $(_HELP_LINGUAS); do \
 
179
            helpdir="$(DESTDIR)$(HELP_DIR)/$$lc/$(HELP_ID)/"; \
 
180
            echo "rm -f $$helpdir$$f"; \
 
181
            rm -f "$$helpdir$$f"; \
 
182
          done; \
 
183
        done;
 
184
'
 
185
AC_SUBST([YELP_HELP_RULES])
 
186
m4_ifdef([_AM_SUBST_NOTMAKE], [_AM_SUBST_NOTMAKE([YELP_HELP_RULES])])
 
187
])
236
188
 
237
189
# Copyright (C) 2002, 2003, 2005, 2006, 2007, 2008  Free Software Foundation, Inc.
238
190
#