diff options
author | Dmitry V. Levin <ldv@strace.io> | 2024-09-01 08:00:00 +0000 |
---|---|---|
committer | Dmitry V. Levin <ldv@strace.io> | 2024-09-10 08:00:00 +0000 |
commit | 7fb6beed01bc1a59438b8b2a9b34b2dba296e553 (patch) | |
tree | 2f6ae951c4d94d331e29e348e6ffd9846687be33 /tests | |
parent | aa3e91322cbc651bb130ec8636b28d676979d4fe (diff) | |
download | pam-7fb6beed01bc1a59438b8b2a9b34b2dba296e553.tar.gz pam-7fb6beed01bc1a59438b8b2a9b34b2dba296e553.tar.bz2 pam-7fb6beed01bc1a59438b8b2a9b34b2dba296e553.zip |
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.
Diffstat (limited to 'tests')
-rw-r--r-- | tests/meson.build | 47 |
1 files changed, 47 insertions, 0 deletions
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 |