gnunet-svn
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[libmicrohttpd] 01/03: Reworked 'po' directory files and 'po' infrastruc


From: gnunet
Subject: [libmicrohttpd] 01/03: Reworked 'po' directory files and 'po' infrastructure handling
Date: Fri, 12 May 2023 17:25:47 +0200

This is an automated email from the git hooks/post-receive script.

karlson2k pushed a commit to branch master
in repository libmicrohttpd.

commit 66e16b627e413c64a96a596a41ddd9c1f7bb12b2
Author: Evgeny Grin (Karlson2k) <k2k@narod.ru>
AuthorDate: Mon Apr 17 23:01:36 2023 +0300

    Reworked 'po' directory files and 'po' infrastructure handling
    
    The project makefiles should handle rebuild of all required autopoint files.
    The new implementation uses unpatched autopoint files to simplify updates.
    Any missing distribution file should be recreated automatically when
    required (before making 'dist' targets).
    This implementation should work well with parallel make.
---
 Makefile.am           | 318 ++++++++++++++++++++++++++++++++++++++++++++------
 configure.ac          |  20 +++-
 po/.gitignore         |   4 +
 po/Makefile.in.in     |  15 +--
 po/Makevars           |  31 +++++
 po/po-configure.ac.in |  28 +++--
 6 files changed, 357 insertions(+), 59 deletions(-)

diff --git a/Makefile.am b/Makefile.am
index c2bb9005..bf9ca7b4 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -80,37 +80,73 @@ pre-dist-hook-doc:
 
 .PHONY: pre-dist-hook pre-dist-hook-doc
 
+# Works with old automake versions (<1.12.2) as "false"
+MHD_V = $(AM_V_P) false
+
 distclean-local: distclean-po
 
 maintainer-clean-local: maintainer-clean-po
 
-PO_ACLOCAL_M4 = $(top_srcdir)/po/aclocal.m4
+srcdir_po = $(top_srcdir)/po
+
+PO_ACLOCAL_M4 = $(srcdir_po)/aclocal.m4
+
+PO_MAIN_FILES = $(srcdir_po)/Makefile.in.in $(srcdir_po)/remove-potcdate.sin \
+  $(srcdir_po)/quot.sed $(srcdir_po)/boldquot.sed \
+  $(srcdir_po)/en@quot.header $(srcdir_po)/en@boldquot.header \
+  $(srcdir_po)/insert-header.sin $(srcdir_po)/Rules-quot
+
+PO_EXTRA_FILES = $(srcdir_po)/Makevars.template
 
-PO_M4_FILES = $(top_srcdir)/po/m4/gettext.m4 
$(top_srcdir)/po/m4/host-cpu-c-abi.m4 \
-  $(top_srcdir)/po/m4/iconv.m4 $(top_srcdir)/po/m4/intlmacosx.m4 \
-  $(top_srcdir)/po/m4/lib-ld.m4 $(top_srcdir)/po/m4/lib-link.m4 \
-  $(top_srcdir)/po/m4/lib-prefix.m4 $(top_srcdir)/po/m4/nls.m4 \
-  $(top_srcdir)/po/m4/po.m4 $(top_srcdir)/po/m4/progtest.m4
+PO_ROOT_FILES = $(srcdir_po)/ABOUT-NLS
 
-am__po_aclocal_m4_deps = $(PO_M4_FILES) $(top_srcdir)/po/configure.ac
+PO_M4_FILES = $(srcdir_po)/m4/gettext.m4 $(srcdir_po)/m4/host-cpu-c-abi.m4 \
+  $(srcdir_po)/m4/iconv.m4 $(srcdir_po)/m4/intlmacosx.m4 \
+  $(srcdir_po)/m4/lib-ld.m4 $(srcdir_po)/m4/lib-link.m4 \
+  $(srcdir_po)/m4/lib-prefix.m4 $(srcdir_po)/m4/nls.m4 \
+  $(srcdir_po)/m4/po.m4 $(srcdir_po)/m4/progtest.m4
+
+PO_AUX_FILES = $(srcdir_po)/$(MHD_AUX_DIR)/config.rpath
+
+# All autopoint-created files
+PO_ALL_FILES = $(PO_MAIN_FILES) $(PO_EXTRA_FILES) $(PO_ROOT_FILES) \
+  $(PO_M4_FILES) $(PO_AUX_FILES)
+
+am__po_aclocal_m4_deps = $(PO_M4_FILES) $(srcdir_po)/configure.ac
 am__po_configure_deps = $(am__po_aclocal_m4_deps) $(PO_ACLOCAL_M4)
 
 $(PO_ACLOCAL_M4): $(am__po_aclocal_m4_deps)
