From f02884d9968b473a5fd6d340f25376ff947f8eda Mon Sep 17 00:00:00 2001 From: Hugo Slepicka Date: Thu, 29 Apr 2021 17:11:36 -0700 Subject: [PATCH 1/5] Add error message for when EPICS_BASE is not set on templates. Add error message and validation at convertRelease.pl for empty RELEASE files. --- src/template/base/top/configure/CONFIG | 5 +++++ src/template/ext/top/configure/CONFIG | 5 +++++ src/tools/convertRelease.pl | 6 ++++++ 3 files changed, 16 insertions(+) diff --git a/src/template/base/top/configure/CONFIG b/src/template/base/top/configure/CONFIG index c1a470322..7dfd05d5b 100644 --- a/src/template/base/top/configure/CONFIG +++ b/src/template/base/top/configure/CONFIG @@ -13,6 +13,11 @@ ifdef T_A -include $(TOP)/configure/RELEASE.$(EPICS_HOST_ARCH).$(T_A) endif +# Check for proper EPICS_BASE +ifneq (file,$(origin EPICS_BASE)) + $(error EPICS_BASE must be defined in configure/RELEASE or a similar file or it will not be correctly read by convertRelease.pl!) +endif + CONFIG = $(RULES)/configure include $(CONFIG)/CONFIG diff --git a/src/template/ext/top/configure/CONFIG b/src/template/ext/top/configure/CONFIG index 321f6cea2..de0742729 100644 --- a/src/template/ext/top/configure/CONFIG +++ b/src/template/ext/top/configure/CONFIG @@ -17,6 +17,11 @@ ifdef T_A -include $(TOP)/configure/RELEASE.$(EPICS_HOST_ARCH).$(T_A) endif +# Check for proper EPICS_BASE +ifneq (file,$(origin EPICS_BASE)) + $(error EPICS_BASE must be defined in configure/RELEASE or a similar file or it will not be correctly read by convertRelease.pl!) +endif + CONFIG = $(RULES)/configure include $(CONFIG)/CONFIG diff --git a/src/tools/convertRelease.pl b/src/tools/convertRelease.pl index 3375eb4f2..d2fa2dc87 100644 --- a/src/tools/convertRelease.pl +++ b/src/tools/convertRelease.pl @@ -113,6 +113,9 @@ EOF # sub releaseTops { my @includes = grep !m/^ (TOP | TEMPLATE_TOP) $/x, @apps; + if (!@includes) { + die "No variables defined in RELEASE*s"; + } print join(' ', @includes), "\n"; } @@ -256,6 +259,9 @@ sub checkRelease { } my @modules = grep(!m/^(RULES|TOP|TEMPLATE_TOP)$/, @apps); + if (!@modules) { + die "No variables defined in RELEASE*s"; + } my $app = shift @modules; my $latest = AbsPath($macros{$app}); my %paths = ($latest => $app); From 9cca12936dd6a361a6c0fa958960e0747e19ce53 Mon Sep 17 00:00:00 2001 From: Andrew Johnson Date: Mon, 17 May 2021 12:11:00 -0500 Subject: [PATCH 2/5] Expand EPICS_BASE checks in templates --- src/template/base/top/configure/CONFIG | 8 ++++++-- src/template/ext/top/configure/CONFIG | 8 ++++++-- 2 files changed, 12 insertions(+), 4 deletions(-) diff --git a/src/template/base/top/configure/CONFIG b/src/template/base/top/configure/CONFIG index 7dfd05d5b..40fa93140 100644 --- a/src/template/base/top/configure/CONFIG +++ b/src/template/base/top/configure/CONFIG @@ -13,9 +13,13 @@ ifdef T_A -include $(TOP)/configure/RELEASE.$(EPICS_HOST_ARCH).$(T_A) endif -# Check for proper EPICS_BASE +# Check EPICS_BASE is set properly ifneq (file,$(origin EPICS_BASE)) - $(error EPICS_BASE must be defined in configure/RELEASE or a similar file or it will not be correctly read by convertRelease.pl!) + $(error EPICS_BASE must be set in a configure/RELEASE file) +else + ifeq ($(wildcard $(EPICS_BASE)/configure/CONFIG_BASE),) + $(error EPICS_BASE does not point to an EPICS installation) + endif endif CONFIG = $(RULES)/configure diff --git a/src/template/ext/top/configure/CONFIG b/src/template/ext/top/configure/CONFIG index de0742729..49595bc84 100644 --- a/src/template/ext/top/configure/CONFIG +++ b/src/template/ext/top/configure/CONFIG @@ -17,9 +17,13 @@ ifdef T_A -include $(TOP)/configure/RELEASE.$(EPICS_HOST_ARCH).$(T_A) endif -# Check for proper EPICS_BASE +# Check EPICS_BASE is set properly ifneq (file,$(origin EPICS_BASE)) - $(error EPICS_BASE must be defined in configure/RELEASE or a similar file or it will not be correctly read by convertRelease.pl!) + $(error EPICS_BASE must be set in a configure/RELEASE file) +else + ifeq ($(wildcard $(EPICS_BASE)/configure/CONFIG_BASE),) + $(error EPICS_BASE does not point to an EPICS installation) + endif endif CONFIG = $(RULES)/configure From e20502fb4cd2423d2c142a9581d8a339f1b2254d Mon Sep 17 00:00:00 2001 From: Andrew Johnson Date: Mon, 17 May 2021 12:12:19 -0500 Subject: [PATCH 3/5] Remove EPICS_BASE check from releaseTops() --- src/tools/convertRelease.pl | 3 --- 1 file changed, 3 deletions(-) diff --git a/src/tools/convertRelease.pl b/src/tools/convertRelease.pl index d2fa2dc87..bc20bc69c 100644 --- a/src/tools/convertRelease.pl +++ b/src/tools/convertRelease.pl @@ -113,9 +113,6 @@ EOF # sub releaseTops { my @includes = grep !m/^ (TOP | TEMPLATE_TOP) $/x, @apps; - if (!@includes) { - die "No variables defined in RELEASE*s"; - } print join(' ', @includes), "\n"; } From cc3e1039cea66aec9abce2ac454c83272e5ea65a Mon Sep 17 00:00:00 2001 From: Andrew Johnson Date: Mon, 17 May 2021 12:13:53 -0500 Subject: [PATCH 4/5] checkRelease(): expand EPICS_BASE checks --- src/tools/convertRelease.pl | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/src/tools/convertRelease.pl b/src/tools/convertRelease.pl index bc20bc69c..b8c596edb 100644 --- a/src/tools/convertRelease.pl +++ b/src/tools/convertRelease.pl @@ -227,6 +227,12 @@ sub envPaths { # Check RELEASE file consistency with support modules # sub checkRelease { + die "\nEPICS_BASE must be set in a configure/RELEASE file.\n\n" + unless grep(m/^(EPICS_BASE)$/, @apps) && + exists $macros{EPICS_BASE} && + $macros{EPICS_BASE} ne '' && + -f "$macros{EPICS_BASE}/configure/CONFIG_BASE"; + my $status = 0; delete $macros{RULES}; delete $macros{TOP}; @@ -256,9 +262,6 @@ sub checkRelease { } my @modules = grep(!m/^(RULES|TOP|TEMPLATE_TOP)$/, @apps); - if (!@modules) { - die "No variables defined in RELEASE*s"; - } my $app = shift @modules; my $latest = AbsPath($macros{$app}); my %paths = ($latest => $app); From 1db35d9edcc1dee3569edc92ad1e9c32f8744827 Mon Sep 17 00:00:00 2001 From: Andrew Johnson Date: Mon, 17 May 2021 12:16:55 -0500 Subject: [PATCH 5/5] Cosmetic changes to template configure/CONFIG files --- src/template/base/top/configure/CONFIG | 13 +++++++--- src/template/ext/top/configure/CONFIG | 34 +++++++++++++------------- 2 files changed, 27 insertions(+), 20 deletions(-) diff --git a/src/template/base/top/configure/CONFIG b/src/template/base/top/configure/CONFIG index 40fa93140..34ace5775 100644 --- a/src/template/base/top/configure/CONFIG +++ b/src/template/base/top/configure/CONFIG @@ -8,9 +8,10 @@ RULES = $(EPICS_BASE) # RELEASE files point to other application tops include $(TOP)/configure/RELEASE -include $(TOP)/configure/RELEASE.$(EPICS_HOST_ARCH).Common + ifdef T_A --include $(TOP)/configure/RELEASE.Common.$(T_A) --include $(TOP)/configure/RELEASE.$(EPICS_HOST_ARCH).$(T_A) + -include $(TOP)/configure/RELEASE.Common.$(T_A) + -include $(TOP)/configure/RELEASE.$(EPICS_HOST_ARCH).$(T_A) endif # Check EPICS_BASE is set properly @@ -28,11 +29,17 @@ include $(CONFIG)/CONFIG # Override the Base definition: INSTALL_LOCATION = $(TOP) -# CONFIG_SITE files contain other build configuration settings +# CONFIG_SITE files contain local build configuration settings include $(TOP)/configure/CONFIG_SITE + +# Host-arch specific settings -include $(TOP)/configure/CONFIG_SITE.$(EPICS_HOST_ARCH).Common + ifdef T_A + # Target-arch specific settings -include $(TOP)/configure/CONFIG_SITE.Common.$(T_A) + + # Host & target specific settings -include $(TOP)/configure/CONFIG_SITE.$(EPICS_HOST_ARCH).$(T_A) endif diff --git a/src/template/ext/top/configure/CONFIG b/src/template/ext/top/configure/CONFIG index 49595bc84..0c239bf18 100644 --- a/src/template/ext/top/configure/CONFIG +++ b/src/template/ext/top/configure/CONFIG @@ -1,13 +1,11 @@ # CONFIG - Load build configuration data # -# Do not make changes in this file, any site-specific -# overrides should be given in a CONFIG_SITE file. +# Do not make changes to this file! -# Where the build rules come from +# Allow user to override where the build rules come from RULES = $(EPICS_BASE) -INSTALL_IDLFILE = $(INSTALL) - +# RELEASE files point to other application tops include $(TOP)/configure/RELEASE -include $(TOP)/configure/RELEASE.$(EPICS_HOST_ARCH) -include $(TOP)/configure/RELEASE.$(EPICS_HOST_ARCH).Common @@ -29,24 +27,26 @@ endif CONFIG = $(RULES)/configure include $(CONFIG)/CONFIG -# Override some Base definitions +# Override the Base definition: INSTALL_LOCATION = $(TOP) -# CONFIG_SITE files contain build configuration overrides +# CONFIG_SITE files contain local build configuration settings include $(TOP)/configure/CONFIG_SITE -# Host-arch specific settings +# Host-arch specific settings for extensions are in configure/os -include $(TOP)/configure/os/CONFIG_SITE.$(EPICS_HOST_ARCH).Common +ifdef T_A + # Target-arch specific settings for extensions are in configure/os + -include $(TOP)/configure/os/CONFIG_SITE.Common.$(T_A) + + # Host & target specific settings for extensions are in configure/os + -include $(TOP)/configure/os/CONFIG_SITE.$(EPICS_HOST_ARCH).$(T_A) +endif + +# Additional settings for extensions +INSTALL_IDLFILE = $(INSTALL) + ifdef INSTALL_LOCATION_EXTENSIONS INSTALL_LOCATION = $(INSTALL_LOCATION_EXTENSIONS) endif - -ifdef T_A - # Target-arch specific settings - -include $(TOP)/configure/os/CONFIG_SITE.Common.$(T_A) - - # Host & target specific combination settings - -include $(TOP)/configure/os/CONFIG_SITE.$(EPICS_HOST_ARCH).$(T_A) -endif -