1 Integration of this library into your package:
3 * Copy the lib/ sourcefiles (localcharset.c, config.charset, ref-add.sin,
4 ref-del.sin) and the include file (include/libcharset.h) into your package.
6 * Add the m4/ files (codeset.m4, glibc21.m4) to your aclocal.m4 file or, if
7 you are using automake, to your m4/ directory.
9 * Add the following lines to your configure.in file:
14 AC_CHECK_HEADERS(stddef.h stdlib.h string.h)
15 AC_CHECK_FUNCS(setlocale)
17 and make sure that it sets and AC_SUBSTs the PACKAGE variable.
19 * If you are not using automake, add rules to your Makefile.in:
21 - Augment target "all" by
22 localcharset.o charset.alias ref-add.sed ref-del.sed
23 with special rules for the last three:
25 charset.alias: $(srcdir)/config.charset
26 $(SHELL) $(srcdir)/config.charset '@host@' > t-$@
29 ref-add.sed : $(srcdir)/ref-add.sin
30 sed -e '/^#/d' -e 's/@''PACKAGE''@/@PACKAGE@/g' $(srcdir)/ref-add.sin > t-$@
33 ref-del.sed : $(srcdir)/ref-del.sin
34 sed -e '/^#/d' -e 's/@''PACKAGE''@/@PACKAGE@/g' $(srcdir)/ref-del.sin > t-$@
37 - Augment target "install" by
39 $(MKINSTALLDIRS) $(DESTDIR)$(libdir)
40 if test -f $(DESTDIR)$(libdir)/charset.alias; then \
41 sed -f ref-add.sed $(DESTDIR)$(libdir)/charset.alias > $(DESTDIR)$(libdir)/t-charset.alias; \
42 $(INSTALL_DATA) $(DESTDIR)$(libdir)/t-charset.alias $(DESTDIR)$(libdir)/charset.alias; \
43 rm -f $(DESTDIR)$(libdir)/t-charset.alias; \
45 if test @GLIBC21@ = no; then \
46 sed -f ref-add.sed charset.alias > $(DESTDIR)$(libdir)/t-charset.alias; \
47 $(INSTALL_DATA) $(DESTDIR)$(libdir)/t-charset.alias $(DESTDIR)$(libdir)/charset.alias; \
48 rm -f $(DESTDIR)$(libdir)/t-charset.alias; \
52 - Augment target "installdirs" by
54 $(MKINSTALLDIRS) $(DESTDIR)$(libdir)
56 - Augment target "uninstall" by
58 if test -f $(DESTDIR)$(libdir)/charset.alias; then \
59 sed -f ref-del.sed $(DESTDIR)$(libdir)/charset.alias > $(DESTDIR)$(libdir)/t-charset.alias; \
60 if grep '^# Packages using this file: $$' $(DESTDIR)$(libdir)/t-charset.alias > /dev/null; then \
61 rm -f $(DESTDIR)$(libdir)/charset.alias; \
63 $(INSTALL_DATA) $(DESTDIR)$(libdir)/t-charset.alias $(DESTDIR)$(libdir)/charset.alias; \
65 rm -f $(DESTDIR)$(libdir)/t-charset.alias; \
68 - Augment target "clean" by
70 rm -f charset.alias ref-add.sed ref-del.sed
72 * If you are using automake, add rules to your Makefile.am:
74 - Augment the main *_SOURCES variable by
78 - Augment EXTRA_DIST by
80 config.charset ref-add.sin ref-del.sin
82 - Augment target "all-local" by
84 charset.alias ref-add.sed ref-del.sed
88 charset_alias = $(DESTDIR)$(libdir)/charset.alias
89 charset_tmp = $(DESTDIR)$(libdir)/charset.tmp
90 install-exec-local: all-local
91 $(mkinstalldirs) $(DESTDIR)$(libdir)
92 if test -f $(charset_alias); then \
93 sed -f ref-add.sed $(charset_alias) > $(charset_tmp) ; \
94 $(INSTALL_DATA) $(charset_tmp) $(charset_alias) ; \
95 rm -f $(charset_tmp) ; \
97 if test @GLIBC21@ = no; then \
98 sed -f ref-add.sed charset.alias > $(charset_tmp) ; \
99 $(INSTALL_DATA) $(charset_tmp) $(charset_alias) ; \
100 rm -f $(charset_tmp) ; \
104 uninstall-local: all-local
105 if test -f $(charset_alias); then \
106 sed -f ref-del.sed $(charset_alias) > $(charset_tmp); \
107 if grep '^# Packages using this file: $$' $(charset_tmp) \
109 rm -f $(charset_alias); \
111 $(INSTALL_DATA) $(charset_tmp) $(charset_alias); \
113 rm -f $(charset_tmp); \
116 charset.alias: config.charset
117 $(SHELL) $(srcdir)/config.charset '@host@' > t-$@
122 sed -e '/^#/d' -e 's/@''PACKAGE''@/@PACKAGE@/g' $< > t-$@
125 CLEANFILES = charset.alias ref-add.sed ref-del.sed