Argonne National Laboratory

Experimental Physics and
Industrial Control System

1994  1995  1996  1997  1998  1999  2000  2001  2002  2003  2004  <20052006  2007  2008  2009  2010  2011  2012  2013  2014  2015  2016  2017  2018  2019  2020  Index 1994  1995  1996  1997  1998  1999  2000  2001  2002  2003  2004  <20052006  2007  2008  2009  2010  2011  2012  2013  2014  2015  2016  2017  2018  2019  2020 
<== Date ==> <== Thread ==>

Subject: Re: 3.14 build system doesn't cope with hyphens in IOC names
From: "Ernest L. Williams Jr." <ernesto@ornl.gov>
To: "Denison, PN (Peter)" <peter.denison@diamond.ac.uk>
Cc: EPICS tech-talk <tech-talk@aps.anl.gov>
Date: Thu, 01 Sep 2005 09:02:06 -0400
Hi,


We use hyphens in our IOC names under EPICS R3.14.7.
I don't remember making any modifications to support this.

For example,

=============================================================================

[williams@lion test]$ makeBaseApp.pl -t example example
[williams@lion test]$ makeBaseApp.pl -i -t example my-new-ioc
The following target architectures are available in base:
    vxWorks-mv2100_v6
    vxWorks-mv5100_v6
    vxWorks-ppc603_T2-2
    vxWorks-ppc603_long
    vxWorks-ppc603
    linux-x86
    vxWorks-ppc604_T2-2
What architecture do you want to use? vxWorks-ppc603
[williams@lion test]$ ls
configure/  exampleApp/  iocBoot/  Makefile
[williams@lion test]$ ls  iocBoot/
iocmy-new-ioc/  Makefile  nfsCommands
==============================================================================

Works perfect.




