f347d351125bf15469b3184d57bca3fbd04f6857
[gnulib.git] / modules / localcharset
1 Description:
2
3 Files:
4 lib/localcharset.h
5 lib/localcharset.c
6 lib/config.charset
7 lib/ref-add.sin
8 lib/ref-del.sin
9 m4/codeset.m4
10 m4/glibc21.m4
11 m4/localcharset.m4
12
13 Depends-on:
14
15 configure.ac:
16 gl_LOCALCHARSET
17
18 Makefile.am:
19 lib_SOURCES += localcharset.h localcharset.c
20 EXTRA_DIST += config.charset ref-add.sin ref-del.sin
21 DEFS += -DLIBDIR=\"$(libdir)\"
22
23 # The following is needed in order to install a simple file in $(libdir)
24 # which is shared with other installed packages. We use a list of referencing
25 # packages so that "make uninstall" will remove the file if and only if it
26 # is not used by another installed package.
27 # On systems with glibc-2.1 or newer, the file is redundant, therefore we
28 # avoid installing it.
29
30 all-local: charset.alias ref-add.sed ref-del.sed
31
32 charset_alias = $(DESTDIR)$(libdir)/charset.alias
33 charset_tmp = $(DESTDIR)$(libdir)/charset.tmp
34 install-exec-local: all-local
35         test @GLIBC21@ != no || $(mkinstalldirs) $(DESTDIR)$(libdir)
36         if test -f $(charset_alias); then \
37           sed -f ref-add.sed $(charset_alias) > $(charset_tmp) ; \
38           $(INSTALL_DATA) $(charset_tmp) $(charset_alias) ; \
39           rm -f $(charset_tmp) ; \
40         else \
41           if test @GLIBC21@ = no; then \
42             sed -f ref-add.sed charset.alias > $(charset_tmp) ; \
43             $(INSTALL_DATA) $(charset_tmp) $(charset_alias) ; \
44             rm -f $(charset_tmp) ; \
45           fi ; \
46         fi
47
48 uninstall-local: all-local
49         if test -f $(charset_alias); then \
50           sed -f ref-del.sed $(charset_alias) > $(charset_tmp); \
51           if grep '^# Packages using this file: $$' $(charset_tmp) \
52               > /dev/null; then \
53             rm -f $(charset_alias); \
54           else \
55             $(INSTALL_DATA) $(charset_tmp) $(charset_alias); \
56           fi; \
57           rm -f $(charset_tmp); \
58         fi
59
60 charset.alias: config.charset
61         $(SHELL) $(srcdir)/config.charset '@host@' > t-$@
62         mv t-$@ $@
63
64 SUFFIXES += .sed .sin
65 .sin.sed:
66         sed -e '/^#/d' -e 's/@''PACKAGE''@/@PACKAGE@/g' $< > t-$@
67         mv t-$@ $@
68
69 CLEANFILES += charset.alias ref-add.sed ref-del.sed
70
71 Include:
72 "localcharset.h"
73