]> git.draconx.ca Git - rrace.git/blob - lib/local/modules/gnulib-local
Don't build locale/wcwidth junk if NLS is disabled.
[rrace.git] / lib / local / modules / gnulib-local
1 Description:
2 Helper to export gnulib-tool local-dir settings to Automake and distribute
3 files automatically.
4
5 configure.ac:
6 m4_set_add([DX_GNULIB_LOCAL_DIST], [modules/gnulib-local])dnl
7 AC_REQUIRE([AC_PROG_AWK])dnl
8 m4_pushdef([gl_LOCAL_DIR],
9   [m4_define([_DX_GNULIB_LOCAL_DIR_], $][@)])m4_divert_push([KILL])
10 m4_include([m4/gnulib-cache.m4])
11 m4_popdef([gl_LOCAL_DIR])m4_divert_pop([KILL])dnl
12 AC_SUBST([DX_GNULIB_LOCAL_DIR], m4_defn([_DX_GNULIB_LOCAL_DIR_]))
13
14 AC_CONFIG_COMMANDS_PRE([AC_SUBST([DX_GNULIB_LOCAL_DIST],
15   ["m4_set_dump([DX_GNULIB_LOCAL_DIST], [ ])"])])
16
17 Makefile.am:
18 DX_GNULIB_LOCAL_DIRS_AWK = \
19         { for (i=1; i<=NF; i++) { sub(/\/[^\/]*$$/, "", $$i); dirs[$$i]=1; } } \
20         END { for (i in dirs) print outdir "/" i; }
21
22 dist-hook: dist-gnulib-local
23 dist-gnulib-local:
24         save_IFS=$$IFS; \
25         IFS=:; set x $(DX_GNULIB_LOCAL_DIR); shift; \
26         IFS=$$save_IFS; \
27         outdir="$(top_distdir)/$$1"; \
28         dirs=`echo $(DX_GNULIB_LOCAL_DIST) \
29               | $(AWK) '$(DX_GNULIB_LOCAL_DIRS_AWK)' outdir="$$outdir"`; \
30         ( set -x; $(MKDIR_P) $$dirs && chmod u+w $$dirs ) || exit; \
31         for f in $(DX_GNULIB_LOCAL_DIST); do \
32           for indir; do \
33             test -f "$(top_srcdir)/$$indir/$$f" || continue; \
34             ( set -x; cp -p "$(top_srcdir)/$$indir/$$f" "$$outdir/$$f" ) || exit; \
35             break; \
36           done; \
37         done
38 .PHONY: dist-gnulib-local