-       @echo "Building $@"
-       $(am__cd) '$(top_srcdir)/po' && $(ACLOCAL) $(ACLOCAL_AMFLAGS)
+       @{ $(MHD_V) && echo "Building $@" ; } || true
+       @echo "cd $(srcdir_po) && $(ACLOCAL) $(ACLOCAL_AMFLAGS)" && \
+         $(am__cd) '$(srcdir_po)' && $(ACLOCAL) $(ACLOCAL_AMFLAGS)
 
 # Do update po/configure.ac only if template files updated
-$(top_srcdir)/po/configure.ac: $(top_srcdir)/po/po-configure.ac.in 
$(top_srcdir)/configure.ac
-       @echo "Building $@"
-       @$(am__cd) '$(top_builddir)' && $(MAKE) $(AM_MAKEFLAGS) 
po/po-configure.ac
-       @rm -f '$@' && cp -f po/po-configure.ac '$@'
+$(srcdir_po)/configure.ac: $(srcdir_po)/po-configure.ac.in 
$(top_srcdir)/configure.ac
+       @{ $(MHD_V) && echo "Building $@" ; } || true
+       @$(MAKE) $(AM_MAKEFLAGS) po/po-configure.ac
+       @cp -f po/po-configure.ac '$@'
+
+$(top_srcdir)/po-configure: $(srcdir_po)/configure.ac $(PO_ACLOCAL_M4) 
$(PO_AUX_FILES) $(srcdir_po)/$(MHD_AUX_DIR)/install-sh
+       @{ $(MHD_V) && echo "Building $@" ; } || true
+       @echo "cd $(srcdir_po) && $(AUTOCONF)" && \
+         ( $(am__cd) '$(srcdir_po)' && $(AUTOCONF) )
+       mv -f '$(srcdir_po)/configure' '$@'
+       -chmod a-x '$@'
 
-$(top_srcdir)/po-configure: $(top_srcdir)/po/configure.ac $(PO_ACLOCAL_M4)
-       @echo "Building $@"
-       @$(am__cd) '$(top_srcdir)/po' && $(AUTOCONF)
-       @mv -f '$(top_srcdir)/po/configure' '$@'
+EXTRA_DIST += $(top_srcdir)/$(MHD_AUX_DIR)/config.rpath 
$(srcdir_po)/$(MHD_AUX_DIR)/install-sh \
+  $(PO_ALL_FILES) \
+  $(PO_ACLOCAL_M4) \
+  $(srcdir_po)/po-configure.ac.in $(srcdir_po)/configure.ac \
+  $(top_srcdir)/po-configure \
+  $(srcdir_po)/stamp-m.in
 
-po-config.status: $(top_srcdir)/po-configure
+DISTCLEANFILES += config.main.log po-config.log po/stamp-m
+MAINTAINERCLEANFILES += $(srcdir_po)/configure.ac
+
+$(srcdir_po)/stamp-m.in:
+       @: > '$@'
+
+po-config.status: $(top_srcdir)/po-configure 
$(top_srcdir)/$(MHD_AUX_DIR)/install-sh 
$(top_srcdir)/$(MHD_AUX_DIR)/config.rpath
        @if test -f config.log; then \
          mv -f config.log config.main.log; \
        else \
@@ -124,40 +160,252 @@ po-config.status: $(top_srcdir)/po-configure
          true; \
        fi
 
-po/Makefile: $(top_srcdir)/po/Makefile.in.in $(top_srcdir)/po/Makevars 
$(top_builddir)/po-config.status $(top_srcdir)/po/POTFILES.in
-       @$(am__cd) $(top_builddir) \
-         && @SHELL@ ./po-config.status po/Makefile.in po-directories
+po/Makefile: $(srcdir_po)/Makefile.in.in $(srcdir_po)/Makevars 
po-config.status $(srcdir_po)/POTFILES.in $(srcdir_po)/stamp-m.in
+       @: && @SHELL@ ./po-config.status po/stamp-m po/Makefile.in 
po-directories
 
