############################################################
+# binaries that have --help and are intended for use by humans,
+# usually, but not always, installed in /bin.
+public_programs = []
+
+subdir('src/libudev')
+subdir('src/shared')
+subdir('src/core')
+subdir('src/udev')
+subdir('src/network')
+
+subdir('src/analyze')
+subdir('src/journal-remote')
+subdir('src/coredump')
+subdir('src/hostname')
+subdir('src/import')
+subdir('src/kernel-install')
+subdir('src/locale')
+subdir('src/machine')
+subdir('src/nspawn')
+subdir('src/resolve')
+subdir('src/timedate')
+subdir('src/timesync')
+subdir('src/vconsole')
+subdir('src/sulogin-shell')
+subdir('src/boot/efi')
+
+subdir('src/test')
+subdir('test')
+
+############################################################
+
+# only static linking apart from libdl, to make sure that the
+# module is linked to all libraries that it uses.
+test_dlopen = executable(
+ 'test-dlopen',
+ test_dlopen_c,
+ include_directories : includes,
+ link_with : [libbasic],
+ dependencies : [libdl])
+
foreach tuple : [['myhostname', 'HAVE_MYHOSTNAME', []],
['systemd', '', []],
['mymachines', 'ENABLE_MACHINED', []],
sym = 'src/nss-@0@/nss-@0@.sym'.format(module)
version_script_arg = join_paths(meson.current_source_dir(), sym)
- shared_library(
+ nss = shared_library(
'nss_' + module,
'src/nss-@0@/nss-@0@.c'.format(module),
version : '2',
meson.add_install_script('sh', '-c',
'rm $DESTDIR@0@/libnss_@1@.so'
.format(rootlibdir, module))
+
+ test('dlopen-nss_' + module,
+ test_dlopen,
+ args : [nss.full_path()]) # path to dlopen must include a slash
endif
endforeach
############################################################
-# binaries that have --help and are intended for use by humans,
-# usually, but not always, installed in /bin.
-public_programs = []
-
-subdir('src/libudev')
-subdir('src/shared')
-subdir('src/core')
-subdir('src/udev')
-subdir('src/network')
-
-subdir('src/analyze')
-subdir('src/journal-remote')
-subdir('src/coredump')
-subdir('src/hostname')
-subdir('src/import')
-subdir('src/kernel-install')
-subdir('src/locale')
-subdir('src/machine')
-subdir('src/nspawn')
-subdir('src/resolve')
-subdir('src/timedate')
-subdir('src/timesync')
-subdir('src/vconsole')
-subdir('src/sulogin-shell')
-subdir('src/boot/efi')
-
-subdir('src/test')
-subdir('test')
-
executable('systemd',
systemd_sources,
include_directories : includes,
if conf.get('HAVE_PAM', 0) == 1
version_script_arg = join_paths(meson.current_source_dir(), pam_systemd_sym)
- shared_library(
+ pam_systemd = shared_library(
'pam_systemd',
pam_systemd_c,
name_prefix : '',
link_depends : pam_systemd_sym,
install : true,
install_dir : pamlibdir)
+
+ test('dlopen-pam_systemd',
+ test_dlopen,
+ args : [pam_systemd.full_path()]) # path to dlopen must include a slash
endif
endif
--- /dev/null
+/***
+ This file is part of systemd.
+
+ Copyright 2016 Zbigniew Jędrzejewski-Szmek
+
+ systemd is free software; you can redistribute it and/or modify it
+ under the terms of the GNU Lesser General Public License as published by
+ the Free Software Foundation; either version 2.1 of the License, or
+ (at your option) any later version.
+
+ systemd is distributed in the hope that it will be useful, but
+ WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public License
+ along with systemd; If not, see <http://www.gnu.org/licenses/>.
+***/
+
+#include <dlfcn.h>
+#include <stdlib.h>
+
+#include "macro.h"
+
+int main(int argc, char **argv) {
+ void *handle;
+
+ assert_se((handle = dlopen(argv[1], RTLD_NOW)));
+ assert_se(dlclose(handle) == 0);
+
+ return EXIT_SUCCESS;
+}