win32: Fix meson build system for Windows.
[platform/upstream/pulseaudio.git] / src / daemon / meson.build
1 pulseaudio_sources = [
2   'caps.c',
3   'cmdline.c',
4   'cpulimit.c',
5   'daemon-conf.c',
6   'dumpmodules.c',
7   'ltdl-bind-now.c',
8   'main.c',
9 ]
10
11 pulseaudio_headers = [
12   'caps.h',
13   'cmdline.h',
14   'cpulimit.h',
15   'daemon-conf.h',
16   'dumpmodules.h',
17   'ltdl-bind-now.h',
18 ]
19
20 if dbus_dep.found()
21   pulseaudio_sources += 'server-lookup.c'
22   pulseaudio_headers += 'server-lookup.h'
23 endif
24
25 # FIXME: dependencies
26 executable('pulseaudio',
27   pulseaudio_sources,
28   pulseaudio_headers,
29   install: true,
30   install_rpath : privlibdir,
31   include_directories : [configinc, topinc],
32   link_args : ['-ffast-math'],
33   link_with : [libpulsecore, libpulsecommon, libpulse],
34   dependencies : [ltdl_dep, cap_dep, dbus_dep, libsystemd_dep, dl_dep, libintl_dep, platform_dep, platform_socket_dep],
35   c_args : pa_c_args,
36 )
37
38 if x11_dep.found()
39   conf = configuration_data()
40   conf.set('PACTL_BINARY', join_paths(bindir, 'pactl'))
41
42   configure_file(
43     input : 'start-pulseaudio-x11.in',
44     output : 'start-pulseaudio-x11',
45     configuration : conf,
46     install : true,
47     install_dir : bindir,
48   )
49
50   desktop_file = i18n.merge_file(
51     input : 'pulseaudio.desktop.in',
52     output : 'pulseaudio.desktop',
53     po_dir : po_dir,
54     type : 'desktop',
55     install : true,
56     install_dir : join_paths(sysconfdir, 'xdg', 'autostart'),
57   )
58
59   desktop_utils = find_program('desktop-file-validate', required: false)
60   if desktop_utils.found()
61     test('Validate desktop file', desktop_utils,
62       args: [ desktop_file ],
63     )
64   endif
65 endif
66
67 # Configuration files
68
69 m4 = find_program('m4', required: true)
70
71 daemon_conf = configuration_data()
72 daemon_conf.merge_from(cdata)
73 daemon_conf.set('PA_DEFAULT_CONFIG_DIR', cdata.get_unquoted('PA_DEFAULT_CONFIG_DIR'))
74
75 daemon_template_file = configure_file(
76   input : 'daemon.conf.in',
77   output : 'daemon.conf.tmp',
78   configuration : daemon_conf,
79 )
80
81 custom_target('daemon.conf',
82   input : daemon_template_file,
83   output : 'daemon.conf',
84   capture : true,
85   command : [m4, '@INPUT@'],
86   build_by_default : true,
87   install : true,
88   install_dir : pulsesysconfdir,
89 )
90
91 default_conf = configuration_data()
92 default_conf.merge_from(cdata)
93 default_conf.set('PA_BINARY', cdata.get_unquoted('PA_BINARY'))
94 default_conf.set('PA_SOEXT', cdata.get_unquoted('PA_SOEXT'))
95 default_conf.set10('HAVE_AF_UNIX', cc.has_header('sys/un.h'))
96 default_conf.set10('OS_IS_WIN32', host_machine.system() == 'windows')
97 default_conf.set10('HAVE_MKFIFO', cc.has_function('mkfifo'))
98 # We don't support the deprecated GConf option in meson
99 default_conf.set10('HAVE_GCONF', 0)
100
101 default_template_file = configure_file(
102   input : 'default.pa.in',
103   output : 'default.pa.tmp',
104   configuration : default_conf,
105 )
106
107 custom_target('default.pa',
108   input : default_template_file,
109   output : 'default.pa',
110   capture : true,
111   command : [m4, '@INPUT@'],
112   build_by_default : true,
113   install : true,
114   install_dir : pulsesysconfdir,
115 )
116
117 system_conf = configuration_data()
118 system_conf.merge_from(cdata)
119 system_conf.set('PA_BINARY', cdata.get_unquoted('PA_BINARY'))
120 system_conf.set('PA_SOEXT', cdata.get_unquoted('PA_SOEXT'))
121
122 system_template_file = configure_file(
123   input : 'system.pa.in',
124   output : 'system.pa.tmp',
125   configuration : system_conf,
126 )
127
128 custom_target('system.pa',
129   input : system_template_file,
130   output : 'system.pa',
131   capture : true,
132   command : [m4, '@INPUT@'],
133   build_by_default : true,
134   install : true,
135   install_dir : pulsesysconfdir,
136 )
137
138 if dbus_dep.found()
139   install_data('pulseaudio-system.conf',
140     install_dir : join_paths(sysconfdir, 'dbus-1', 'system.d')
141   )
142 endif
143
144 if systemd_dep.found()
145   sd_user_service_conf = configuration_data()
146   sd_user_service_conf.set('PA_BINARY', cdata.get_unquoted('PA_BINARY'))
147
148   sd_user_service_file = configure_file(
149     input : 'systemd/user/pulseaudio.service.in',
150     output : 'pulseaudio.service',
151     configuration : sd_user_service_conf,
152     install : true,
153     install_dir : systemduserunitdir,
154   )
155
156   install_data('systemd/user/pulseaudio.socket',
157     install_dir: systemduserunitdir,
158   )
159 endif