-dist-po: po/Makefile
+dist-po: po/Makefile $(PO_MAIN_FILES)
        @dir1="po"; dir2="$(distdir)/po"; \
        $(am__relativize); \
        rel_distsubdir=$$reldir; \
        echo "cd po && $(MAKE) $(AM_MAKEFLAGS) distdir='$$rel_distsubdir' 
distdir" && \
        $(am__cd) po && $(MAKE) $(AM_MAKEFLAGS) distdir="$$rel_distsubdir" 
distdir
 
-$(top_srcdir)/po/POTFILES.in: $(top_srcdir)/src/microhttpd/Makefile.am
-       @echo "cd src/microhttpd && $(MAKE) $(AM_MAKEFLAGS) 
update-po-POTFILES.in" && \
-       $(am__cd) src/microhttpd && $(MAKE) $(AM_MAKEFLAGS) 
update-po-POTFILES.in
+$(srcdir_po)/POTFILES.in: $(top_srcdir)/src/microhttpd/Makefile.am
+       @echo "cd $(top_builddir)/src/microhttpd && $(MAKE) $(AM_MAKEFLAGS) 
update-po-POTFILES.in" && \
+       $(am__cd) '$(top_builddir)/src/microhttpd' && $(MAKE) $(AM_MAKEFLAGS) 
update-po-POTFILES.in
+
+AUTOPOINT = autopoint
+AUTOPOINT_FLAGS = 
+
+APIM_LOCK_BASE = autopoint-updating-lock
+APIM_TMSTMP_BASE = autopoint-timestamp
+APIM_TMSTMP_TMP_BASE = $(APIM_TMSTMP_BASE)-tmp
+APIM_TRIGGER_BASE = autopoint-trigger
+APIM_LOCK = $(srcdir_po)/$(APIM_LOCK_BASE)
+APIM_TMSTMP = $(srcdir_po)/$(APIM_TMSTMP_BASE)
+APIM_TMSTMP_TMP = $(srcdir_po)/$(APIM_TMSTMP_TMP_BASE)
+APIM_TRIGGER = $(srcdir_po)/$(APIM_TRIGGER_BASE)
+# Run 'autopoint' even if no file missing
+FORCE_AUTOPOINT_CHECK = no
+
+LOCK_TIMEOUT_VALUE = 120
+
+EXTRA_DIST += $(APIM_TMSTMP) $(APIM_TRIGGER)
+
+sleep_with_timeout = \
+    sleep 1; \
+    sec_waiting=`expr ${sec_waiting} + 1`; \
+    if test $${sec_waiting} -gt '$(LOCK_TIMEOUT_VALUE)'; then \
+        echo "Waiting timeout" 1>&2; \
+        rmdir "$${lock_name}" ; \
+        exit 1; \
+    fi
 
