10552
dnl Do not call GNOME_DOC_DEFINES directly. It is split out from
10553
dnl GNOME_DOC_INIT to allow gnome-doc-utils to bootstrap off itself.
10554
AC_DEFUN([GNOME_DOC_DEFINES],
10556
AC_ARG_WITH([help-dir],
10557
AC_HELP_STRING([--with-help-dir=DIR], [path to help docs]),,
10558
[with_help_dir='${datadir}/gnome/help'])
10559
HELP_DIR="$with_help_dir"
10562
AC_ARG_WITH([omf-dir],
10563
AC_HELP_STRING([--with-omf-dir=DIR], [path to OMF files]),,
10564
[with_omf_dir='${datadir}/omf'])
10565
OMF_DIR="$with_omf_dir"
10568
AC_ARG_WITH([help-formats],
10569
AC_HELP_STRING([--with-help-formats=FORMATS], [list of formats]),,
10570
[with_help_formats=''])
10571
DOC_USER_FORMATS="$with_help_formats"
10572
AC_SUBST(DOC_USER_FORMATS)
10574
AC_ARG_ENABLE([scrollkeeper],
10575
[AC_HELP_STRING([--disable-scrollkeeper],
10576
[do not make updates to the scrollkeeper database])],,
10577
enable_scrollkeeper=yes)
10578
AM_CONDITIONAL([ENABLE_SK],[test "$gdu_cv_have_gdu" = "yes" -a "$enable_scrollkeeper" = "yes"])
10580
dnl disable scrollkeeper automatically for distcheck
10581
DISTCHECK_CONFIGURE_FLAGS="--disable-scrollkeeper $DISTCHECK_CONFIGURE_FLAGS"
10582
AC_SUBST(DISTCHECK_CONFIGURE_FLAGS)
10584
AM_CONDITIONAL([HAVE_GNOME_DOC_UTILS],[test "$gdu_cv_have_gdu" = "yes"])
10587
# GNOME_DOC_INIT ([MINIMUM-VERSION],[ACTION-IF-FOUND],[ACTION-IF-NOT-FOUND])
10589
AC_DEFUN([GNOME_DOC_INIT],
10590
[AC_REQUIRE([AC_PROG_LN_S])dnl
10592
if test -z "$AM_DEFAULT_VERBOSITY"; then
10593
AM_DEFAULT_VERBOSITY=1
10595
AC_SUBST([AM_DEFAULT_VERBOSITY])
10597
ifelse([$1],,[gdu_cv_version_required=0.3.2],[gdu_cv_version_required=$1])
10599
AC_MSG_CHECKING([gnome-doc-utils >= $gdu_cv_version_required])
10600
PKG_CHECK_EXISTS([gnome-doc-utils >= $gdu_cv_version_required],
10601
[gdu_cv_have_gdu=yes],[gdu_cv_have_gdu=no])
10603
if test "$gdu_cv_have_gdu" = "yes"; then
10604
AC_MSG_RESULT([yes])
10605
ifelse([$2],,[:],[$2])
10607
AC_MSG_RESULT([no])
10608
ifelse([$3],,[AC_MSG_ERROR([gnome-doc-utils >= $gdu_cv_version_required not found])],[$3])
10614
10552
dnl GLIB_GSETTINGS
10615
10553
dnl Defines GSETTINGS_SCHEMAS_INSTALL which controls whether
10616
10554
dnl the schema should be compiled
10636
AC_DEFUN([YELP_HELP_INIT],
10638
AC_REQUIRE([AC_PROG_LN_S])
10639
m4_pattern_allow([AM_V_at])
10640
m4_pattern_allow([AM_V_GEN])
10641
m4_pattern_allow([AM_DEFAULT_VERBOSITY])
10642
AC_ARG_WITH([help-dir],
10643
AC_HELP_STRING([--with-help-dir=DIR],
10644
[path where help files are installed]),,
10645
[with_help_dir='${datadir}/help'])
10646
HELP_DIR="$with_help_dir"
10649
AC_ARG_VAR([ITSTOOL], [Path to the `itstool` command])
10650
AC_CHECK_PROG([ITSTOOL], [itstool], [itstool])
10651
if test x"$ITSTOOL" = x; then
10652
AC_MSG_ERROR([itstool not found])
10655
AC_ARG_VAR([XMLLINT], [Path to the `xmllint` command])
10656
AC_CHECK_PROG([XMLLINT], [xmllint], [xmllint])
10657
if test x"$XMLLINT" = x; then
10658
AC_MSG_ERROR([xmllint not found])
10669
_HELP_LINGUAS = $(if $(filter environment,$(origin LINGUAS)),$(filter $(LINGUAS),$(HELP_LINGUAS)),$(HELP_LINGUAS))
10670
_HELP_POTFILE = $(if $(HELP_POT),$(HELP_POT),$(if $(HELP_ID),$(HELP_ID).pot))
10671
_HELP_POFILES = $(if $(HELP_ID),$(foreach lc,$(_HELP_LINGUAS),$(lc)/$(lc).po))
10672
_HELP_MOFILES = $(patsubst %.po,%.mo,$(_HELP_POFILES))
10673
_HELP_C_FILES = $(foreach f,$(HELP_FILES),C/$(f))
10674
_HELP_C_EXTRA = $(foreach f,$(HELP_EXTRA),C/$(f))
10675
_HELP_C_MEDIA = $(foreach f,$(HELP_MEDIA),C/$(f))
10676
_HELP_LC_FILES = $(foreach lc,$(_HELP_LINGUAS),$(foreach f,$(HELP_FILES),$(lc)/$(f)))
10677
_HELP_LC_STAMPS = $(foreach lc,$(_HELP_LINGUAS),$(lc)/$(lc).stamp)
10679
_HELP_DEFAULT_V = $(if $(AM_DEFAULT_VERBOSITY),$(AM_DEFAULT_VERBOSITY),1)
10680
_HELP_V = $(if $(V),$(V),$(_HELP_DEFAULT_V))
10681
_HELP_LC_VERBOSE = $(_HELP_LC_VERBOSE_$(_HELP_V))
10682
_HELP_LC_VERBOSE_ = $(_HELP_LC_VERBOSE_$(_HELP_DEFAULT_V))
10683
_HELP_LC_VERBOSE_0 = @echo " GEN "$(dir [$]@);
10685
all: $(_HELP_C_FILES) $(_HELP_C_EXTRA) $(_HELP_C_MEDIA) $(_HELP_LC_FILES) $(_HELP_POFILES)
10688
pot: $(_HELP_POTFILE)
10689
$(_HELP_POTFILE): $(_HELP_C_FILES) $(_HELP_C_EXTRA) $(_HELP_C_MEDIA)
10690
$(AM_V_GEN)$(ITSTOOL) -o "[$]@" $(_HELP_C_FILES)
10693
repo: $(_HELP_POTFILE)
10694
$(AM_V_at)for po in $(_HELP_POFILES); do \
10695
if test "x[$](_HELP_V)" = "x0"; then echo " GEN $${po}"; fi; \
10696
msgmerge -q -o "$${po}" "$${po}" "$(_HELP_POTFILE)"; \
10700
$(AM_V_at)if ! test -d "$(dir [$]@)"; then mkdir "$(dir [$]@)"; fi
10701
$(AM_V_at)if test ! -f "[$]@" -a -f "$(srcdir)/[$]@"; then cp "$(srcdir)/[$]@" "[$]@"; fi
10702
$(AM_V_GEN)if ! test -f "[$]@"; then \
10703
(cd "$(dir [$]@)" && \
10704
$(ITSTOOL) -o "$(notdir [$]@).tmp" $(_HELP_C_FILES) && \
10705
mv "$(notdir [$]@).tmp" "$(notdir [$]@)"); \
10707
(cd "$(dir [$]@)" && \
10708
$(ITSTOOL) -o "$(notdir [$]@).tmp" $(_HELP_C_FILES) && \
10709
msgmerge -o "$(notdir [$]@)" "$(notdir [$]@)" "$(notdir [$]@).tmp" && \
10710
rm "$(notdir [$]@).tmp"); \
10713
$(_HELP_MOFILES): %.mo: %.po
10714
$(AM_V_at)if ! test -d "$(dir [$]@)"; then mkdir "$(dir [$]@)"; fi
10715
$(AM_V_GEN)msgfmt -o "[$]@" "$<"
10717
$(_HELP_LC_FILES): $(_HELP_LINGUAS)
10718
$(_HELP_LINGUAS): $(_HELP_LC_STAMPS)
10719
$(_HELP_LC_STAMPS): %.stamp: %.mo
10720
$(_HELP_LC_STAMPS): $(_HELP_C_FILES) $(_HELP_C_EXTRA)
10721
$(AM_V_at)if ! test -d "$(dir [$]@)"; then mkdir "$(dir [$]@)"; fi
10722
$(_HELP_LC_VERBOSE)if test -d "C"; then d="../"; else d="$(abs_srcdir)/"; fi; \
10723
mo="$(dir [$]@)$(patsubst %/$(notdir [$]@),%,[$]@).mo"; \
10724
if test -f "$${mo}"; then mo="../$${mo}"; else mo="$(abs_srcdir)/$${mo}"; fi; \
10725
(cd "$(dir [$]@)" && $(ITSTOOL) -m "$${mo}" $(foreach f,$(_HELP_C_FILES),$${d}/$(f))) && \
10729
mostlyclean-am: $(if $(HELP_ID),clean-help)
10731
rm -f $(_HELP_LC_FILES) $(_HELP_LC_STAMPS) $(_HELP_MOFILES)
10734
EXTRA_DIST += $(_HELP_C_EXTRA) $(_HELP_C_MEDIA)
10735
EXTRA_DIST += $(foreach lc,$(HELP_LINGUAS),$(lc)/$(lc).stamp)
10736
EXTRA_DIST += $(foreach lc,$(HELP_LINGUAS),$(lc)/$(lc).po)
10737
EXTRA_DIST += $(foreach f,$(HELP_MEDIA),$(foreach lc,$(HELP_LINGUAS),$(wildcard $(lc)/$(f))))
10739
distdir: distdir-help-files
10740
distdir-help-files:
10741
@for lc in C $(HELP_LINGUAS); do \
10742
$(MKDIR_P) "$(distdir)/$$lc"; \
10743
for file in $(HELP_FILES); do \
10744
if test -f "$$lc/$$file"; then d=./; else d=$(srcdir)/; fi; \
10745
cp -p "$$d$$lc/$$file" "$(distdir)/$$lc/" || exit 1; \
10752
for lc in C $(_HELP_LINGUAS); do \
10753
if test -d "$$lc"; \
10758
xmlpath="$$lc:$(srcdir)/$$lc"; \
10760
for page in $(HELP_FILES); do \
10761
echo "$(XMLLINT) --noout --noent --path $$xmlpath --xinclude $$d$$lc/$$page"; \
10762
$(XMLLINT) --noout --noent --path "$$xmlpath" --xinclude "$$d$$lc/$$page"; \
10767
.PHONY: install-help
10768
install-data-am: $(if $(HELP_ID),install-help)
10770
@for lc in C $(_HELP_LINGUAS); do \
10771
$(mkinstalldirs) "$(DESTDIR)$(HELP_DIR)/$$lc/$(HELP_ID)" || exit 1; \
10773
@for lc in C $(_HELP_LINGUAS); do for f in $(HELP_FILES); do \
10774
if test -f "$$lc/$$f"; then d=; else d="$(srcdir)/"; fi; \
10775
helpdir="$(DESTDIR)$(HELP_DIR)/$$lc/$(HELP_ID)/"; \
10776
if ! test -d "$$helpdir"; then $(mkinstalldirs) "$$helpdir"; fi; \
10777
echo "$(INSTALL_DATA) $$d$$lc/$$f $$helpdir`basename $$f`"; \
10778
$(INSTALL_DATA) "$$d$$lc/$$f" "$$helpdir`basename $$f`" || exit 1; \
10780
@for f in $(_HELP_C_EXTRA); do \
10781
lc=`dirname "$$f"`; lc=`basename "$$lc"`; \
10782
if test -f "$$f"; then d=; else d="$(srcdir)/"; fi; \
10783
helpdir="$(DESTDIR)$(HELP_DIR)/$$lc/$(HELP_ID)/"; \
10784
if ! test -d "$$helpdir"; then $(mkinstalldirs) "$$helpdir"; fi; \
10785
echo "$(INSTALL_DATA) $$d$$f $$helpdir`basename $$f`"; \
10786
$(INSTALL_DATA) "$$d$$f" "$$helpdir`basename $$f`" || exit 1; \
10788
@for f in $(HELP_MEDIA); do \
10789
for lc in C $(_HELP_LINGUAS); do \
10790
if test -f "$$lc$$f"; then d=; else d="$(srcdir)/"; fi; \
10791
helpdir="$(DESTDIR)$(HELP_DIR)/$$lc/$(HELP_ID)/"; \
10792
mdir=`dirname "$$f"`; \
10793
if test "x$mdir" = "x."; then mdir=""; fi; \
10794
if ! test -d "$$helpdir$$mdir"; then $(mkinstalldirs) "$$helpdir$$mdir"; fi; \
10795
if test -f "$$d$$lc/$$f"; then \
10796
echo "$(INSTALL_DATA) $$d$$lc/$$f $$helpdir$$f"; \
10797
$(INSTALL_DATA) "$$d$$lc/$$f" "$$helpdir$$f" || exit 1; \
10798
elif test "x$$lc" != "xC"; then \
10799
echo "$(LN_S) -f $(HELP_DIR)/C/$(HELP_ID)/$$f $$helpdir$$f"; \
10800
$(LN_S) -f "$(HELP_DIR)/C/$(HELP_ID)/$$f" "$$helpdir$$f" || exit 1; \
10805
.PHONY: uninstall-help
10806
uninstall-am: $(if $(HELP_ID),uninstall-help)
10808
for lc in C $(_HELP_LINGUAS); do for f in $(HELP_FILES); do \
10809
helpdir="$(DESTDIR)$(HELP_DIR)/$$lc/$(HELP_ID)/"; \
10810
echo "rm -f $$helpdir`basename $$f`"; \
10811
rm -f "$$helpdir`basename $$f`"; \
10813
@for f in $(_HELP_C_EXTRA); do \
10814
lc=`dirname "$$f"`; lc=`basename "$$lc"`; \
10815
helpdir="$(DESTDIR)$(HELP_DIR)/$$lc/$(HELP_ID)/"; \
10816
echo "rm -f $$helpdir`basename $$f`"; \
10817
rm -f "$$helpdir`basename $$f`"; \
10819
@for f in $(HELP_MEDIA); do \
10820
for lc in C $(_HELP_LINGUAS); do \
10821
helpdir="$(DESTDIR)$(HELP_DIR)/$$lc/$(HELP_ID)/"; \
10822
echo "rm -f $$helpdir$$f"; \
10823
rm -f "$$helpdir$$f"; \
10827
AC_SUBST([YELP_HELP_RULES])
10828
m4_ifdef([_AM_SUBST_NOTMAKE], [_AM_SUBST_NOTMAKE([YELP_HELP_RULES])])