1
#-------------------------------------------------------------------------
4
# Makefile for utils/mb/conversion_procs
7
# $PostgreSQL: pgsql/src/backend/utils/mb/conversion_procs/Makefile,v 1.11.4.1 2005-05-03 19:18:16 tgl Exp $
9
#-------------------------------------------------------------------------
11
subdir = src/backend/utils/mb/conversion_procs
12
top_builddir = ../../../../..
13
include $(top_builddir)/src/Makefile.global
15
SQLSCRIPT = conversion_create.sql
17
# This file can be placed as src/test/regress/conversion.sql
18
REGRESSION_SCRIPT = conversion.sql
21
ascii_and_mic cyrillic_and_mic euc_cn_and_mic euc_jp_and_sjis \
22
euc_kr_and_mic euc_tw_and_big5 latin2_and_win1250 latin_and_mic \
23
utf8_and_ascii utf8_and_big5 utf8_and_cyrillic utf8_and_euc_cn \
24
utf8_and_euc_jp utf8_and_euc_kr utf8_and_euc_tw utf8_and_gb18030 \
25
utf8_and_gbk utf8_and_iso8859 utf8_and_iso8859_1 utf8_and_johab \
26
utf8_and_sjis utf8_and_tcvn utf8_and_uhc utf8_and_win1250 \
27
utf8_and_win1256 utf8_and_win874
29
# conversion_name source_encoding destination_encoding function object
31
ascii_to_mic SQL_ASCII MULE_INTERNAL ascii_to_mic ascii_and_mic \
32
mic_to_ascii MULE_INTERNAL SQL_ASCII mic_to_ascii ascii_and_mic \
33
koi8_r_to_mic KOI8R MULE_INTERNAL koi8r_to_mic cyrillic_and_mic \
34
mic_to_koi8_r MULE_INTERNAL KOI8R mic_to_koi8r cyrillic_and_mic \
35
iso_8859_5_to_mic ISO-8859-5 MULE_INTERNAL iso_to_mic cyrillic_and_mic \
36
mic_to_iso_8859_5 MULE_INTERNAL ISO-8859-5 mic_to_iso cyrillic_and_mic \
37
windows_1251_to_mic WIN1251 MULE_INTERNAL win1251_to_mic cyrillic_and_mic \
38
mic_to_windows_1251 MULE_INTERNAL WIN1251 mic_to_win1251 cyrillic_and_mic \
39
windows_866_to_mic ALT MULE_INTERNAL alt_to_mic cyrillic_and_mic \
40
mic_to_windows_866 MULE_INTERNAL ALT mic_to_alt cyrillic_and_mic \
41
koi8_r_to_windows_1251 KOI8R WIN1251 koi8r_to_win1251 cyrillic_and_mic \
42
windows_1251_to_koi8_r WIN1251 KOI8R win1251_to_koi8r cyrillic_and_mic \
43
koi8_r_to_windows_866 KOI8R ALT koi8r_to_alt cyrillic_and_mic \
44
windows_866_to_koi8_r ALT KOI8R alt_to_koi8r cyrillic_and_mic \
45
windows_866_to_windows_1251 ALT WIN1251 alt_to_win1251 cyrillic_and_mic \
46
windows_1251_to_windows_866 WIN1251 ALT win1251_to_alt cyrillic_and_mic \
47
iso_8859_5_to_koi8_r ISO-8859-5 KOI8R iso_to_koi8r cyrillic_and_mic \
48
koi8_r_to_iso_8859_5 KOI8R ISO-8859-5 koi8r_to_iso cyrillic_and_mic \
49
iso_8859_5_to_windows_1251 ISO-8859-5 WIN1251 iso_to_win1251 cyrillic_and_mic \
50
windows_1251_to_iso_8859_5 WIN1251 ISO-8859-5 win1251_to_iso cyrillic_and_mic \
51
iso_8859_5_to_windows_866 ISO-8859-5 ALT iso_to_alt cyrillic_and_mic \
52
windows_866_to_iso_8859_5 ALT ISO-8859-5 alt_to_iso cyrillic_and_mic \
53
euc_cn_to_mic EUC_CN MULE_INTERNAL euc_cn_to_mic euc_cn_and_mic \
54
mic_to_euc_cn MULE_INTERNAL EUC_CN mic_to_euc_cn euc_cn_and_mic \
55
euc_jp_to_sjis EUC_JP SJIS euc_jp_to_sjis euc_jp_and_sjis \
56
sjis_to_euc_jp SJIS EUC_JP sjis_to_euc_jp euc_jp_and_sjis \
57
euc_jp_to_mic EUC_JP MULE_INTERNAL euc_jp_to_mic euc_jp_and_sjis \
58
sjis_to_mic SJIS MULE_INTERNAL sjis_to_mic euc_jp_and_sjis \
59
mic_to_euc_jp MULE_INTERNAL EUC_JP mic_to_euc_jp euc_jp_and_sjis \
60
mic_to_sjis MULE_INTERNAL SJIS mic_to_sjis euc_jp_and_sjis \
61
euc_kr_to_mic EUC_KR MULE_INTERNAL euc_kr_to_mic euc_kr_and_mic \
62
mic_to_euc_kr MULE_INTERNAL EUC_KR mic_to_euc_kr euc_kr_and_mic \
63
euc_tw_to_big5 EUC_TW BIG5 euc_tw_to_big5 euc_tw_and_big5 \
64
big5_to_euc_tw BIG5 EUC_TW big5_to_euc_tw euc_tw_and_big5 \
65
euc_tw_to_mic EUC_TW MULE_INTERNAL euc_tw_to_mic euc_tw_and_big5 \
66
big5_to_mic BIG5 MULE_INTERNAL big5_to_mic euc_tw_and_big5 \
67
mic_to_euc_tw MULE_INTERNAL EUC_TW mic_to_euc_tw euc_tw_and_big5 \
68
mic_to_big5 MULE_INTERNAL BIG5 mic_to_big5 euc_tw_and_big5 \
69
iso_8859_2_to_mic LATIN2 MULE_INTERNAL latin2_to_mic latin2_and_win1250 \
70
mic_to_iso_8859_2 MULE_INTERNAL LATIN2 mic_to_latin2 latin2_and_win1250 \
71
windows_1250_to_mic WIN1250 MULE_INTERNAL win1250_to_mic latin2_and_win1250 \
72
mic_to_windows_1250 MULE_INTERNAL WIN1250 mic_to_win1250 latin2_and_win1250 \
73
iso_8859_2_to_windows_1250 LATIN2 WIN1250 latin2_to_win1250 latin2_and_win1250 \
74
windows_1250_to_iso_8859_2 WIN1250 LATIN2 win1250_to_latin2 latin2_and_win1250 \
75
iso_8859_1_to_mic LATIN1 MULE_INTERNAL latin1_to_mic latin_and_mic \
76
mic_to_iso_8859_1 MULE_INTERNAL LATIN1 mic_to_latin1 latin_and_mic \
77
iso_8859_3_to_mic LATIN3 MULE_INTERNAL latin3_to_mic latin_and_mic \
78
mic_to_iso_8859_3 MULE_INTERNAL LATIN3 mic_to_latin3 latin_and_mic \
79
iso_8859_4_to_mic LATIN4 MULE_INTERNAL latin4_to_mic latin_and_mic \
80
mic_to_iso_8859_4 MULE_INTERNAL LATIN4 mic_to_latin4 latin_and_mic \
81
ascii_to_utf_8 SQL_ASCII UNICODE ascii_to_utf8 utf8_and_ascii \
82
utf_8_to_ascii UNICODE SQL_ASCII utf8_to_ascii utf8_and_ascii \
83
big5_to_utf_8 BIG5 UNICODE big5_to_utf8 utf8_and_big5 \
84
utf_8_to_big5 UNICODE BIG5 utf8_to_big5 utf8_and_big5 \
85
utf_8_to_koi8_r UNICODE KOI8R utf8_to_koi8r utf8_and_cyrillic \
86
koi8_r_to_utf_8 KOI8R UNICODE koi8r_to_utf8 utf8_and_cyrillic \
87
utf_8_to_windows_1251 UNICODE WIN1251 utf8_to_win1251 utf8_and_cyrillic \
88
windows_1251_to_utf_8 WIN1251 UNICODE win1251_to_utf8 utf8_and_cyrillic \
89
utf_8_to_windows_866 UNICODE ALT utf8_to_alt utf8_and_cyrillic \
90
windows_866_to_utf_8 ALT UNICODE alt_to_utf8 utf8_and_cyrillic \
91
euc_cn_to_utf_8 EUC_CN UNICODE euc_cn_to_utf8 utf8_and_euc_cn \
92
utf_8_to_euc_cn UNICODE EUC_CN utf8_to_euc_cn utf8_and_euc_cn \
93
euc_jp_to_utf_8 EUC_JP UNICODE euc_jp_to_utf8 utf8_and_euc_jp \
94
utf_8_to_euc_jp UNICODE EUC_JP utf8_to_euc_jp utf8_and_euc_jp \
95
euc_kr_to_utf_8 EUC_KR UNICODE euc_kr_to_utf8 utf8_and_euc_kr \
96
utf_8_to_euc_kr UNICODE EUC_KR utf8_to_euc_kr utf8_and_euc_kr \
97
euc_tw_to_utf_8 EUC_TW UNICODE euc_tw_to_utf8 utf8_and_euc_tw \
98
utf_8_to_euc_tw UNICODE EUC_TW utf8_to_euc_tw utf8_and_euc_tw \
99
gb18030_to_utf_8 GB18030 UNICODE gb18030_to_utf8 utf8_and_gb18030 \
100
utf_8_to_gb18030 UNICODE GB18030 utf8_to_gb18030 utf8_and_gb18030 \
101
gbk_to_utf_8 GBK UNICODE gbk_to_utf8 utf8_and_gbk \
102
utf_8_to_gbk UNICODE GBK utf8_to_gbk utf8_and_gbk \
103
utf_8_to_iso_8859_2 UNICODE LATIN2 utf8_to_iso8859 utf8_and_iso8859 \
104
iso_8859_2_to_utf_8 LATIN2 UNICODE iso8859_to_utf8 utf8_and_iso8859 \
105
utf_8_to_iso_8859_3 UNICODE LATIN3 utf8_to_iso8859 utf8_and_iso8859 \
106
iso_8859_3_to_utf_8 LATIN3 UNICODE iso8859_to_utf8 utf8_and_iso8859 \
107
utf_8_to_iso_8859_4 UNICODE LATIN4 utf8_to_iso8859 utf8_and_iso8859 \
108
iso_8859_4_to_utf_8 LATIN4 UNICODE iso8859_to_utf8 utf8_and_iso8859 \
109
utf_8_to_iso_8859_9 UNICODE LATIN5 utf8_to_iso8859 utf8_and_iso8859 \
110
iso_8859_9_to_utf_8 LATIN5 UNICODE iso8859_to_utf8 utf8_and_iso8859 \
111
utf_8_to_iso_8859_10 UNICODE LATIN6 utf8_to_iso8859 utf8_and_iso8859 \
112
iso_8859_10_to_utf_8 LATIN6 UNICODE iso8859_to_utf8 utf8_and_iso8859 \
113
utf_8_to_iso_8859_13 UNICODE LATIN7 utf8_to_iso8859 utf8_and_iso8859 \
114
iso_8859_13_to_utf_8 LATIN7 UNICODE iso8859_to_utf8 utf8_and_iso8859 \
115
utf_8_to_iso_8859_14 UNICODE LATIN8 utf8_to_iso8859 utf8_and_iso8859 \
116
iso_8859_14_to_utf_8 LATIN8 UNICODE iso8859_to_utf8 utf8_and_iso8859 \
117
utf_8_to_iso_8859_15 UNICODE LATIN9 utf8_to_iso8859 utf8_and_iso8859 \
118
iso_8859_15_to_utf_8 LATIN9 UNICODE iso8859_to_utf8 utf8_and_iso8859 \
119
utf_8_to_iso_8859_16 UNICODE LATIN10 utf8_to_iso8859 utf8_and_iso8859 \
120
iso_8859_16_to_utf_8 LATIN10 UNICODE iso8859_to_utf8 utf8_and_iso8859 \
121
utf_8_to_iso_8859_5 UNICODE ISO-8859-5 utf8_to_iso8859 utf8_and_iso8859 \
122
iso_8859_5_to_utf_8 ISO-8859-5 UNICODE iso8859_to_utf8 utf8_and_iso8859 \
123
utf_8_to_iso_8859_6 UNICODE ISO-8859-6 utf8_to_iso8859 utf8_and_iso8859 \
124
iso_8859_6_to_utf_8 ISO-8859-6 UNICODE iso8859_to_utf8 utf8_and_iso8859 \
125
utf_8_to_iso_8859_7 UNICODE ISO-8859-7 utf8_to_iso8859 utf8_and_iso8859 \
126
iso_8859_7_to_utf_8 ISO-8859-7 UNICODE iso8859_to_utf8 utf8_and_iso8859 \
127
utf_8_to_iso_8859_8 UNICODE ISO-8859-8 utf8_to_iso8859 utf8_and_iso8859 \
128
iso_8859_8_to_utf_8 ISO-8859-8 UNICODE iso8859_to_utf8 utf8_and_iso8859 \
129
iso_8859_1_to_utf_8 LATIN1 UNICODE iso8859_1_to_utf8 utf8_and_iso8859_1 \
130
utf_8_to_iso_8859_1 UNICODE LATIN1 utf8_to_iso8859_1 utf8_and_iso8859_1 \
131
johab_to_utf_8 JOHAB UNICODE johab_to_utf8 utf8_and_johab \
132
utf_8_to_johab UNICODE JOHAB utf8_to_johab utf8_and_johab \
133
sjis_to_utf_8 SJIS UNICODE sjis_to_utf8 utf8_and_sjis \
134
utf_8_to_sjis UNICODE SJIS utf8_to_sjis utf8_and_sjis \
135
tcvn_to_utf_8 TCVN UNICODE tcvn_to_utf8 utf8_and_tcvn \
136
utf_8_to_tcvn UNICODE TCVN utf8_to_tcvn utf8_and_tcvn \
137
uhc_to_utf_8 UHC UNICODE uhc_to_utf8 utf8_and_uhc \
138
utf_8_to_uhc UNICODE UHC utf8_to_uhc utf8_and_uhc \
139
utf_8_to_windows_1250 UNICODE WIN1250 utf_to_win1250 utf8_and_win1250 \
140
windows_1250_to_utf_8 WIN1250 UNICODE win1250_to_utf utf8_and_win1250 \
141
utf_8_to_windows_1256 UNICODE WIN1256 utf_to_win1256 utf8_and_win1256 \
142
windows_1256_to_utf_8 WIN1256 UNICODE win1256_to_utf utf8_and_win1256 \
143
utf_8_to_windows_874 UNICODE WIN874 utf_to_win874 utf8_and_win874 \
144
windows_874_to_utf_8 WIN874 UNICODE win874_to_utf utf8_and_win874
147
@for dir in $(DIRS); do $(MAKE) -C $$dir $@ || exit; done
149
$(SQLSCRIPT): Makefile
150
ifeq ($(enable_shared), yes)
151
@set $(CONVERSIONS) ; \
152
while [ "$$#" -gt 0 ] ; \
159
echo "-- $$se --> $$de"; \
160
echo "CREATE OR REPLACE FUNCTION $$func (INTEGER, INTEGER, CSTRING, INTERNAL, INTEGER) RETURNS VOID AS '$$"libdir"/$$obj', '$$func' LANGUAGE 'c' STRICT;"; \
161
echo "DROP CONVERSION pg_catalog.$$name;"; \
162
echo "CREATE DEFAULT CONVERSION pg_catalog.$$name FOR '$$se' TO '$$de' FROM $$func;"; \
165
echo "-- No conversion support, for lack of shared library support" > $@
168
$(REGRESSION_SCRIPT): Makefile
169
@cp regress_prolog $@; \
170
set $(CONVERSIONS) ; \
171
while [ "$$#" -gt 0 ] ; \
178
echo "-- $$se --> $$de"; \
179
echo "SELECT CONVERT('foo' USING $$name);"; \
180
echo "SELECT CONVERT('foo', '$$se', '$$de');"; \
182
cat regress_epilogue >> $@;
184
install: $(SQLSCRIPT) installdirs
185
$(INSTALL_DATA) $(SQLSCRIPT) $(DESTDIR)$(datadir)
186
@for dir in $(DIRS); do $(MAKE) -C $$dir $@ || exit; done
189
$(mkinstalldirs) $(DESTDIR)$(datadir) $(DESTDIR)$(pkglibdir)
192
rm -f $(DESTDIR)$(datadir)/$(SQLSCRIPT)
193
@for dir in $(DIRS); do $(MAKE) -C $$dir $@ || exit; done
195
clean distclean maintainer-clean:
197
@for dir in $(DIRS); do $(MAKE) -C $$dir $@; done