-EXTRA_DIST += $(am__po_configure_deps) $(top_srcdir)/po/po-configure.ac.in 
$(top_srcdir)/po-configure
-DISTCLEANFILES += config.main.log po-config.log
+wait_for_unlock = \
+    test -n "$${lock_name}" || lock_name='$(APIM_LOCK)'; \
+    if test -d "$${lock_name}"; then \
+        { $(MHD_V) && \
+            echo "Autopoint files are being updated in parallel thread, wait"; 
} || : ; \
+        sec_waiting=0; \
+        while test -d "$${lock_name}"; do \
+            $(sleep_with_timeout) ; \
+        done; \
+    fi
+
+apim_prepare = \
+    $(am__cd) '$(srcdir_po)' || exit 1; \
+    lock_name='$(APIM_LOCK_BASE)'; \
+    { trap "rm -rf $(APIM_TMSTMP_BASE) $(APIM_TMSTMP_TMP_BASE) $${lock_name} 
po" HUP ABRT INT TERM 2>/dev/null && \
+    trap "rm -rf $(APIM_TMSTMP_BASE) $(APIM_TMSTMP_TMP_BASE) $${lock_name} po" 
PIPE 2>/dev/null ; } || \
+    trap "rm -rf $(APIM_TMSTMP_BASE) $(APIM_TMSTMP_TMP_BASE) $${lock_name} po" 
1 2 13 15; \
+    lock_held='false'; \
+    sec_waiting=0; \
+    while : ; do \
+        if mkdir "$${lock_name}" 2>/dev/null; then lock_held=':' ; else : ; 
fi; \
+        $${lock_held} && break || : ; \
+        test 'xyes' = 'x$(FORCE_AUTOPOINT_CHECK)' || break ; \
+        $(sleep_with_timeout) ; \
+    done; \
+    if $${lock_held} ; then \
+        rm -f '$(APIM_TMSTMP_BASE)' '$(APIM_TMSTMP_TMP_BASE)' || exit 1; \
+        echo 'timestamp' > '$(APIM_TMSTMP_TMP_BASE)' || exit 1; \
+        if test 'xyes' = 'x$(FORCE_AUTOPOINT_CHECK)'; then \
+            call_autopoint=':'; check_all='false'; \
+        else \
+            call_autopoint='false'; check_all=':'; \
+        fi; \
+        if $(MHD_V) ; then apim_echo='echo' ; else apim_echo=':'; fi ;\
+        $$apim_echo "Sync autopoint files"; \
+        files_missing='false'; \
+        $(MKDIR_P) 'po'; \
+        $(MKDIR_P) '$(MHD_AUX_DIR)'; \
+        main_f_names=`for f in $(PO_MAIN_FILES) $(PO_EXTRA_FILES); do echo 
"$$f"; done | $(SED) -e 's|^.*/||'`; \
+        root_f_names=`for f in $(PO_ROOT_FILES); do echo "$$f"; done | $(SED) 
-e 's|^.*/||'`; \
+        m4_f_names=`for f in $(PO_M4_FILES); do echo "$$f"; done | $(SED) -e 
's|^.*/||'`; \
+        aux_f_names=`for f in $(PO_AUX_FILES); do echo "$$f"; done | $(SED) -e 
's|^.*/||'`; \
+        for f in $${main_f_names}; do \
+            if test -f "$$f"; then \
+                 cp -f "$$f" "po/$$f" ; \
+            else \
+                $$apim_echo "Missing $(srcdir_po)/$$f" ; \
+                files_missing=':' ; \
+            fi; \
+        done; \
+        if $${check_all} ; then \
+            for f in $${root_f_names}; do \
+                if test -f "./$$f"; then : ; \
+                else \
+                    $$apim_echo "Missing $(srcdir_po)/$$f" ; \
+                    files_missing=':' ; \
+                fi; \
+            done; \
+            for f in $${m4_f_names}; do \
+                if test -f "m4/$$f"; then : ; \
+                else \
+                    $$apim_echo "Missing $(srcdir_po)/m4/$$f" ; \
+                    files_missing=':' ; \
+                fi; \
+            done; \
+            for f in $${aux_f_names}; do \
+                if test -f "$(MHD_AUX_DIR)/$$f"; then : ;\
+                else \
+                    $$apim_echo "Missing $(srcdir_po)/$(MHD_AUX_DIR)/$$f" ; \
+                    files_missing=':' ; \
+                fi; \
+            done; \
+        fi; \
+        if $${files_missing} ; then \
+            call_autopoint=':' ; \
+            $$apim_echo "Some files are missing, call autopoint to restore 
them" ; \
+        elif $${call_autopoint}; then $$apim_echo "Check and update autopoint 
files" ; \
+        fi; \
+        rc_code=0; \
+        if $${call_autopoint} ; then \
+            echo '  cd $(srcdir_po) && $(AUTOPOINT) $(AUTOPOINT_FLAGS)'; \
+            '$(AUTOPOINT)' $(AUTOPOINT_FLAGS) || rc_code=1; \
+        fi; \
+        if test "$${rc_code}" = "0"; then \
+            $$apim_echo "Re-sync autopoint files back"; \
+            for f in $${aux_f_names}; do \
+                if test -f "$(MHD_AUX_DIR)/$$f"; then \
+                    touch -f "$(MHD_AUX_DIR)/$$f" && \
+                    cp -f "$(MHD_AUX_DIR)/$$f" "../$(MHD_AUX_DIR)/$$f"; \
+                else \
+                    $$apim_echo "Still missing 
$(srcdir_po)/$(MHD_AUX_DIR)/$$f" 1>&2 ; \
+                    rc_code=1; \
+                fi; \
+            done; \
+            for f in $${m4_f_names}; do \
+                if test -f "m4/$$f"; then \
+                    touch "m4/$$f"; \
+                else \
+                    $$apim_echo "Still missing $(srcdir_po)/m4/$$f" 1>&2 ; \
+                    rc_code=1; \
+                fi; \
+            done; \
+            for f in $${root_f_names}; do \
+                if test -f "./$$f"; then \
+                    touch "./$$f"; \
+                else \
+                    $$apim_echo "Still missing $(srcdir_po)/$$f" 1>&2 ; \
+                    rc_code=1; \
+                fi; \
+            done; \
+            for f in $${main_f_names}; do \
+                if test -f "po/$$f"; then \
+                    cp -f "po/$$f" "$$f"; \
+                else \
+                    $$apim_echo "Still missing $(srcdir_po)/$$f" 1>&2 ; \
+                    rc_code=1; \
+                fi; \
+            done; \
+        fi; \
+        if test $${rc_code} = 0; then \
+            cp -fp '$(APIM_TMSTMP_TMP_BASE)' '$(APIM_TMSTMP_BASE)' ; \
+            touch -r '$(APIM_TMSTMP_TMP_BASE)' '$(APIM_TMSTMP_BASE)' ; \
+            $$apim_echo "All autopoint files have been synced"; \
+            rm -f '$(APIM_TMSTMP_TMP_BASE)'; \
+        else \
+            rm -f '$(APIM_TMSTMP_BASE)' '$(APIM_TMSTMP_TMP_BASE)'; \
+        fi; \
+        rm -fr 'po'; \
+        rmdir "$${lock_name}"; \
+        exit $${rc_code} ; \
+    else \
+        $(wait_for_unlock) ; \
+        test -f '$(APIM_TMSTMP_BASE)' || exit 1; \
+    fi; \
+    :
+
+mostlyclean-local: mostlyclean-autopoint-update
+mostlyclean-autopoint-update:
+       -test -d '$(APIM_LOCK)' && rm -rf '$(APIM_LOCK)'
+       -test -d '$(srcdir_po)/po' && rm -rf '$(srcdir_po)/po'
+       rm -f '$(APIM_TMSTMP_TMP)'
+
+$(APIM_TRIGGER):
+       @echo "autopoint files rebuild trigger" > "$@"
+
+$(APIM_TMSTMP): $(srcdir_po)/configure.ac $(APIM_TRIGGER)
+       @ $(apim_prepare)
+
+.DELETE_ON_ERROR: $(APIM_TMSTMP)
+
+$(PO_ALL_FILES): $(APIM_TMSTMP) $(srcdir_po)/configure.ac
+       @ ( $(apim_prepare) )
+       @test -f '$@'
+
+prepare-autopoint: $(srcdir_po)/configure.ac
+       @ ( $(apim_prepare) )
+       @test -f '$(APIM_TMSTMP)'
+
+check-prepare-autopoint: $(srcdir_po)/$(MHD_AUX_DIR)/install-sh $(APIM_TMSTMP)
+       @echo "Check all autopoint files"; \
+           files_missing='false'; \
+           for f in $(PO_ALL_FILES); do \
+               if test -f "$$f"; then : ; \
+               else \
+                   echo "Missing $$f" ; \
+                   files_missing=':' ; \
+               fi; \
+           done; \
+           if $${files_missing}; then \
+               $(MAKE) $(AM_MAKEFLAGS) prepare-autopoint || exit 1; \
+           else \
+               exit 0; \
+           fi
+
+# This could be used to update autopoint files for git or for 'dist' target
+update-autopoint-force:
+       $(MAKE) $(AM_MAKEFLAGS) 'FORCE_AUTOPOINT_CHECK=yes' 
'AUTOPOINT_FLAGS=$(AUTOPOINT_FLAGS) -f' prepare-autopoint
+
+autopoint-files-all: $(APIM_TRIGGER) $(APIM_TMSTMP) $(PO_MAIN_FILES) 
$(PO_EXTRA_FILES) $(PO_M4_FILES) $(PO_AUX_FILES) 
$(srcdir_po)/$(MHD_AUX_DIR)/install-sh
+
+$(top_srcdir)/$(MHD_AUX_DIR)/config.rpath: 
$(srcdir_po)/$(MHD_AUX_DIR)/config.rpath
+       cp -f '$(srcdir_po)/$(MHD_AUX_DIR)/config.rpath' '$@'
+
+$(srcdir_po)/$(MHD_AUX_DIR)/install-sh: $(top_srcdir)/$(MHD_AUX_DIR)/install-sh
+       $(MKDIR_P) '$(srcdir_po)/$(MHD_AUX_DIR)'
+       cp -f '$(top_srcdir)/$(MHD_AUX_DIR)/install-sh' '$@'
+
+.PHONY: mostlyclean-autopoint-update prepare-autopoint update-autopoint-force 
check-prepare-autopoint autopoint-files-all
 
 distclean-po:
