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. --- xtests/meson.build | 70 ++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 70 insertions(+) create mode 100644 xtests/meson.build (limited to 'xtests') diff --git a/xtests/meson.build b/xtests/meson.build new file mode 100644 index 00000000..96b2612f --- /dev/null +++ b/xtests/meson.build @@ -0,0 +1,70 @@ +xtest_progs = [ + 'tst-pam_access1', + 'tst-pam_access2', + 'tst-pam_access3', + 'tst-pam_access4', + 'tst-pam_authfail', + 'tst-pam_authsucceed', + 'tst-pam_dispatch1', + 'tst-pam_dispatch2', + 'tst-pam_dispatch3', + 'tst-pam_dispatch4', + 'tst-pam_dispatch5', + 'tst-pam_group1', + 'tst-pam_limits1', + 'tst-pam_motd', + 'tst-pam_pwhistory1', + 'tst-pam_shells', + 'tst-pam_succeed_if1', + 'tst-pam_time1', + 'tst-pam_unix1', + 'tst-pam_unix2', + 'tst-pam_unix3', + 'tst-pam_unix4', +] + +foreach prog: xtest_progs + tst_exe = executable( + prog, + sources: prog + '.c', + c_args: ['-DLIBPAM_COMPILE'], + link_args: exe_link_args, + include_directories: [libpamc_inc], + dependencies: [libpam_dep, libpam_misc_dep], + ) + + test( + 'xtests ' + prog, + chdir_meson_build_subdir, + args: [ + files('run-xtests.sh'), + meson.current_source_dir(), + fs.name(tst_exe), + ], + env: ['MESON_BUILD_SUBDIR=' + meson.current_build_dir()], + is_parallel: false, + ) +endforeach + +xtest_scripts = [ + 'tst-pam_assemble_line1', + 'tst-pam_substack1', + 'tst-pam_substack2', + 'tst-pam_substack3', + 'tst-pam_substack4', + 'tst-pam_substack5', +] + +foreach name: xtest_scripts + test( + 'xtests ' + name, + chdir_meson_build_subdir, + args: [ + files('run-xtests.sh'), + meson.current_source_dir(), + name, + ], + env: ['MESON_BUILD_SUBDIR=' + meson.current_build_dir()], + is_parallel: false, + ) +endforeach -- cgit v1.2.3