aboutsummaryrefslogtreecommitdiff
path: root/libpam
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 /libpam
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 'libpam')
-rw-r--r--libpam/include/meson.build3
-rw-r--r--libpam/include/security/meson.build10
-rw-r--r--libpam/meson.build73
3 files changed, 86 insertions, 0 deletions
diff --git a/libpam/include/meson.build b/libpam/include/meson.build
new file mode 100644
index 00000000..1bf46f3b
--- /dev/null
+++ b/libpam/include/meson.build
@@ -0,0 +1,3 @@
+configure_file(output: 'config.h', configuration: cdata)
+
+subdir('security')
diff --git a/libpam/include/security/meson.build b/libpam/include/security/meson.build
new file mode 100644
index 00000000..1a712c9f
--- /dev/null
+++ b/libpam/include/security/meson.build
@@ -0,0 +1,10 @@
+install_headers([
+ '_pam_compat.h',
+ '_pam_macros.h',
+ '_pam_types.h',
+ 'pam_appl.h',
+ 'pam_ext.h',
+ 'pam_modules.h',
+ 'pam_modutil.h',
+ ],
+ install_dir: includedir)
diff --git a/libpam/meson.build b/libpam/meson.build
new file mode 100644
index 00000000..3e8a531c
--- /dev/null
+++ b/libpam/meson.build
@@ -0,0 +1,73 @@
+subdir('include')
+
+libpam_src = [
+ 'pam_account.c',
+ 'pam_audit.c',
+ 'pam_auth.c',
+ 'pam_data.c',
+ 'pam_delay.c',
+ 'pam_dispatch.c',
+ 'pam_dynamic.c',
+ 'pam_end.c',
+ 'pam_env.c',
+ 'pam_get_authtok.c',
+ 'pam_handlers.c',
+ 'pam_item.c',
+ 'pam_misc.c',
+ 'pam_modutil_check_user.c',
+ 'pam_modutil_cleanup.c',
+ 'pam_modutil_getgrgid.c',
+ 'pam_modutil_getgrnam.c',
+ 'pam_modutil_getlogin.c',
+ 'pam_modutil_getpwnam.c',
+ 'pam_modutil_getpwuid.c',
+ 'pam_modutil_getspnam.c',
+ 'pam_modutil_ingroup.c',
+ 'pam_modutil_ioloop.c',
+ 'pam_modutil_priv.c',
+ 'pam_modutil_sanitize.c',
+ 'pam_modutil_searchkey.c',
+ 'pam_password.c',
+ 'pam_prelude.c',
+ 'pam_session.c',
+ 'pam_start.c',
+ 'pam_strerror.c',
+ 'pam_syslog.c',
+ 'pam_vprompt.c',
+]
+
+libpam_version = '0.85.1'
+libpam_map = 'libpam.map'
+libpam_map_path = meson.current_source_dir() / libpam_map
+
+libpam_link_deps = [libpam_map]
+libpam_link_args = ['-Wl,--version-script=' + libpam_map_path]
+
+libpam = shared_library(
+ 'pam',
+ sources: libpam_src,
+ include_directories: [libpam_inc],
+ c_args: [
+ '-DDEFAULT_MODULE_PATH="@0@/"'.format(securedir),
+ '-DLIBPAM_COMPILE',
+ ],
+ dependencies: [libpam_internal_dep, libaudit, libeconf, libdl, libintl],
+ link_depends: libpam_link_deps,
+ link_args: libpam_link_args,
+ version: libpam_version,
+ install: true,
+)
+
+libpam_dep = declare_dependency(
+ include_directories: [libpam_inc],
+ link_with: [libpam],
+)
+
+pkgconfig.generate(
+ libpam,
+ description: 'The primary Linux-PAM library. It is used by PAM modules and PAM-aware applications.',
+ name: 'PAM',
+ filebase: 'pam',
+ version: meson.project_version(),
+ url: 'http://www.linux-pam.org/'
+)