-       @if test -f po/Makefile; then \
-         $(am__cd) po && $(MAKE) $(AM_MAKEFLAGS) distclean; \
+       @( if test -f po/Makefile; then \
+          $(am__cd) po && $(MAKE) $(AM_MAKEFLAGS) distclean; \
        else \
          true; \
-       fi
-       -rm -f po-config.status po/Makefile
+       fi )
+       -rm -f po-config.status po/Makefile po/stamp-m
        -rm -f po/POTFILES po/remove-potcdate.sed po/Makefile.in
 
 maintainer-clean-po:
-       @if test -f po/Makefile; then \
+       @( if test -f po/Makefile; then \
          $(am__cd) po && $(MAKE) $(AM_MAKEFLAGS) maintainer-clean; \
        else \
          true; \
-       fi
-       -rm -f po/$(PACKAGE_TARNAME).pot po/stamp-po
-       -rm -rf $(top_srcdir)/po/autom4te.cache
+       fi )
+       -rm -f po/$(PACKAGE_TARNAME).pot
+       -rm -rf $(srcdir_po)/autom4te.cache
 
 .PHONY: distclean-po maintainer-clean-po
diff --git a/configure.ac b/configure.ac
index c1115135..4d51d6c1 100644
--- a/configure.ac
+++ b/configure.ac
@@ -1,6 +1,6 @@
 # This file is part of libmicrohttpd.
 # (C) 2006-2021 Christian Grothoff (and other contributing authors)
