From patchwork Sun Apr 6 19:38:28 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ramsay Jones X-Patchwork-Id: 14039466 Received: from avasout-ptp-001.plus.net (avasout-ptp-001.plus.net [84.93.230.227]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 41927155C97 for ; Sun, 6 Apr 2025 19:42:22 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=84.93.230.227 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1743968544; cv=none; b=a2+rcof+ClNXDa/MHMRz8tUUtStuqm0VazngQIbu32iuYQ/oFueSvV9aHLywtlhrkgePt7lqhrkqXXcV/owyALsO8g+u14fce3AKQk157kDmDwfjuJmeI7WDYb30TUinTLiDjPoDaKSWH48cWYYkIz7no3bNkDXpqh/TDwTtvT4= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1743968544; c=relaxed/simple; bh=4oZtVPkKwwvl4/kG3Pcwo/gIn6elwSpnxPM52qbEXxg=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=S7iN0iG+oubWS85pj1f2oM16UyT9Z31yrx4mVf63tiec2vscLyUicFTMBnjobzVU315sCixhVQDwRreTecvZF49J0REcGEKHOE8S3UngZ7Rh2Aw0/Lxdu6GoYzuZuDGvOma3fgRQn56iXrMqsWeBKNiCbcZGSsOP5eARIWtOteo= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=ramsayjones.plus.com; spf=none smtp.mailfrom=ramsayjones.plus.com; dkim=pass (2048-bit key) header.d=plus.com header.i=@plus.com header.b=g2714YC4; arc=none smtp.client-ip=84.93.230.227 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=ramsayjones.plus.com Authentication-Results: smtp.subspace.kernel.org; spf=none smtp.mailfrom=ramsayjones.plus.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=plus.com header.i=@plus.com header.b="g2714YC4" Received: from localhost.localdomain ([80.189.83.109]) by smtp with ESMTPA id 1VpUuYqwzbpaN1VpyupkLJ; Sun, 06 Apr 2025 20:39:22 +0100 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=plus.com; s=042019; t=1743968362; bh=mnSwRgfsuqwJWe3cxnQyOOlcRFjXhLi55yE0/tQoN7w=; h=From:To:Cc:Subject:Date:In-Reply-To:References; b=g2714YC4MkwapUIhvZmoOHLSGwT3a8AzQHR67VMlRLmo9U6bnNtJfXHH3HNJJwaMm pEn9iPH0jOZQPHtaW7C0qrkzcljrWIhTQEgkdXpkuUV2XBHF4/9tm4nlb7pOitcMQv L4FryCxEZjdtnGZZGUU4E2j++uj0lYUXulBRpaUxVaExC0ATHTA+/xsvAU/ybFwXjs 0v23lpvc0tY201wXj7iW8oeEoMOOCO8N7LTKx2xElFon6VU/j+i1auskGyUifySlIw 0RUMYv+FLQHtXA2cfpv821Mc9Gujyfj7ZHR80RJ5R+NBPtUDUHVJmPWBXn6RVp/Epa IELoGc/xxfFuw== X-Clacks-Overhead: "GNU Terry Pratchett" X-CM-Score: 0.00 X-CNFS-Analysis: v=2.4 cv=frZ/Z04f c=1 sm=1 tr=0 ts=67f2d86a a=oM5NSl/Bl4BpjFr0C8iQlQ==:117 a=oM5NSl/Bl4BpjFr0C8iQlQ==:17 a=EBOSESyhAAAA:8 a=UssqkuoP40Gt3Q7oBg4A:9 a=yJM6EZoI5SlJf8ks9Ge_:22 X-AUTH: ramsayjones@:2500 From: Ramsay Jones To: GIT Mailing-list Cc: Junio C Hamano , Patrick Steinhardt , Adam Dinwoodie , Ramsay Jones Subject: [PATCH v2 02/13] Makefile: only set some BASIC_CFLAGS when RUNTIME_PREFIX is set Date: Sun, 6 Apr 2025 20:38:28 +0100 Message-ID: <8df541634aedbba40d8b0fa57dbf9cb0e495f11b.1743859985.git.ramsay@ramsayjones.plus.com> X-Mailer: git-send-email 2.49.0 In-Reply-To: References: <1c04882b-e518-4272-bd18-ab918774e424@ramsayjones.plus.com> Precedence: bulk X-Mailing-List: git@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-CMAE-Envelope: MS4xfAKImvLWS4A1A6icwVQHAEvGlv9dn7gt+aUKrQHqUb1DQE0paVoJOnBFpc2eRyylld0qLNVpdIL+d3kkSh4upQSVneLBoM+FLsgclDzs22vicXm5Hl6m r4Aga7sVUh83hVsQGW6VBYZwxviKHTtzFtB5jY3nDUJU4gWHl+iz6GIoK9mk47TfdbTxlxHVtjcteVep9pxl6bRLdP1Ah6+xgqg= Several build variables only have any meaning when the RUNTIME_PREFIX variable has been set. In particular, the following build variables are otherwise ignored: HAVE_BSD_KERN_PROC_SYSCTL PROCFS_EXECUTABLE_PATH HAVE_NS_GET_EXECUTABLE_PATH HAVE_ZOS_GET_EXECUTABLE_PATH HAVE_WPGMPTR Make setting BASIC_CFLAGS, for each of these variables, conditional on the RUNTIME_PREFIX being defined. Signed-off-by: Ramsay Jones --- Makefile | 38 +++++++++++++++++++++----------------- 1 file changed, 21 insertions(+), 17 deletions(-) diff --git a/Makefile b/Makefile index 7315507381..818dde32a9 100644 --- a/Makefile +++ b/Makefile @@ -2179,10 +2179,6 @@ ifdef HAVE_BSD_SYSCTL BASIC_CFLAGS += -DHAVE_BSD_SYSCTL endif -ifdef HAVE_BSD_KERN_PROC_SYSCTL - BASIC_CFLAGS += -DHAVE_BSD_KERN_PROC_SYSCTL -endif - ifdef HAVE_GETDELIM BASIC_CFLAGS += -DHAVE_GETDELIM endif @@ -2213,25 +2209,33 @@ ifneq ($(findstring openssl,$(CSPRNG_METHOD)),) EXTLIBS += -lcrypto -lssl endif -ifneq ($(PROCFS_EXECUTABLE_PATH),) - procfs_executable_path_SQ = $(subst ','\'',$(PROCFS_EXECUTABLE_PATH)) - BASIC_CFLAGS += '-DPROCFS_EXECUTABLE_PATH="$(procfs_executable_path_SQ)"' -endif - ifndef HAVE_PLATFORM_PROCINFO COMPAT_OBJS += compat/stub/procinfo.o endif -ifdef HAVE_NS_GET_EXECUTABLE_PATH - BASIC_CFLAGS += -DHAVE_NS_GET_EXECUTABLE_PATH -endif +ifdef RUNTIME_PREFIX -ifdef HAVE_ZOS_GET_EXECUTABLE_PATH - BASIC_CFLAGS += -DHAVE_ZOS_GET_EXECUTABLE_PATH -endif + ifdef HAVE_BSD_KERN_PROC_SYSCTL + BASIC_CFLAGS += -DHAVE_BSD_KERN_PROC_SYSCTL + endif + + ifneq ($(PROCFS_EXECUTABLE_PATH),) + pep_SQ = $(subst ','\'',$(PROCFS_EXECUTABLE_PATH)) + BASIC_CFLAGS += '-DPROCFS_EXECUTABLE_PATH="$(pep_SQ)"' + endif + + ifdef HAVE_NS_GET_EXECUTABLE_PATH + BASIC_CFLAGS += -DHAVE_NS_GET_EXECUTABLE_PATH + endif + + ifdef HAVE_ZOS_GET_EXECUTABLE_PATH + BASIC_CFLAGS += -DHAVE_ZOS_GET_EXECUTABLE_PATH + endif + + ifdef HAVE_WPGMPTR + BASIC_CFLAGS += -DHAVE_WPGMPTR + endif -ifdef HAVE_WPGMPTR - BASIC_CFLAGS += -DHAVE_WPGMPTR endif ifdef FILENO_IS_A_MACRO From patchwork Sun Apr 6 19:38:29 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ramsay Jones X-Patchwork-Id: 14039467 Received: from avasout-ptp-001.plus.net (avasout-ptp-001.plus.net [84.93.230.227]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 3DCBE70814 for ; Sun, 6 Apr 2025 19:42:29 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=84.93.230.227 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1743968551; cv=none; b=SHGgkmeK+HZgl1Pcb8sVaYjrhM+R9cXTj6bO5qK5lw7WFmMDqw3Aqh7OM3QzDZScLCroOhaunXwVygoIJ1F1rQO+uNAjUQHalikQVXVPCTLrOHaSRQ5OvCEB/Sfb5KufUZlD1joE9JeJSbXVkifmaStt/QBFvdFqYVcc5vRknDk= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1743968551; c=relaxed/simple; bh=bW/j7rKgYhirA3eLLuJkFjLSgCAypFp8g5mp1rmzIgM=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=tF5XJ1fzmejITs/M4t+G1EsHQfbnAPUrcNhoNDcfihQ03lfNRpATeIASkC7Z3bmkPmvlESD9YN7EBAOilGH/n8042OQ81bIw/59fJXOXMUUwWQOZW8JbbKJFNI7tSBXH9sNPCadYQlVPghF5fYey8p8yXKEtHSOU4h92vyjsn6k= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=ramsayjones.plus.com; spf=none smtp.mailfrom=ramsayjones.plus.com; dkim=pass (2048-bit key) header.d=plus.com header.i=@plus.com header.b=aEXhkOT4; arc=none smtp.client-ip=84.93.230.227 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=ramsayjones.plus.com Authentication-Results: smtp.subspace.kernel.org; spf=none smtp.mailfrom=ramsayjones.plus.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=plus.com header.i=@plus.com header.b="aEXhkOT4" Received: from localhost.localdomain ([80.189.83.109]) by smtp with ESMTPA id 1VpUuYqwzbpaN1Vq5upkLP; Sun, 06 Apr 2025 20:39:29 +0100 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=plus.com; s=042019; t=1743968369; bh=3n50cZYJlZz6WMT7x1eU8mzOm0zp4CHQZUs4o4EFlfw=; h=From:To:Cc:Subject:Date:In-Reply-To:References; b=aEXhkOT4jXALzCM4LhvDGQk4F75mT5k41dRdFsBHQD6y/yjBBeMyJWrjAgyN25JHZ iZdlhiFnkQsYHD+BvpL9XnGkNPtepmG9GJa9VQL46XpFOMSvGsRdIa9uPU1dGZin/f xQm/ZxnlEt1SacTkoUm4G+yjuAlZJxh+l98EAbvCRelTJQBqYVJghws5bmEywlMiA2 HEp/D+ZtjzNMU+VP+eyGig9+SlTGJyqcpEJajqJMSOHetbvTByKxbKzMUlILAlfMGX ViY8Ro8fDQDxgIiPNcd32rKJxDeskeKBrdBv1S/E4o2xpIz15MG3IxDC57sFrdxdP2 0uO81s50dx39A== X-Clacks-Overhead: "GNU Terry Pratchett" X-CM-Score: 0.00 X-CNFS-Analysis: v=2.4 cv=frZ/Z04f c=1 sm=1 tr=0 ts=67f2d871 a=oM5NSl/Bl4BpjFr0C8iQlQ==:117 a=oM5NSl/Bl4BpjFr0C8iQlQ==:17 a=EBOSESyhAAAA:8 a=Vy2chUuRFShQgWdV_nEA:9 a=yJM6EZoI5SlJf8ks9Ge_:22 X-AUTH: ramsayjones@:2500 From: Ramsay Jones To: GIT Mailing-list Cc: Junio C Hamano , Patrick Steinhardt , Adam Dinwoodie , Ramsay Jones Subject: [PATCH v2 03/13] meson.build: only set build variables for non-default values Date: Sun, 6 Apr 2025 20:38:29 +0100 Message-ID: <280363cd569a8c6e870107eb219597b42911fed2.1743859985.git.ramsay@ramsayjones.plus.com> X-Mailer: git-send-email 2.49.0 In-Reply-To: References: <1c04882b-e518-4272-bd18-ab918774e424@ramsayjones.plus.com> Precedence: bulk X-Mailing-List: git@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-CMAE-Envelope: MS4xfBDleLQZGLW7hhaOdRK6WstxkAn5KKjeU36+9zObc/z+VmVaLeC6qGSOF6gbP29Uce6jsI180wAJ/L1RFx6sOzsKxBo/KuGFW7rrrG7iBH7au4Yuyv9p VgNll/JxIisE2S3A79WQ9myLFEy1PB4efCQGG7NgsXuMmWdjgBk6HIRI7g7SO6MPAyOw5ZkwHoMWZNnOOXwqfNQlfXJlH35rAAs= Some preprocessor -Defines have defaults set in the source code when they have not been provided to the C compiler. In this case, there is no need to pass them on the command-line, unless the build requires a non-standard value. The build variables for DEFAULT_EDITOR and DEFAULT_PAGER have appropriate defaults ('vi' and 'less') set in the code. Add the preprocessor -Defines to the 'libgit_c_args' only if the values set with the corresponding 'options' are different to these standard values. Also, the 'git-var' documentation contains some conditional text which documents the chosen compiled in value, which would not read well for the standard values. Similar to the above, only add the corresponding '-a' attribute arguments to the 'asciidoc_common_options' variable, if the values set in the 'options' are different to these standard values. Signed-off-by: Ramsay Jones --- Documentation/meson.build | 20 ++++++++++++++++++++ meson.build | 13 +++++++++++-- 2 files changed, 31 insertions(+), 2 deletions(-) diff --git a/Documentation/meson.build b/Documentation/meson.build index 594546d68b..1642b6e2a3 100644 --- a/Documentation/meson.build +++ b/Documentation/meson.build @@ -242,6 +242,16 @@ if docs_backend == 'asciidoc' '--attribute=build_dir=' + meson.current_build_dir(), ] + pager_opt = get_option('default_pager') + if pager_opt != '' and pager_opt != 'less' + asciidoc_common_options += '-agit-default-pager=' + pager_opt + endif + + editor_opt = get_option('default_editor') + if editor_opt != '' and editor_opt != 'vi' + asciidoc_common_options += '-agit-default-editor=' + editor_opt + endif + documentation_deps = [ asciidoc_conf, ] @@ -279,6 +289,16 @@ elif docs_backend == 'asciidoctor' '--require', 'asciidoctor-extensions', ] + pager_opt = get_option('default_pager') + if pager_opt != '' and pager_opt != 'less' + asciidoc_common_options += '-agit-default-pager=' + pager_opt + endif + + editor_opt = get_option('default_editor') + if editor_opt != '' and editor_opt != 'vi' + asciidoc_common_options += '-agit-default-editor=' + editor_opt + endif + documentation_deps = [ asciidoctor_extensions, ] diff --git a/meson.build b/meson.build index 88a29fd043..efd0bd3319 100644 --- a/meson.build +++ b/meson.build @@ -693,10 +693,8 @@ endif # These variables are used for building libgit.a. libgit_c_args = [ '-DBINDIR="' + get_option('bindir') + '"', - '-DDEFAULT_EDITOR="' + get_option('default_editor') + '"', '-DDEFAULT_GIT_TEMPLATE_DIR="' + get_option('datadir') / 'git-core/templates' + '"', '-DDEFAULT_HELP_FORMAT="' + get_option('default_help_format') + '"', - '-DDEFAULT_PAGER="' + get_option('default_pager') + '"', '-DETC_GITATTRIBUTES="' + get_option('gitattributes') + '"', '-DETC_GITCONFIG="' + get_option('gitconfig') + '"', '-DFALLBACK_RUNTIME_PREFIX="' + get_option('prefix') + '"', @@ -708,6 +706,17 @@ libgit_c_args = [ '-DPAGER_ENV="' + get_option('pager_environment') + '"', '-DSHELL_PATH="' + fs.as_posix(shell.full_path()) + '"', ] + +editor_opt = get_option('default_editor') +if editor_opt != '' and editor_opt != 'vi' + libgit_c_args += '-DDEFAULT_EDITOR="' + editor_opt + '"' +endif + +pager_opt = get_option('default_pager') +if pager_opt != '' and pager_opt != 'less' + libgit_c_args += '-DDEFAULT_PAGER="' + pager_opt + '"' +endif + libgit_include_directories = [ '.' ] libgit_dependencies = [ ] From patchwork Sun Apr 6 19:38:30 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ramsay Jones X-Patchwork-Id: 14039468 Received: from avasout-ptp-001.plus.net (avasout-ptp-001.plus.net [84.93.230.227]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 3E0B970814 for ; Sun, 6 Apr 2025 19:42:33 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=84.93.230.227 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1743968554; cv=none; b=ZEEAVghDqPiOXPn+yWsLLdbAKThYvVi5BZ8xMFzNLlfbzQVsatz0uckue3cYMDdEBLPw5fmKX65EYg6P6XZSZX39iI631d8f8QNaPz95cMM9eXVygWcbr4wi2XxOTYRpS0+IhJGH+tmWFKzdC46+sOkBIWfnD3hkAAaX6PgM4Qk= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1743968554; c=relaxed/simple; bh=CPmYKMmTb9AXzVMVfvG7PCfEyENCM/NIr7hl6XLnyN4=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=pJeCDTGjFKbpO4B3keopdJNXvrt4p3w3tJpo26i0tQS8amrz0Ezl1RWzrNBHz6c36bemvA2ZQr8lTb4H2+tTsY4dDYA0FSv99pVxQ6Q6pO+RPHsIe596k1p7JJcqKdO1PllOWNVktO23sRu2xRnfqJXKu8RcU7zuEade4POV0qI= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=ramsayjones.plus.com; spf=none smtp.mailfrom=ramsayjones.plus.com; dkim=pass (2048-bit key) header.d=plus.com header.i=@plus.com header.b=FkTxaNwA; arc=none smtp.client-ip=84.93.230.227 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=ramsayjones.plus.com Authentication-Results: smtp.subspace.kernel.org; spf=none smtp.mailfrom=ramsayjones.plus.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=plus.com header.i=@plus.com header.b="FkTxaNwA" Received: from localhost.localdomain ([80.189.83.109]) by smtp with ESMTPA id 1VpUuYqwzbpaN1Vq8upkLU; Sun, 06 Apr 2025 20:39:33 +0100 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=plus.com; s=042019; t=1743968373; bh=/kmbUB+q16OLoAX1Ktai3FPtuGvbh9wjvtuedrSTUbI=; h=From:To:Cc:Subject:Date:In-Reply-To:References; b=FkTxaNwAQio3yxuox3AQzhMPE4JsVNb5vBgqtolupqE+yRCwAumSB9X9TaGneO9bE 6fs/1eMbt/PfOEv8YgfDuleFx1O4CHiHfyJT4FUjwsdKqhPtHb8l7jOhNcCWU65xjL cRYfeRuAKCZFVe2KWwkRmtwZeoEfDABnwSqam2sT71Si0et6vQpVrirvE2xkdFdVim 6FbIk3/2CHcI6rFVFF2Nx/zmtSncAy+O0Bs2pQKF5L/qUrthlZKXi7m/housBFm5FJ rfj+XOTyGBhQQTrykZErtvD6eHyULPJs7vyA2KI8eC0vo2omAhTJ+yySJijU+OZ6B4 sm0Jj5jc+gKFQ== X-Clacks-Overhead: "GNU Terry Pratchett" X-CM-Score: 0.00 X-CNFS-Analysis: v=2.4 cv=frZ/Z04f c=1 sm=1 tr=0 ts=67f2d875 a=oM5NSl/Bl4BpjFr0C8iQlQ==:117 a=oM5NSl/Bl4BpjFr0C8iQlQ==:17 a=EBOSESyhAAAA:8 a=anev5XLoH9Hw9iYphZAA:9 a=yJM6EZoI5SlJf8ks9Ge_:22 X-AUTH: ramsayjones@:2500 From: Ramsay Jones To: GIT Mailing-list Cc: Junio C Hamano , Patrick Steinhardt , Adam Dinwoodie , Ramsay Jones Subject: [PATCH v2 04/13] meson.build: set default help format to html on windows Date: Sun, 6 Apr 2025 20:38:30 +0100 Message-ID: <34349bf98c5b01dd1b73065448b616517bb784a3.1743859985.git.ramsay@ramsayjones.plus.com> X-Mailer: git-send-email 2.49.0 In-Reply-To: References: <1c04882b-e518-4272-bd18-ab918774e424@ramsayjones.plus.com> Precedence: bulk X-Mailing-List: git@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-CMAE-Envelope: MS4xfJVxKdMhU4a+Pz3Y1S+qj9h92FgtiqEqYon8xTxb67iUY2/RkHZ4onIW/07Mmlg6Yk2i18t6SbwUN8wlyGgVEJGvnCKOV/a8N01/8dYRnymXD/PnJNZM TIopzY2UIEICq3//EqMNcpSo7qRzBMBmxx5MlSh96rWyCEZp/CzT4hVd0NW779VTWXRQkof0lPi192g/NtPuOKAseZzQzgf3wxw= The build variable DEFAULT_HELP_FORMAT has an appropriate default ('man') set in the code, so there is no need to pass the -Define on the compiler command-line, unless the build requires a non-standard value. In addition, on windows the make build overrides the default help format to 'html', rather than 'man', in the 'config.mak.uname' file. In order to suppress the -Define on the C compiler command-line, only add the -Define to the 'libgit_c_args' variable when the requested value is not the standard 'man'. In order to override the default value on windows, add a 'platform' value to the 'default_help_format' combo option and set it as the default choice. When this option is set to 'platform', use the 'host_machine.system()' method call to determine the appropriate default value for the host system. Signed-off-by: Ramsay Jones --- meson.build | 13 ++++++++++++- meson_options.txt | 2 +- 2 files changed, 13 insertions(+), 2 deletions(-) diff --git a/meson.build b/meson.build index efd0bd3319..8f8a258064 100644 --- a/meson.build +++ b/meson.build @@ -694,7 +694,6 @@ endif libgit_c_args = [ '-DBINDIR="' + get_option('bindir') + '"', '-DDEFAULT_GIT_TEMPLATE_DIR="' + get_option('datadir') / 'git-core/templates' + '"', - '-DDEFAULT_HELP_FORMAT="' + get_option('default_help_format') + '"', '-DETC_GITATTRIBUTES="' + get_option('gitattributes') + '"', '-DETC_GITCONFIG="' + get_option('gitconfig') + '"', '-DFALLBACK_RUNTIME_PREFIX="' + get_option('prefix') + '"', @@ -717,6 +716,18 @@ if pager_opt != '' and pager_opt != 'less' libgit_c_args += '-DDEFAULT_PAGER="' + pager_opt + '"' endif +help_format_opt = get_option('default_help_format') +if help_format_opt == 'platform' + if host_machine.system() == 'windows' + help_format_opt = 'html' + else + help_format_opt = 'man' + endif +endif +if help_format_opt != 'man' + libgit_c_args += '-DDEFAULT_HELP_FORMAT="' + help_format_opt + '"' +endif + libgit_include_directories = [ '.' ] libgit_dependencies = [ ] diff --git a/meson_options.txt b/meson_options.txt index 78d172a740..8ac30a5223 100644 --- a/meson_options.txt +++ b/meson_options.txt @@ -95,7 +95,7 @@ option('highlight_bin', type: 'string', value: 'highlight') # Documentation. option('docs', type: 'array', choices: ['man', 'html'], value: [], description: 'Which documenattion formats to build and install.') -option('default_help_format', type: 'combo', choices: ['man', 'html'], value: 'man', +option('default_help_format', type: 'combo', choices: ['man', 'html', 'platform'], value: 'platform', description: 'Default format used when executing git-help(1).') option('docs_backend', type: 'combo', choices: ['asciidoc', 'asciidoctor', 'auto'], value: 'auto', description: 'Which backend to use to generate documentation.') From patchwork Sun Apr 6 19:38:31 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ramsay Jones X-Patchwork-Id: 14039469 Received: from avasout-ptp-001.plus.net (avasout-ptp-001.plus.net [84.93.230.227]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 3CCAA70814 for ; Sun, 6 Apr 2025 19:42:39 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=84.93.230.227 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1743968560; cv=none; b=hg5U6TKUro/iR6+7C3dPGCM5YYLpmWsyh5fvpwrb8fSkoCYNQFCjHxWNg+ZbkTbZIfoA+oJQoe8w1qcctks6kJhoAIUpfsObtlBfZEW8cUueSJ2HbxjyV9tJ5sjMueHcAaamfdVtADd/vFz0/vaG1OCNVS3p1r3H2yhFTOIAYfg= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1743968560; c=relaxed/simple; bh=tzPzckbvdUhXQEiO2ILe2extWUQisgdqfIyP/L4PGps=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=ATIxELv42BRKojRyPQYHsccQPwMsQTsh2qtND96WIYeWyiSLXpEZNSe9NZBWEbN/p4UKGmWa/5/YT/yJgk8R3xsukSYVjUn+Lx8QPao2UvtRsaJASRlCjRuOuo8jZPO5ZmIvNSK3D5M2LzOuHVgkPXyhdiBK1OjHNe1htkh3yj4= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=ramsayjones.plus.com; spf=none smtp.mailfrom=ramsayjones.plus.com; dkim=pass (2048-bit key) header.d=plus.com header.i=@plus.com header.b=SRl2PFsK; arc=none smtp.client-ip=84.93.230.227 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=ramsayjones.plus.com Authentication-Results: smtp.subspace.kernel.org; spf=none smtp.mailfrom=ramsayjones.plus.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=plus.com header.i=@plus.com header.b="SRl2PFsK" Received: from localhost.localdomain ([80.189.83.109]) by smtp with ESMTPA id 1VpUuYqwzbpaN1VqEupkLZ; Sun, 06 Apr 2025 20:39:39 +0100 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=plus.com; s=042019; t=1743968379; bh=bGD7ZGnPLY1NQoF0MwEgIdUtKb+sl6vNMUFMQlbU8Ys=; h=From:To:Cc:Subject:Date:In-Reply-To:References; b=SRl2PFsK2UKvRM8SFxfku2zWVqxnbn0etMYhyk1i/Xw47YX5A9uxVqy362WNWSzre zHbd7mwKyVpRcOSQVTwKCUxxFWP47HaxctEWBBVPWRawJnX2Lm6z4NpZkCjvOJQmme jGW1cR9ag3/KUb/6stoH9Qnjti4EEbtgR88TovGmjH6awKrT44hwAyhDiTDcc3U5le m6iyMqW21j4y5OWwlsXTYpzfXJLe5dZPHc9S8KC1iQaeo5eGTYGjwXUgGWZvdWs4NI +BII4ov6+lFHPbkI2VfOWx+ACcWoMOT8Tw7ka6Kt3ciiuP8MOUN7x/oD+fM1AsQbvu NJ+LrwYv0jkxg== X-Clacks-Overhead: "GNU Terry Pratchett" X-CM-Score: 0.00 X-CNFS-Analysis: v=2.4 cv=frZ/Z04f c=1 sm=1 tr=0 ts=67f2d87b a=oM5NSl/Bl4BpjFr0C8iQlQ==:117 a=oM5NSl/Bl4BpjFr0C8iQlQ==:17 a=EBOSESyhAAAA:8 a=MwKkaEpK1oP1WH10rxgA:9 a=yJM6EZoI5SlJf8ks9Ge_:22 X-AUTH: ramsayjones@:2500 From: Ramsay Jones To: GIT Mailing-list Cc: Junio C Hamano , Patrick Steinhardt , Adam Dinwoodie , Ramsay Jones Subject: [PATCH v2 05/13] Makefile: remove NEEDS_LIBRT build variable Date: Sun, 6 Apr 2025 20:38:31 +0100 Message-ID: X-Mailer: git-send-email 2.49.0 In-Reply-To: References: <1c04882b-e518-4272-bd18-ab918774e424@ramsayjones.plus.com> Precedence: bulk X-Mailing-List: git@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-CMAE-Envelope: MS4xfADEZ7j5j/GcItCpoX3VQSL2uogHzCxqGdQ/Y4uyhfQQGTxEqwhL7vIuzZwGPdchpQUFR4W/gWp6t9z/esBDv5t9h0KWYgU4TdvYYRYzdKYM9HPRmF2n KCUsSWjl33G64Y0kaQpTRELeVsqrz1xfz7b8dBaFIS8K9xSYoW/b3xsBRizlNRVEaCfq9Tj/BBlZRSP4nKQOzLLGIW5v45hisak= Commit d19e3a5b21 ("Makefile: add NEEDS_LIBRT to optionally link with librt", 2016-07-07) introduced the NEEDS_LIBRT build variable to disassociate the HAVE_CLOCK_GETTIME variable with the unconditional linking of the librt library. At one time, the clock_gettime() function was not available as part of the libc library and (on some unix systems) required linking with librt. Commit 52fcec75ce ("config.mak.uname: define NEEDS_LIBRT under Linux, for now", 2016-07-10) set the NEEDS_LIBRT variable in the Linux section of the config.mak.uname file, since Debian 7 (wheezy) was one of the few remaining distributions, with glibc 2.13, that required linking with librt for clock_gettime(). Note that from glibc version 2.17, this is no longer necessary. Note that Debian 7.0 was released on May 4th, 2013 and benefited from long term support until May 2018 when it went end-of-life. Since that time, Linux distributions use a more up-to-date library, for example: Distribution version end of support Debian 8 2.19 30th June 2020 RHEL 8 2.28 31st May 2024 * Ubuntu 16.04 2.23 30th Apr 2021 * paid 'Maintenance support' ends 31st May 2029 Since it is no longer required, remove NEEDS_LIBRT from the Makefile and config.mak.uname. Signed-off-by: Ramsay Jones --- Makefile | 7 ------- config.mak.uname | 2 -- 2 files changed, 9 deletions(-) diff --git a/Makefile b/Makefile index 818dde32a9..8fa4d2664e 100644 --- a/Makefile +++ b/Makefile @@ -340,9 +340,6 @@ include shared.mak # # Define HAVE_SYNC_FILE_RANGE if your platform has sync_file_range. # -# Define NEEDS_LIBRT if your platform requires linking with librt (glibc version -# before 2.17) for clock_gettime and CLOCK_MONOTONIC. -# # Define HAVE_BSD_SYSCTL if your platform has a BSD-compatible sysctl function. # # Define HAVE_GETDELIM if your system has the getdelim() function. @@ -2171,10 +2168,6 @@ ifdef HAVE_SYNC_FILE_RANGE BASIC_CFLAGS += -DHAVE_SYNC_FILE_RANGE endif -ifdef NEEDS_LIBRT - EXTLIBS += -lrt -endif - ifdef HAVE_BSD_SYSCTL BASIC_CFLAGS += -DHAVE_BSD_SYSCTL endif diff --git a/config.mak.uname b/config.mak.uname index b12d4e168a..88007c4f13 100644 --- a/config.mak.uname +++ b/config.mak.uname @@ -54,8 +54,6 @@ ifeq ($(uname_S),Linux) HAVE_DEV_TTY = YesPlease HAVE_CLOCK_GETTIME = YesPlease HAVE_CLOCK_MONOTONIC = YesPlease - # -lrt is needed for clock_gettime on glibc <= 2.16 - NEEDS_LIBRT = YesPlease HAVE_SYNC_FILE_RANGE = YesPlease HAVE_GETDELIM = YesPlease FREAD_READS_DIRECTORIES = UnfortunatelyYes