On Thu, 2005-09-01 at 13:48 +0100, Denison, PN (Peter) wrote:
> The build system in R3.14 won't cope with IOC names containing hyphens
> (or any other character permitted in filenames, but not permitted in C
> identifiers). This is a problem for us with our current naming
> convention. It occurs because the auto-generated
> <name>_registerRecordDeviceDriver.cpp file uses the app name to
> construct a function <name>_registerRecordDeviceDriver() that is then
> called from the st.cmd file.
> 
> The following patch to base just converts all the non-allowed characters
> in the app name to underscores. Unfortunately, it relies on a change to
> the ioc templates for makeBaseApp.pl, introducing a "_CSAFEAPPNAME_"
> substitution where previously there was just "_APPNAME_". 
> 
> Is this a candidate for sneaking into R3.14.8? Can anyone suggest a
> better way?
> 
> Index: src/registry/registerRecordDeviceDriver.pl
> ===================================================================
> --- src/registry/registerRecordDeviceDriver.pl	(revision 67)
> +++ src/registry/registerRecordDeviceDriver.pl	(working copy)
> @@ -15,6 +15,11 @@
>  $numberDeviceSupport = 0;
>  $numberDriverSupport = 0;
>  
> +# PND 2005-08-31 avoid C errors by using only allowed characters in
> identifiers
> +# Requires a corresponding change in the substitution of st.cmd files
> +$c_bad_ident_chars = '[^0-9A-Za-z_]';
> +$subname =~ s/$c_bad_ident_chars/_/g;
> +
>  open(INP,"$file") or die "$! opening file";
>  while(<INP>) {
>      next if m/ ^ \s* \# /x;
> Index: src/makeBaseApp/top/iocBoot/ioc/st.cmd@Common
> ===================================================================
> --- src/makeBaseApp/top/iocBoot/ioc/st.cmd@Common	(revision 67)
> +++ src/makeBaseApp/top/iocBoot/ioc/st.cmd@Common	(working copy)
> @@ -9,7 +9,7 @@
>  
>  ## Register all support components
>  dbLoadDatabase("dbd/_APPNAME_.dbd",0,0)
> -_APPNAME__registerRecordDeviceDriver(pdbbase)
> +_CSAFEAPPNAME__registerRecordDeviceDriver(pdbbase)
>  
>  ## Load record instances
>  #dbLoadRecords("db/xxx.db","user=_USER_Host")
> Index: src/makeBaseApp/top/iocBoot/ioc/st.cmd@RTEMS
> ===================================================================
> --- src/makeBaseApp/top/iocBoot/ioc/st.cmd@RTEMS	(revision 67)
> +++ src/makeBaseApp/top/iocBoot/ioc/st.cmd@RTEMS	(working copy)
> @@ -7,7 +7,7 @@
>  
>  ## Register all support components
>  dbLoadDatabase("dbd/_APPNAME_.dbd",0,0)
> -_APPNAME__registerRecordDeviceDriver(pdbbase) 
> +_CSAFEAPPNAME__registerRecordDeviceDriver(pdbbase) 
>  
>  ## Load record instances
>  dbLoadRecords("../../db/_APPNAME_.db","user=_USER_")
> Index: src/makeBaseApp/top/iocBoot/ioc/st.cmd@vxWorks
> ===================================================================
> --- src/makeBaseApp/top/iocBoot/ioc/st.cmd@vxWorks	(revision 67)
> +++ src/makeBaseApp/top/iocBoot/ioc/st.cmd@vxWorks	(working copy)
> @@ -16,7 +16,7 @@
>  ## Register all support components
>  cd top
>  dbLoadDatabase("dbd/_APPNAME_.dbd",0,0)
> -_APPNAME__registerRecordDeviceDriver(pdbbase)
> +_CSAFEAPPNAME__registerRecordDeviceDriver(pdbbase)
>  
>  ## Load record instances
>  #dbLoadRecords("db/_APPNAME_.db","macro=value")
> Index: src/makeBaseApp/makeBaseApp.pl
> ===================================================================
> --- src/makeBaseApp/makeBaseApp.pl	(revision 67)
> +++ src/makeBaseApp/makeBaseApp.pl	(working copy)
> @@ -14,6 +14,8 @@
>  %release = (TOP => $app_top);
>  @apps   = (TOP);
>  
> +$c_bad_ident_chars = '[^0-9A-Za-z_]';
> +
>  &GetUser;		# Ensure we know who's in charge
>  &readRelease("configure/RELEASE", \%release, \@apps) if (-r
> "configure/RELEASE");
>  &readRelease("configure/RELEASE.$ENV{EPICS_HOST_ARCH}", \%release,
> \@apps)
> @@ -93,6 +95,7 @@
>      $line =~ s/_TEMPLATE_TOP_/$app_template_top/go;
>      $line =~ s/_TOP_/$app_top/go;
>      $line =~ s/_APPNAME_/$appname/g;
> +    $line =~ s/_CSAFEAPPNAME_/$csafeappname/g;
>      $line =~ s/_APPTYPE_/$apptype/go;
>      $line =~ s/_ARCH_/$arch/go if ($opt_i);
>      $line =~ s/_IOC_/$ioc/g if ($ioc);
> @@ -122,6 +125,7 @@
>  
>      foreach $ioc ( @ARGV ) {
>  	($appname = $ioc) =~ s/App$//;
> +	($csafeappname = $appname) =~ s/$c_bad_ident_chars/_/g;
>  	$ioc = "ioc" . $ioc unless ($ioc =~ /^ioc/);
>          if (-d "iocBoot/$ioc") {
>  	    print "iocBoot/$ioc exists, not modified.\n";
> @@ -137,6 +141,7 @@
>  #
>  foreach $app ( @ARGV ) {
>      ($appname = $app) =~ s/App$//;
> +    ($csafeappname = $appname) =~ s/$c_bad_ident_chars/_/g;
>      $appdir  = $appname . "App";
>      if (-d "$appdir") {
>  	print "$appname exists, not modified.\n";
> 
> Peter Denison, Senior Software Engineer
> Diamond Light Source Ltd., Diamond House, Chilton, Didcot, Oxon, OX11
> 0DE
> Tel: +44 1235 778511


References:
3.14 build system doesn't cope with hyphens in IOC names Denison, PN (Peter)

Navigate by Date:
Prev: 3.14 build system doesn't cope with hyphens in IOC names Denison, PN (Peter)
Next: RE: 3.14 build system doesn't cope with hyphens in IOC names Denison, PN (Peter)
Index: 1994  1995  1996  1997  1998  1999  2000  2001  2002  2003  2004  <20052006  2007  2008  2009  2010  2011  2012  2013  2014  2015  2016  2017  2018  2019  2020 
Navigate by Thread:
Prev: 3.14 build system doesn't cope with hyphens in IOC names Denison, PN (Peter)
Next: RE: 3.14 build system doesn't cope with hyphens in IOC names Denison, PN (Peter)
Index: 1994  1995  1996  1997  1998  1999  2000  2001  2002  2003  2004  <20052006  2007  2008  2009  2010  2011  2012  2013  2014  2015  2016  2017  2018  2019  2020 
ANJ, 02 Sep 2010 Valid HTML 4.01! · Home · News · About · Base · Modules · Extensions · Distributions · Download ·
· Search · EPICS V4 · IRMIS · Talk · Bugs · Documents · Links · Licensing ·