From 2e07fda7a90afdf7c89fccebee3e624e972d815e Mon Sep 17 00:00:00 2001
From: Giovanni Bussi <giovanni.bussi@gmail.com>
Date: Wed, 22 Jul 2015 07:51:49 -0600
Subject: [PATCH] Added check that program_name does not terminate with
 "kernel"

this is required to avoid name clashes
---
 configure    | 4 ++++
 configure.ac | 4 ++++
 2 files changed, 8 insertions(+)

diff --git a/configure b/configure
index 9e4848e47..65fbb7107 100755
--- a/configure
+++ b/configure
@@ -6735,6 +6735,10 @@ program_transform_name=`$as_echo "$program_transform_name" | sed "$ac_script"`
 program_transform_name_sh=$(echo "${program_transform_name}" | sed 's:\$\$:$:g')
 program_name=$(echo plumed | sed "$program_transform_name_sh")
 
+if test "$(echo "$program_name" | tr 'A-Z' 'a-z')" != "$(echo "$program_name" | tr 'A-Z' 'a-z' | sed 's/kernel$//')" ; then
+  as_fn_error $? "$program_name is not a valid program name (should not terminate with Kernel)" "$LINENO" 5
+fi
+
 { $as_echo "$as_me:${as_lineno-$LINENO}: **** PLUMED will be installed using prefix $prefix" >&5
 $as_echo "$as_me: **** PLUMED will be installed using prefix $prefix" >&6;}
 { $as_echo "$as_me:${as_lineno-$LINENO}: **** You can change this later using \"make install prefix=/path\"" >&5
diff --git a/configure.ac b/configure.ac
index e61908451..4e9b2ad5a 100644
--- a/configure.ac
+++ b/configure.ac
@@ -629,6 +629,10 @@ AC_ARG_PROGRAM
 program_transform_name_sh=$(echo "${program_transform_name}" | sed 's:\$\$:$:g')
 program_name=$(echo plumed | sed "$program_transform_name_sh")
 
+if test "$(echo "$program_name" | tr '[A-Z]' '[a-z]')" != "$(echo "$program_name" | tr '[A-Z]' '[a-z]' | sed 's/kernel$//')" ; then
+  AC_MSG_ERROR([$program_name is not a valid program name (should not terminate with Kernel)])
+fi
+
 AC_MSG_NOTICE([**** PLUMED will be installed using prefix $prefix])
 AC_MSG_NOTICE([**** You can change this later using "make install prefix=/path"])
 AC_MSG_NOTICE([**** Executable will be named $program_name])
-- 
GitLab