From nobody Sat Oct 4 23:25:52 2025 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) client-ip=192.237.175.120; envelope-from=xen-devel-bounces@lists.xenproject.org; helo=lists.xenproject.org; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) smtp.mailfrom=xen-devel-bounces@lists.xenproject.org; dmarc=pass(p=none dis=none) header.from=xenproject.org ARC-Seal: i=1; a=rsa-sha256; t=1759147712; cv=none; d=zohomail.com; s=zohoarc; b=lLvw/XUnhCH8mj2Ky9+mIyeud5gj8V711cEzTpIpFbBY02EfKz/FfigpOM8zfB9ZK0PZk4Q23uopr0ps3y9Bt8aqoIQguNbAImPqW96HqPpCY4Aqiwarma76o6bH7e0eXcocMiRBBRNyqJmvbwWFTK5Y3XRRsSlkbX+XsL8Mzns= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1759147712; h=Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=9LmUJ4zuB4olL3YoOObx5zrJYD33c+ZXbGLTgVb/atI=; b=K5hZR7QkLM8/opSTLWzFQhGReuH4JIU/hRQOJ2IU5oC6Se8xZga3bK54MlEq9fi7speniwG8XBOQabRbNcrapYZB6WmJtplxKjYDC/64OQaiuy5eCBsWMmmuTITxSVYIO6//riRroeP2axUx8TYRbu0i6UkDmUin6B3ljSYiZzQ= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) smtp.mailfrom=xen-devel-bounces@lists.xenproject.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) by mx.zohomail.com with SMTPS id 1759147712711310.4334598269844; Mon, 29 Sep 2025 05:08:32 -0700 (PDT) Received: from list by lists.xenproject.org with outflank-mailman.1132745.1471039 (Exim 4.92) (envelope-from ) id 1v3Cfn-0000Fe-4B; Mon, 29 Sep 2025 12:08:07 +0000 Received: by outflank-mailman (output) from mailman id 1132745.1471039; Mon, 29 Sep 2025 12:08:07 +0000 Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1v3Cfm-0000Er-R9; Mon, 29 Sep 2025 12:08:06 +0000 Received: by outflank-mailman (input) for mailman id 1132745; Mon, 29 Sep 2025 12:08:05 +0000 Received: from mail.xenproject.org ([104.130.215.37]) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1v3Cfl-0008Sd-FG for xen-devel@lists.xenproject.org; Mon, 29 Sep 2025 12:08:05 +0000 Received: from xenbits.xenproject.org ([104.239.192.120]) by mail.xenproject.org with esmtp (Exim 4.96) (envelope-from ) id 1v3Cfl-00GXBu-14; Mon, 29 Sep 2025 12:08:05 +0000 Received: from [2a01:cb15:80df:da00:e2a9:ff82:7bde:38cd] (helo=l14.home) by xenbits.xenproject.org with esmtpsa (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.96) (envelope-from ) id 1v3Cfl-004JHo-1B; Mon, 29 Sep 2025 12:08:05 +0000 X-Outflank-Mailman: Message body and most headers restored to incoming version X-BeenThere: xen-devel@lists.xenproject.org List-Id: Xen developer discussion List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Errors-To: xen-devel-bounces@lists.xenproject.org Precedence: list Sender: "Xen-devel" DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xenproject.org; s=20200302mail; h=Content-Transfer-Encoding:MIME-Version: References:In-Reply-To:Message-ID:Date:Subject:Cc:To:From; bh=9LmUJ4zuB4olL3YoOObx5zrJYD33c+ZXbGLTgVb/atI=; b=etrR+Ma3DnJFtNc9fa0KgGf8Wy o3eW5hATHhPH20+szrlhm+XcQRrzjX/uvHt9dipP1yk3p86dxvckIhKZJg+MzVHGIitZBnKC4IBgq ttdIWQgdw6OqAfoemb5LyWKffJ04WxBeZKgjZV9E0z8ImVT6YpYZBWmqXz8TJLTOrF6g=; From: Anthony PERARD To: xen-devel@lists.xenproject.org Cc: Anthony PERARD Subject: [XEN PATCH v2 7/8] configure: Use json-c by default, fallback to yajl Date: Mon, 29 Sep 2025 14:07:55 +0200 Message-ID: <20250929120756.46075-8-anthony@xenproject.org> X-Mailer: git-send-email 2.47.3 In-Reply-To: <20250929120756.46075-1-anthony@xenproject.org> References: <20250929120756.46075-1-anthony@xenproject.org> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @xenproject.org) X-ZM-MESSAGEID: 1759147714237116600 Content-Type: text/plain; charset="utf-8" From: Anthony PERARD Signed-off-by: Anthony PERARD Acked-by: Andrew Cooper Reviewed-by: Jason Andryuk --- tools/configure | 97 +++++++++++++++++++++++++++++----------------- tools/configure.ac | 12 +++--- 2 files changed, 69 insertions(+), 40 deletions(-) diff --git a/tools/configure b/tools/configure index edd1701b2d..0eb7a0ab6a 100755 --- a/tools/configure +++ b/tools/configure @@ -9692,41 +9692,7 @@ fi # Put the nasty error message in config.log where it belongs echo "$libjsonc_PKG_ERRORS" >&5 =20 - as_fn_error $? "Package requirements (json-c) were not met: - -$libjsonc_PKG_ERRORS - -Consider adjusting the PKG_CONFIG_PATH environment variable if you -installed software in a non-standard prefix. - -Alternatively, you may set the environment variables libjsonc_CFLAGS -and libjsonc_LIBS to avoid the need to call pkg-config. -See the pkg-config man page for more details." "$LINENO" 5 -elif test $pkg_failed =3D untried; then - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 -printf "%s\n" "no" >&6; } - { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 -printf "%s\n" "$as_me: error: in \`$ac_pwd':" >&2;} -as_fn_error $? "The pkg-config script could not be found or is too old. M= ake sure it -is in your PATH or set the PKG_CONFIG environment variable to the full -path to pkg-config. - -Alternatively, you may set the environment variables libjsonc_CFLAGS -and libjsonc_LIBS to avoid the need to call pkg-config. -See the pkg-config man page for more details. - -To get pkg-config, see . -See \`config.log' for more details" "$LINENO" 5; } -else - libjsonc_CFLAGS=3D$pkg_cv_libjsonc_CFLAGS - libjsonc_LIBS=3D$pkg_cv_libjsonc_LIBS - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 -printf "%s\n" "yes" >&6; } - -printf "%s\n" "#define HAVE_LIBJSONC 1" >>confdefs.h - -fi -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for yajl_alloc in -= lyajl" >&5 + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for yajl_alloc in = -lyajl" >&5 printf %s "checking for yajl_alloc in -lyajl... " >&6; } if test ${ac_cv_lib_yajl_yajl_alloc+y} then : @@ -9772,6 +9738,67 @@ else $as_nop as_fn_error $? "Could not find yajl" "$LINENO" 5 fi =20 + +elif test $pkg_failed =3D untried; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for yajl_alloc in = -lyajl" >&5 +printf %s "checking for yajl_alloc in -lyajl... " >&6; } +if test ${ac_cv_lib_yajl_yajl_alloc+y} +then : + printf %s "(cached) " >&6 +else $as_nop + ac_check_lib_save_LIBS=3D$LIBS +LIBS=3D"-lyajl $LIBS" +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ +char yajl_alloc (); +int +main (void) +{ +return yajl_alloc (); + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO" +then : + ac_cv_lib_yajl_yajl_alloc=3Dyes +else $as_nop + ac_cv_lib_yajl_yajl_alloc=3Dno +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam \ + conftest$ac_exeext conftest.$ac_ext +LIBS=3D$ac_check_lib_save_LIBS +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_yajl_yajl= _alloc" >&5 +printf "%s\n" "$ac_cv_lib_yajl_yajl_alloc" >&6; } +if test "x$ac_cv_lib_yajl_yajl_alloc" =3D xyes +then : + YAJL_LIBS=3D-lyajl + + +printf "%s\n" "#define HAVE_LIBYAJL 1" >>confdefs.h + +else $as_nop + as_fn_error $? "Could not find yajl" "$LINENO" 5 +fi + + +else + libjsonc_CFLAGS=3D$pkg_cv_libjsonc_CFLAGS + libjsonc_LIBS=3D$pkg_cv_libjsonc_LIBS + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +printf "%s\n" "yes" >&6; } + +printf "%s\n" "#define HAVE_LIBJSONC 1" >>confdefs.h + +fi + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for deflateCopy in = -lz" >&5 printf %s "checking for deflateCopy in -lz... " >&6; } if test ${ac_cv_lib_z_deflateCopy+y} diff --git a/tools/configure.ac b/tools/configure.ac index bb40b5b3f0..7267d02a04 100644 --- a/tools/configure.ac +++ b/tools/configure.ac @@ -425,11 +425,13 @@ AC_SUBST([ZLIB_LIBS]) AX_CHECK_EXTFS AX_CHECK_PTHREAD PKG_CHECK_MODULES([libjsonc], [json-c], - [AC_DEFINE([HAVE_LIBJSONC], [1], [Use library json-c])]) -AC_CHECK_LIB([yajl], [yajl_alloc], - [AC_SUBST([YAJL_LIBS],[-lyajl]) - AC_DEFINE([HAVE_LIBYAJL],[1],[Define to 1 if you have the `yajl' libra= ry (-lyajl).])], - [AC_MSG_ERROR([Could not find yajl])]) + [AC_DEFINE([HAVE_LIBJSONC], [1], [Use library json-c])], + [AC_CHECK_LIB([yajl], [yajl_alloc], + [AC_SUBST([YAJL_LIBS],[-lyajl]) + AC_DEFINE([HAVE_LIBYAJL],[1],[Define to 1 if you have the `yajl' = library (-lyajl).])], + [AC_MSG_ERROR([Could not find yajl])]) +]) + AC_CHECK_LIB([z], [deflateCopy], [], [AC_MSG_ERROR([Could not find zlib])]) AC_CHECK_HEADER([argp.h], [ AC_CHECK_LIB([argp], [argp_usage], [argp_ldflags=3D"-largp"]) --=20 Anthony PERARD