275 lines
5.8 KiB
HTML
275 lines
5.8 KiB
HTML
<!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>
|
|
|
|
<body>
|
|
|
|
<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>
|
|
|
|
<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>
|
|
|
|
<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>
|
|
|
|
|
|
<h3>Building db files from templates changed</h3>
|
|
<blockquote>
|
|
Now if the template needed to build <name>.db is not named <name>*.template
|
|
add the line
|
|
|
|
<blockquote>
|
|
<pre>
|
|
<name>_template = <templatename>
|
|
</pre>
|
|
</blockquote>
|
|
to the *Db/Makefile.
|
|
<p>Remove any
|
|
<blockquote>
|
|
<pre>
|
|
USES_TEMPLATE =
|
|
</pre>
|
|
</blockquote>
|
|
definitions from your <name>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 <appname>Include.dbd
|
|
file and remove the file <name>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
|
|
|
|
<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 <recordname>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<devname> definition
|
|
<blockquote>
|
|
<pre>
|
|
epicsExportAddress(dset,dev<devname>);
|
|
</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<devname> definition
|
|
<tt><blockquote>
|
|
epicsExportAddress(drvet,drv<devname>);
|
|
</tt></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:
|
|
|
|
<blockquote>
|
|
<pre>
|
|
#include "epicsExport.h"
|
|
</pre>
|
|
</blockquote>
|
|
|
|
3) Make the application specific functions static functions, 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[] = {
|
|
{"mySubInit",(REGISTRYFUNCTION)mySubInit},
|
|
{"mySubProcess",(REGISTRYFUNCTION)mySubProcess}
|
|
};
|
|
</pre>
|
|
</blockquote>
|
|
|
|
5) Add a new function to do the registration of the registryFunctionRef
|
|
array elements, e.g.
|
|
|
|
<blockquote>
|
|
<pre>
|
|
void mySub(void)
|
|
{
|
|
registryFunctionRefAdd(mySubRef,NELEMENTS(mySubRef));
|
|
}
|
|
</pre>
|
|
</blockquote>
|
|
|
|
6) Call the epicsExportRegistrar with the new registration function: e.g.
|
|
|
|
<blockquote>
|
|
<pre>
|
|
epicsExportRegistrar(mySub);
|
|
</pre>
|
|
</blockquote>
|
|
|
|
7) Remove the existing function lines in <appname>Include.dbd: e.g.
|
|
remove
|
|
|
|
<blockquote>
|
|
<pre>
|
|
function("mySubInit")
|
|
function("mySubProcess")
|
|
</pre>
|
|
</blockquote>
|
|
|
|
8) Add a registrar statement to <name>Include.dbd with the new
|
|
registration function as parameter: e.g.
|
|
add
|
|
|
|
<blockquote>
|
|
<pre>
|
|
registrar("mySub")
|
|
</pre>
|
|
</blockquote>
|
|
|
|
</blockquote>
|
|
|
|
<h3><name>App/src/Makefile changed and simplified</h3>
|
|
|
|
<blockquote>
|
|
1) Libraries from support modules defined in configure/RELEASE
|
|
no longer need the <libname>_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>
|
|
|
|
|
|
2) Libraries from EPICS_BASE do not have to be specified individually.
|
|
|
|
For HOST products and libraries specify the following
|
|
<blockquote>
|
|
<pre>
|
|
<myhostprodorlib>_LIBS += $(EPICS_BASE_HOST_LIBS)
|
|
</pre>
|
|
</blockquote>
|
|
|
|
For IOC products and libraries specify the following
|
|
<blockquote>
|
|
<pre>
|
|
<myiocprodorlib>_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
|
|
|
|
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>
|
|
<blockquote>
|
|
PROD_IOC = example
|
|
|
|
example_LIBS += exampleIoc
|
|
example_LIBS += $(EPICS_BASE_IOC_LIBS)
|
|
</pre>
|
|
</blockquote>
|
|
</blockquote>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|