meson: Add some platform specific configuration data
authorArnaud Rebillout <arnaud.rebillout@collabora.com>
Mon, 22 Oct 2018 04:57:26 +0000 (11:57 +0700)
committerArun Raghavan <arun@arunraghavan.net>
Thu, 27 Dec 2018 11:55:56 +0000 (17:25 +0530)
Signed-off-by: Arnaud Rebillout <arnaud.rebillout@collabora.com>
meson.build
src/daemon/meson.build

index 7e32455..52dbd8c 100644 (file)
@@ -84,6 +84,22 @@ cdata.set_quoted('PA_ALSA_PATHS_DIR', join_paths(datadir, 'pulseaudio', 'alsa-mi
 cdata.set_quoted('PA_ALSA_PROFILE_SETS_DIR', join_paths(datadir, 'pulseaudio', 'alsa-mixer', 'profile-sets'))
 cdata.set_quoted('DESKTOPFILEDIR', join_paths(datadir, 'applications'))
 
+# Platform specifics
+# FIXME: This was not tested. Maybe some flags should better be CFLAGS,
+# rather than ending up in the config.h file?
+if host_machine.system() == 'darwin'
+  cdata.set('OS_IS_DARWIN', 1)
+  cdata.set('_DARWIN_C_SOURCE', '200112L') # Needed to get NSIG on Mac OS
+elif host_machine.system() == 'windows'
+  cdata.set('OS_IS_WIN32', 1)
+  cdata.set('WIN32_LEAN_AND_MEAN', 1) # Needed to avoid including unnecessary headers on Windows
+#elif host_machine.system() == 'solaris'
+#  # Apparently meson has no solaris support?
+#  # Needed to get declarations for msg_control and msg_controllen on Solaris
+#  cdata.set('_XOPEN_SOURCE', 600)
+#  cdata.set('__EXTENSIONS__', 1)
+endif
+
 # Headers
 
 check_headers = [
index fa9e24c..130c67d 100644 (file)
@@ -73,7 +73,6 @@ default_conf = configuration_data()
 default_conf.merge_from(cdata)
 default_conf.set('PA_BINARY', cdata.get_unquoted('PA_BINARY'))
 default_conf.set('PA_SOEXT', cdata.get_unquoted('PA_SOEXT'))
-# TODO: OS_IS_WIN32
 
 default_template_file = configure_file(
   input : 'default.pa.in',