From b0151cad38a7f71b5888f393db9b7d2673b67b52 Mon Sep 17 00:00:00 2001 From: Mathieu Lirzin Date: Fri, 8 May 2020 17:19:28 +0200 Subject: build: Handle missing "bin" directory This fixes the generation of scripts when "bin" directory does not exist. * Makefile.am (bin/%): Invoke $(MKDIR_P) first. --- Makefile.am | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/Makefile.am b/Makefile.am index e8fe80c..f63ff8f 100755 --- a/Makefile.am +++ b/Makefile.am @@ -1,6 +1,6 @@ ## Process this file with automake to produce Makefile.in. # Copyright © 2003 Dale Mellor -# Copyright © 2015, 2016, 2017, 2018 Mathieu Lirzin +# Copyright © 2015, 2016, 2017, 2018, 2020 Mathieu Lirzin # # This file is part of GNU Mcron. # @@ -100,7 +100,8 @@ DISTCLEANFILES = src/mcron/config.scm bin/% : src/%.in Makefile - -@sed -e 's,%PREFIX%,${prefix},g' \ + $(AM_V_GEN)$(MKDIR_P) bin ; \ + sed -e 's,%PREFIX%,${prefix},g' \ -e 's,%modsrcdir%,${guilesitedir},g' \ -e 's,%modbuilddir%,${guilesitegodir},g' \ -e 's,%localstatedir%,${localstatedir},g' \ @@ -112,8 +113,8 @@ bin/% : src/%.in Makefile -e 's,%PACKAGE_NAME%,@PACKAGE_NAME@,g' \ -e 's,%PACKAGE_URL%,@PACKAGE_URL@,g' \ -e 's,%GUILE%,$(GUILE),g' \ - $< > $@; - -@chmod a+x $@ + $< > $@ ; \ + chmod a+x $@ ## ------------ ## -- cgit v1.2.3 From 39857ae8442853e4f7d89116da400ca24d58ba7b Mon Sep 17 00:00:00 2001 From: Mathieu Lirzin Date: Fri, 8 May 2020 17:20:06 +0200 Subject: build: Distribute script source files This allows 'make distcheck' to succeed. * Makefile.am (EXTRA_DIST): Add script source files. --- Makefile.am | 3 +++ 1 file changed, 3 insertions(+) diff --git a/Makefile.am b/Makefile.am index f63ff8f..b5c6260 100755 --- a/Makefile.am +++ b/Makefile.am @@ -148,6 +148,9 @@ EXTRA_DIST = \ bootstrap \ build-aux/guix.scm \ HACKING \ + src/cron.in \ + src/crontab.in \ + src/mcron.in \ tests/init.sh \ $(TESTS) -- cgit v1.2.3 From 6ae322468832759c1950779d6faff0fa550580ce Mon Sep 17 00:00:00 2001 From: Mathieu Lirzin Date: Fri, 8 May 2020 18:06:20 +0200 Subject: scripts: Separate build/install directory context This prevents installed modules to interfere with the ones from the build directory. * src/cron.in: Augment Guile load paths with install directories only when MCRON_UNINSTALLED environment variable is not set. * src/crontab.in: Likewise. * src/mcron.in: Likewise. --- src/cron.in | 8 +++++--- src/crontab.in | 6 ++++-- src/mcron.in | 8 +++++--- 3 files changed, 14 insertions(+), 8 deletions(-) diff --git a/src/cron.in b/src/cron.in index 97d49b4..25ad273 100644 --- a/src/cron.in +++ b/src/cron.in @@ -2,7 +2,9 @@ -*- scheme -*- !# -(set! %load-path (cons "%modsrcdir%" %load-path)) -(set! %load-compiled-path (cons "%modbuilddir%" %load-compiled-path)) -(use-modules (mcron scripts cron)) +(unless (getenv "MCRON_UNINSTALLED") + (set! %load-path (cons "%modsrcdir%" %load-path)) + (set! %load-compiled-path (cons "%modbuilddir%" %load-compiled-path))) + +(use-modules (mcron scripts cron)) (main) diff --git a/src/crontab.in b/src/crontab.in index fa31878..dad0dd2 100644 --- a/src/crontab.in +++ b/src/crontab.in @@ -2,6 +2,8 @@ -*- scheme -*- !# -(set! %load-path (cons "%modsrcdir%" %load-path)) -(set! %load-compiled-path (cons "%modbuilddir%" %load-compiled-path)) +(unless (getenv "MCRON_UNINSTALLED") + (set! %load-path (cons "%modsrcdir%" %load-path)) + (set! %load-compiled-path (cons "%modbuilddir%" %load-compiled-path))) + ((@ (mcron scripts crontab) main)) diff --git a/src/mcron.in b/src/mcron.in index 4519ad0..268743c 100644 --- a/src/mcron.in +++ b/src/mcron.in @@ -2,7 +2,9 @@ -*- scheme -*- !# -(set! %load-path (cons "%modsrcdir%" %load-path)) -(set! %load-compiled-path (cons "%modbuilddir%" %load-compiled-path)) -(use-modules (mcron scripts mcron)) +(unless (getenv "MCRON_UNINSTALLED") + (set! %load-path (cons "%modsrcdir%" %load-path)) + (set! %load-compiled-path (cons "%modbuilddir%" %load-compiled-path))) + +(use-modules (mcron scripts mcron)) (main) -- cgit v1.2.3 From bfe2a8921226cc7ccb54357d4f0c07534b763671 Mon Sep 17 00:00:00 2001 From: Mathieu Lirzin Date: Fri, 8 May 2020 19:24:00 +0200 Subject: build: Detect guile M4 macro expansion errors This ensures that the absence of 'pkg-config' or 'guile' M4 macros expansion do not pass the bootstrap step. * configure.ac: Allow or forbid some M4 macros patterns in the generated 'configure' script. --- configure.ac | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/configure.ac b/configure.ac index f92619b..d27e12e 100755 --- a/configure.ac +++ b/configure.ac @@ -1,7 +1,7 @@ ## Process this file with autoconf to produce a configure script. # # Copyright © 2003, 2005, 2012, 2014 Dale Mellor -# Copyright © 2015, 2016, 2017, 2018 Mathieu Lirzin +# Copyright © 2015, 2016, 2017, 2018, 2020 Mathieu Lirzin # Copyright © 2018 宋文武 # # This file is part of GNU Mcron. @@ -33,6 +33,13 @@ AM_SILENT_RULES([yes]) # Enables silent rules by default. AC_CANONICAL_HOST +dnl We require pkg.m4 (from pkg-config) and guile.m4 (from Guile.) +dnl Make sure they are available when generating the configure script. +m4_pattern_forbid([^PKG_PROG]) +m4_pattern_forbid([^PKG_CHECK]) +m4_pattern_forbid([^GUILE_P]) +m4_pattern_allow([^GUILE_PKG_ERRORS]) + # Check for Guile development files. GUILE_PKG([3.0 2.2 2.0]) -- cgit v1.2.3 From 289e4c505e52402e5dfba08d57f2ba1d61a90bf3 Mon Sep 17 00:00:00 2001 From: Mathieu Lirzin Date: Sat, 9 May 2020 00:30:23 +0200 Subject: build: Remove C specific Guile configuration step * configure.ac: Remove unecessary PKG_CHECK_MODULES invocation. --- configure.ac | 5 ----- 1 file changed, 5 deletions(-) diff --git a/configure.ac b/configure.ac index d27e12e..97e9cff 100755 --- a/configure.ac +++ b/configure.ac @@ -43,12 +43,7 @@ m4_pattern_allow([^GUILE_PKG_ERRORS]) # Check for Guile development files. GUILE_PKG([3.0 2.2 2.0]) -# Set Guile flags without using GUILE_FLAGS which is requiring the unused -# 'config.rpath' script. -PKG_CHECK_MODULES(GUILE, [guile-$GUILE_EFFECTIVE_VERSION]) - # Checks for programs. - GUILE_PROGS AM_MISSING_PROG(HELP2MAN, help2man, $missing_dir) -- cgit v1.2.3