diff options
author | Evgeny Grin (Karlson2k) <k2k@narod.ru> | 2023-04-17 23:01:36 +0300 |
---|---|---|
committer | Christian Grothoff <christian@grothoff.org> | 2023-05-25 10:44:49 +0200 |
commit | fac57219474d08ef559e87bf1b08f00baccb5bd4 (patch) | |
tree | 3267c2d110f4bcbcfc459ca1a9c269b727faa676 | |
parent | ab16762203214f16ed7abfaf5a421ebe8b01c9d7 (diff) | |
download | libmicrohttpd-fac57219474d08ef559e87bf1b08f00baccb5bd4.tar.gz libmicrohttpd-fac57219474d08ef559e87bf1b08f00baccb5bd4.zip |
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.
-rw-r--r-- | Makefile.am | 318 | ||||
-rw-r--r-- | configure.ac | 20 | ||||
-rw-r--r-- | po/.gitignore | 4 | ||||
-rw-r--r-- | po/Makefile.in.in | 15 | ||||
-rw-r--r-- | po/Makevars | 31 | ||||
-rw-r--r-- | 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: | |||
80 | 80 | ||
81 | .PHONY: pre-dist-hook pre-dist-hook-doc | 81 | .PHONY: pre-dist-hook pre-dist-hook-doc |
82 | 82 | ||
83 | # Works with old automake versions (<1.12.2) as "false" | ||
84 | MHD_V = $(AM_V_P) false | ||
85 | |||
83 | distclean-local: distclean-po | 86 | distclean-local: distclean-po |
84 | 87 | ||
85 | maintainer-clean-local: maintainer-clean-po | 88 | maintainer-clean-local: maintainer-clean-po |
86 | 89 | ||
87 | PO_ACLOCAL_M4 = $(top_srcdir)/po/aclocal.m4 | 90 | srcdir_po = $(top_srcdir)/po |
91 | |||
92 | PO_ACLOCAL_M4 = $(srcdir_po)/aclocal.m4 | ||
93 | |||
94 | PO_MAIN_FILES = $(srcdir_po)/Makefile.in.in $(srcdir_po)/remove-potcdate.sin \ | ||
95 | $(srcdir_po)/quot.sed $(srcdir_po)/boldquot.sed \ | ||
96 | $(srcdir_po)/en@quot.header $(srcdir_po)/en@boldquot.header \ | ||
97 | $(srcdir_po)/insert-header.sin $(srcdir_po)/Rules-quot | ||
98 | |||
99 | PO_EXTRA_FILES = $(srcdir_po)/Makevars.template | ||
88 | 100 | ||
89 | PO_M4_FILES = $(top_srcdir)/po/m4/gettext.m4 $(top_srcdir)/po/m4/host-cpu-c-abi.m4 \ | 101 | PO_ROOT_FILES = $(srcdir_po)/ABOUT-NLS |
90 | $(top_srcdir)/po/m4/iconv.m4 $(top_srcdir)/po/m4/intlmacosx.m4 \ | ||
91 | $(top_srcdir)/po/m4/lib-ld.m4 $(top_srcdir)/po/m4/lib-link.m4 \ | ||
92 | $(top_srcdir)/po/m4/lib-prefix.m4 $(top_srcdir)/po/m4/nls.m4 \ | ||
93 | $(top_srcdir)/po/m4/po.m4 $(top_srcdir)/po/m4/progtest.m4 | ||
94 | 102 | ||
95 | am__po_aclocal_m4_deps = $(PO_M4_FILES) $(top_srcdir)/po/configure.ac | 103 | PO_M4_FILES = $(srcdir_po)/m4/gettext.m4 $(srcdir_po)/m4/host-cpu-c-abi.m4 \ |
104 | $(srcdir_po)/m4/iconv.m4 $(srcdir_po)/m4/intlmacosx.m4 \ | ||
105 | $(srcdir_po)/m4/lib-ld.m4 $(srcdir_po)/m4/lib-link.m4 \ | ||
106 | $(srcdir_po)/m4/lib-prefix.m4 $(srcdir_po)/m4/nls.m4 \ | ||
107 | $(srcdir_po)/m4/po.m4 $(srcdir_po)/m4/progtest.m4 | ||
108 | |||
109 | PO_AUX_FILES = $(srcdir_po)/$(MHD_AUX_DIR)/config.rpath | ||
110 | |||
111 | # All autopoint-created files | ||
112 | PO_ALL_FILES = $(PO_MAIN_FILES) $(PO_EXTRA_FILES) $(PO_ROOT_FILES) \ | ||
113 | $(PO_M4_FILES) $(PO_AUX_FILES) | ||
114 | |||
115 | am__po_aclocal_m4_deps = $(PO_M4_FILES) $(srcdir_po)/configure.ac | ||
96 | am__po_configure_deps = $(am__po_aclocal_m4_deps) $(PO_ACLOCAL_M4) | 116 | am__po_configure_deps = $(am__po_aclocal_m4_deps) $(PO_ACLOCAL_M4) |
97 | 117 | ||
98 | $(PO_ACLOCAL_M4): $(am__po_aclocal_m4_deps) | 118 | $(PO_ACLOCAL_M4): $(am__po_aclocal_m4_deps) |
99 | @echo "Building $@" | 119 | @{ $(MHD_V) && echo "Building $@" ; } || true |
100 | $(am__cd) '$(top_srcdir)/po' && $(ACLOCAL) $(ACLOCAL_AMFLAGS) | 120 | @echo "cd $(srcdir_po) && $(ACLOCAL) $(ACLOCAL_AMFLAGS)" && \ |
121 | $(am__cd) '$(srcdir_po)' && $(ACLOCAL) $(ACLOCAL_AMFLAGS) | ||
101 | 122 | ||
102 | # Do update po/configure.ac only if template files updated | 123 | # Do update po/configure.ac only if template files updated |
103 | $(top_srcdir)/po/configure.ac: $(top_srcdir)/po/po-configure.ac.in $(top_srcdir)/configure.ac | 124 | $(srcdir_po)/configure.ac: $(srcdir_po)/po-configure.ac.in $(top_srcdir)/configure.ac |
104 | @echo "Building $@" | 125 | @{ $(MHD_V) && echo "Building $@" ; } || true |
105 | @$(am__cd) '$(top_builddir)' && $(MAKE) $(AM_MAKEFLAGS) po/po-configure.ac | 126 | @$(MAKE) $(AM_MAKEFLAGS) po/po-configure.ac |
106 | @rm -f '$@' && cp -f po/po-configure.ac '$@' | 127 | @cp -f po/po-configure.ac '$@' |
128 | |||
129 | $(top_srcdir)/po-configure: $(srcdir_po)/configure.ac $(PO_ACLOCAL_M4) $(PO_AUX_FILES) $(srcdir_po)/$(MHD_AUX_DIR)/install-sh | ||
130 | @{ $(MHD_V) && echo "Building $@" ; } || true | ||
131 | @echo "cd $(srcdir_po) && $(AUTOCONF)" && \ | ||
132 | ( $(am__cd) '$(srcdir_po)' && $(AUTOCONF) ) | ||
133 | mv -f '$(srcdir_po)/configure' '$@' | ||
134 | -chmod a-x '$@' | ||
107 | 135 | ||
108 | $(top_srcdir)/po-configure: $(top_srcdir)/po/configure.ac $(PO_ACLOCAL_M4) | 136 | EXTRA_DIST += $(top_srcdir)/$(MHD_AUX_DIR)/config.rpath $(srcdir_po)/$(MHD_AUX_DIR)/install-sh \ |
109 | @echo "Building $@" | 137 | $(PO_ALL_FILES) \ |
110 | @$(am__cd) '$(top_srcdir)/po' && $(AUTOCONF) | 138 | $(PO_ACLOCAL_M4) \ |
111 | @mv -f '$(top_srcdir)/po/configure' '$@' | 139 | $(srcdir_po)/po-configure.ac.in $(srcdir_po)/configure.ac \ |
140 | $(top_srcdir)/po-configure \ | ||
141 | $(srcdir_po)/stamp-m.in | ||
112 | 142 | ||
113 | po-config.status: $(top_srcdir)/po-configure | 143 | DISTCLEANFILES += config.main.log po-config.log po/stamp-m |
144 | MAINTAINERCLEANFILES += $(srcdir_po)/configure.ac | ||
145 | |||
146 | $(srcdir_po)/stamp-m.in: | ||
147 | @: > '$@' | ||
148 | |||
149 | po-config.status: $(top_srcdir)/po-configure $(top_srcdir)/$(MHD_AUX_DIR)/install-sh $(top_srcdir)/$(MHD_AUX_DIR)/config.rpath | ||
114 | @if test -f config.log; then \ | 150 | @if test -f config.log; then \ |
115 | mv -f config.log config.main.log; \ | 151 | mv -f config.log config.main.log; \ |
116 | else \ | 152 | else \ |
@@ -124,40 +160,252 @@ po-config.status: $(top_srcdir)/po-configure | |||
124 | true; \ | 160 | true; \ |
125 | fi | 161 | fi |
126 | 162 | ||
127 | po/Makefile: $(top_srcdir)/po/Makefile.in.in $(top_srcdir)/po/Makevars $(top_builddir)/po-config.status $(top_srcdir)/po/POTFILES.in | 163 | po/Makefile: $(srcdir_po)/Makefile.in.in $(srcdir_po)/Makevars po-config.status $(srcdir_po)/POTFILES.in $(srcdir_po)/stamp-m.in |
128 | @$(am__cd) $(top_builddir) \ | 164 | @: && @SHELL@ ./po-config.status po/stamp-m po/Makefile.in po-directories |
129 | && @SHELL@ ./po-config.status po/Makefile.in po-directories | ||
130 | 165 | ||
131 | dist-po: po/Makefile | 166 | dist-po: po/Makefile $(PO_MAIN_FILES) |
132 | @dir1="po"; dir2="$(distdir)/po"; \ | 167 | @dir1="po"; dir2="$(distdir)/po"; \ |
133 | $(am__relativize); \ | 168 | $(am__relativize); \ |
134 | rel_distsubdir=$$reldir; \ | 169 | rel_distsubdir=$$reldir; \ |
135 | echo "cd po && $(MAKE) $(AM_MAKEFLAGS) distdir='$$rel_distsubdir' distdir" && \ | 170 | echo "cd po && $(MAKE) $(AM_MAKEFLAGS) distdir='$$rel_distsubdir' distdir" && \ |
136 | $(am__cd) po && $(MAKE) $(AM_MAKEFLAGS) distdir="$$rel_distsubdir" distdir | 171 | $(am__cd) po && $(MAKE) $(AM_MAKEFLAGS) distdir="$$rel_distsubdir" distdir |
137 | 172 | ||
138 | $(top_srcdir)/po/POTFILES.in: $(top_srcdir)/src/microhttpd/Makefile.am | 173 | $(srcdir_po)/POTFILES.in: $(top_srcdir)/src/microhttpd/Makefile.am |
139 | @echo "cd src/microhttpd && $(MAKE) $(AM_MAKEFLAGS) update-po-POTFILES.in" && \ | 174 | @echo "cd $(top_builddir)/src/microhttpd && $(MAKE) $(AM_MAKEFLAGS) update-po-POTFILES.in" && \ |
140 | $(am__cd) src/microhttpd && $(MAKE) $(AM_MAKEFLAGS) update-po-POTFILES.in | 175 | $(am__cd) '$(top_builddir)/src/microhttpd' && $(MAKE) $(AM_MAKEFLAGS) update-po-POTFILES.in |
176 | |||
177 | AUTOPOINT = autopoint | ||
178 | AUTOPOINT_FLAGS = | ||
179 | |||
180 | APIM_LOCK_BASE = autopoint-updating-lock | ||
181 | APIM_TMSTMP_BASE = autopoint-timestamp | ||
182 | APIM_TMSTMP_TMP_BASE = $(APIM_TMSTMP_BASE)-tmp | ||
183 | APIM_TRIGGER_BASE = autopoint-trigger | ||
184 | APIM_LOCK = $(srcdir_po)/$(APIM_LOCK_BASE) | ||
185 | APIM_TMSTMP = $(srcdir_po)/$(APIM_TMSTMP_BASE) | ||
186 | APIM_TMSTMP_TMP = $(srcdir_po)/$(APIM_TMSTMP_TMP_BASE) | ||
187 | APIM_TRIGGER = $(srcdir_po)/$(APIM_TRIGGER_BASE) | ||
188 | # Run 'autopoint' even if no file missing | ||
189 | FORCE_AUTOPOINT_CHECK = no | ||
190 | |||
191 | LOCK_TIMEOUT_VALUE = 120 | ||
192 | |||
193 | EXTRA_DIST += $(APIM_TMSTMP) $(APIM_TRIGGER) | ||
194 | |||
195 | sleep_with_timeout = \ | ||
196 | sleep 1; \ | ||
197 | sec_waiting=`expr ${sec_waiting} + 1`; \ | ||
198 | if test $${sec_waiting} -gt '$(LOCK_TIMEOUT_VALUE)'; then \ | ||
199 | echo "Waiting timeout" 1>&2; \ | ||
200 | rmdir "$${lock_name}" ; \ | ||
201 | exit 1; \ | ||
202 | fi | ||
141 | 203 | ||
142 | EXTRA_DIST += $(am__po_configure_deps) $(top_srcdir)/po/po-configure.ac.in $(top_srcdir)/po-configure | 204 | wait_for_unlock = \ |
143 | DISTCLEANFILES += config.main.log po-config.log | 205 | test -n "$${lock_name}" || lock_name='$(APIM_LOCK)'; \ |
206 | if test -d "$${lock_name}"; then \ | ||
207 | { $(MHD_V) && \ | ||
208 | echo "Autopoint files are being updated in parallel thread, wait"; } || : ; \ | ||
209 | sec_waiting=0; \ | ||
210 | while test -d "$${lock_name}"; do \ | ||
211 | $(sleep_with_timeout) ; \ | ||
212 | done; \ | ||
213 | fi | ||
214 | |||
215 | apim_prepare = \ | ||
216 | $(am__cd) '$(srcdir_po)' || exit 1; \ | ||
217 | lock_name='$(APIM_LOCK_BASE)'; \ | ||
218 | { trap "rm -rf $(APIM_TMSTMP_BASE) $(APIM_TMSTMP_TMP_BASE) $${lock_name} po" HUP ABRT INT TERM 2>/dev/null && \ | ||
219 | trap "rm -rf $(APIM_TMSTMP_BASE) $(APIM_TMSTMP_TMP_BASE) $${lock_name} po" PIPE 2>/dev/null ; } || \ | ||
220 | trap "rm -rf $(APIM_TMSTMP_BASE) $(APIM_TMSTMP_TMP_BASE) $${lock_name} po" 1 2 13 15; \ | ||
221 | lock_held='false'; \ | ||
222 | sec_waiting=0; \ | ||
223 | while : ; do \ | ||
224 | if mkdir "$${lock_name}" 2>/dev/null; then lock_held=':' ; else : ; fi; \ | ||
225 | $${lock_held} && break || : ; \ | ||
226 | test 'xyes' = 'x$(FORCE_AUTOPOINT_CHECK)' || break ; \ | ||
227 | $(sleep_with_timeout) ; \ | ||
228 | done; \ | ||
229 | if $${lock_held} ; then \ | ||
230 | rm -f '$(APIM_TMSTMP_BASE)' '$(APIM_TMSTMP_TMP_BASE)' || exit 1; \ | ||
231 | echo 'timestamp' > '$(APIM_TMSTMP_TMP_BASE)' || exit 1; \ | ||
232 | if test 'xyes' = 'x$(FORCE_AUTOPOINT_CHECK)'; then \ | ||
233 | call_autopoint=':'; check_all='false'; \ | ||
234 | else \ | ||
235 | call_autopoint='false'; check_all=':'; \ | ||
236 | fi; \ | ||
237 | if $(MHD_V) ; then apim_echo='echo' ; else apim_echo=':'; fi ;\ | ||
238 | $$apim_echo "Sync autopoint files"; \ | ||
239 | files_missing='false'; \ | ||
240 | $(MKDIR_P) 'po'; \ | ||
241 | $(MKDIR_P) '$(MHD_AUX_DIR)'; \ | ||
242 | main_f_names=`for f in $(PO_MAIN_FILES) $(PO_EXTRA_FILES); do echo "$$f"; done | $(SED) -e 's|^.*/||'`; \ | ||
243 | root_f_names=`for f in $(PO_ROOT_FILES); do echo "$$f"; done | $(SED) -e 's|^.*/||'`; \ | ||
244 | m4_f_names=`for f in $(PO_M4_FILES); do echo "$$f"; done | $(SED) -e 's|^.*/||'`; \ | ||
245 | aux_f_names=`for f in $(PO_AUX_FILES); do echo "$$f"; done | $(SED) -e 's|^.*/||'`; \ | ||
246 | for f in $${main_f_names}; do \ | ||
247 | if test -f "$$f"; then \ | ||
248 | cp -f "$$f" "po/$$f" ; \ | ||
249 | else \ | ||
250 | $$apim_echo "Missing $(srcdir_po)/$$f" ; \ | ||
251 | files_missing=':' ; \ | ||
252 | fi; \ | ||
253 | done; \ | ||
254 | if $${check_all} ; then \ | ||
255 | for f in $${root_f_names}; do \ | ||
256 | if test -f "./$$f"; then : ; \ | ||
257 | else \ | ||
258 | $$apim_echo "Missing $(srcdir_po)/$$f" ; \ | ||
259 | files_missing=':' ; \ | ||
260 | fi; \ | ||
261 | done; \ | ||
262 | for f in $${m4_f_names}; do \ | ||
263 | if test -f "m4/$$f"; then : ; \ | ||
264 | else \ | ||
265 | $$apim_echo "Missing $(srcdir_po)/m4/$$f" ; \ | ||
266 | files_missing=':' ; \ | ||
267 | fi; \ | ||
268 | done; \ | ||
269 | for f in $${aux_f_names}; do \ | ||
270 | if test -f "$(MHD_AUX_DIR)/$$f"; then : ;\ | ||
271 | else \ | ||
272 | $$apim_echo "Missing $(srcdir_po)/$(MHD_AUX_DIR)/$$f" ; \ | ||
273 | files_missing=':' ; \ | ||
274 | fi; \ | ||
275 | done; \ | ||
276 | fi; \ | ||
277 | if $${files_missing} ; then \ | ||
278 | call_autopoint=':' ; \ | ||
279 | $$apim_echo "Some files are missing, call autopoint to restore them" ; \ | ||
280 | elif $${call_autopoint}; then $$apim_echo "Check and update autopoint files" ; \ | ||
281 | fi; \ | ||
282 | rc_code=0; \ | ||
283 | if $${call_autopoint} ; then \ | ||
284 | echo ' cd $(srcdir_po) && $(AUTOPOINT) $(AUTOPOINT_FLAGS)'; \ | ||
285 | '$(AUTOPOINT)' $(AUTOPOINT_FLAGS) || rc_code=1; \ | ||
286 | fi; \ | ||
287 | if test "$${rc_code}" = "0"; then \ | ||
288 | $$apim_echo "Re-sync autopoint files back"; \ | ||
289 | for f in $${aux_f_names}; do \ | ||
290 | if test -f "$(MHD_AUX_DIR)/$$f"; then \ | ||
291 | touch -f "$(MHD_AUX_DIR)/$$f" && \ | ||
292 | cp -f "$(MHD_AUX_DIR)/$$f" "../$(MHD_AUX_DIR)/$$f"; \ | ||
293 | else \ | ||
294 | $$apim_echo "Still missing $(srcdir_po)/$(MHD_AUX_DIR)/$$f" 1>&2 ; \ | ||
295 | rc_code=1; \ | ||
296 | fi; \ | ||
297 | done; \ | ||
298 | for f in $${m4_f_names}; do \ | ||
299 | if test -f "m4/$$f"; then \ | ||
300 | touch "m4/$$f"; \ | ||
301 | else \ | ||
302 | $$apim_echo "Still missing $(srcdir_po)/m4/$$f" 1>&2 ; \ | ||
303 | rc_code=1; \ | ||
304 | fi; \ | ||
305 | done; \ | ||
306 | for f in $${root_f_names}; do \ | ||
307 | if test -f "./$$f"; then \ | ||
308 | touch "./$$f"; \ | ||
309 | else \ | ||
310 | $$apim_echo "Still missing $(srcdir_po)/$$f" 1>&2 ; \ | ||
311 | rc_code=1; \ | ||
312 | fi; \ | ||
313 | done; \ | ||
314 | for f in $${main_f_names}; do \ | ||
315 | if test -f "po/$$f"; then \ | ||
316 | cp -f "po/$$f" "$$f"; \ | ||
317 | else \ | ||
318 | $$apim_echo "Still missing $(srcdir_po)/$$f" 1>&2 ; \ | ||
319 | rc_code=1; \ | ||
320 | fi; \ | ||
321 | done; \ | ||
322 | fi; \ | ||
323 | if test $${rc_code} = 0; then \ | ||
324 | cp -fp '$(APIM_TMSTMP_TMP_BASE)' '$(APIM_TMSTMP_BASE)' ; \ | ||
325 | touch -r '$(APIM_TMSTMP_TMP_BASE)' '$(APIM_TMSTMP_BASE)' ; \ | ||
326 | $$apim_echo "All autopoint files have been synced"; \ | ||
327 | rm -f '$(APIM_TMSTMP_TMP_BASE)'; \ | ||
328 | else \ | ||
329 | rm -f '$(APIM_TMSTMP_BASE)' '$(APIM_TMSTMP_TMP_BASE)'; \ | ||
330 | fi; \ | ||
331 | rm -fr 'po'; \ | ||
332 | rmdir "$${lock_name}"; \ | ||
333 | exit $${rc_code} ; \ | ||
334 | else \ | ||
335 | $(wait_for_unlock) ; \ | ||
336 | test -f '$(APIM_TMSTMP_BASE)' || exit 1; \ | ||
337 | fi; \ | ||
338 | : | ||
339 | |||
340 | mostlyclean-local: mostlyclean-autopoint-update | ||
341 | mostlyclean-autopoint-update: | ||
342 | -test -d '$(APIM_LOCK)' && rm -rf '$(APIM_LOCK)' | ||
343 | -test -d '$(srcdir_po)/po' && rm -rf '$(srcdir_po)/po' | ||
344 | rm -f '$(APIM_TMSTMP_TMP)' | ||
345 | |||
346 | $(APIM_TRIGGER): | ||
347 | @echo "autopoint files rebuild trigger" > "$@" | ||
348 | |||
349 | $(APIM_TMSTMP): $(srcdir_po)/configure.ac $(APIM_TRIGGER) | ||
350 | @ $(apim_prepare) | ||
351 | |||
352 | .DELETE_ON_ERROR: $(APIM_TMSTMP) | ||
353 | |||
354 | $(PO_ALL_FILES): $(APIM_TMSTMP) $(srcdir_po)/configure.ac | ||
355 | @ ( $(apim_prepare) ) | ||
356 | @test -f '$@' | ||
357 | |||
358 | prepare-autopoint: $(srcdir_po)/configure.ac | ||
359 | @ ( $(apim_prepare) ) | ||
360 | @test -f '$(APIM_TMSTMP)' | ||
361 | |||
362 | check-prepare-autopoint: $(srcdir_po)/$(MHD_AUX_DIR)/install-sh $(APIM_TMSTMP) | ||
363 | @echo "Check all autopoint files"; \ | ||
364 | files_missing='false'; \ | ||
365 | for f in $(PO_ALL_FILES); do \ | ||
366 | if test -f "$$f"; then : ; \ | ||
367 | else \ | ||
368 | echo "Missing $$f" ; \ | ||
369 | files_missing=':' ; \ | ||
370 | fi; \ | ||
371 | done; \ | ||
372 | if $${files_missing}; then \ | ||
373 | $(MAKE) $(AM_MAKEFLAGS) prepare-autopoint || exit 1; \ | ||
374 | else \ | ||
375 | exit 0; \ | ||
376 | fi | ||
377 | |||
378 | # This could be used to update autopoint files for git or for 'dist' target | ||
379 | update-autopoint-force: | ||
380 | $(MAKE) $(AM_MAKEFLAGS) 'FORCE_AUTOPOINT_CHECK=yes' 'AUTOPOINT_FLAGS=$(AUTOPOINT_FLAGS) -f' prepare-autopoint | ||
381 | |||
382 | 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 | ||
383 | |||
384 | $(top_srcdir)/$(MHD_AUX_DIR)/config.rpath: $(srcdir_po)/$(MHD_AUX_DIR)/config.rpath | ||
385 | cp -f '$(srcdir_po)/$(MHD_AUX_DIR)/config.rpath' '$@' | ||
386 | |||
387 | $(srcdir_po)/$(MHD_AUX_DIR)/install-sh: $(top_srcdir)/$(MHD_AUX_DIR)/install-sh | ||
388 | $(MKDIR_P) '$(srcdir_po)/$(MHD_AUX_DIR)' | ||
389 | cp -f '$(top_srcdir)/$(MHD_AUX_DIR)/install-sh' '$@' | ||
390 | |||
391 | .PHONY: mostlyclean-autopoint-update prepare-autopoint update-autopoint-force check-prepare-autopoint autopoint-files-all | ||
144 | 392 | ||
145 | distclean-po: | 393 | distclean-po: |
146 | @if test -f po/Makefile; then \ | 394 | @( if test -f po/Makefile; then \ |
147 | $(am__cd) po && $(MAKE) $(AM_MAKEFLAGS) distclean; \ | 395 | $(am__cd) po && $(MAKE) $(AM_MAKEFLAGS) distclean; \ |
148 | else \ | 396 | else \ |
149 | true; \ | 397 | true; \ |
150 | fi | 398 | fi ) |
151 | -rm -f po-config.status po/Makefile | 399 | -rm -f po-config.status po/Makefile po/stamp-m |
152 | -rm -f po/POTFILES po/remove-potcdate.sed po/Makefile.in | 400 | -rm -f po/POTFILES po/remove-potcdate.sed po/Makefile.in |
153 | 401 | ||
154 | maintainer-clean-po: | 402 | maintainer-clean-po: |
155 | @if test -f po/Makefile; then \ | 403 | @( if test -f po/Makefile; then \ |
156 | $(am__cd) po && $(MAKE) $(AM_MAKEFLAGS) maintainer-clean; \ | 404 | $(am__cd) po && $(MAKE) $(AM_MAKEFLAGS) maintainer-clean; \ |
157 | else \ | 405 | else \ |
158 | true; \ | 406 | true; \ |
159 | fi | 407 | fi ) |
160 | -rm -f po/$(PACKAGE_TARNAME).pot po/stamp-po | 408 | -rm -f po/$(PACKAGE_TARNAME).pot |
161 | -rm -rf $(top_srcdir)/po/autom4te.cache | 409 | -rm -rf $(srcdir_po)/autom4te.cache |
162 | 410 | ||
163 | .PHONY: distclean-po maintainer-clean-po | 411 | .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 @@ | |||
1 | # This file is part of libmicrohttpd. | 1 | # This file is part of libmicrohttpd. |
2 | # (C) 2006-2021 Christian Grothoff (and other contributing authors) | 2 | # (C) 2006-2021 Christian Grothoff (and other contributing authors) |
3 | # (C) 2014-2022 Evgeny Grin (Karlson2k) | 3 | # (C) 2014-2023 Evgeny Grin (Karlson2k) |
4 | # | 4 | # |
5 | # libmicrohttpd is free software; you can redistribute it and/or modify | 5 | # libmicrohttpd is free software; you can redistribute it and/or modify |
6 | # it under the terms of the GNU General Public License as published | 6 | # it under the terms of the GNU General Public License as published |
@@ -25,6 +25,7 @@ AC_PREREQ([2.64]) | |||
25 | LT_PREREQ([2.4.0]) | 25 | LT_PREREQ([2.4.0]) |
26 | AC_INIT([GNU libmicrohttpd],[0.9.76],[libmicrohttpd@gnu.org]) | 26 | AC_INIT([GNU libmicrohttpd],[0.9.76],[libmicrohttpd@gnu.org]) |
27 | AC_CONFIG_AUX_DIR([build-aux]) | 27 | AC_CONFIG_AUX_DIR([build-aux]) |
28 | MHD_AUX_DIR='build-aux' # Must be set to the same value as in the previous line | ||
28 | AC_CONFIG_HEADERS([MHD_config.h]) | 29 | AC_CONFIG_HEADERS([MHD_config.h]) |
29 | AC_CONFIG_MACRO_DIR([m4]) | 30 | AC_CONFIG_MACRO_DIR([m4]) |
30 | m4_pattern_forbid([^_?MHD_[A-Z_]+_CC_])dnl | 31 | m4_pattern_forbid([^_?MHD_[A-Z_]+_CC_])dnl |
@@ -4865,7 +4866,21 @@ AC_SUBST([CPPFLAGS_ac]) | |||
4865 | 4866 | ||
4866 | # Used for 'po' directory staff | 4867 | # Used for 'po' directory staff |
4867 | AC_SUBST([ac_configure_args]) | 4868 | AC_SUBST([ac_configure_args]) |
4868 | AC_SUBST([EMPTY_VAR], [[]]) | 4869 | AC_SUBST([EMPTY_VAR],[]) |
4870 | AC_SUBST([MHD_AUX_DIR]) | ||
4871 | AC_CONFIG_FILES([po/po-configure.ac]) | ||
4872 | AC_CONFIG_COMMANDS([po/Makefile.in], | ||
4873 | [ | ||
4874 | echo "Skipping update of po/Makefile.in" | ||
4875 | echo "Real update of po/Makefile.in for 'make dist' is peformed by po-config.status" | ||
4876 | ] | ||
4877 | ) | ||
4878 | AC_CONFIG_COMMANDS([po-directories], | ||
4879 | [ | ||
4880 | echo "Skipping po-directories command." | ||
4881 | echo "Real po-directories command for 'make dist' is implemented in po-config.status" | ||
4882 | ] | ||
4883 | ) | ||
4869 | 4884 | ||
4870 | # We define the paths here, because MinGW/GCC expands paths | 4885 | # We define the paths here, because MinGW/GCC expands paths |
4871 | # passed through the command line ("-DDIR=..."). This would | 4886 | # passed through the command line ("-DDIR=..."). This would |
@@ -4887,7 +4902,6 @@ AM_CONDITIONAL([HAVE_EXPERIMENTAL], [test "x$enable_experimental" = "xyes"]) | |||
4887 | AC_CONFIG_FILES([libmicrohttpd.pc | 4902 | AC_CONFIG_FILES([libmicrohttpd.pc |
4888 | w32/common/microhttpd_dll_res_vc.rc | 4903 | w32/common/microhttpd_dll_res_vc.rc |
4889 | Makefile | 4904 | Makefile |
4890 | po/po-configure.ac | ||
4891 | contrib/Makefile | 4905 | contrib/Makefile |
4892 | doc/Makefile | 4906 | doc/Makefile |
4893 | doc/doxygen/libmicrohttpd.doxy | 4907 | 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 @@ | |||
1 | /build-aux/install?sh | ||
2 | /autopoint-trigger | ||
3 | /autopoint-timestamp | ||
4 | /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): | |||
495 | update-gmo: Makefile $(GMOFILES) | 495 | update-gmo: Makefile $(GMOFILES) |
496 | @: | 496 | @: |
497 | 497 | ||
498 | # | ||
499 | # The next three targets are customized for MHD | ||
500 | # | ||
501 | |||
502 | # Recreate Makefile by invoking config.status. Explicitly invoke the shell, | 498 | # Recreate Makefile by invoking config.status. Explicitly invoke the shell, |
503 | # because execution permission bits may not work on the current file system. | 499 | # because execution permission bits may not work on the current file system. |
504 | # Use @SHELL@, which is the shell determined by autoconf for the use by its | 500 | # Use @SHELL@, which is the shell determined by autoconf for the use by its |
505 | # scripts, not $(SHELL) which is hardwired to /bin/sh and may be deficient. | 501 | # scripts, not $(SHELL) which is hardwired to /bin/sh and may be deficient. |
506 | Makefile: Makefile.in.in Makevars $(top_builddir)/po-config.status @POMAKEFILEDEPS@ | 502 | Makefile: Makefile.in.in Makevars $(top_builddir)/config.status @POMAKEFILEDEPS@ |
507 | cd $(top_builddir) \ | 503 | cd $(top_builddir) \ |
508 | && @SHELL@ ./po-config.status $(subdir)/$@.in po-directories | 504 | && @SHELL@ ./config.status $(subdir)/$@.in po-directories |
509 | |||
510 | $(top_builddir)/po-config.status: $(srcdir)/po-configure.ac.in $(top_srcdir)/configure.ac | ||
511 | cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) po-config.status | ||
512 | |||
513 | remove-potcdate.sed: $(srcdir)/remove-potcdate.sin | ||
514 | $(SED) -e '/^#/d' '$(srcdir)/remove-potcdate.sin' > t-$@ | ||
515 | mv t-$@ $@ | ||
516 | 505 | ||
517 | force: | 506 | force: |
518 | 507 | ||
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 | |||
80 | # "no". Set this to no if the POT file and PO files are maintained | 80 | # "no". Set this to no if the POT file and PO files are maintained |
81 | # externally. | 81 | # externally. |
82 | DIST_DEPENDS_ON_UPDATE_PO = yes | 82 | DIST_DEPENDS_ON_UPDATE_PO = yes |
83 | |||
84 | # Hacks for MHD | ||
85 | am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd | ||
86 | |||
87 | $(top_builddir)/po-config.status: $(srcdir)/po-configure.ac.in $(top_srcdir)/configure.ac | ||
88 | @echo "cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) po-config.status" && \ | ||
89 | $(am__cd) '$(top_builddir)' && $(MAKE) $(AM_MAKEFLAGS) po-config.status | ||
90 | |||
91 | $(srcdir)/POTFILES.in: $(top_srcdir)/src/microhttpd/Makefile.am | ||
92 | @echo "cd $(top_srcdir)/src/microhttpd && $(MAKE) $(AM_MAKEFLAGS) update-po-POTFILES.in" && \ | ||
93 | $(am__cd) '$(top_srcdir)/src/microhttpd' && $(MAKE) $(AM_MAKEFLAGS) update-po-POTFILES.in | ||
94 | |||
95 | $(srcdir)/stamp-m.in: | ||
96 | @: > '$@' | ||
97 | |||
98 | stamp-m: $(srcdir)/Makefile.in.in $(srcdir)/Makevars $(top_builddir)/po-config.status $(srcdir)/POTFILES.in $(srcdir)/stamp-m.in | ||
99 | @$(am__cd) $(top_builddir) \ | ||
100 | && $(MHD_CONFIG_SHELL) ./po-config.status po/stamp-m po/Makefile.in po-directories | ||
101 | |||
102 | .DELETE_ON_ERROR: stamp-m | ||
103 | |||
104 | $(srcdir)/$(MHD_AUX_DIR)/install-sh: $(topsrcdir)/$(MHD_AUX_DIR)/install-sh | ||
105 | @$(MKDIR_P) '$(topsrcdir)/$(MHD_AUX_DIR)' | ||
106 | cp -f '$(topsrcdir)/$(MHD_AUX_DIR)/install-sh' '$@' | ||
107 | |||
108 | mostlyclean: mostlycleancustom | ||
109 | mostlycleancustom: | ||
110 | -rm -f stamp-m Makefile.in po-configure.ac | ||
111 | -rm -f $(top_builddir)/po-config.status | ||
112 | |||
113 | .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 @@ | |||
1 | AC_INIT([@PACKAGE_NAME@],[@PACKAGE_VERSION@],[@PACKAGE_BUGREPORT@]) | 1 | AC_INIT([@PACKAGE_NAME@],[@PACKAGE_VERSION@],[@PACKAGE_BUGREPORT@]) |
2 | CONFIG_STATUS='./po-config.status' | 2 | CONFIG_STATUS='./po-config.status' |
3 | 3 | ||
4 | AC_CONFIG_AUX_DIR([build-aux]) | 4 | AC_CONFIG_AUX_DIR([@MHD_AUX_DIR@]) |
5 | AC_CONFIG_MACRO_DIR([m4]) | 5 | AC_CONFIG_MACRO_DIR([m4]) |
6 | |||
6 | AC_PRESERVE_HELP_ORDER | 7 | AC_PRESERVE_HELP_ORDER |
7 | 8 | ||
8 | AC_MSG_NOTICE([ | 9 | AC_MSG_NOTICE([ |
9 | This special $as_me is designed to be run only internally as part of distribution tarball building process. | 10 | This special $as_me is designed to be run only internally as part of distribution tarball building process. |
10 | The only purpose of the $as_me is a preparion of the files to update ${PACKAGE_TARNAME}.pot | 11 | The only purpose of the $as_me is a preparation of the files to update ${PACKAGE_TARNAME}.pot |
11 | 12 | ||
12 | $as_me is not meant to be started by the user and is not needed to build ${PACKAGE_NAME} library. | 13 | $as_me is not meant to be started by the user and is not needed to build ${PACKAGE_NAME} library. |
13 | ]) | 14 | ]) |
14 | AC_MSG_NOTICE([Check src/examples/msgs_i18n.c for inspiration how to use ${PACKAGE_TARNAME}.pot]) | 15 | AC_MSG_NOTICE([Check src/examples/msgs_i18n.c for inspiration how to use ${PACKAGE_TARNAME}.pot]) |
16 | |||
17 | AM_PROG_INSTALL_SH | ||
18 | AC_PROG_MKDIR_P | ||
19 | |||
15 | AS_VAR_SET_IF([enable_nls], [], [[enable_nls=no]]) | 20 | AS_VAR_SET_IF([enable_nls], [], [[enable_nls=no]]) |
16 | AM_GNU_GETTEXT([external],[need-ngettext]) | 21 | AM_GNU_GETTEXT([external],[need-ngettext]) |
22 | AM_GNU_GETTEXT_REQUIRE_VERSION([0.18]) | ||
17 | 23 | ||
18 | m4_divert_text([HELP_ENABLE], [[ | 24 | m4_divert_text([HELP_VAR_END], [[ |
19 | ############################################################################### | 25 | ############################################################################### |
20 | This special po-configure is designed to be run only internally as part of | 26 | This special po-configure is designed to be run only internally as part of |
21 | distribution tarball building process. | 27 | distribution tarball building process. |
22 | The only purpose of the po-configure is a preparion of the files to update | 28 | The only purpose of the po-configure is a preparation of the files to update |
23 | libmicrohttpd.pot | 29 | @PACKAGE_TARNAME@.pot |
24 | 30 | ||
25 | po-configure is not meant to be started by the user and is not needed to build | 31 | po-configure is not meant to be started by the user and is not needed to build |
26 | @PACKAGE_NAME@ library. | 32 | @PACKAGE_NAME@ library. |
27 | ############################################################################### | 33 | ############################################################################### |
28 | ]]) | 34 | ]]) |
29 | 35 | ||
30 | AC_CONFIG_FILES([po/Makefile.in]) | 36 | # Hacks for libmicrohttpd |
37 | AC_CONFIG_FILES([po/stamp-m],[echo 'timestamp' > po/stamp-m]) | ||
38 | AC_SUBST([POMAKEFILEDEPS],["POTFILES.in stamp-m"]) | ||
39 | AM_SUBST_NOTMAKE([POMAKEFILEDEPS]) | ||
40 | AC_SUBST([MHD_CONFIG_SHELL],["${CONFIG_SHELL}"]) | ||
41 | AC_SUBST([MHD_AUX_DIR],['@MHD_AUX_DIR@']) | ||
31 | 42 | ||
43 | AC_CONFIG_FILES([po/Makefile.in]) | ||
32 | AS_IF([test -z "${XGETTEXT}" || test "x${XGETTEXT}" = "x:"], [AC_MSG_ERROR([Cannot find xgettext. xgettext is required to update distribution tarball files.])]) | 44 | AS_IF([test -z "${XGETTEXT}" || test "x${XGETTEXT}" = "x:"], [AC_MSG_ERROR([Cannot find xgettext. xgettext is required to update distribution tarball files.])]) |
33 | AC_SUBST([PACKAGE],["${PACKAGE_TARNAME}"]) | 45 | AC_SUBST([PACKAGE],["${PACKAGE_TARNAME}"]) |
34 | AC_SUBST([VERSION],["${PACKAGE_VERSION}"]) | 46 | AC_SUBST([VERSION],["${PACKAGE_VERSION}"]) |
35 | AC_SUBST([CROSS_COMPILING],["${cross_compiling}"]) | 47 | AC_SUBST([CROSS_COMPILING],["${cross_compiling}"]) |
48 | AC_SUBST([MKDIR_P]) | ||
36 | AC_SUBST([mkdir_p],['$(MKDIR_P)']) | 49 | AC_SUBST([mkdir_p],['$(MKDIR_P)']) |
37 | AC_SUBST([install_sh],['false']) | ||
38 | 50 | ||
39 | AC_OUTPUT \ No newline at end of file | 51 | AC_OUTPUT |