INTEGRATE 4.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153
  1. Integration of this library into your package:
  2. * Copy the lib/ sourcefiles (localcharset.c, config.charset, ref-add.sin,
  3. ref-del.sin) and the include file (include/localcharset.h) into your
  4. package.
  5. * Add the m4/ files (codeset.m4, glibc21.m4) to your aclocal.m4 file or, if
  6. you are using automake, to your m4/ directory.
  7. * Add the following lines to your configure.ac file:
  8. AC_CANONICAL_HOST
  9. AM_LANGINFO_CODESET
  10. jm_GLIBC21
  11. AC_CHECK_HEADERS(stddef.h stdlib.h string.h)
  12. and make sure that it sets and AC_SUBSTs the PACKAGE variable.
  13. * If you are not using automake, add rules to your Makefile.in:
  14. - Augment target "all" by
  15. localcharset.o charset.alias ref-add.sed ref-del.sed
  16. with special rules for the last three:
  17. charset.alias: $(srcdir)/config.charset
  18. $(SHELL) $(srcdir)/config.charset '@host@' > t-$@
  19. mv t-$@ $@
  20. ref-add.sed : $(srcdir)/ref-add.sin
  21. sed -e '/^#/d' -e 's/@''PACKAGE''@/@PACKAGE@/g' $(srcdir)/ref-add.sin > t-$@
  22. mv t-$@ $@
  23. ref-del.sed : $(srcdir)/ref-del.sin
  24. sed -e '/^#/d' -e 's/@''PACKAGE''@/@PACKAGE@/g' $(srcdir)/ref-del.sin > t-$@
  25. mv t-$@ $@
  26. - Augment target "install" by
  27. if test @GLIBC21@ = no; then \
  28. case '@host_os@' in \
  29. darwin[56]*) \
  30. need_charset_alias=true ;; \
  31. darwin* | cygwin* | mingw* | pw32* | cegcc*) \
  32. need_charset_alias=false ;; \
  33. *) \
  34. need_charset_alias=true ;; \
  35. esac ; \
  36. else \
  37. need_charset_alias=false ; \
  38. fi ; \
  39. if $$need_charset_alias; then \
  40. $(mkinstalldirs) $(DESTDIR)$(libdir) ; \
  41. fi ; \
  42. if test -f $(DESTDIR)$(libdir)/charset.alias; then \
  43. sed -f ref-add.sed $(DESTDIR)$(libdir)/charset.alias > $(DESTDIR)$(libdir)/t-charset.alias; \
  44. $(INSTALL_DATA) $(DESTDIR)$(libdir)/t-charset.alias $(DESTDIR)$(libdir)/charset.alias; \
  45. rm -f $(DESTDIR)$(libdir)/t-charset.alias; \
  46. else \
  47. if $$need_charset_alias; then \
  48. sed -f ref-add.sed charset.alias > $(DESTDIR)$(libdir)/t-charset.alias; \
  49. $(INSTALL_DATA) $(DESTDIR)$(libdir)/t-charset.alias $(DESTDIR)$(libdir)/charset.alias; \
  50. rm -f $(DESTDIR)$(libdir)/t-charset.alias; \
  51. fi; \
  52. fi
  53. - Augment target "installdirs" by
  54. if test @GLIBC21@ = no; then \
  55. case '@host_os@' in \
  56. darwin[56]*) \
  57. need_charset_alias=true ;; \
  58. darwin* | cygwin* | mingw* | pw32* | cegcc*) \
  59. need_charset_alias=false ;; \
  60. *) \
  61. need_charset_alias=true ;; \
  62. esac ; \
  63. else \
  64. need_charset_alias=false ; \
  65. fi ; \
  66. if $$need_charset_alias; then \
  67. $(mkinstalldirs) $(DESTDIR)$(libdir) ; \
  68. fi ; \
  69. - Augment target "uninstall" by
  70. if test -f $(DESTDIR)$(libdir)/charset.alias; then \
  71. sed -f ref-del.sed $(DESTDIR)$(libdir)/charset.alias > $(DESTDIR)$(libdir)/t-charset.alias; \
  72. if grep '^# Packages using this file: $$' $(DESTDIR)$(libdir)/t-charset.alias > /dev/null; then \
  73. rm -f $(DESTDIR)$(libdir)/charset.alias; \
  74. else \
  75. $(INSTALL_DATA) $(DESTDIR)$(libdir)/t-charset.alias $(DESTDIR)$(libdir)/charset.alias; \
  76. fi; \
  77. rm -f $(DESTDIR)$(libdir)/t-charset.alias; \
  78. fi
  79. - Augment target "clean" by
  80. rm -f charset.alias ref-add.sed ref-del.sed
  81. * If you are using automake, add rules to your Makefile.am:
  82. - Augment the main *_SOURCES variable by
  83. localcharset.h localcharset.c
  84. - Augment EXTRA_DIST by
  85. config.charset ref-add.sin ref-del.sin
  86. - Augment target "all-local" by
  87. charset.alias ref-add.sed ref-del.sed
  88. - Add the lines:
  89. charset_alias = $(DESTDIR)$(libdir)/charset.alias
  90. charset_tmp = $(DESTDIR)$(libdir)/charset.tmp
  91. install-exec-local: all-local
  92. test @GLIBC21@ != no || $(mkinstalldirs) $(DESTDIR)$(libdir)
  93. if test -f $(charset_alias); then \
  94. sed -f ref-add.sed $(charset_alias) > $(charset_tmp) ; \
  95. $(INSTALL_DATA) $(charset_tmp) $(charset_alias) ; \
  96. rm -f $(charset_tmp) ; \
  97. else \
  98. if test @GLIBC21@ = no; then \
  99. sed -f ref-add.sed charset.alias > $(charset_tmp) ; \
  100. $(INSTALL_DATA) $(charset_tmp) $(charset_alias) ; \
  101. rm -f $(charset_tmp) ; \
  102. fi ; \
  103. fi
  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) \
  108. > /dev/null; then \
  109. rm -f $(charset_alias); \
  110. else \
  111. $(INSTALL_DATA) $(charset_tmp) $(charset_alias); \
  112. fi; \
  113. rm -f $(charset_tmp); \
  114. fi
  115. charset.alias: config.charset
  116. $(SHELL) $(srcdir)/config.charset '@host@' > t-$@
  117. mv t-$@ $@
  118. SUFFIXES = .sed .sin
  119. .sin.sed:
  120. sed -e '/^#/d' -e 's/@''PACKAGE''@/@PACKAGE@/g' $< > t-$@
  121. mv t-$@ $@
  122. CLEANFILES = charset.alias ref-add.sed ref-del.sed