From ec6a023c6634777da138f6237aab98b2f40ed4c2 Mon Sep 17 00:00:00 2001 From: ulfvonbelow Date: Thu, 2 Feb 2023 19:29:50 +0000 Subject: config.scm.in: rename to config.scm.in.in, substitute from Makefile. * src/mcron/config.scm.in: renamed to config.scm.in.in. (config-sbin-dir): new variable. * Makefile.am: substitute in config.scm.in. --- Makefile.am | 15 +++++++++------ configure.ac | 2 +- src/mcron/config.scm.in | 42 ------------------------------------------ src/mcron/config.scm.in.in | 43 +++++++++++++++++++++++++++++++++++++++++++ 4 files changed, 53 insertions(+), 49 deletions(-) delete mode 100644 src/mcron/config.scm.in create mode 100644 src/mcron/config.scm.in.in diff --git a/Makefile.am b/Makefile.am index a9ef5a9..4afd7f3 100755 --- a/Makefile.am +++ b/Makefile.am @@ -100,10 +100,7 @@ DISTCLEANFILES = src/mcron/config.scm --warn=format --warn=unbound-variable --warn=arity-mismatch \ --target="$(host)" --output="$@" "$<" $(devnull_verbose) - -bin/% : src/%.in Makefile - $(AM_V_GEN)$(MKDIR_P) bin ; \ - sed -e 's,%PREFIX%,${prefix},g' \ +do_subst = sed -e 's,%PREFIX%,${prefix},g' \ -e 's,%modsrcdir%,${guilesitedir},g' \ -e 's,%modbuilddir%,${guilesitegodir},g' \ -e 's,%localstatedir%,${localstatedir},g' \ @@ -114,8 +111,14 @@ bin/% : src/%.in Makefile -e 's,%PACKAGE_BUGREPORT%,@PACKAGE_BUGREPORT@,g' \ -e 's,%PACKAGE_NAME%,@PACKAGE_NAME@,g' \ -e 's,%PACKAGE_URL%,@PACKAGE_URL@,g' \ - -e 's,%GUILE%,$(GUILE),g' \ - $< > $@ ; \ + -e 's,%GUILE%,$(GUILE),g' + +src/mcron/config.scm: src/mcron/config.scm.in Makefile + $(AM_V_GEN)$(do_subst) $< > $@ + +bin/% : src/%.in Makefile + $(AM_V_GEN)$(MKDIR_P) bin ; \ + $(do_subst) $< > $@ ; \ chmod a+x $@ diff --git a/configure.ac b/configure.ac index 451777d..7ea532f 100644 --- a/configure.ac +++ b/configure.ac @@ -127,5 +127,5 @@ AC_CONFIG_FILES([pre-inst-env:build-aux/pre-inst-env.in], [chmod +x pre-inst-env]) AC_CONFIG_FILES([doc/config.texi Makefile - src/mcron/config.scm]) + src/mcron/config.scm.in]) AC_OUTPUT diff --git a/src/mcron/config.scm.in b/src/mcron/config.scm.in deleted file mode 100644 index e6a0e07..0000000 --- a/src/mcron/config.scm.in +++ /dev/null @@ -1,42 +0,0 @@ -;;;; config.scm -- variables defined at configure time -;;; Copyright © 2003 Dale Mellor -;;; Copyright © 2015, 2016 Mathieu Lirzin -;;; -;;; This file is part of GNU Mcron. -;;; -;;; GNU Mcron is free software: you can redistribute it and/or modify -;;; it under the terms of the GNU General Public License as published by -;;; the Free Software Foundation, either version 3 of the License, or -;;; (at your option) any later version. -;;; -;;; GNU Mcron 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 General Public License for more details. -;;; -;;; You should have received a copy of the GNU General Public License -;;; along with GNU Mcron. If not, see . - -(define-module (mcron config)) - -(define-public config-package-name "@PACKAGE_NAME@") -(define-public config-package-version "@PACKAGE_VERSION@") -(define-public config-package-string "@PACKAGE_STRING@") -(define-public config-package-bugreport "@PACKAGE_BUGREPORT@") -(define-public config-package-url "@PACKAGE_URL@") -(define-public config-sendmail "@SENDMAIL@") - -(define-public config-spool-dir "@CONFIG_SPOOL_DIR@") -(define-public config-socket-file "@CONFIG_SOCKET_FILE@") -(define-public config-allow-file "@CONFIG_ALLOW_FILE@") -(define-public config-deny-file "@CONFIG_DENY_FILE@") -(define-public config-pid-file "@CONFIG_PID_FILE@") -(define-public config-tmp-dir "@CONFIG_TMP_DIR@") - -;;; -;;; Runtime configuration -;;; - -(define-public config-debug - ;; Trigger the display of Guile stack traces on errors. - (getenv "MCRON_DEBUG")) diff --git a/src/mcron/config.scm.in.in b/src/mcron/config.scm.in.in new file mode 100644 index 0000000..769a913 --- /dev/null +++ b/src/mcron/config.scm.in.in @@ -0,0 +1,43 @@ +;;;; config.scm -- variables defined at configure time +;;; Copyright © 2003 Dale Mellor +;;; Copyright © 2015, 2016 Mathieu Lirzin +;;; +;;; This file is part of GNU Mcron. +;;; +;;; GNU Mcron is free software: you can redistribute it and/or modify +;;; it under the terms of the GNU General Public License as published by +;;; the Free Software Foundation, either version 3 of the License, or +;;; (at your option) any later version. +;;; +;;; GNU Mcron 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 General Public License for more details. +;;; +;;; You should have received a copy of the GNU General Public License +;;; along with GNU Mcron. If not, see . + +(define-module (mcron config)) + +(define-public config-package-name "@PACKAGE_NAME@") +(define-public config-package-version "@PACKAGE_VERSION@") +(define-public config-package-string "@PACKAGE_STRING@") +(define-public config-package-bugreport "@PACKAGE_BUGREPORT@") +(define-public config-package-url "@PACKAGE_URL@") +(define-public config-sendmail "@SENDMAIL@") + +(define-public config-sbin-dir "%sbindir%") +(define-public config-spool-dir "@CONFIG_SPOOL_DIR@") +(define-public config-socket-file "@CONFIG_SOCKET_FILE@") +(define-public config-allow-file "@CONFIG_ALLOW_FILE@") +(define-public config-deny-file "@CONFIG_DENY_FILE@") +(define-public config-pid-file "@CONFIG_PID_FILE@") +(define-public config-tmp-dir "@CONFIG_TMP_DIR@") + +;;; +;;; Runtime configuration +;;; + +(define-public config-debug + ;; Trigger the display of Guile stack traces on errors. + (getenv "MCRON_DEBUG")) -- cgit v1.2.3