From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Maxim Cournoyer Newsgroups: gmane.lisp.guile.devel Subject: [PATCH devel 6/6] configure.ac: Standardize default installation directory. Date: Thu, 4 Mar 2021 21:35:24 -0500 Message-ID: <20210305023524.15317-6-maxim.cournoyer@gmail.com> References: <8735xapc3x.fsf@gmail.com> <20210305023524.15317-1-maxim.cournoyer@gmail.com> Mime-Version: 1.0 Content-Transfer-Encoding: 8bit Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="25517"; mail-complaints-to="usenet@ciao.gmane.io" Cc: Maxim Cournoyer To: guile-devel@gnu.org Original-X-From: guile-devel-bounces+guile-devel=m.gmane-mx.org@gnu.org Fri Mar 05 04:02:13 2021 Return-path: Envelope-to: guile-devel@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1lI0jF-0006Yz-Dp for guile-devel@m.gmane-mx.org; Fri, 05 Mar 2021 04:02:13 +0100 Original-Received: from localhost ([::1]:36186 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1lI0jE-0003Xs-Bj for guile-devel@m.gmane-mx.org; Thu, 04 Mar 2021 22:02:12 -0500 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:50060) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lI0Jy-0006o8-Nv for guile-devel@gnu.org; Thu, 04 Mar 2021 21:36:06 -0500 Original-Received: from mail-qk1-x72f.google.com ([2607:f8b0:4864:20::72f]:45938) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1lI0Jw-0007Ud-8o for guile-devel@gnu.org; Thu, 04 Mar 2021 21:36:06 -0500 Original-Received: by mail-qk1-x72f.google.com with SMTP id z128so584427qkc.12 for ; Thu, 04 Mar 2021 18:36:03 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=hCbf24LdfOKP2nxJuqTUGv6XcfoP91vnsEe9XQI/zh8=; b=WFqIsihwlMV7xsxbjjpZO41zfiFwY55eRenQV81ptt66+ZHTZ5V7Q2PbN8GMqvDkX3 v9+DyD1jfwkJQ+sGnA7dQbqw9zNLzbiFgEt/hFIzbHMkFnTJgMJ7BfLHeOlgwnFgCy15 mmBr+aaWy+GJm/CHuoIGSZo3Ctos0pZpX5x9cdlHCXmfgssq731cMwgHWx9qHYjMsP8K dvZed1/naufpTqu+qOQwInfMVvDab1yRPNpS+w4JbirWmrIVqVBtr5BVAaM7gc1AHUkk +Ojakd6T9WXhpEKKIXx1krASS7tf5GUeqqIt5YySB6w7ZqguMz1pgFCX4LZoeBGssyJI AX7w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=hCbf24LdfOKP2nxJuqTUGv6XcfoP91vnsEe9XQI/zh8=; b=c2wQjXszaPnyCg9kQavwvnZqaco437LMhORkiUWg4qD25BDoEFIQf4eCODgCJtS6Vw 9coWMB2P+NHTP96yJ8d/EfRstOIg55aZZ5sO+5u5jSFsfVouhPSJTv1L3T7oigfYWl9u rWJOw9Nwmj6CgShcqnH6ERnwOgPDEf+uhzMj5kUiZxbeRizNUevgRB8QbMUE7cRg8NQQ sT42Y1k+LFAAZ8dDBC+sYJ3lEHvT9QZT+lK+Usw+lYgCHb9od/2iRyN1Z9LyEA3zCfBN q+RRw3QZ247ZktbfFSnh3HZWRW6z+27oJjGtBCc011u6WvBnd78rbNZQmtZ6sOoRFM9w FZ2Q== X-Gm-Message-State: AOAM532wIdI0TodW/+5W9bbYGcJ1zurmIdWduRk8ihMhU0cvXy7b5BX6 afBZKm8Oz0XZhIzy77G03/zrcJZk3mRWAQ== X-Google-Smtp-Source: ABdhPJxaLBLWdx6Xobx8IAM1MVxaA2CasRwMjMxxl8PrpQlemZCfBPcTzccPvvIe+duWwS6nbugh2w== X-Received: by 2002:a37:87c4:: with SMTP id j187mr7213328qkd.408.1614911763171; Thu, 04 Mar 2021 18:36:03 -0800 (PST) Original-Received: from localhost.localdomain (dsl-10-132-106.b2b2c.ca. [72.10.132.106]) by smtp.gmail.com with ESMTPSA id a34sm1009349qtc.97.2021.03.04.18.36.02 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 04 Mar 2021 18:36:02 -0800 (PST) X-Mailer: git-send-email 2.30.1 In-Reply-To: <20210305023524.15317-1-maxim.cournoyer@gmail.com> Received-SPF: pass client-ip=2607:f8b0:4864:20::72f; envelope-from=maxim.cournoyer@gmail.com; helo=mail-qk1-x72f.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FROM=0.001, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-Mailman-Approved-At: Thu, 04 Mar 2021 22:01:12 -0500 X-BeenThere: guile-devel@gnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "Developers list for Guile, the GNU extensibility library" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guile-devel-bounces+guile-devel=m.gmane-mx.org@gnu.org Original-Sender: "guile-devel" Xref: news.gmane.io gmane.lisp.guile.devel:20688 Archived-At: And add a new --with-guile-site-dir option that allows specifying an exact location explicitly. Also add a --with-versioned-site-dir option that appends the effective Guile version to the default site directory when set to 'yes'. * m4/guile-ext.m4: Remove file. * configure.ac (GUILE_GLOBAL_SITE_DIR, GUILE_SITE_CCACHE_DIR): Remove macro uses. Adjust to use the GUILE_SITE and GUILE_SITE_CCACHE variables defined by the GUILE_SITE_DIR macro from guile.m4. The default SITEDIR and SITECCACHEDIR values now match the more standard layout suggested in the Guile Reference manual. It's now also possible to have the default SITEDIR versioned. [--with-guile-site-dir]: New option to specify an exact site installation directory. Add it to the notice message. --- configure.ac | 57 +++++++++++++++++++++++++++++-------- m4/guile-ext.m4 | 74 ------------------------------------------------- 2 files changed, 45 insertions(+), 86 deletions(-) delete mode 100644 m4/guile-ext.m4 diff --git a/configure.ac b/configure.ac index da741ba..dd5e91c 100644 --- a/configure.ac +++ b/configure.ac @@ -8,6 +8,7 @@ define(GUILE_LIB_CONFIGURE_COPYRIGHT,[[ Copyright (C) 2016 - 2018 David Pirotte David Pirotte +Copyright (C) 2021 Maxim Cournoyer This file is part of Guile-Lib. @@ -63,8 +64,6 @@ dnl dependency version to 2.0.12 [or higher], because it has texinfo dnl patches so 'make check' pass. GUILE_PROGS([2.0.12]) GUILE_SITE_DIR -GUILE_GLOBAL_SITE_DIR -GUILE_SITE_CCACHE_DIR GUILE_FLAGS dnl This argument is passed to guild; it ensures cross-compiling uses @@ -78,22 +77,54 @@ AC_ARG_WITH( [AS_HELP_STRING( [--with-guile-site], [install source modules and compiled files using Guile's site and site-ccache dirs])], - [case "x$withval" in - xyes) - guile_site="yes";; + [case "$withval" in + yes) + guile_site=yes;; *) - guile_site="no";; + guile_site=no;; esac], [guile_site="no"]) AC_SUBST([guile_site]) -if test "x$guile_site" = "xyes"; then - SITEDIR="$GUILE_GLOBAL_SITE"; - SITECCACHEDIR="$GUILE_SITE_CCACHE"; +AC_ARG_WITH( + [guile-site-dir], + [AS_HELP_STRING( + [--with-guile-site-dir], + [install source modules to the provided directory])], + [guile_site_dir=$withval], + [guile_site_dir=""]) +AC_SUBST([guile_site_dir]) + +AC_ARG_WITH( + [versioned-site-dir], + [AS_HELP_STRING( + [--with-versioned-site-dir], + [append the effective version of Guile to the default site directory])], + [case "$withval" in + yes) + versioned_site_dir=yes;; + *) + versioned_site_dir=no;; + esac], + [versioned_site_dir=no]) +AC_SUBST([versioned_site_dir]) + +if test "$guile_site" = "yes"; then + SITEDIR=$GUILE_SITE + SITECCACHEDIR=$GUILE_SITE_CCACHE else - SITEDIR="$datadir/guile-lib"; - SITECCACHEDIR="$libdir/guile-lib/guile/$GUILE_EFFECTIVE_VERSION/site-ccache"; +dnl These are the default values. + SITEDIR=$datadir/guile/site + test "$versioned_site_dir" = yes && SITEDIR+=/$GUILE_EFFECTIVE_VERSION + SITECCACHEDIR=$libdir/guile/$GUILE_EFFECTIVE_VERSION/site-ccache fi + +dnl Process guile_site_dir here, so that it takes precedence over any +dnl other value. +if test "$guile_site_dir" != ""; then + SITEDIR=$guile_site_dir +fi + AC_SUBST([SITEDIR]) AC_SUBST([SITECCACHEDIR]) @@ -122,7 +153,9 @@ AC_MSG_NOTICE( [datarootdir=$datarootdir] [datadir=$datadir] [] - [--with-guile-site="$guile_site"] + [--with-guile-site=$guile_site] + [--with-guile-site-dir=${guile_site_dir:-unspecified}] + [--with-versioned-site-dir=${versioned_site_dir}] [] [sitedir (source code): ${SITEDIR}] [siteccachedir (compiled modules): ${SITECCACHEDIR}] diff --git a/m4/guile-ext.m4 b/m4/guile-ext.m4 deleted file mode 100644 index 9eebcc5..0000000 --- a/m4/guile-ext.m4 +++ /dev/null @@ -1,74 +0,0 @@ -## Autoconf macros for working with Guile. - -## Copyright (C) 2017 Free Software Foundation, Inc. - -## This library is free software; you can redistribute it and/or -## modify it under the terms of the GNU Lesser General Public License -## as published by the Free Software Foundation; either version 3 of -## the License, or (at your option) any later version. - -## This library is distributed in the hope that it will be useful, -## but WITHOUT ANY WARRANTY; without even the implied warranty of -## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -## Lesser General Public License for more details. - -## You should have received a copy of the GNU Lesser General Public -## License along with this library; if not, write to the Free Software -## Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA -## 02110-1301 USA - -# serial 10 - -## Index -## ----- - -## GUILE_GLOBAL_SITE_DIR -- find path to Guile "global site" directory -## GUILE_SITE_CCACHE_DIR -- find path to Guile "site-ccache" directory - -## Code -## ---- - - -# GUILE_GLOBAL_SITE_DIR -- find path to Guile global site directory -# -# Usage: GUILE_GLOBAL_SITE_DIR -# -# This looks for Guile's global site directory, usually something like -# PREFIX/share/guile/site, and sets var @var{GUILE_GLOBAL_SITE} to the -# path. Note that the var name is different from the macro name. -# -# The variable is marked for substitution, as by @code{AC_SUBST}. -# -AC_DEFUN([GUILE_GLOBAL_SITE_DIR], - [AC_REQUIRE([GUILE_PROGS]) - AC_MSG_CHECKING(for Guile global site directory) - GUILE_GLOBAL_SITE=`$GUILE -c "(display (%global-site-dir))"` - if test "$GUILE_GLOBAL_SITE" = ""; then - AC_MSG_FAILURE(global site dir not found) - fi - AC_MSG_RESULT($GUILE_GLOBAL_SITE) - AC_SUBST(GUILE_GLOBAL_SITE) - ]) - - -# GUILE_SITE_CCACHE_DIR -- find path to Guile "site-ccache" directory -# -# Usage: GUILE_SITE_CCACHE_DIR -# -# This looks for Guile's "site-ccache" directory, usually something -# like PREFIX/lib/guile/GUILE_EFFECTIVE_VERSION/site-ccache, and sets -# var @var{GUILE_SITE_CCACHE} to the path. Note that the var name is -# different from the macro name. -# -# The variable is marked for substitution, as by @code{AC_SUBST}. -# -AC_DEFUN([GUILE_SITE_CCACHE_DIR], - [AC_REQUIRE([GUILE_PROGS]) - AC_MSG_CHECKING(for Guile site ccache directory) - GUILE_SITE_CCACHE=`$GUILE -c "(display (%site-ccache-dir))"` - if test "$GUILE_SITE_CCACHE" = ""; then - AC_MSG_FAILURE(site ccache dir not found) - fi - AC_MSG_RESULT($GUILE_SITE_CCACHE) - AC_SUBST(GUILE_SITE_CCACHE) - ]) -- 2.30.1