Don't install charset.alias on mingw and Cygwin.
[gnulib.git] / modules / localcharset
1 Description:
2 Return current locale's character encoding.
3
4 Notice:
5 If your package's tests make use of the locale_charset() function directly or
6 indirectly, you may need to define the CHARSETALIASDIR environment variable,
7 so that "make check" works before "make install". In Makefile.am syntax:
8 TESTS_ENVIRONMENT += @LOCALCHARSET_TESTS_ENVIRONMENT@
9
10 Files:
11 lib/localcharset.h
12 lib/localcharset.c
13 lib/config.charset
14 lib/ref-add.sin
15 lib/ref-del.sin
16 m4/codeset.m4
17 m4/glibc21.m4
18 m4/localcharset.m4
19
20 Depends-on:
21 configmake
22
23 configure.ac:
24 gl_LOCALCHARSET
25 LOCALCHARSET_TESTS_ENVIRONMENT="CHARSETALIASDIR=\"\$(top_builddir)/$gl_source_base\""
26 AC_SUBST([LOCALCHARSET_TESTS_ENVIRONMENT])
27
28 Makefile.am:
29 lib_SOURCES += localcharset.h localcharset.c
30
31 # We need the following in order to install a simple file in $(libdir)
32 # which is shared with other installed packages. We use a list of referencing
33 # packages so that "make uninstall" will remove the file if and only if it
34 # is not used by another installed package.
35 # On systems with glibc-2.1 or newer, the file is redundant, therefore we
36 # avoid installing it.
37
38 all-local: charset.alias ref-add.sed ref-del.sed
39
40 charset_alias = $(DESTDIR)$(libdir)/charset.alias
41 charset_tmp = $(DESTDIR)$(libdir)/charset.tmp
42 install-exec-local: all-local
43         if test $(GLIBC21) = no; then \
44           case '$(host_os)' in \
45             cygwin* | mingw* | pw32* | cegcc*) \
46               need_charset_alias=false ;; \
47             *) \
48               need_charset_alias=true ;; \
49           esac ; \
50         else \
51           need_charset_alias=false ; \
52         fi ; \
53         if $$need_charset_alias; then \
54           $(mkinstalldirs) $(DESTDIR)$(libdir) ; \
55         fi ; \
56         if test -f $(charset_alias); then \
57           sed -f ref-add.sed $(charset_alias) > $(charset_tmp) ; \
58           $(INSTALL_DATA) $(charset_tmp) $(charset_alias) ; \
59           rm -f $(charset_tmp) ; \
60         else \
61           if $$need_charset_alias; then \
62             sed -f ref-add.sed charset.alias > $(charset_tmp) ; \
63             $(INSTALL_DATA) $(charset_tmp) $(charset_alias) ; \
64             rm -f $(charset_tmp) ; \
65           fi ; \
66         fi
67
68 uninstall-local: all-local
69         if test -f $(charset_alias); then \
70           sed -f ref-del.sed $(charset_alias) > $(charset_tmp); \
71           if grep '^# Packages using this file: $$' $(charset_tmp) \
72               > /dev/null; then \
73             rm -f $(charset_alias); \
74           else \
75             $(INSTALL_DATA) $(charset_tmp) $(charset_alias); \
76           fi; \
77           rm -f $(charset_tmp); \
78         fi
79
80 charset.alias: config.charset
81         rm -f t-$@ $@
82         $(SHELL) $(srcdir)/config.charset '$(host)' > t-$@
83         mv t-$@ $@
84
85 SUFFIXES += .sed .sin
86 .sin.sed:
87         rm -f t-$@ $@
88         sed -e '/^#/d' -e 's/@''PACKAGE''@/$(PACKAGE)/g' $< > t-$@
89         mv t-$@ $@
90
91 CLEANFILES += charset.alias ref-add.sed ref-del.sed
92
93 Include:
94 "localcharset.h"
95
96 License:
97 LGPLv2+
98
99 Maintainer:
100 Bruno Haible