2 Return current locale's character encoding.
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@
25 LOCALCHARSET_TESTS_ENVIRONMENT="CHARSETALIASDIR=\"\$(top_builddir)/$gl_source_base\""
26 AC_SUBST([LOCALCHARSET_TESTS_ENVIRONMENT])
29 lib_SOURCES += localcharset.h localcharset.c
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.
38 all-local: charset.alias ref-add.sed ref-del.sed
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 \
46 need_charset_alias=true ;; \
47 darwin* | cygwin* | mingw* | pw32* | cegcc*) \
48 need_charset_alias=false ;; \
50 need_charset_alias=true ;; \
53 need_charset_alias=false ; \
55 if $$need_charset_alias; then \
56 $(mkinstalldirs) $(DESTDIR)$(libdir) ; \
58 if test -f $(charset_alias); then \
59 sed -f ref-add.sed $(charset_alias) > $(charset_tmp) ; \
60 $(INSTALL_DATA) $(charset_tmp) $(charset_alias) ; \
61 rm -f $(charset_tmp) ; \
63 if $$need_charset_alias; then \
64 sed -f ref-add.sed charset.alias > $(charset_tmp) ; \
65 $(INSTALL_DATA) $(charset_tmp) $(charset_alias) ; \
66 rm -f $(charset_tmp) ; \
70 uninstall-local: all-local
71 if test -f $(charset_alias); then \
72 sed -f ref-del.sed $(charset_alias) > $(charset_tmp); \
73 if grep '^# Packages using this file: $$' $(charset_tmp) \
75 rm -f $(charset_alias); \
77 $(INSTALL_DATA) $(charset_tmp) $(charset_alias); \
79 rm -f $(charset_tmp); \
82 charset.alias: config.charset
84 $(SHELL) $(srcdir)/config.charset '$(host)' > t-$@
90 sed -e '/^#/d' -e 's/@''PACKAGE''@/$(PACKAGE)/g' $< > t-$@
93 CLEANFILES += charset.alias ref-add.sed ref-del.sed