-# (C) 2014-2022 Evgeny Grin (Karlson2k)
+# (C) 2014-2023 Evgeny Grin (Karlson2k)
 #
 # libmicrohttpd is free software; you can redistribute it and/or modify
 # it under the terms of the GNU General Public License as published
@@ -25,6 +25,7 @@ AC_PREREQ([2.64])
 LT_PREREQ([2.4.0])
 AC_INIT([GNU libmicrohttpd],[0.9.76],[libmicrohttpd@gnu.org])
 AC_CONFIG_AUX_DIR([build-aux])
+MHD_AUX_DIR='build-aux' # Must be set to the same value as in the previous line
 AC_CONFIG_HEADERS([MHD_config.h])
 AC_CONFIG_MACRO_DIR([m4])
 m4_pattern_forbid([^_?MHD_[A-Z_]+_CC_])dnl
@@ -4865,7 +4866,21 @@ AC_SUBST([CPPFLAGS_ac])
 
 # Used for 'po' directory staff
 AC_SUBST([ac_configure_args])
-AC_SUBST([EMPTY_VAR], [[]])
+AC_SUBST([EMPTY_VAR],[])
+AC_SUBST([MHD_AUX_DIR])
+AC_CONFIG_FILES([po/po-configure.ac])
+AC_CONFIG_COMMANDS([po/Makefile.in],
+  [
+    echo "Skipping update of po/Makefile.in"
+    echo "Real update of po/Makefile.in for 'make dist' is peformed by 
po-config.status"
+  ]
+)
+AC_CONFIG_COMMANDS([po-directories],
+  [
+    echo "Skipping po-directories command."
+    echo "Real po-directories command for 'make dist' is implemented in 
po-config.status"
+  ]
+)
 
 # We define the paths here, because MinGW/GCC expands paths
 # passed through the command line ("-DDIR=..."). This would
