more changes for 3.14.2

This commit is contained in:
Marty Kraimer
2003-04-09 13:39:33 +00:00
parent ec3958a36e
commit 000aaea550
2 changed files with 184 additions and 214 deletions
+180 -211
View File
@@ -1,274 +1,243 @@
<!DOCTYPE doctype PUBLIC "-//w3c//dtd html 4.0 transitional//en"><html><head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<meta name="Author" content="jba">
<meta name="GENERATOR" content="Mozilla/4.77 [en] (X11; U; SunOS 5.8 sun4u) [Netscape]"></head>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<title></title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<meta name="Author" content="jba">
</head>
<body>
<center>
<h2> Converting an EPICS R3.14.1 application to R3.14.2</h2></center>
<h2>Converting an EPICS R3.14.1 application to R3.14.2</h2>
</center>
<p><br>This document describes how to convert a R3.14.1 application
so that it builds with release R3.14.2.</p>
<p>This document describes how to convert a R3.14.1 application so that it
builds with release R3.14.2.</p>
<h3> Gnumake clean uninstall</h3>
<p><span style="font-weight: bold">MAJOR CHANGE since 3.14.1</span></p>
<p>The base supplied record and device support are now build as regular
libraries rather than as just object files. This allows simplified build
ruiles. The changes do require changes to:</p>
<ul>
<li>any record, device, or driver support you provide.</li>
<li>changes to any subroutines for subRecord.</li>
<li>replace any DBD <span style="font-family: courier">function</span>
statements with <span style="font-family: courier">register</span>
statements</li>
</ul>
<p>Please read the new chapter "Getting Started" of the Application
Developer's Guide for more information about building support and ioc
applications.</p>
<h3>Gnumake clean uninstall</h3>
<blockquote>
First do a "<tt>gnumake clean uninstall"</tt> in the application's
root directory to remove all files created by earlier builds.
</blockquote>
First do a "<tt>gnumake clean uninstall"</tt> in the application's root
directory to remove all files created by earlier builds.</blockquote>
<h3>INSTALL_LOCATION_APP</h3>
<h3> INSTALL_LOCATION_APP</h3>
<blockquote>
If your application is NOT being installed into $(TOP),
move your INSTALL_LOCATION_APP definition to the configure/RELEASE file.
</blockquote>
If your application is NOT being installed into $(TOP), move your
INSTALL_LOCATION_APP definition to the configure/RELEASE file.</blockquote>
<h3>Building db files from templates changed</h3>
<blockquote>
Now if the template needed to build &lt;name&gt;.db is not named &lt;name&gt;*.template
add the line
<blockquote>
<pre>
&lt;name&gt;_template = &lt;templatename&gt;
</pre>
</blockquote>
to the *Db/Makefile.
<p>Remove any
<blockquote>
<pre>
USES_TEMPLATE =
</pre>
</blockquote>
definitions from your &lt;name&gt;App/*Db/Makefile files;
these definitions are no longer used.
</blockquote>
Now if the template needed to build &lt;name&gt;.db is not named
&lt;name&gt;*.template add the line
<blockquote>
<pre> &lt;name&gt;_template = &lt;templatename&gt;</pre>
</blockquote>
to the *Db/Makefile.
<p>Remove any</p>
<blockquote>
<pre>USES_TEMPLATE =</pre>
</blockquote>
definitions from your &lt;name&gt;App/*Db/Makefile files; these definitions
are no longer used.</blockquote>
<h3>File base.dbd no longer needed</h3>
<blockquote>
You now can add the line include "base.dbd" to your &lt;appname&gt;Include.dbd
file and remove the file &lt;name&gt;App/src/base.dbd from your src directory.
The base.dbd from R3.14.2 base/dbd will be included. However, if you only
want a subset of record definitions from base you should keep your base.dbd
file.
</blockquote>
You now can add the line include "base.dbd" to your
&lt;appname&gt;Include.dbd file and remove the file
&lt;name&gt;App/src/base.dbd from your src directory. The base.dbd from
R3.14.2 base/dbd will be included. However, if you only want a subset of
record definitions from base you should keep your base.dbd
file.</blockquote>
<h3>Record support </h3>
<blockquote>
Add the following line after all existing #includes
<h3>Record support</h3>
<blockquote>
<pre>
#include "epicsExport.h"
</pre>
</blockquote>
Add the following line after all existing #includes
The structure rset is now a typedef so change
<blockquote>
<pre>
struct rset <recordname>RSET={ ...
</pre>
</blockquote>
to
<blockquote>
<pre>
rset <recordname>RSET={ ...
</pre>
</blockquote>
and add the following line after the "rset &lt;recordname&gt;RSET=" definition.
<blockquote>
<pre>
epicsExportAddress(rset,xxxRSET);
</pre>
</blockquote>
</blockquote>
<blockquote>
<pre>#include "epicsExport.h"</pre>
</blockquote>
The structure rset is now a typedef so change
<blockquote>
<pre>struct rset <recordname>RSET={ ...</pre>
</blockquote>
to
<blockquote>
<pre>rset <recordname>RSET={ ...</pre>
</blockquote>
and add the following line after the "rset &lt;recordname&gt;RSET="
definition.
<blockquote>
<pre>epicsExportAddress(rset,xxxRSET);</pre>
</blockquote>
</blockquote>
<h3>Device support</h3>
<blockquote>
Add the following line after all existing #includes
<blockquote>
<pre>
#include "epicsExport.h"
</pre>
</blockquote>
and add the following line after the dset dev&lt;devname&gt; definition
<blockquote>
<pre>
epicsExportAddress(dset,dev&lt;devname&gt;);
</pre>
</blockquote>
</blockquote>
<blockquote>
Add the following line after all existing #includes
<blockquote>
<pre>#include "epicsExport.h"</pre>
</blockquote>
and add the following line after the dset dev&lt;devname&gt; definition
<blockquote>
<pre>epicsExportAddress(dset,dev&lt;devname&gt;);</pre>
</blockquote>
</blockquote>
<h3>Driver support</h3>
<blockquote>
Add the following line after all existing #includes
<tt><blockquote>
#include "epicsExport.h"
</tt></blockquote>
and add the following line after the drvet dev&lt;devname&gt; definition
<tt><blockquote>
epicsExportAddress(drvet,drv&lt;devname&gt;);
</tt></blockquote>
</blockquote>
<blockquote>
Add the following line after all existing #includes
<blockquote>
<pre>#include "epicsExport.h"</pre>
</blockquote>
and add the following line after the drvet dev&lt;devname&gt; definition
<blockquote>
<pre>epicsExportAddress(drvet,drv&lt;devname&gt;);</pre>
</blockquote>
</blockquote>
<h3>Registration code changed</h3>
<blockquote>
Registration code for application specific functions, e.g. subroutine
record init and process functions, has been changed as follows
<p>
1) Include the registration support header files:
<blockquote>
<pre>
#include "dbDefs.h"
#include "registryFunction.h"
</pre>
</blockquote>
2) Include the export definitions header file after including all
other header files:
Registration code for application specific functions, e.g. subroutine
record init and process functions, has been changed as follows
<blockquote>
<pre>
#include "epicsExport.h"
</pre>
</blockquote>
<p>1) Include the registration support header files:</p>
3) Make the application specific functions static functions, e.g.
<blockquote>
<pre>#include "dbDefs.h"
#include "registryFunction.h"</pre>
</blockquote>
2) Include the export definitions header file after including all other
header files:
<blockquote>
<pre>
static long mySubInit(subRecord *precord,processMethod process)
static long mySubProcess(subRecord *precord)
</pre>
</blockquote>
<blockquote>
<pre>#include "epicsExport.h"</pre>
</blockquote>
3) Make the application specific functions static functions, e.g.
4) Define a registryFunctionRef array of the application specific
functions to be registered, e.g.
<blockquote>
<pre>static long mySubInit(subRecord *precord,processMethod process)
static long mySubProcess(subRecord *precord)</pre>
</blockquote>
4) Define a registryFunctionRef array of the application specific functions
to be registered, e.g.
<blockquote>
<pre>
static registryFunctionRef mySubRef[] = {
<blockquote>
<pre>static registryFunctionRef mySubRef[] = {
{"mySubInit",(REGISTRYFUNCTION)mySubInit},
{"mySubProcess",(REGISTRYFUNCTION)mySubProcess}
};
</pre>
</blockquote>
};</pre>
</blockquote>
5) Add a new function to do the registration of the registryFunctionRef
array elements, e.g.
5) Add a new function to do the registration of the registryFunctionRef
array elements, e.g.
<blockquote>
<pre>
void mySub(void)
<blockquote>
<pre>void mySub(void)
{
registryFunctionRefAdd(mySubRef,NELEMENTS(mySubRef));
}
</pre>
</blockquote>
}</pre>
</blockquote>
6) Call the epicsExportRegistrar with the new registration function: e.g.
6) Call the epicsExportRegistrar with the new registration function: e.g.
<blockquote>
<pre>epicsExportRegistrar(mySub);</pre>
</blockquote>
7) Remove the existing function lines in &lt;appname&gt;Include.dbd: e.g.
remove
<blockquote>
<pre>
epicsExportRegistrar(mySub);
</pre>
</blockquote>
7) Remove the existing function lines in &lt;appname&gt;Include.dbd: e.g.
remove
<blockquote>
<pre>
function("mySubInit")
function("mySubProcess")
</pre>
</blockquote>
8) Add a registrar statement to &lt;name&gt;Include.dbd with the new
registration function as parameter: e.g.
add
<blockquote>
<pre>
registrar("mySub")
</pre>
</blockquote>
<blockquote>
<pre>function("mySubInit")
function("mySubProcess")</pre>
</blockquote>
8) Add a registrar statement to &lt;name&gt;Include.dbd with the new
registration function as parameter: e.g. add
<blockquote>
<pre>registrar("mySub")</pre>
</blockquote>
</blockquote>
<h3>&lt;name&gt;App/src/Makefile changed and simplified</h3>
<blockquote>
1) Libraries from support modules defined in configure/RELEASE
no longer need the &lt;libname&gt;_DIR definitions. You can remove lines like the
following from your src/Makefile
1) Libraries from support modules defined in configure/RELEASE no longer
need the &lt;libname&gt;_DIR definitions. You can remove lines like the
following from your src/Makefile
<blockquote>
<pre>
ca_DIR = $(EPICS_BASE_LIB)
Com_DIR = $(EPICS_BASE_LIB)
</pre>
</blockquote>
<blockquote>
<pre>ca_DIR = $(EPICS_BASE_LIB)
Com_DIR = $(EPICS_BASE_LIB)</pre>
</blockquote>
2) Libraries from EPICS_BASE do not have to be specified individually. For
HOST products and libraries specify the following
<blockquote>
<pre>&lt;myhostprodorlib&gt;_LIBS += $(EPICS_BASE_HOST_LIBS)</pre>
</blockquote>
For IOC products and libraries specify the following
2) Libraries from EPICS_BASE do not have to be specified individually.
<blockquote>
<pre>&lt;myiocprodorlib&gt;_LIBS += $(EPICS_BASE_IOC_LIBS)</pre>
</blockquote>
3) All record, device, and driver support must now exist in shared
libraries. You will need to create an IOC library containing your
application specific support.
For HOST products and libraries specify the following
<blockquote>
<pre>
&lt;myhostprodorlib&gt;_LIBS += $(EPICS_BASE_HOST_LIBS)
</pre>
</blockquote>
For IOC products and libraries specify the following
<blockquote>
<pre>
&lt;myiocprodorlib&gt;_LIBS += $(EPICS_BASE_IOC_LIBS)
</pre>
</blockquote>
3) All record, device, and driver support must now exist in shared libraries.
You will need to create an IOC library containing your application specific support.
<blockquote>
<pre>
LIBRARY_IOC += exampleIoc
<blockquote>
<pre>LIBRARY_IOC += exampleIoc
exampleIoc_SRCS += xxxRecord.c
exampleIoc_SRCS += devXxxSoft.c
exampleIoc_SRCS += dbSubExample.c
exampleIoc_LIBS += $(EPICS_BASE_IOC_LIBS)
</pre>
</blockquote>
4) Add your new record, device, and driver support library to your ioc
product's libraries: e.g.
<pre>
exampleIoc_LIBS += $(EPICS_BASE_IOC_LIBS)</pre>
</blockquote>
4) Add your new record, device, and driver support library to your ioc
product's libraries: e.g.
<pre>
<blockquote>
PROD_IOC = example
example_LIBS += exampleIoc
example_LIBS += $(EPICS_BASE_IOC_LIBS)
</pre>
PROD_IOC = example
example_LIBS += exampleIoc
example_LIBS += $(EPICS_BASE_IOC_LIBS)</blockquote>
</pre>
</blockquote>
</blockquote>
</body>
</html>
+4 -3
View File
@@ -24,7 +24,8 @@ The good news is that the rules for support and ioc applications
are now greatly simplified. The bad news is that it does mean
changes for existing 3.14.1 applications. Please see:</p>
<p><a href="ConvertingR3.14.1AppsToR3.14.2.html">ConvertingR3.14.1AppsToR3.14.2</a></p>
<p>for details.</p>
<p>for details. If you are using the function DBD keyword it no
longer exists. Please read this conversion document for details.</p>
<p><strong>Application Developer's Guide</strong></p>
<p>The old chapter "New Feature's for 3.14" has been replaced by
@@ -62,8 +63,8 @@ is processed (analagous to setting ADEL/MDEL=-1 for numeric record types).</p>
<p><strong>epicsStdio and errlogPrintf</strong></p>
<p>A new facility has been added to libCom described by epicsStdio.h.
It contains the functions epicsSnprintf and epicsVsnprintf.
These are like the C99 functions snprintf and vsnprintf.
These are like printf except that thet accept a argument
These are like the C99 functions snprintf and vsnprintf,
which are like sprintf and vsprintf except that they accept a argument
limiting the number of characters written.</p>
<p>The errlogPrintf facility has been modified to use this facility.
Thus it is not longer subject to a possible buffer overflow.</p>