From 7fb6beed01bc1a59438b8b2a9b34b2dba296e553 Mon Sep 17 00:00:00 2001 From: "Dmitry V. Levin" Date: Sun, 1 Sep 2024 08:00:00 +0000 Subject: meson: build Linux-PAM using meson On my non-representative hardware, the full build using autotools (./autogen.sh && CFLAGS=-O2 ./configure && make -j`nproc` && make -j`nproc` install) takes about 45 seconds. On the same hardware, the full build using meson (meson setup -Doptimization=2 dir && meson compile -C dir && meson install -C dir) takes just about 7.5 seconds. --- tests/meson.build | 47 +++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 47 insertions(+) create mode 100644 tests/meson.build (limited to 'tests') diff --git a/tests/meson.build b/tests/meson.build new file mode 100644 index 00000000..4d37e450 --- /dev/null +++ b/tests/meson.build @@ -0,0 +1,47 @@ +foreach name: ['dlopen', + 'pam_start', + 'pam_end', + 'pam_fail_delay', + 'pam_open_session', + 'pam_close_session', + 'pam_acct_mgmt', + 'pam_authenticate', + 'pam_chauthtok', + 'pam_setcred', + 'pam_get_item', + 'pam_set_item', + 'pam_getenvlist', + 'pam_get_user', + 'pam_get_data', + 'pam_set_data', + 'pam_mkargv', + 'pam_start_confdir', + ] + tst_deps = [libpam_internal_dep, libpam_dep] + if name == 'dlopen' + tst_deps += libdl + endif + tst_name = 'tst-' + name + + tst_exe = executable( + tst_name, + sources: tst_name + '.c', + dependencies: tst_deps, + include_directories: [libpam_private_inc], + c_args: ['-DLIBPAM_COMPILE'], + link_args: exe_link_args, + ) + + if name == 'dlopen' + tst_dlopen = tst_exe + endif + + test( + tst_name, + chdir_meson_build_subdir, + args: [tst_exe], + env: ['MESON_BUILD_SUBDIR=' + meson.current_build_dir(), + 'srcdir=' + meson.current_source_dir() + ], + ) +endforeach -- cgit v1.2.3