@@ -4887,7 +4902,6 @@ AM_CONDITIONAL([HAVE_EXPERIMENTAL], [test 
"x$enable_experimental" = "xyes"])
 AC_CONFIG_FILES([libmicrohttpd.pc
 w32/common/microhttpd_dll_res_vc.rc
 Makefile
-po/po-configure.ac
 contrib/Makefile
 doc/Makefile
 doc/doxygen/libmicrohttpd.doxy
diff --git a/po/.gitignore b/po/.gitignore
new file mode 100644
index 00000000..ff723e00
--- /dev/null
+++ b/po/.gitignore
@@ -0,0 +1,4 @@
+/build-aux/install?sh
+/autopoint-trigger
+/autopoint-timestamp
+/stamp-m.in
diff --git a/po/Makefile.in.in b/po/Makefile.in.in
index 0dc27d36..6b25f0d9 100644
--- a/po/Makefile.in.in
+++ b/po/Makefile.in.in
@@ -495,24 +495,13 @@ $(DUMMYPOFILES):
 update-gmo: Makefile $(GMOFILES)
        @:
 
-#
-# The next three targets are customized for MHD
-#
-
 # Recreate Makefile by invoking config.status. Explicitly invoke the shell,
 # because execution permission bits may not work on the current file system.
 # Use @SHELL@, which is the shell determined by autoconf for the use by its
 # scripts, not $(SHELL) which is hardwired to /bin/sh and may be deficient.
-Makefile: Makefile.in.in Makevars $(top_builddir)/po-config.status 
@POMAKEFILEDEPS@
+Makefile: Makefile.in.in Makevars $(top_builddir)/config.status 
@POMAKEFILEDEPS@
        cd $(top_builddir) \
-         && @SHELL@ ./po-config.status $(subdir)/$@.in po-directories
-
-$(top_builddir)/po-config.status: $(srcdir)/po-configure.ac.in 
$(top_srcdir)/configure.ac
-       cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) po-config.status
-
-remove-potcdate.sed: $(srcdir)/remove-potcdate.sin
-       $(SED) -e '/^#/d' '$(srcdir)/remove-potcdate.sin' > t-$@
-       mv t-$@ $@
+         && @SHELL@ ./config.status $(subdir)/$@.in po-directories
 
 force:
 
diff --git a/po/Makevars b/po/Makevars
index 5b2468e3..0325c716 100644
--- a/po/Makevars
+++ b/po/Makevars
@@ -80,3 +80,34 @@ PO_DEPENDS_ON_POT = yes
 # "no".  Set this to no if the POT file and PO files are maintained
 # externally.
 DIST_DEPENDS_ON_UPDATE_PO = yes
+
+# Hacks for MHD
+am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd
+
+$(top_builddir)/po-config.status: $(srcdir)/po-configure.ac.in 
$(top_srcdir)/configure.ac
+       @echo "cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) po-config.status" 
&& \
+       $(am__cd) '$(top_builddir)' && $(MAKE) $(AM_MAKEFLAGS) po-config.status
+
+$(srcdir)/POTFILES.in: $(top_srcdir)/src/microhttpd/Makefile.am
+       @echo "cd $(top_srcdir)/src/microhttpd && $(MAKE) $(AM_MAKEFLAGS) 
update-po-POTFILES.in" && \
+       $(am__cd) '$(top_srcdir)/src/microhttpd' && $(MAKE) $(AM_MAKEFLAGS) 
update-po-POTFILES.in
+
+$(srcdir)/stamp-m.in:
+       @: > '$@'
+
+stamp-m: $(srcdir)/Makefile.in.in $(srcdir)/Makevars 
$(top_builddir)/po-config.status $(srcdir)/POTFILES.in $(srcdir)/stamp-m.in
+       @$(am__cd) $(top_builddir) \
+           && $(MHD_CONFIG_SHELL) ./po-config.status po/stamp-m po/Makefile.in 
po-directories
+
+.DELETE_ON_ERROR: stamp-m
+
+$(srcdir)/$(MHD_AUX_DIR)/install-sh: $(topsrcdir)/$(MHD_AUX_DIR)/install-sh
+       @$(MKDIR_P) '$(topsrcdir)/$(MHD_AUX_DIR)'
+       cp -f '$(topsrcdir)/$(MHD_AUX_DIR)/install-sh' '$@'
+
+mostlyclean: mostlycleancustom
+mostlycleancustom:
+       -rm -f stamp-m Makefile.in po-configure.ac
+       -rm -f $(top_builddir)/po-config.status
+
+.PHONY: mostlycleancustom
diff --git a/po/po-configure.ac.in b/po/po-configure.ac.in
index 9f7e8b03..6f5e4a6d 100644
--- a/po/po-configure.ac.in
+++ b/po/po-configure.ac.in
@@ -1,39 +1,51 @@
 AC_INIT([@PACKAGE_NAME@],[@PACKAGE_VERSION@],[@PACKAGE_BUGREPORT@])
 CONFIG_STATUS='./po-config.status'
 
-AC_CONFIG_AUX_DIR([build-aux])
+AC_CONFIG_AUX_DIR([@MHD_AUX_DIR@])
 AC_CONFIG_MACRO_DIR([m4])
+
 AC_PRESERVE_HELP_ORDER
 
 AC_MSG_NOTICE([
 This special $as_me is designed to be run only internally as part of 
distribution tarball building process.
-The only purpose of the $as_me is a preparion of the files to update 
${PACKAGE_TARNAME}.pot
+The only purpose of the $as_me is a preparation of the files to update 
${PACKAGE_TARNAME}.pot
 
 $as_me is not meant to be started by the user and is not needed to build 
${PACKAGE_NAME} library.
 ])
 AC_MSG_NOTICE([Check src/examples/msgs_i18n.c for inspiration how to use 
${PACKAGE_TARNAME}.pot])
+
+AM_PROG_INSTALL_SH
+AC_PROG_MKDIR_P
+
 AS_VAR_SET_IF([enable_nls], [], [[enable_nls=no]])
 AM_GNU_GETTEXT([external],[need-ngettext])
+AM_GNU_GETTEXT_REQUIRE_VERSION([0.18])
 
-m4_divert_text([HELP_ENABLE], [[
+m4_divert_text([HELP_VAR_END], [[
 ###############################################################################
 This special po-configure is designed to be run only internally as part of
 distribution tarball building process.
-The only purpose of the po-configure is a preparion of the files to update
-libmicrohttpd.pot
+The only purpose of the po-configure is a preparation of the files to update
+@PACKAGE_TARNAME@.pot
 
 po-configure is not meant to be started by the user and is not needed to build
 @PACKAGE_NAME@ library.
 ###############################################################################
 ]])
 
-AC_CONFIG_FILES([po/Makefile.in])
+# Hacks for libmicrohttpd
+AC_CONFIG_FILES([po/stamp-m],[echo 'timestamp' > po/stamp-m])
+AC_SUBST([POMAKEFILEDEPS],["POTFILES.in stamp-m"])
+AM_SUBST_NOTMAKE([POMAKEFILEDEPS])
+AC_SUBST([MHD_CONFIG_SHELL],["${CONFIG_SHELL}"])
+AC_SUBST([MHD_AUX_DIR],['@MHD_AUX_DIR@'])
 
+AC_CONFIG_FILES([po/Makefile.in])
 AS_IF([test -z "${XGETTEXT}" || test "x${XGETTEXT}" = "x:"], 
[AC_MSG_ERROR([Cannot find xgettext. xgettext is required to update 
distribution tarball files.])])
 AC_SUBST([PACKAGE],["${PACKAGE_TARNAME}"])
 AC_SUBST([VERSION],["${PACKAGE_VERSION}"])
 AC_SUBST([CROSS_COMPILING],["${cross_compiling}"])
+AC_SUBST([MKDIR_P])
 AC_SUBST([mkdir_p],['$(MKDIR_P)'])
-AC_SUBST([install_sh],['false'])
 
-AC_OUTPUT
\ No newline at end of file
+AC_OUTPUT

-- 
To stop receiving notification emails like this one, please contact
gnunet@gnunet.org.



reply via email to

[Prev in Thread] Current Thread [Next in Thread]