From nobody Sun Feb 8 19:35:29 2026 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of redhat.com designates 205.139.110.120 as permitted sender) client-ip=205.139.110.120; envelope-from=libvir-list-bounces@redhat.com; helo=us-smtp-1.mimecast.com; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 205.139.110.120 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1594893704; cv=none; d=zohomail.com; s=zohoarc; b=IPjhZSbmW6/2xh7ztEeirP7Aw85qfvGoDuWUQU/o+nf/kBZBjIGqcnigK+xvgrmGHTisvRUQHJobE72a3Rw6XCKOHpGkJS7lvMn/p4w447WDtMS2KR2VYqrQfexWL4QDVxs5zFpxwM4s3xZIipUadMZMvXkbxyOyhl8hvkTudhI= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1594893704; h=Content-Type:Content-Transfer-Encoding:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=V2ed4jGgBsNj7y79WZSJad8/fzTGLUB0a8E1dfyKT6U=; b=AYhJZPkDPz+60XA/9k6ZM997wZb0e8UMmXzCkhhE0gWG8wnlyJR6N23lvOszEjZp9dvQhAKLQib10YsCFsPUmG/mM64mBQBS6X3oma4/vVH6Jm1rd46vu6ZBuGSjKtDEkLoubzzeqEiyF09t1U0adl8Z3DAgG7KvDUgIdk3DWwM= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 205.139.110.120 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass header.from= (p=none dis=none) header.from= Return-Path: Received: from us-smtp-1.mimecast.com (us-smtp-delivery-1.mimecast.com [205.139.110.120]) by mx.zohomail.com with SMTPS id 1594893704001790.1190550370101; Thu, 16 Jul 2020 03:01:44 -0700 (PDT) Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-15-aPPV1AF7OVipTu1r-QpbvQ-1; Thu, 16 Jul 2020 06:00:39 -0400 Received: from smtp.corp.redhat.com (int-mx04.intmail.prod.int.phx2.redhat.com [10.5.11.14]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id C2ABB8027F1; Thu, 16 Jul 2020 10:00:33 +0000 (UTC) Received: from colo-mx.corp.redhat.com (colo-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.20]) by smtp.corp.redhat.com (Postfix) with ESMTPS id A32CE78A5C; Thu, 16 Jul 2020 10:00:33 +0000 (UTC) Received: from lists01.pubmisc.prod.ext.phx2.redhat.com (lists01.pubmisc.prod.ext.phx2.redhat.com [10.5.19.33]) by colo-mx.corp.redhat.com (Postfix) with ESMTP id 70A4B1800FF0; Thu, 16 Jul 2020 10:00:33 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx08.intmail.prod.int.phx2.redhat.com [10.5.11.23]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id 06GA0Ta7015266 for ; Thu, 16 Jul 2020 06:00:29 -0400 Received: by smtp.corp.redhat.com (Postfix) id D91C32B6E2; Thu, 16 Jul 2020 10:00:29 +0000 (UTC) Received: from antique-work.redhat.com (unknown [10.40.194.85]) by smtp.corp.redhat.com (Postfix) with ESMTP id 5406C2B6DC for ; Thu, 16 Jul 2020 10:00:29 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1594893701; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references:list-id:list-help: list-unsubscribe:list-subscribe:list-post; bh=V2ed4jGgBsNj7y79WZSJad8/fzTGLUB0a8E1dfyKT6U=; b=URmbrELcj0qTvEEbfiOpUqnxaeVM3Fl9EYf/eOmaCxJ5xpMS0m4Heamvr4TDuomOBtiJZF 3mZkXzBbgZ9pDZEJzXyd7kwnOYoVz243cQcFmashN8fcaVD75FqXCmlaOyf5o8I56ebl9U EHFlQXPPMivJWBpF1StQmK6pApUB1aE= X-MC-Unique: aPPV1AF7OVipTu1r-QpbvQ-1 From: Pavel Hrdina To: libvir-list@redhat.com Subject: [libvirt PATCH 010/351] meson: introduce meson build files Date: Thu, 16 Jul 2020 11:54:06 +0200 Message-Id: In-Reply-To: References: MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.84 on 10.5.11.23 X-loop: libvir-list@redhat.com X-BeenThere: libvir-list@redhat.com X-Mailman-Version: 2.1.12 Precedence: junk List-Id: Development discussions about the libvirt library & tools List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: libvir-list-bounces@redhat.com Errors-To: libvir-list-bounces@redhat.com X-Scanned-By: MIMEDefang 2.79 on 10.5.11.14 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=libvir-list-bounces@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @redhat.com) Content-Type: text/plain; charset="utf-8" The PACKAGE* variables are defined by AC_INIT so we have to define explicitly with meson. Signed-off-by: Pavel Hrdina Reviewed-by: J=C3=A1n Tomko --- autogen.sh | 53 ------------------ config.h | 1 + configure.ac | 96 --------------------------------- meson.build | 134 ++++++++++++++++++++++++++++++++++++++++++++++ meson_options.txt | 3 ++ 5 files changed, 138 insertions(+), 149 deletions(-) delete mode 100755 autogen.sh create mode 100644 config.h create mode 100644 meson.build create mode 100644 meson_options.txt diff --git a/autogen.sh b/autogen.sh deleted file mode 100755 index 389f07ef4d2..00000000000 --- a/autogen.sh +++ /dev/null @@ -1,53 +0,0 @@ -#!/bin/sh -# Run this to generate all the initial makefiles, etc. -# -# THe following options must come first. All other or subsequent -# arguments are passed to configure: -# --no-git skip `git submodule update --init` - -test -n "$srcdir" || srcdir=3D$(dirname "$0") -test -n "$srcdir" || srcdir=3D. - -olddir=3D$(pwd) - -cd "$srcdir" - -(test -f src/libvirt.c) || { - echo -n "**Error**: Directory "\`$srcdir\'" does not look like the" - echo " top-level libvirt directory" - exit 1 -} - -if [ "x$1" =3D x--no-git ]; then - shift -else - git submodule update --init || exit 1 -fi - -autoreconf --verbose --force --install || exit 1 - -if test "x$1" =3D "x--system"; then - shift - prefix=3D/usr - libdir=3D$prefix/lib - sysconfdir=3D/etc - localstatedir=3D/var - if [ -d /usr/lib64 ]; then - libdir=3D$prefix/lib64 - fi - EXTRA_ARGS=3D"--prefix=3D$prefix --sysconfdir=3D$sysconfdir --localsta= tedir=3D$localstatedir --libdir=3D$libdir" -fi - -cd "$olddir" - -if [ "$NOCONFIGURE" =3D "" ]; then - $srcdir/configure $EXTRA_ARGS "$@" || exit 1 - - if [ "$1" =3D "--help" ]; then - exit 0 - else - echo "Now type 'make' to compile libvirt" || exit 1 - fi -else - echo "Skipping configure process." -fi diff --git a/config.h b/config.h new file mode 100644 index 00000000000..05cd1507f45 --- /dev/null +++ b/config.h @@ -0,0 +1 @@ +#include diff --git a/configure.ac b/configure.ac index 23074d3badd..a91ed590edd 100644 --- a/configure.ac +++ b/configure.ac @@ -16,16 +16,7 @@ dnl You should have received a copy of the GNU Lesser Ge= neral Public dnl License along with this library. If not, see dnl . =20 -AC_INIT([libvirt], [6.6.0], [libvir-list@redhat.com], [], [https://libvirt= .org]) - -if test $srcdir =3D "." -then - AC_MSG_ERROR([Build directory must be different from source directory]) -fi - -AC_CONFIG_SRCDIR([src/libvirt.c]) AC_CONFIG_AUX_DIR([build-aux]) -AC_CONFIG_HEADERS([config.h]) AH_BOTTOM([#include ]) AC_CONFIG_MACRO_DIR([m4]) dnl Make automake keep quiet about wildcards & other GNUmake-isms @@ -50,61 +41,6 @@ m4_ifndef([AM_SILENT_RULES], =20 AC_CANONICAL_HOST =20 -AC_USE_SYSTEM_EXTENSIONS - -# First extract pieces from the version number string -LIBVIRT_MAJOR_VERSION=3D`echo $VERSION | awk -F. '{print $1}'` -LIBVIRT_MINOR_VERSION=3D`echo $VERSION | awk -F. '{print $2}'` -LIBVIRT_MICRO_VERSION=3D`echo $VERSION | awk -F. '{print $3}'` -LIBVIRT_VERSION=3D$LIBVIRT_MAJOR_VERSION.$LIBVIRT_MINOR_VERSION.$LIBVIRT_M= ICRO_VERSION$LIBVIRT_MICRO_VERSION_SUFFIX -LIBVIRT_VERSION_NUMBER=3D`expr $LIBVIRT_MAJOR_VERSION \* 1000000 + $LIBVIR= T_MINOR_VERSION \* 1000 + $LIBVIRT_MICRO_VERSION` - -# In libtool terminology we need to figure out: -# -# CURRENT -# The most recent interface number that this library implements. -# -# REVISION -# The implementation number of the CURRENT interface. -# -# AGE -# The difference between the newest and oldest interfaces that this -# library implements. -# -# In other words, the library implements all the interface numbers -# in the range from number `CURRENT - AGE' to `CURRENT'. -# -# Libtool assigns the soname version from `CURRENT - AGE', and we -# don't want that to ever change in libvirt. ie it must always be -# zero, to produce libvirt.so.0. -# -# We would, however, like the libvirt version number reflected -# in the so version'd symlinks, and this is based on AGE.REVISION -# eg libvirt.so.0.AGE.REVISION -# -# Assuming we do ever want to break soname version, this can -# toggled. But seriously, don't ever touch this. -LIBVIRT_SONUM=3D0 - -# The following examples show what libtool will do -# -# Input: 0.9.14 -> libvirt.so.0.9.14 -# Input: 1.0.0 -> libvirt.so.0.1000.0 -# Input: 2.5.8 -> libvirt.so.0.2005.8 -# -AGE=3D`expr $LIBVIRT_MAJOR_VERSION '*' 1000 + $LIBVIRT_MINOR_VERSION` -REVISION=3D$LIBVIRT_MICRO_VERSION -CURRENT=3D`expr $LIBVIRT_SONUM + $AGE` -LIBVIRT_VERSION_INFO=3D$CURRENT:$REVISION:$AGE - -AC_SUBST([LIBVIRT_MAJOR_VERSION]) -AC_SUBST([LIBVIRT_MINOR_VERSION]) -AC_SUBST([LIBVIRT_MICRO_VERSION]) -AC_SUBST([LIBVIRT_SONUM]) -AC_SUBST([LIBVIRT_VERSION]) -AC_SUBST([LIBVIRT_VERSION_INFO]) -AC_SUBST([LIBVIRT_VERSION_NUMBER]) - LIBVIRT_ARG_WITH([PACKAGER], [Extra packager name], [no]) LIBVIRT_ARG_WITH([PACKAGER_VERSION], [Extra packager version], [no]) if test "x$with_packager" !=3D "xno" @@ -126,27 +62,6 @@ AC_PROG_CC AC_PROG_INSTALL AC_PROG_CPP =20 -dnl autoconf 2.70 adds a --runstatedir option so that downstreams -dnl can point to /run instead of the historic /var/run, but -dnl autoconf hasn't had a release since 2012. -if test "x$runstatedir" =3D x; then - AC_SUBST([runstatedir], ['${localstatedir}/run']) -fi - -dnl we introduce --with-runstatedir and then overwrite the -dnl value of $runstatedir so configmake.h is more useful -AC_ARG_WITH( - [runstatedir], - [AS_HELP_STRING( - [--with-runstatedir], - [State directory for temporary sockets, pid files, etc])]) - -if test -n "$with_runstatedir" -then - runstatedir=3D$with_runstatedir -fi - - dnl get 64-int interfaces on 32-bit platforms AC_SYS_LARGEFILE =20 @@ -450,17 +365,6 @@ dnl =20 LIBVIRT_CHECK_EXTERNAL_PROGRAMS =20 -dnl if --prefix is /usr, don't use /usr/var for localstatedir -dnl or /usr/etc for sysconfdir -dnl as this makes a lot of things break in testing situations - -if test "$prefix" =3D "/usr" && test "$localstatedir" =3D '${prefix}/var' = ; then - localstatedir=3D'/var' -fi -if test "$prefix" =3D "/usr" && test "$sysconfdir" =3D '${prefix}/etc' ; t= hen - sysconfdir=3D'/etc' -fi - dnl dnl Virtualization drivers check dnl diff --git a/meson.build b/meson.build new file mode 100644 index 00000000000..12a6a14ee58 --- /dev/null +++ b/meson.build @@ -0,0 +1,134 @@ +project( + 'libvirt', 'c', + version: '6.6.0', + license: 'LGPLv2+', + meson_version: '>=3D 0.54.0', + default_options: [ + 'buildtype=3Ddebugoptimized', + 'c_std=3Dgnu99', + ], +) + + +# figure out if we are building from git + +git =3D run_command('test', '-d', '.git').returncode() =3D=3D 0 + +if git and not get_option('no-git') + run_command('git', 'submodule', 'update', '--init') +endif + + +# prepare build configuration data + +conf =3D configuration_data() + +conf.set('_GNU_SOURCE', 1) +conf.set_quoted('abs_top_builddir', meson.build_root()) +conf.set_quoted('abs_top_srcdir', meson.source_root()) +conf.set_quoted('PACKAGE', meson.project_name()) +conf.set_quoted('PACKAGE_NAME', meson.project_name()) +conf.set_quoted('PACKAGE_VERSION', meson.project_version()) +conf.set_quoted('VERSION', meson.project_version()) + + +# set various paths + +if get_option('system') + prefix =3D '/usr' + libdir =3D prefix / 'lib64' + if run_command('test', '-d', libdir).returncode() !=3D 0 + libdir =3D prefix / 'lib' + endif + localstatedir =3D '/var' + sysconfdir =3D '/etc' +else + prefix =3D get_option('prefix') + libdir =3D prefix / get_option('libdir') + localstatedir =3D prefix / get_option('localstatedir') + sysconfdir =3D prefix / get_option('sysconfdir') +endif + +# if --prefix is /usr, don't use /usr/var for localstatedir or /usr/etc for +# sysconfdir as this makes a lot of things break in testing situations +if prefix =3D=3D '/usr' + if localstatedir =3D=3D '/usr/var' + localstatedir =3D '/var' + endif + if sysconfdir =3D=3D '/usr/etc' + sysconfdir =3D '/etc' + endif +endif + +runstatedir =3D get_option('runstatedir') +if runstatedir =3D=3D '' + runstatedir =3D localstatedir / 'run' +endif + +bindir =3D prefix / get_option('bindir') +datadir =3D prefix / get_option('datadir') +includedir =3D prefix / get_option('includedir') +infodir =3D prefix / get_option('infodir') +libexecdir =3D prefix / get_option('libexecdir') +localedir =3D prefix / get_option('localedir') +mandir =3D prefix / get_option('mandir') +sbindir =3D prefix / get_option('sbindir') +sharedstatedir =3D prefix / get_option('sharedstatedir') + +confdir =3D sysconfdir / meson.project_name() +docdir =3D datadir / 'doc' / meson.project_name() +pkgdatadir =3D datadir / meson.project_name() + + +# figure out libvirt version strings + +arr_version =3D meson.project_version().split('.') +libvirt_version_number =3D 1000000 * arr_version[0].to_int() + 1000 * arr_= version[1].to_int() + arr_version[2].to_int() + +conf.set('LIBVIRT_VERSION_NUMBER', libvirt_version_number) + +# In libtool terminology we need to figure out: +# +# CURRENT +# The most recent interface number that this library implements. +# +# REVISION +# The implementation number of the CURRENT interface. +# +# AGE +# The difference between the newest and oldest interfaces that this +# library implements. +# +# In other words, the library implements all the interface numbers +# in the range from number `CURRENT - AGE' to `CURRENT'. +# +# Libtool assigns the soname version from `CURRENT - AGE', and we +# don't want that to ever change in libvirt. ie it must always be +# zero, to produce libvirt.so.0. +# +# We would, however, like the libvirt version number reflected +# in the so version'd symlinks, and this is based on AGE.REVISION +# eg libvirt.so.0.AGE.REVISION +# +# The following examples show what libtool will do +# +# Input: 0.9.14 -> libvirt.so.0.9.14 +# Input: 1.0.0 -> libvirt.so.0.1000.0 +# Input: 2.5.8 -> libvirt.so.0.2005.8 +# +# Assuming we do ever want to break soname version, this can +# toggled. But seriously, don't ever touch this. + +libvirt_so_version =3D 0 +libvirt_age =3D 1000 * arr_version[0].to_int() + arr_version[1].to_int() +libvirt_revision =3D arr_version[2].to_int() +libvirt_lib_version =3D '@0@.@1@.@2@'.format(libvirt_so_version, libvirt_a= ge, libvirt_revision) + + +# define top include directory + +top_inc_dir =3D include_directories('.') + + +# generate meson-config.h file +configure_file(output: 'meson-config.h', configuration: conf) diff --git a/meson_options.txt b/meson_options.txt new file mode 100644 index 00000000000..5338ee89b9a --- /dev/null +++ b/meson_options.txt @@ -0,0 +1,3 @@ +option('no-git', type: 'boolean', value: false, description: 'Disable git = submodule update') +option('system', type: 'boolean', value: false, description: 'Set install = paths to system ones') +option('runstatedir', type: 'string', value: '', description: 'State direc= tory for temporary sockets, pid files, etc') --=20 2.26.2