aboutsummaryrefslogtreecommitdiff
path: root/libpamc
diff options
context:
space:
mode:
authorDmitry V. Levin <ldv@strace.io>2024-09-01 08:00:00 +0000
committerDmitry V. Levin <ldv@strace.io>2024-09-10 08:00:00 +0000
commit7fb6beed01bc1a59438b8b2a9b34b2dba296e553 (patch)
tree2f6ae951c4d94d331e29e348e6ffd9846687be33 /libpamc
parentaa3e91322cbc651bb130ec8636b28d676979d4fe (diff)
downloadpam-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 'libpamc')
-rw-r--r--libpamc/include/security/meson.build1
-rw-r--r--libpamc/meson.build36
2 files changed, 37 insertions, 0 deletions
diff --git a/libpamc/include/security/meson.build b/libpamc/include/security/meson.build
new file mode 100644
index 00000000..f82fea09
--- /dev/null
+++ b/libpamc/include/security/meson.build
@@ -0,0 +1 @@
+install_headers('pam_client.h', install_dir: includedir)
diff --git a/libpamc/meson.build b/libpamc/meson.build
new file mode 100644
index 00000000..f5da0679
--- /dev/null
+++ b/libpamc/meson.build
@@ -0,0 +1,36 @@
+subdir('include/security')
+
+libpamc_src = [
+ 'pamc_client.c',
+ 'pamc_converse.c',
+ 'pamc_load.c',
+]
+
+libpamc_inc = include_directories('include')
+
+libpamc_version = '0.82.1'
+libpamc_map = 'libpamc.map'
+libpamc_map_path = meson.current_source_dir() / libpamc_map
+
+libpamc_link_deps = [libpamc_map]
+libpamc_link_args = ['-Wl,--version-script=' + libpamc_map_path]
+
+libpamc = shared_library(
+ 'pamc',
+ sources: libpamc_src,
+ include_directories: [libpam_inc, libpamc_inc],
+ dependencies: [libpam_internal_dep],
+ link_depends: libpamc_link_deps,
+ link_args: libpamc_link_args,
+ version: libpamc_version,
+ install: true,
+)
+
+pkgconfig.generate(
+ libpamc,
+ description: 'The PAM client API library and binary prompt support. Rarely used.',
+ name: 'libpamc',
+ filebase: 'pamc',
+ version: meson.project_version(),
+ url: 'http://www.linux-pam.org/'
+)