Skip to content

Commit e36e8c7

Browse files
committed
configure, meson: convert libpmem detection to meson
Reviewed-by: Daniel P. Berrangé <[email protected]> Signed-off-by: Paolo Bonzini <[email protected]>
1 parent 83ef168 commit e36e8c7

File tree

3 files changed

+10
-24
lines changed

3 files changed

+10
-24
lines changed

configure

+4-20
Original file line numberDiff line numberDiff line change
@@ -427,7 +427,7 @@ qed=${default_feature:-yes}
427427
parallels=${default_feature:-yes}
428428
libxml2="$default_feature"
429429
debug_mutex="no"
430-
libpmem="$default_feature"
430+
libpmem="auto"
431431
default_devices="true"
432432
plugins="no"
433433
fuzzing="no"
@@ -1504,9 +1504,9 @@ for opt do
15041504
;;
15051505
--disable-debug-mutex) debug_mutex=no
15061506
;;
1507-
--enable-libpmem) libpmem=yes
1507+
--enable-libpmem) libpmem=disabled
15081508
;;
1509-
--disable-libpmem) libpmem=no
1509+
--disable-libpmem) libpmem=enabled
15101510
;;
15111511
--enable-xkbcommon) xkbcommon="enabled"
15121512
;;
@@ -4933,22 +4933,6 @@ EOF
49334933
fi
49344934
fi
49354935

4936-
##########################################
4937-
# check for libpmem
4938-
4939-
if test "$libpmem" != "no"; then
4940-
if $pkg_config --exists "libpmem"; then
4941-
libpmem="yes"
4942-
libpmem_libs=$($pkg_config --libs libpmem)
4943-
libpmem_cflags=$($pkg_config --cflags libpmem)
4944-
else
4945-
if test "$libpmem" = "yes" ; then
4946-
feature_not_found "libpmem" "Install nvml or pmdk"
4947-
fi
4948-
libpmem="no"
4949-
fi
4950-
fi
4951-
49524936
##########################################
49534937
# check for slirp
49544938

@@ -6087,7 +6071,7 @@ if test "$skip_meson" = no; then
60876071
-Dcurl=$curl -Dglusterfs=$glusterfs -Dbzip2=$bzip2 -Dlibiscsi=$libiscsi \
60886072
-Dlibnfs=$libnfs -Diconv=$iconv -Dcurses=$curses -Dlibudev=$libudev\
60896073
-Drbd=$rbd -Dlzo=$lzo -Dsnappy=$snappy -Dlzfse=$lzfse \
6090-
-Dlibdaxctl=$libdaxctl \
6074+
-Dlibdaxctl=$libdaxctl -Dlibpmem=$libpmem \
60916075
-Dgnutls=$gnutls -Dnettle=$nettle -Dgcrypt=$gcrypt -Dauth_pam=$auth_pam \
60926076
-Dzstd=$zstd -Dseccomp=$seccomp -Dvirtfs=$virtfs -Dcap_ng=$cap_ng \
60936077
-Dattr=$attr -Ddefault_devices=$default_devices -Dvirglrenderer=$virglrenderer \

meson.build

+4-4
Original file line numberDiff line numberDiff line change
@@ -1006,9 +1006,9 @@ if not get_option('libusb').auto() or have_system
10061006
endif
10071007

10081008
libpmem = not_found
1009-
if 'CONFIG_LIBPMEM' in config_host
1010-
libpmem = declare_dependency(compile_args: config_host['LIBPMEM_CFLAGS'].split(),
1011-
link_args: config_host['LIBPMEM_LIBS'].split())
1009+
if not get_option('libpmem').auto() or have_system
1010+
libpmem = dependency('libpmem', required: get_option('libpmem'),
1011+
method: 'pkg-config', kwargs: static_kwargs)
10121012
endif
10131013
libdaxctl = not_found
10141014
if not get_option('libdaxctl').auto() or have_system
@@ -2822,7 +2822,7 @@ summary_info += {'zstd support': zstd.found()}
28222822
summary_info += {'NUMA host support': config_host.has_key('CONFIG_NUMA')}
28232823
summary_info += {'libxml2': config_host.has_key('CONFIG_LIBXML2')}
28242824
summary_info += {'capstone': capstone_opt == 'disabled' ? false : capstone_opt}
2825-
summary_info += {'libpmem support': config_host.has_key('CONFIG_LIBPMEM')}
2825+
summary_info += {'libpmem support': libpmem.found()}
28262826
summary_info += {'libdaxctl support': libdaxctl.found()}
28272827
summary_info += {'libudev': libudev.found()}
28282828
summary_info += {'FUSE lseek': fuse_lseek.found()}

meson_options.txt

+2
Original file line numberDiff line numberDiff line change
@@ -86,6 +86,8 @@ option('gcrypt', type : 'feature', value : 'auto',
8686
description: 'libgcrypt cryptography support')
8787
option('libdaxctl', type : 'feature', value : 'auto',
8888
description: 'libdaxctl support')
89+
option('libpmem', type : 'feature', value : 'auto',
90+
description: 'libpmem support')
8991
option('libudev', type : 'feature', value : 'auto',
9092
description: 'Use libudev to enumerate host devices')
9193
option('libusb', type : 'feature', value : 'auto',

0 commit comments

Comments
 (0)