Fixed #if ENABLE_SSL for ssl_check_error
[yaz-moved-to-github.git] / src / Makefile.am
1 ## This file is part of the YAZ toolkit.
2 ## Copyright (C) 1995-2008 Index Data
3
4 YAZ_VERSION_INFO=3:0:0
5
6 lib_LTLIBRARIES = libyaz.la libyaz_server.la libyaz_icu.la
7
8 dist-hook:
9         test -f $(srcdir)/cql.c || exit 1
10
11 tabdatadir = $(pkgdatadir)/z39.50
12 tabdata_DATA=datetime.asn esupdate.asn univres.asn z3950v3.asn z.tcl \
13  esadmin.asn charneg-3.asn mterm2.asn oclcui.asn
14
15 illdatadir=$(pkgdatadir)/ill
16 illdata_DATA=ill9702.asn item-req.asn ill.tcl oclc-ill-req-ext.asn
17
18 EXTRA_DIST=$(tabdata_DATA) $(illdata_DATA) \
19  charconv.tcl codetables.xml \
20  csvtodiag.tcl csvtobib1.tcl csvtosrw.tcl bib1.csv srw.csv \
21  csvtosru_update.tcl sru_update.csv \
22  oidtoc.tcl oid.csv sc_test.c
23
24 YAZCOMP=$(top_srcdir)/util/yaz-asncomp
25 YAZCOMP_Z = $(YAZCOMP) -d $(srcdir)/z.tcl -i yaz -I$(top_srcdir)/include
26 YAZCOMP_I = $(YAZCOMP) -d $(srcdir)/ill.tcl -i yaz -I$(top_srcdir)/include
27
28 AM_CPPFLAGS=-I$(top_srcdir)/include $(XML2_CFLAGS) $(SSL_CFLAGS) 
29 libyaz_la_LIBADD = $(SSL_LIBS)
30 libyaz_server_la_CFLAGS = $(PTHREAD_CFLAGS)
31 libyaz_server_la_LIBADD = libyaz.la
32 libyaz_icu_la_CPPFLAGS = $(AM_CPPFLAGS) $(ICU_CPPFLAGS)
33 libyaz_icu_la_LIBADD = libyaz.la $(ICU_LIBS)
34
35 AM_YFLAGS=-p cql_
36
37 # MARC8->UTF8 conversion is generated from codetables.xml
38 marc8.c: charconv.tcl codetables.xml
39         $(TCLSH) $(srcdir)/charconv.tcl -p marc8 $(srcdir)/codetables.xml -o marc8.c
40
41 # UTF-8->MARC8 conversion is generated from codetables.xml
42 marc8r.c: charconv.tcl codetables.xml
43         $(TCLSH) $(srcdir)/charconv.tcl -r -p marc8r $(srcdir)/codetables.xml -o marc8r.c
44
45 # Generate OID database from CSV
46 oid_std.c $(top_srcdir)/include/yaz/oid_std.h: oidtoc.tcl oid.csv
47         $(TCLSH) $(srcdir)/oidtoc.tcl $(srcdir) $(srcdir)/oid.csv oid_std.c oid_std.h
48
49 # Generate diagnostics from CSVs
50 diagbib1.c $(top_srcdir)/include/yaz/diagbib1.h: csvtobib1.tcl bib1.csv
51         $(TCLSH) $(srcdir)/csvtobib1.tcl $(srcdir)
52
53 diagsrw.c $(top_srcdir)/include/yaz/diagsrw.h: csvtosrw.tcl srw.csv
54         $(TCLSH) $(srcdir)/csvtosrw.tcl $(srcdir)
55
56 diagsru_update.c $(top_srcdir)/include/yaz/diagsru_update.h: csvtosru_update.tcl sru_update.csv
57         $(TCLSH) $(srcdir)/csvtosru_update.tcl $(srcdir)
58
59 # Auto-generated C-files
60 GEN_FILES = oid_std.c \
61   marc8.c marc8r.c \
62   diagbib1.c diagsrw.c diagsru_update.c \
63   z-accdes1.c z-accform1.c z-acckrb1.c z-core.c \
64   z-diag1.c z-espec1.c z-estask.c z-exp.c z-grs.c z-mterm2.c z-opac.c \
65   z-uifr1.c z-rrf1.c z-rrf2.c z-sum.c z-sutrs.c z-oclcui.c\
66   zes-expi.c zes-exps.c zes-order.c zes-pquery.c zes-psched.c \
67   zes-pset.c zes-update0.c z-date.c z-univ.c zes-update.c zes-admin.c \
68   z-charneg.c \
69   ill-core.c item-req.c oclc-ill-req-ext.c
70
71 libyaz_la_SOURCES=version.c options.c log.c \
72  $(GEN_FILES) \
73   marcdisp.c marc_read_xml.c marc_read_iso2709.c marc_read_line.c \
74   wrbuf.c oid_db.c \
75   nmemsdup.c xmalloc.c readconf.c tpath.c nmem.c matchstr.c atoin.c \
76   siconv.c iconv-p.h utf8.c ucs4.c iso5428.c advancegreek.c \
77   odr_bool.c ber_bool.c ber_len.c ber_tag.c odr_util.c \
78   odr_null.c ber_null.c odr_int.c ber_int.c odr_tag.c odr_cons.c \
79   odr_seq.c odr_oct.c ber_oct.c odr_bit.c ber_bit.c odr_oid.c \
80   ber_oid.c odr_use.c odr_choice.c odr_any.c ber_any.c odr.c odr_mem.c \
81   dumpber.c odr_enum.c odr-priv.h libxml2_error.c \
82   comstack.c tcpip.c waislen.c unix.c \
83   prt-ext.c \
84   ill-get.c \
85   zget.c yaz-ccl.c diag-entry.c diag-entry.h \
86   logrpn.c \
87   otherinfo.c pquery.c sortspec.c charneg.c initopt.c \
88   zoom-c.c zoom-socket.c zoom-opt.c zoom-p.h \
89   grs1disp.c zgdu.c soap.c srw.c srwutil.c \
90   opacdisp.c cclfind.c ccltoken.c cclerrms.c cclqual.c cclptree.c cclp.h \
91   cclqfile.c cclstr.c cclxmlconfig.c ccl_stop_words.c \
92   cql.y cqlstdio.c cqltransform.c cqlutil.c xcqlutil.c cqlstring.c rpn2cql.c \
93   cqlstrer.c querytowrbuf.c \
94   tcpdchk.c \
95   test.c timing.c \
96   xmlquery.c xmlerror.c http.c \
97   mime.c mime.h oid_util.c tokenizer.c \
98   record_conv.c retrieval.c elementset.c snprintf.c query-charset.c \
99   copy_types.c match_glob.c poll.c daemon.c \
100   iconv_encode_marc8.c iconv_encode_iso_8859_1.c iconv_encode_wchar.c \
101   iconv_decode_marc8.c sc.c
102
103 libyaz_la_LDFLAGS=-version-info $(YAZ_VERSION_INFO)
104
105 libyaz_server_la_SOURCES = statserv.c seshigh.c eventl.c \
106   requestq.c eventl.h session.h mutex.c
107
108 libyaz_server_la_LDFLAGS=-version-info $(YAZ_VERSION_INFO)
109
110 libyaz_icu_la_SOURCES = icu_I18N.c
111 libyaz_icu_la_LDFLAGS=-version-info $(YAZ_VERSION_INFO)
112
113 # Rules for Z39.50 V3
114 z-accdes1.c \
115 z-accform1.c \
116 z-acckrb1.c \
117 z-diag1.c \
118 z-espec1.c \
119 z-estask.c \
120 z-exp.c \
121 z-grs.c \
122 z-opac.c \
123 z-uifr1.c \
124 z-rrf1.c \
125 z-rrf2.c \
126 z-sum.c \
127 z-sutrs.c \
128 zes-expi.c \
129 zes-exps.c \
130 zes-order.c \
131 zes-pquery.c \
132 zes-psched.c \
133 zes-pset.c \
134 zes-update0.c \
135 $(top_srcdir)/include/yaz/z-accdes1.h \
136 $(top_srcdir)/include/yaz/z-core.h: z-core.c
137
138 z-core.c: $(srcdir)/z.tcl $(srcdir)/z3950v3.asn $(YAZCOMP)
139         $(TCLSH) $(YAZCOMP_Z) $(srcdir)/z3950v3.asn
140
141 # Date extension
142 z-date.c \
143 $(top_srcdir)/include/yaz/z-date.h: $(srcdir)/z.tcl $(srcdir)/datetime.asn $(YAZCOMP)
144         $(TCLSH) $(YAZCOMP_Z) $(srcdir)/datetime.asn
145
146 # UNIverse extension
147 z-univ.c \
148 $(top_srcdir)/include/yaz/z-univ.h: \
149 $(srcdir)/z.tcl $(srcdir)/univres.asn $(YAZCOMP)
150         $(TCLSH) $(YAZCOMP_Z) $(srcdir)/univres.asn
151
152 # New Update extended service
153 zes-update.c \
154 $(top_srcdir)/include/yaz/zes-update.h: \
155 $(srcdir)/z.tcl $(srcdir)/esupdate.asn $(YAZCOMP)
156         $(TCLSH) $(YAZCOMP_Z) $(srcdir)/esupdate.asn
157
158 # Admin extended service
159 zes-admin.c \
160 $(top_srcdir)/include/yaz/zes-admin.h: \
161 $(srcdir)/z.tcl $(srcdir)/esadmin.asn $(YAZCOMP)
162         $(TCLSH) $(YAZCOMP_Z) $(srcdir)/esadmin.asn
163
164 # Charset negotiation
165 z-charneg.c \
166 $(top_srcdir)/include/yaz/z-charneg.h: \
167 $(srcdir)/z.tcl $(srcdir)/charneg-3.asn $(YAZCOMP)
168         $(TCLSH) $(YAZCOMP_Z) $(srcdir)/charneg-3.asn
169
170 # UserInfoFormat-multipleSearchTerms-2
171 z-mterm2.c \
172 $(top_srcdir)/include/yaz/z-mterm2.h: \
173 $(srcdir)/z.tcl $(srcdir)/mterm2.asn $(YAZCOMP)
174         $(TCLSH) $(YAZCOMP_Z) $(srcdir)/mterm2.asn
175
176 # UserInfoFormat-multipleSearchTerms-2
177 z-oclcui.c \
178 $(top_srcdir)/include/yaz/z-oclcui.h: \
179 $(srcdir)/z.tcl $(srcdir)/oclcui.asn $(YAZCOMP)
180         $(TCLSH) $(YAZCOMP_Z) $(srcdir)/oclcui.asn
181
182 # ILL protocol
183 ill-core.c \
184 $(top_srcdir)/include/yaz/ill-core.h: \
185 $(srcdir)/ill.tcl $(srcdir)/ill9702.asn $(YAZCOMP)
186         $(TCLSH) $(YAZCOMP_I) $(srcdir)/ill9702.asn
187
188 # OCLC ILL Request Extension
189 oclc-ill-req-ext.c \
190 $(top_srcdir)/include/yaz/oclc-ill-req-ext.h: \
191 $(srcdir)/ill.tcl $(srcdir)/oclc-ill-req-ext.asn $(YAZCOMP)
192         $(TCLSH) $(YAZCOMP_I) $(srcdir)/oclc-ill-req-ext.asn
193
194 # Item Request
195 item-req.c \
196 $(top_srcdir)/include/yaz/item-req.h: \
197 $(srcdir)/ill.tcl $(srcdir)/item-req.asn $(YAZCOMP)
198         $(TCLSH) $(YAZCOMP_I) $(srcdir)/item-req.asn
199