summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGleb Popov <6yearold@gmail.com>2019-11-09 23:03:38 +0400
committerWim Taymans <wtaymans@redhat.com>2019-11-19 13:41:40 +0100
commitfd937fa37831c4f7ada03caa7461c65da923ace0 (patch)
tree9ab2e58e00661641d8c74cceb750731b27db0ee2
parent68e94a2e7e96f99b4659cf6ab3427c0971fb4b7b (diff)
On FreeBSD, add dependency on epoll-shim library.
FreeBSD doesn't provide timerfd and eventfd functions. These are implemented in 3rd party library called epoll-shim. Link targets requiring these functions to this library.
-rw-r--r--meson.build6
-rw-r--r--spa/examples/meson.build2
-rw-r--r--spa/plugins/alsa/meson.build2
-rw-r--r--spa/plugins/audiotestsrc/meson.build2
-rw-r--r--spa/plugins/support/meson.build4
-rw-r--r--spa/plugins/test/meson.build2
-rw-r--r--spa/plugins/v4l2/meson.build2
-rw-r--r--spa/plugins/videotestsrc/meson.build2
-rw-r--r--spa/tests/meson.build2
-rw-r--r--spa/tools/meson.build4
-rw-r--r--src/daemon/meson.build2
-rw-r--r--src/pipewire/meson.build13
12 files changed, 26 insertions, 17 deletions
diff --git a/meson.build b/meson.build
index 83423040..2734b0d2 100644
--- a/meson.build
+++ b/meson.build
@@ -207,8 +207,12 @@ if get_option('gstreamer')
dependency('gstreamer-allocators-1.0'),]
endif
-subdir('spa')
+# On FreeBSD, epoll-shim library is required for eventfd() and timerfd()
+epoll_shim_dep = (build_machine.system() == 'freebsd'
+ ? dependency('epoll-shim', required: true)
+ : dependency('', required: false))
+subdir('spa')
subdir('src')
if get_option('pipewire-jack')
diff --git a/spa/examples/meson.build b/spa/examples/meson.build
index a390b5ee..9accaef4 100644
--- a/spa/examples/meson.build
+++ b/spa/examples/meson.build
@@ -7,5 +7,5 @@ endif
executable('example-control', 'example-control.c',
include_directories : [spa_inc ],
- dependencies : [dl_lib, pthread_lib, mathlib],
+ dependencies : [dl_lib, pthread_lib, mathlib, epoll_shim_dep],
install : false)
diff --git a/spa/plugins/alsa/meson.build b/spa/plugins/alsa/meson.build
index 11bf9c51..b3169036 100644
--- a/spa/plugins/alsa/meson.build
+++ b/spa/plugins/alsa/meson.build
@@ -10,6 +10,6 @@ spa_alsa_sources = ['alsa.c',
spa_alsa = shared_library('spa-alsa',
spa_alsa_sources,
include_directories : [spa_inc],
- dependencies : [ alsa_dep, libudev_dep, mathlib ],
+ dependencies : [ alsa_dep, libudev_dep, mathlib, epoll_shim_dep ],
install : true,
install_dir : '@0@/spa/alsa'.format(get_option('libdir')))
diff --git a/spa/plugins/audiotestsrc/meson.build b/spa/plugins/audiotestsrc/meson.build
index 1a3d14ce..4c313d83 100644
--- a/spa/plugins/audiotestsrc/meson.build
+++ b/spa/plugins/audiotestsrc/meson.build
@@ -3,6 +3,6 @@ audiotestsrc_sources = ['audiotestsrc.c', 'plugin.c']
audiotestsrclib = shared_library('spa-audiotestsrc',
audiotestsrc_sources,
include_directories : [spa_inc],
- dependencies : mathlib,
+ dependencies : [mathlib, epoll_shim_dep],
install : true,
install_dir : '@0@/spa/audiotestsrc'.format(get_option('libdir')))
diff --git a/spa/plugins/support/meson.build b/spa/plugins/support/meson.build
index 77f29781..08462567 100644
--- a/spa/plugins/support/meson.build
+++ b/spa/plugins/support/meson.build
@@ -8,7 +8,7 @@ spa_support_lib = shared_library('spa-support',
spa_support_sources,
c_args : [ '-D_GNU_SOURCE' ],
include_directories : [ spa_inc ],
- dependencies : [ pthread_lib ],
+ dependencies : [ pthread_lib, epoll_shim_dep ],
install : true,
install_dir : '@0@/spa/support'.format(get_option('libdir')))
@@ -35,6 +35,6 @@ spa_dbus_sources = ['dbus.c']
spa_dbus_lib = shared_library('spa-dbus',
spa_dbus_sources,
include_directories : [ spa_inc],
- dependencies : dbus_dep,
+ dependencies : [dbus_dep, epoll_shim_dep],
install : true,
install_dir : '@0@/spa/support'.format(get_option('libdir')))
diff --git a/spa/plugins/test/meson.build b/spa/plugins/test/meson.build
index 852f16d0..ec10a5e1 100644
--- a/spa/plugins/test/meson.build
+++ b/spa/plugins/test/meson.build
@@ -3,6 +3,6 @@ test_sources = ['fakesrc.c', 'fakesink.c', 'plugin.c']
testlib = shared_library('spa-test',
test_sources,
include_directories : [ spa_inc],
- dependencies : pthread_lib,
+ dependencies : [pthread_lib, epoll_shim_dep],
install : true,
install_dir : '@0@/spa/test'.format(get_option('libdir')))
diff --git a/spa/plugins/v4l2/meson.build b/spa/plugins/v4l2/meson.build
index 802b61bb..bd95f258 100644
--- a/spa/plugins/v4l2/meson.build
+++ b/spa/plugins/v4l2/meson.build
@@ -6,6 +6,6 @@ v4l2_sources = ['v4l2.c',
v4l2lib = shared_library('spa-v4l2',
v4l2_sources,
include_directories : [ spa_inc ],
- dependencies : [ libudev_dep ],
+ dependencies : [ libudev_dep, epoll_shim_dep ],
install : true,
install_dir : '@0@/spa/v4l2'.format(get_option('libdir')))
diff --git a/spa/plugins/videotestsrc/meson.build b/spa/plugins/videotestsrc/meson.build
index cf73f4d0..8207a8a5 100644
--- a/spa/plugins/videotestsrc/meson.build
+++ b/spa/plugins/videotestsrc/meson.build
@@ -3,6 +3,6 @@ videotestsrc_sources = ['videotestsrc.c', 'plugin.c']
videotestsrclib = shared_library('spa-videotestsrc',
videotestsrc_sources,
include_directories : [ spa_inc],
- dependencies : pthread_lib,
+ dependencies : [pthread_lib, epoll_shim_dep],
install : true,
install_dir : '@0@/spa/videotestsrc'.format(get_option('libdir')))
diff --git a/spa/tests/meson.build b/spa/tests/meson.build
index e6f9c68d..e108836a 100644
--- a/spa/tests/meson.build
+++ b/spa/tests/meson.build
@@ -20,7 +20,7 @@ endforeach
if have_cpp
test_cpp = executable('spa-test-cpp', 'test-cpp.cpp',
include_directories : [spa_inc ],
- dependencies : [],
+ dependencies : [epoll_shim_dep],
install : false)
test('spa-test-cpp', test_cpp)
endif
diff --git a/spa/tools/meson.build b/spa/tools/meson.build
index fe4f2e7a..8a18ca8f 100644
--- a/spa/tools/meson.build
+++ b/spa/tools/meson.build
@@ -1,9 +1,9 @@
executable('spa-inspect', 'spa-inspect.c',
include_directories : [spa_inc],
- dependencies : [dl_lib],
+ dependencies : [dl_lib, epoll_shim_dep],
install : true)
executable('spa-monitor', 'spa-monitor.c',
include_directories : [spa_inc],
- dependencies : [dl_lib],
+ dependencies : [dl_lib, epoll_shim_dep],
install : true)
diff --git a/src/daemon/meson.build b/src/daemon/meson.build
index 17155952..451009b9 100644
--- a/src/daemon/meson.build
+++ b/src/daemon/meson.build
@@ -30,7 +30,7 @@ executable('pipewire',
install: true,
c_args : pipewire_c_args,
include_directories : [configinc, spa_inc],
- dependencies : [pipewire_dep],
+ dependencies : [pipewire_dep, epoll_shim_dep],
)
if get_option('systemd') and systemd.found()
diff --git a/src/pipewire/meson.build b/src/pipewire/meson.build
index f929796a..2c3cf190 100644
--- a/src/pipewire/meson.build
+++ b/src/pipewire/meson.build
@@ -75,10 +75,15 @@ install_headers(pipewire_headers, subdir : 'pipewire')
libpipewire_c_args = [
'-DHAVE_CONFIG_H',
- '-D_GNU_SOURCE',
- '-D_POSIX_C_SOURCE',
]
+if build_machine.system() != 'freebsd'
+ libpipewire_c_args += [
+ '-D_GNU_SOURCE',
+ '-D_POSIX_C_SOURCE'
+ ]
+endif
+
libpipewire_name = 'pipewire-@0@'.format(apiversion)
libpipewire = shared_library(libpipewire_name, pipewire_sources,
version : libversion,
@@ -86,12 +91,12 @@ libpipewire = shared_library(libpipewire_name, pipewire_sources,
c_args : libpipewire_c_args,
include_directories : [pipewire_inc, configinc, spa_inc],
install : true,
- dependencies : [dl_lib, mathlib, pthread_lib],
+ dependencies : [dl_lib, mathlib, pthread_lib, epoll_shim_dep],
)
pipewire_dep = declare_dependency(link_with : libpipewire,
include_directories : [pipewire_inc, configinc, spa_inc],
- dependencies : [pthread_lib],
+ dependencies : [pthread_lib, epoll_shim_dep],
)
pkgconfig.generate(filebase : 'lib@0@'.format(libpipewire_name),