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'.])])
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],
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"
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"
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)
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"])
50
dnl disable scrollkeeper automatically for distcheck
51
DISTCHECK_CONFIGURE_FLAGS="--disable-scrollkeeper $DISTCHECK_CONFIGURE_FLAGS"
52
AC_SUBST(DISTCHECK_CONFIGURE_FLAGS)
54
AM_CONDITIONAL([HAVE_GNOME_DOC_UTILS],[test "$gdu_cv_have_gdu" = "yes"])
57
# GNOME_DOC_INIT ([MINIMUM-VERSION],[ACTION-IF-FOUND],[ACTION-IF-NOT-FOUND])
59
AC_DEFUN([GNOME_DOC_INIT],
60
[AC_REQUIRE([AC_PROG_LN_S])dnl
62
ifelse([$1],,[gdu_cv_version_required=0.3.2],[gdu_cv_version_required=$1])
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])
68
if test "$gdu_cv_have_gdu" = "yes"; then
70
ifelse([$2],,[:],[$2])
73
ifelse([$3],,[AC_MSG_ERROR([gnome-doc-utils >= $gdu_cv_version_required not found])],[$3])
79
# pkg.m4 - Macros to locate and utilise pkg-config. -*- Autoconf -*-
80
# serial 1 (pkg-config-0.24)
82
# Copyright © 2004 Scott James Remnant <scott@netsplit.com>.
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.
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.
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.
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.
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])
112
if test "x$ac_cv_env_PKG_CONFIG_set" != "xset"; then
113
AC_PATH_TOOL([PKG_CONFIG], [pkg-config])
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
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])
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])
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)))
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 [$]@);
70
all: $(_HELP_C_FILES) $(_HELP_C_EXTRA) $(_HELP_C_MEDIA) $(_HELP_LC_FILES) $(_HELP_POFILES)
74
$(_HELP_POTFILE): $(_HELP_C_FILES) $(_HELP_C_EXTRA) $(_HELP_C_MEDIA)
75
$(AM_V_GEN)$(ITSTOOL) -o "[$]@" $(_HELP_C_FILES)
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)"; \
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 [$]@)"); \
92
(cd "$(dir [$]@)" && \
93
$(ITSTOOL) -o "$(notdir [$]@).tmp" $(_HELP_C_FILES) && \
94
msgmerge -o "$(notdir [$]@)" "$(notdir [$]@)" "$(notdir [$]@).tmp" && \
95
rm "$(notdir [$]@).tmp"); \
125
])# PKG_PROG_PKG_CONFIG
127
# PKG_CHECK_EXISTS(MODULES, [ACTION-IF-FOUND], [ACTION-IF-NOT-FOUND])
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.
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
146
# _PKG_CONFIG([VARIABLE], [COMMAND], [MODULES])
147
# ---------------------------------------------
148
m4_define([_PKG_CONFIG],
149
[if test -n "$$1"; then
151
elif test -n "$PKG_CONFIG"; then
152
PKG_CHECK_EXISTS([$3],
153
[pkg_cv_[]$1=`$PKG_CONFIG --[]$2 "$3" 2>/dev/null`],
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
167
_pkg_short_errors_supported=no
169
])# _PKG_SHORT_ERRORS_SUPPORTED
172
# PKG_CHECK_MODULES(VARIABLE-PREFIX, MODULES, [ACTION-IF-FOUND],
173
# [ACTION-IF-NOT-FOUND])
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
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
188
AC_MSG_CHECKING([for $1])
190
_PKG_CONFIG([$1][_CFLAGS], [cflags], [$2])
191
_PKG_CONFIG([$1][_LIBS], [libs], [$2])
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.])
197
if test $pkg_failed = yes; then
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`
203
$1[]_PKG_ERRORS=`$PKG_CONFIG --print-errors "$2" 2>&1`
205
# Put the nasty error message in config.log where it belongs
206
echo "$$1[]_PKG_ERRORS" >&AS_MESSAGE_LOG_FD
208
m4_default([$4], [AC_MSG_ERROR(
209
[Package requirements ($2) were not met:
213
Consider adjusting the PKG_CONFIG_PATH environment variable if you
214
installed software in a non-standard prefix.
218
elif test $pkg_failed = untried; then
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
227
To get pkg-config, see <http://pkg-config.freedesktop.org/>.])
230
$1[]_CFLAGS=$pkg_cv_[]$1[]_CFLAGS
231
$1[]_LIBS=$pkg_cv_[]$1[]_LIBS
235
])# PKG_CHECK_MODULES
98
$(_HELP_MOFILES): %.mo: %.po
99
$(AM_V_at)if ! test -d "$(dir [$]@)"; then mkdir "$(dir [$]@)"; fi
100
$(AM_V_GEN)msgfmt -o "[$]@" "$<"
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)))
111
mostlyclean-am: $(if $(HELP_ID),clean-help)
113
rm -f $(_HELP_LC_FILES) $(_HELP_MOFILES)
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))))
122
for lc in C $(_HELP_LINGUAS); do \
128
xmlpath="$$lc:$(srcdir)/$$lc"; \
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"; \
138
install-data-am: $(if $(HELP_ID),install-help)
140
@for lc in C $(_HELP_LINGUAS); do \
141
$(mkinstalldirs) "$(DESTDIR)$(HELP_DIR)/$$lc/$(HELP_ID)" || exit 1; \
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; \
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; \
168
.PHONY: uninstall-help
169
uninstall-am: $(if $(HELP_ID),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`"; \
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"; \
185
AC_SUBST([YELP_HELP_RULES])
186
m4_ifdef([_AM_SUBST_NOTMAKE], [_AM_SUBST_NOTMAKE([YELP_HELP_RULES])])
237
189
# Copyright (C) 2002, 2003, 2005, 2006, 2007, 2008 Free Software Foundation, Inc.