]> git.proxmox.com Git - mirror_qemu.git/commitdiff
meson: convert authz directory to Meson
authorMarc-André Lureau <marcandre.lureau@redhat.com>
Mon, 15 Jul 2019 18:54:34 +0000 (22:54 +0400)
committerPaolo Bonzini <pbonzini@redhat.com>
Fri, 21 Aug 2020 10:30:15 +0000 (06:30 -0400)
Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Makefile
Makefile.objs
Makefile.target
authz/Makefile.objs [deleted file]
authz/meson.build [new file with mode: 0644]
meson.build

index 4b152e3587fa2549b5fcb0458e19662e3c95479f..d380271765e8bf7c44c0e3420e3a172b90abe09b 100644 (file)
--- a/Makefile
+++ b/Makefile
@@ -241,7 +241,6 @@ include $(SRC_PATH)/Makefile.objs
 endif
 
 dummy := $(call unnest-vars,, \
-                authz-obj-y \
                 chardev-obj-y \
                 block-obj-y \
                 block-obj-m \
index 84bfa2a61a494c934b9d18c9ce27b80fb019258e..0bc361d338496d255b1ea202a1fbf823995abc55 100644 (file)
@@ -9,7 +9,8 @@ ifeq ($(call lor,$(CONFIG_SOFTMMU),$(CONFIG_TOOLS)),y)
 
 chardev-obj-y = chardev/
 
-authz-obj-y = authz/
+authz-obj-y = authz/libauthz.fa
+authz/libauthz.fa-libs = $(if $(CONFIG_AUTH_PAM),-lpam)
 
 block-obj-y = block/ nbd/ scsi/
 block-obj-y += block.o blockjob.o job.o
index 1e04551a8e71d98ab098ccefea8a10321e32de30..79b6e02bed9f2067f126685671da1acbf1f1d441 100644 (file)
@@ -192,9 +192,9 @@ common-obj-m :=
 
 include $(SRC_PATH)/Makefile.objs
 dummy := $(call fix-paths,../,, \
+              authz-obj-y \
               qom-obj-y)
 dummy := $(call unnest-vars,.., \
-               authz-obj-y \
                block-obj-y \
                block-obj-m \
                chardev-obj-y \
diff --git a/authz/Makefile.objs b/authz/Makefile.objs
deleted file mode 100644 (file)
index ed7b273..0000000
+++ /dev/null
@@ -1,7 +0,0 @@
-authz-obj-y += base.o
-authz-obj-y += simple.o
-authz-obj-y += list.o
-authz-obj-y += listfile.o
-authz-obj-$(CONFIG_AUTH_PAM) += pamacct.o
-
-pamacct.o-libs = -lpam
diff --git a/authz/meson.build b/authz/meson.build
new file mode 100644 (file)
index 0000000..516d71f
--- /dev/null
@@ -0,0 +1,19 @@
+authz_ss = ss.source_set()
+authz_ss.add(genh)
+authz_ss.add(files(
+  'base.c',
+  'list.c',
+  'listfile.c',
+  'simple.c',
+))
+
+authz_ss.add(when: ['CONFIG_AUTH_PAM', pam], if_true: files('pamacct.c'))
+
+authz_ss = authz_ss.apply(config_host, strict: false)
+libauthz = static_library('authz', authz_ss.sources() + genh,
+                          dependencies: [authz_ss.dependencies()],
+                          name_suffix: 'fa',
+                          build_by_default: false)
+
+authz = declare_dependency(link_whole: libauthz,
+                           dependencies: qom)
index 658d45c4c600e1ec61232d422ad96d5f33ea6a3b..34363bff19b17ff241acaa5f9f4e9ab80f1a916b 100644 (file)
@@ -103,6 +103,10 @@ if 'CONFIG_GNUTLS' in config_host
 endif
 pixman = declare_dependency(compile_args: config_host['PIXMAN_CFLAGS'].split(),
                             link_args: config_host['PIXMAN_LIBS'].split())
+pam = not_found
+if 'CONFIG_AUTH_PAM' in config_host
+  pam = cc.find_library('pam')
+endif
 libattr = not_found
 if 'CONFIG_ATTR' in config_host
   libattr = declare_dependency(link_args: config_host['LIBATTR_LIBS'].split())
@@ -341,6 +345,7 @@ qemuutil = declare_dependency(link_with: libqemuutil,
                               sources: genh + version_res)
 
 subdir('qom')
+subdir('authz')
 subdir('fsdev')
 
 # Other build targets