aboutsummaryrefslogtreecommitdiff
path: root/meson.build
blob: b52c1edb9f9063b5b45928574e82a3b5a7b2b8ac (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
# Meson file for Sylpheed

project('sylpheed', 'c',
        version : '3.7.0',
	license : ['GPL2+', 'LGPL2+'],
        default_options : ['buildtype=debugoptimized'])


# Dependency packages

gtk = dependency('gtk+-2.0')
glib = dependency('glib-2.0')
gobject = dependency('gobject-2.0')
openssl = dependency('openssl', required : false)


# Suppress some compiler warnings (for now)

add_project_arguments('-Wno-deprecated-declarations', language : 'c')
add_project_arguments('-Wno-unused-but-set-variable', language : 'c')
add_project_arguments('-Wno-format', language : 'c')


# Configuration

compiler = meson.get_compiler('c')
conf_data = configuration_data()

add_project_arguments('-DHAVE_CONFIG_H', language : 'c')
add_project_arguments('-DUSE_THREADS', language : 'c')
conf_data.set('ICONV_CONST', '')
add_project_arguments('-DSYSCONFDIR="'+join_paths(get_option('prefix'),
                                                  get_option('sysconfdir'))+'"',
                      language : 'c')
add_project_arguments('-DMANUALDIR="'+join_paths(get_option('prefix'),
                                                 get_option('datadir'),
						 'sylpheed',
						 'manual')+'"',
                      language : 'c')
add_project_arguments('-DFAQDIR="'+join_paths(get_option('prefix'),
                                              get_option('datadir'),
					      'sylpheed',
					      'faq')+'"',
                      language : 'c')
add_project_arguments('-DTHEMEDIR="'+join_paths(get_option('prefix'),
                                              get_option('datadir'),
					      'sylpheed',
					      'icons')+'"',
                      language : 'c')
add_project_arguments('-DPLUGINDIR="'+join_paths(get_option('prefix'),
                                              get_option('libdir'),
					      'sylpheed',
					      'plugins')+'"',
                      language : 'c')
add_project_arguments('-DTARGET_ALIAS="xxxx"',
                      language : 'c')

if openssl.found()
  add_project_arguments('-DUSE_SSL', language : 'c')
endif

if compiler.has_header('sys/wait.h')
  conf_data.set('HAVE_SYS_WAIT_H', 1)
endif

if compiler.has_header('sys/select.h')
  conf_data.set('HAVE_SYS_SELECT_H', 1)
endif

if compiler.has_header('netdb.h')
  conf_data.set('HAVE_NETDB_H', 1)
endif

configure_file(output : 'config.h',
               configuration : conf_data)


# version.h file

version_data = configuration_data()

version_data.set('MAJOR_VERSION', '3')
version_data.set('MINOR_VERSION', '7')
version_data.set('MICRO_VERSION', '0')
version_data.set('EXTRA_VERSION', '')
version_data.set('BUILD_REVISION', '')
version_data.set('PACKAGE', 'sylpheed')
version_data.set('VERSION', '3.7.0')

configure_file(input : 'src/version.h.in',
               output : 'version.h',
               configuration : version_data)


# Instructions for building libsylph

libsylph_includes = include_directories('libsylph')

libsylph = library('sylph',
                   ['libsylph/account.c',
                    'libsylph/base64.c',
                    'libsylph/codeconv.c',
                    'libsylph/customheader.c',
                    'libsylph/displayheader.c',
                    'libsylph/filter.c',
                    'libsylph/folder.c',
                    'libsylph/html.c',
                    'libsylph/imap.c',
                    'libsylph/mbox.c',
                    'libsylph/md5.c',
                    'libsylph/md5_hmac.c',
                    'libsylph/mh.c',
                    'libsylph/news.c',
                    'libsylph/nntp.c',
                    'libsylph/pop.c',
                    'libsylph/prefs_account.c',
                    'libsylph/prefs.c',
                    'libsylph/prefs_common.c',
                    'libsylph/procheader.c',
                    'libsylph/procmime.c',
                    'libsylph/procmsg.c',
                    'libsylph/quoted-printable.c',
                    'libsylph/recv.c',
                    'libsylph/session.c',
                    'libsylph/smtp.c',
                    'libsylph/socket.c',
                    'libsylph/socks.c',
                    'libsylph/ssl.c',
                    'libsylph/ssl_hostname_validation.c',
                    'libsylph/stringtable.c',
                    'libsylph/sylmain.c',
                    'libsylph/syl-marshal.c',
                    'libsylph/unmime.c',
                    'libsylph/utils.c',
                    'libsylph/uuencode.c',
                    'libsylph/virtual.c',
                    'libsylph/xml.c'],
		   include_directories : libsylph_includes,
                   dependencies : [glib, gobject, openssl],
                   install : true)

libsylph_dep = declare_dependency(include_directories : libsylph_includes,
                                  link_with : libsylph)


# Instructions for building sylpheed executable

flex = find_program('flex')
bison = find_program('bison')

quote_fmt_parse_c = custom_target('quote_fmt_parse.tab.c',
                                  output : ['quote_fmt_parse.tab.c', 'quote_fmt_parse.tab.h'],
                                  input : 'src/quote_fmt_parse.y',
                                  command : [bison, '--defines=@OUTPUT1@',
                                                    '-p', 'quote_fmt',
                                                    '--output=@OUTPUT0@',
                                                    '@INPUT@'])

quote_fmt_c = custom_target('quote_fmt.c',
                            output : ['quote_fmt.c', 'quote_fmt.h'],
                            input : ['src/quote_fmt_lex.l', quote_fmt_parse_c],
                            command : [flex, '--outfile=@OUTPUT0@',
                                             '--header-file=@OUTPUT1@',
                                             '-P', 'quote_fmt',
                                             '@INPUT@'])

glibgenmarshal = find_program('glib-genmarshal')

plugin_marshal_c = custom_target('plugin-marshal.c',
                                 output : ['plugin-marshal.c'],
                                 input : 'src/plugin-marshal.list',
				 command : [glibgenmarshal, '--output=@OUTPUT@',
                                                            '--body',
                                                            '--prefix=syl_plugin_marshal',
                                                            '@INPUT@'])

plugin_marshal_h = custom_target('plugin-marshal.h',
                                 output : ['plugin-marshal.h'],
                                 input : 'src/plugin-marshal.list',
                                 command : [glibgenmarshal, '--output=@OUTPUT@',
                                                            '--header',
                                                            '--prefix=syl_plugin_marshal',
                                                            '@INPUT@'])

executable('sylpheed',
           ['src/about.c',
            'src/account_dialog.c',
            'src/action.c',
            'src/addrbook.c',
            'src/addrcache.c',
            'src/addr_compl.c',
            'src/addressadd.c',
            'src/addressbook.c',
            'src/addrindex.c',
            'src/addritem.c',
            'src/alertpanel.c',
            'src/colorlabel.c',
            'src/compose.c',
            'src/editaddress.c',
            'src/editbook.c',
            'src/editgroup.c',
            'src/editjpilot.c',
            'src/editldap_basedn.c',
            'src/editldap.c',
            'src/editvcard.c',
            'src/eggtrayicon.c',
            'src/export.c',
            'src/exportcsv.c',
            'src/filesel.c',
            'src/foldersel.c',
            'src/folderview.c',
            'src/gtkshruler.c',
            'src/gtkutils.c',
            'src/headerview.c',
            'src/imageview.c',
            'src/import.c',
            'src/importcsv.c',
            'src/importldif.c',
            'src/inc.c',
            'src/inputdialog.c',
            'src/jpilot.c',
            'src/ldif.c',
            'src/logwindow.c',
            'src/main.c',
            'src/mainwindow.c',
            'src/manage_window.c',
            'src/manual.c',
            'src/menu.c',
            'src/message_search.c',
            'src/messageview.c',
            'src/mgutils.c',
            'src/mimeview.c',
            'src/notificationwindow.c',
            'src/passphrase.c',
            'src/plugin.c',
            'src/plugin_manager.c',
	    plugin_marshal_c,
	    plugin_marshal_h,
            'src/prefs_account_dialog.c',
            'src/prefs_actions.c',
            'src/prefs_common_dialog.c',
            'src/prefs_customheader.c',
            'src/prefs_display_header.c',
            'src/prefs_display_items.c',
            'src/prefs_filter.c',
            'src/prefs_filter_edit.c',
            'src/prefs_folder_item.c',
            'src/prefs_search_folder.c',
            'src/prefs_summary_column.c',
            'src/prefs_template.c',
            'src/prefs_toolbar.c',
            'src/prefs_ui.c',
            'src/printing.c',
            'src/progressdialog.c',
            quote_fmt_c,
            'src/query_search.c',
            'src/quick_search.c',
            'src/rfc2015.c',
            'src/rpop3.c',
            'src/select-keys.c',
            'src/send_message.c',
            'src/setup.c',
            'src/sigstatus.c',
            'src/simple-gettext.c',
            'src/sourcewindow.c',
            'src/sslmanager.c',
            'src/statusbar.c',
            'src/stock_pixmap.c',
            'src/subscribedialog.c',
            'src/summaryview.c',
            'src/syldap.c',
            'src/template.c',
            'src/textview.c',
            'src/trayicon.c',
            'src/undo.c',
            'src/update_check.c',
            'src/vcard.c'],
	 dependencies : [gtk, glib, gobject, libsylph_dep],
	 install : true)