From patchwork Sun Jul 7 19:53:41 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Ijaz, Abdul B" X-Patchwork-Id: 1957741 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=intel.com header.i=@intel.com header.a=rsa-sha256 header.s=Intel header.b=PZiH0uD+; dkim-atps=neutral Authentication-Results: legolas.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=gcc.gnu.org (client-ip=2620:52:3:1:0:246e:9693:128c; helo=server2.sourceware.org; envelope-from=gcc-patches-bounces~incoming=patchwork.ozlabs.org@gcc.gnu.org; receiver=patchwork.ozlabs.org) Received: from server2.sourceware.org (server2.sourceware.org [IPv6:2620:52:3:1:0:246e:9693:128c]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (secp384r1) server-digest SHA384) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4WHHyw6z1jz1xpP for ; Mon, 8 Jul 2024 05:54:48 +1000 (AEST) Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 34EA73860757 for ; Sun, 7 Jul 2024 19:54:47 +0000 (GMT) X-Original-To: gcc-patches@gcc.gnu.org Delivered-To: gcc-patches@gcc.gnu.org Received: from mgamail.intel.com (mgamail.intel.com [198.175.65.9]) by sourceware.org (Postfix) with ESMTPS id 73DD8385B505 for ; Sun, 7 Jul 2024 19:54:27 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 73DD8385B505 Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=intel.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=intel.com ARC-Filter: OpenARC Filter v1.0.0 sourceware.org 73DD8385B505 Authentication-Results: server2.sourceware.org; arc=none smtp.remote-ip=198.175.65.9 ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1720382069; cv=none; b=Dk6oIAabeaD2X+YcJcD8630mpvLdDC+HBvts0t2OUPnRu952HcIWAqeUsoT0uv0H2K2Qq/5P4uQpdOiEkAnr6noMxD5uV2sPbzR7GSFH4AcKAqJbrcPwh/MsbVM3spxyWSkF49/ZPdUYiU79p/pHvsByGXvxUL237h3636eudTA= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1720382069; c=relaxed/simple; bh=Q4eUEjafcWBeM0mYj6Zn7FJXxKwrXguHdHFZv1iwX8s=; h=DKIM-Signature:From:To:Subject:Date:Message-Id:MIME-Version; b=xk7+CL+gZ5ZsR8dXqXW8v+7EPjecffs+CPHRYPi0EahBL8QjEhl3asEZO1HUhBvoe00AcOzUXb69PBC0qhw5owKHLQ1+mf5GSCdbY+ZIYJ9HYdSKObesAvlrAkau70JmqsFVvrVrOXHy4mnuoJ0dA4gbZC/WxNNOylTsypQrt8A= ARC-Authentication-Results: i=1; server2.sourceware.org DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1720382067; x=1751918067; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=Q4eUEjafcWBeM0mYj6Zn7FJXxKwrXguHdHFZv1iwX8s=; b=PZiH0uD+jlDFvuT4DZRHpWGz7WqdlcyxIfzgitq9LZr30xEwnFJH8cOi imnhG6wHm617mwdmrteGospsMJtspXe4rcjxybZMxPyn8yEpNVj/F1yt6 KAbhRRp9m4lKbmvGMG/n8ceBLNwzSWiNdvh+sTEA7ZHGiYQCxqnDT9ESz QTmxazUGVyQKv/GlU7lGsCmjURlM24R3rFIlLhsXG3Ez/LTZ6VHT2sUgm YZIS4lrgjJyNfRxX4tKABf39QSz1lN7txjsGdhYvXYYwcIc9sngozwQ8A P0NlA4Zz6GWzWI7BIbJ5Om/MD/avnETNIC5qiZ4SYWrJaQNPwfJVYpowp Q==; X-CSE-ConnectionGUID: Wc8fllouRBCWx6L1/5laeQ== X-CSE-MsgGUID: gzOVivWURWeJ9qNjLAFZcQ== X-IronPort-AV: E=McAfee;i="6700,10204,11126"; a="40088939" X-IronPort-AV: E=Sophos;i="6.09,190,1716274800"; d="scan'208";a="40088939" Received: from orviesa003.jf.intel.com ([10.64.159.143]) by orvoesa101.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 07 Jul 2024 12:54:26 -0700 X-CSE-ConnectionGUID: BeNQxhgrTIGicYmHnc5AwQ== X-CSE-MsgGUID: y58edtzZTvuj/aPkwB3dNg== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.09,190,1716274800"; d="scan'208";a="52133842" Received: from abijaz-mobl2.ger.corp.intel.com (HELO localhost) ([10.246.42.1]) by ORVIESA003-auth.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 07 Jul 2024 12:54:20 -0700 From: Abdul Basit Ijaz To: gcc-patches@gcc.gnu.org Cc: abdul.b.ijaz@intel.com Subject: [PATCH 1/1] config: Handle dash in library name for AC_LIB_LINKAGEFLAGS_BODY Date: Sun, 7 Jul 2024 21:53:41 +0200 Message-Id: <20240707195341.25305-2-abdul.b.ijaz@intel.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20240707195341.25305-1-abdul.b.ijaz@intel.com> References: <20240707195341.25305-1-abdul.b.ijaz@intel.com> MIME-Version: 1.0 X-Spam-Status: No, score=-10.6 required=5.0 tests=BAYES_00, DKIMWL_WL_HIGH, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, GIT_PATCH_0, SPF_HELO_NONE, SPF_NONE, TXREP autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org X-BeenThere: gcc-patches@gcc.gnu.org X-Mailman-Version: 2.1.30 Precedence: list List-Id: Gcc-patches mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: gcc-patches-bounces~incoming=patchwork.ozlabs.org@gcc.gnu.org From: "Ijaz, Abdul B" For a library with dash in the name like yaml-cpp the AC_LIB_LINKAGEFLAGS_BODY function generates a with_libname_type argument variable name with a dash but this results in configure error. Since dashes are not allowed in the variable name. This change handles such cases and in case input library for the AC_LIB_HAVE_LINKFLAGS has dash then it replaces it with the underscore "_". Example of an error for yaml-cpp library before the change using gcc config scripts in gdb: gdb/gdb/configure: line 22868: with_libyaml-cpp_type=auto: command not found After having underscore for this variable name: checking whether to use yaml-cpp... yes checking for libyaml-cpp... yes checking how to link with libyaml-cpp... -lyaml-cpp config/ChangeLog: * lib-link.m4: Handle dash in the library name for AC_LIB_LINKFLAGS_BODY. 2024-07-03 Ijaz, Abdul B --- config/lib-link.m4 | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/config/lib-link.m4 b/config/lib-link.m4 index 20e281fd323..a60a8069453 100644 --- a/config/lib-link.m4 +++ b/config/lib-link.m4 @@ -126,6 +126,7 @@ AC_DEFUN([AC_LIB_LINKFLAGS_BODY], [ define([NAME],[translit([$1],[abcdefghijklmnopqrstuvwxyz./-], [ABCDEFGHIJKLMNOPQRSTUVWXYZ___])]) + define([Name],[translit([$1],[./-], [___])]) dnl By default, look in $includedir and $libdir. use_additional=yes AC_LIB_WITH_FINAL_PREFIX([ @@ -152,8 +153,8 @@ AC_DEFUN([AC_LIB_LINKFLAGS_BODY], ]) AC_LIB_ARG_WITH([lib$1-type], [ --with-lib$1-type=TYPE type of library to search for (auto/static/shared) ], - [ with_lib$1_type=$withval ], [ with_lib$1_type=auto ]) - lib_type=`eval echo \$with_lib$1_type` + [ with_lib[]Name[]_type=$withval ], [ with_lib[]Name[]_type=auto ]) + lib_type=`eval echo \$with_lib[]Name[]_type` dnl Search the library and its dependencies in $additional_libdir and dnl $LDFLAGS. Using breadth-first-seach.