Nombas > SE:ISDK DevSpace > Tips > Getting Started The UNIX Way

 

Getting Started The UNIX Way

Using ScriptEase ISDK With Linux, SunOS, Solaris, FreeBSD, and AIX

Working with the SE:ISDK Ver. 4.03 and various IDE's

When adding the ScriptEase:Integration SDK (ScriptEase:ISDK) to our application, there are several steps that you should follow to make the process as easy as possible. We have outlined this getting started process into 7 steps. The ScriptEase:Integration
SDK is designed to be flexible and powerful for the widest range of uses possible. The downside of this is that there is a lot to the package. And, there are many options. Options are a good thing, but can be confusing on initial exposure. This document is
designed to assist the 75% of the population that doesn't need all of this flexibility at once.

This file outlines Step-by-Step instructions for adding the SE:ISDK libraries and source files with various compilers. The compilers covered are:


BORLAND 4.5
MSVC 1.52, 4.X and 5.0
WATCOM 10.X and 11.0

UNIX (all compilers and systems)

The package you received consists of 3 basic parts. They are the
various ScriptEase:ISDK Interpreter Engines, the ScriptEase Standard
Function Library source code, and miscellaneous source files required
to support the interpreter engine. ScriptEase:ISDK Interpreter Engines
are the static and dynamic linked libraries in the libs directory. The
ScriptEase:ISDK Interpreter Engine contains the complete interpreter
(i.e. parser, interpreter, operator and flow-control commands), but does
not include any function libraries.

You will find one or more interpreter engines in your installation tree.
All of the engines interpret identically, the different versions are for
different compilers and operating systems. You are ready to begin the
integration process.

BORLAND 4.5
-----------
You will need to provide a jseopt.h file in your project directory.
The jseopt.h file is designed to allow you to configure the SE:ISDK
to fit the particulars of your platform and specify the options you
choose to use. The jseopt.h is designed to be the fundamental file
for specifying which operating system is being targeted, which other
include files will be required, and which elements of the standard
library will be included. In most cases it will be sufficient to
copy a jseopt.h from one of the sample applications that closely
resembles your application. Refer to the manual for details on the
various options that can be specified in a jseopt.h

This is where you will add the ScriptEase Interpreter Engine library
file to your application. Start the Borland IDE and open the project
in which you wish to integrate the SE:ISDK. Select the target name
in the project window and press the insert key. Using the "Add to
Project List" dialog box, browse to and select the serte.lib file.
The runtime engine should now show up as the second item in the project
window.

ScriptEase:Integration SDK projects need to have several include
search paths added so the compiler can find the SE:ISDK headers.
From the "Options" menu choice, select "Project...". The first topic
is "Directories", make sure this selection is highlighted. Add to the
existing path the additional paths:
\seisdk\incjse;\seisdk\seclib;\seisdk\srcmisc;\seisdk\srcapp
in the "Include" edit field. Substitute the above paths with the correct
paths if you have install the ISDK somewhere other than the default
locations. If you have not added the path to your project to the
includes path, now is a good time to do it.

With the "Project Options" dialog box still open, expand the "Compiler"
topic and highlight "Defines". In the "Defines" edit field, add the
following defines:
JSETOOLKIT_APP
__JSE_LIB__
__JSE_XXXXX__
NDEBUG
Substitute XXXXX with the proper platform you are targeting. Refer to
the manual for the options available. Alternatively, these defines
can be added to the jseopt.h file described earlier.
Click the "OK" button to dismiss this dialog box.

Next add the base support source files. Again, select the target
name in the project window and press the insert key. Using the "Add
to Project List" dialog box, browse to the srcmisc directory and add
globldat.cpp, dirparts.cpp, jsemem.cpp, and utilstr.cpp source files.
(See Note 1.)

Now you can compile and link your application to insure that you've
accomplished the above steps correctly. If you get a compiler error
stating that a header could not be found, check to make sure that
you've typed in the include paths as you have them installed. If
you get a linker error be sure that you've added the correct runtime
engine for your operating system.

MSVC 1.52
---------
You will need to provide a jseopt.h file in your project directory.
The jseopt.h file is designed to allow you to configure the SE:ISDK
to fit the particulars of your platform and specify the options you
choose to use. The jseopt.h is designed to be the fundamental file
for specifying which operating system is being targeted, which other
include files will be required, and which elements of the standard
library will be included. In most cases it will be sufficient to
copy a jseopt.h from one of the sample applications that closely
resembles your application. Refer to the manual for details on the
various options that can be specified in a jseopt.h

This is where you will add the ScriptEase Interpreter Engine library
file to your application. Start Visual C++ and open the project in
which you wish to integrate the SE:ISDK. Select "Project" from the
menu and then select "Edit...". Using the "Edit - PROJECT" dialog box,
browse to and add the serte.lib file. The runtime engine should
now show up as an item in the "Files in Project" list.

ScriptEase:Integration SDK projects need to have several include
search paths added so the compiler can find the SE:ISDK headers.
From the "Options" menu choice, select "Project...". Click on the
"Compiler" button and then select "Preprocessor" from the listbox.
Click the "Common to Both" radio button and then type in the
additional paths:
\seisdk\incjse;\seisdk\seclib;\seisdk\srcmisc;\seisdk\srcapp
in the "Include Path" edit field. Substitute the above paths with
the correct paths if you have install the ISDK somewhere other than
the default locations. If you have not added the path to your project
to the includes path, now is a good time to do it.

With the "C/C++ Complier Options" dialog box still open and
"Preprocessor" still highlighted, add the following defines to the
"Symbols and Macros to Define" edit field:
JSETOOLKIT_APP
__JSE_LIB__
__JSE_XXXXX__
NDEBUG
Substitute XXXXX with the proper platform you are targeting. Refer to
the manual for the options available. Alternatively, these defines
can be added to the jseopt.h file described earlier. Click the "OK"
button to dismiss this and the "Project Options" dialog boxes.

Next add the base support source files. Select "Project" from the
menu and then select "Edit...". Using the "Edit - PROJECT" dialog box,
browse to the srcmisc directory and add the globldat.cpp, dirparts.cpp,
jsemem.cpp, and utilstr.cpp source files. (See Note 1 & 2.)

Now you can compile and link your application to insure that you've
accomplished the above steps correctly. If you get a compiler error
stating that a header could not be found, check to make sure that
you've typed in the include paths as you have them installed. If
you get a linker error be sure that you've added the correct runtime
engine for your operating system.

MSVC 4.X
--------
You will need to provide a jseopt.h file in your project directory.
The jseopt.h file is designed to allow you to configure the SE:ISDK
to fit the particulars of your platform and specify the options you
choose to use. The jseopt.h is designed to be the fundamental file
for specifying which operating system is being targeted, which other
include files will be required, and which elements of the standard
library will be included. In most cases it will be sufficient to
copy a jseopt.h from one of the sample applications that closely
resembles your application. Refer to the manual for details on the
various options that can be specified in a jseopt.h

This is where you will add the ScriptEase Interpreter Engine library
file to your application. Start the Developer's Studio and open the
workspace for the project in which you wish to integrate the SE:ISDK.
Select the target from the combo box. Select "Insert" from the menu
and then select "Files into Project...". Using the "Insert Files into
Project" dialog box, browse to and select the serte.lib file. The
runtime engine should now show up as an item in the project file list
window.

ScriptEase:Integration SDK projects need to have several include
search paths added so the compiler can find the SE:ISDK headers.
From the "Build" menu choice, select "Settings...". Click on the
"C/C++" tab and then select "Preprocessor" from the dropdown list.
Type in the additional paths:
\seisdk\incjse;\seisdk\seclib;\seisdk\srcmisc;\seisdk\srcapp
in the "Additional include directories" edit field. Substitute the
above paths with the correct paths if you have install the ISDK
somewhere other than the default locations. Substitute the
above paths with the correct paths if you have install the ISDK
somewhere other than the default locations. If you have not
added the path to your project to the includes path, now is a good
time to do it.

With the "Project Settings" dialog box still open and "Preprocessor"
still selected from the "C/C++" tab , add the following defines to the
"Preprocessor Definitions" edit field:
JSETOOLKIT_APP
__JSE_LIB__
__JSE_XXXXX__
NDEBUG
Substitute XXXXX with the proper platform you are targeting. Refer to
the manual for the options available. Alternatively, these defines
can be added to the jseopt.h file described earlier. Click the "OK"
button to dismiss this dialog box.

Next add the base support source files. Again, Select "Insert" from
the menu and then select "Files into Project...". Using the "Insert
Files into Project" dialog box, browse to and select the globldat.cpp,
dirparts.cpp, jsemem.cpp, and utilstr.cpp source files.

Now you can compile and link your application to insure that you've
accomplished the above steps correctly. If you get a compiler error
stating that a header could not be found, check to make sure that
you've typed in the include paths as you have them installed. If
you get a linker error be sure that you've added the correct runtime
engine for your operating system.

MSVC 5.0
--------
You will need to provide a jseopt.h file in your project directory.
The jseopt.h file is designed to allow you to configure the SE:ISDK
to fit the particulars of your platform and specify the options you
choose to use. The jseopt.h is designed to be the fundamental file
for specifying which operating system is being targeted, which other
include files will be required, and which elements of the standard
library will be included. In most cases it will be sufficient to
copy a jseopt.h from one of the sample applications that closely
resembles your application. Refer to the manual for details on the
various options that can be specified in a jseopt.h

This is where you will add the ScriptEase Interpreter Engine library
file to your application. Start the Developer's Studio and open the
workspace for the project in which you wish to integrate the SE:ISDK.
Select the target Workspace. Select "Project" from the menu and then
select "Add to Project" and then "Files". Using the "Insert Files
into Project" dialog box, browse to and select the serte.lib file.
The runtime engine should now show up as an item in the project FileView
list window.

ScriptEase:Integration SDK projects need to have several include
search paths added so the compiler can find the SE:ISDK headers.
From the "Project" menu choice, select "Settings...". Click on the
"C/C++" tab and then select "Preprocessor" from the "Category" dropdown
list. Type in the additional paths:
\seisdk\incjse;\seisdk\seclib;\seisdk\srcmisc;\seisdk\srcapp
in the "Additional include directories" edit field. Substitute the
above paths with the correct paths if you have install the ISDK
somewhere other than the default locations. Substitute the
above paths with the correct paths if you have install the ISDK
somewhere other than the default locations. If you have not
added the path to your project to the includes path, now is a good
time to do it.

With the "Project Settings" dialog box still open and "Preprocessor"
still selected from the "C/C++" tab , add the following defines to the
"Preprocessor Definitions" edit field:
JSETOOLKIT_APP
__JSE_LIB__
__JSE_XXXXX__
NDEBUG
Substitute XXXXX with the proper platform you are targeting. Refer to
the manual for the options available. Alternatively, these defines
can be added to the jseopt.h file described earlier. Click the "OK"
button to dismiss this dialog box.

Next add the base support source files. Again, Select "Project" from
the menu and then select "Add to Project" and then "Files". Using the
"Insert Files into Project" dialog box, browse to the srcmisc directory
and select the globldat.cpp, dirparts.cpp, jsemem.cpp, and utilstr.cpp
source files.

Now you can compile and link your application to insure that you've
accomplished the above steps correctly. If you get a compiler error
stating that a header could not be found, check to make sure that
you've typed in the include paths as you have them installed. If
you get a linker error be sure that you've added the correct runtime
engine for your operating system.

WATCOM 10.X and 11.0
--------------------
You will need to provide a jseopt.h file in your project directory.
The jseopt.h file is designed to allow you to configure the SE:ISDK
to fit the particulars of your platform and specify the options you
choose to use. The jseopt.h is designed to be the fundamental file
for specifying which operating system is being targeted, which other
include files will be required, and which elements of the standard
library will be included. In most cases it will be sufficient to
copy a jseopt.h from one of the sample applications that closely
resembles your application. Refer to the manual for details on the
various options that can be specified in a jseopt.h

This is where you will add the ScriptEase Interpreter Engine library
file to your application. Start Watcom's IDE and open the project
in which you wish to integrate the SE:ISDK. Activate the target child
window and press the insert key. Using the "Add File(s) to 'target'"
dialog box, browse to and select the serte.lib file. The runtime
engine should now show up as an item in the target child window.

ScriptEase:Integration SDK projects need to have several include
search paths added so the compiler can find the SE:ISDK headers.
From the "Options" menu choice, select "C++ Compiler switches...".
The first switches page is "File Option Switches". In the "Include
directories:(-i) edit field type in the additional paths:
\seisdk\incjse;\seisdk\seclib;\seisdk\srcmisc;\seisdk\srcapp
Make sure to preserve the default include path $(%WATCOM)\h. Substitute
the above paths with the correct paths if you have install the ISDK
somewhere other than the default locations. If you have not added the
path to your project to the includes path, now is a good time to do it.

With the "C++ Compiler switches" dialog box still open select "3. Source
Switches" from the switch pages. Add the following defines to the "Macro
Definitions:(-d)" edit field:
JSETOOLKIT_APP
__JSE_LIB__
__JSE_XXXXX__
NDEBUG
Substitute XXXXX with the proper platform you are targeting. Refer to
the manual for the options available. Alternatively, these defines
can be added to the jseopt.h file described earlier. Click the "OK"
button to dismiss this dialog box.

Next add the base support source files. Activate the target child
window and press the insert key. Using the "Add File(s) to 'target'"
dialog box, browse to the srcmisc directory and add the globldat.cpp,
dirparts.cpp, jsemem.cpp, and utilstr.cpp source files. (See Note 1.)

Now you can compile and link your application to insure that you've
accomplished the above steps correctly. If you get a compiler error
stating that a header could not be found, check to make sure that
you've typed in the include paths as you have them installed. If
you get a linker error be sure that you've added the correct runtime
engine for your operating system.

UNIX (All versions and compilers) NOTES
---------------------------------------
After unpacking the archive, the toolkit is similar to other versions of
the ScriptEase toolkit. You compile the libraries you wish available to
your users and link them with your source. You also link in the routines in
'libserte40.a' or 'libserte40.so' (the second is a dynamic library, and is
loaded at compile time rather than integrated at link time.) See the
toolkit manual for more information.

The 'libserte40.so' deserves note. Usually, the ScriptEase run-time routines
are linked directly to your application. This makes your application
self-contained, but increases its size. You can choose to not link in
the routines until the program is actually run. To do so, simply link
with the '.so' version of the SE:ISDK routines rather than the static
versions (the '.a' file.) In order to make your application as portable
as possible, copy 'libserte40.so' into your '/usr/lib' directory, and
when linking with it, do not give it an absolute path (link with
'libserte40.so', not with '/usr/lib/libserte40.so'.) To run the application,
'libserte40.so' must exist on the machine the application is to be run on.

Several example applications are provided in the 'samples' subdirectory,
along with the makefile needed to build them. To build any of the samples,
change to the sample directory (ex: 'cd samples/simple1') and then type
'make'. See the accompanying readme for instructions on enterring the
access key you received to get the samples to work.

We use gcc to build everything. There are a few warnings about functions
not being defined (select, endpwent, bcopy and gettimeofday). These can be
ignored. However, the compilers provided with most Unix operating systems
work equally well.

UNIX (All versions and compilers)
---------------------------------
The SE:ISDK manual describes how to add the ScriptEase engine to your
application. This process can be intimidating at first. This section gives
you three quick ways to add the toolkit to an existing application. Once you
have gotten your feet wet, we encourage you to read the entire manual
carefully, as it allows you to tweak the ScriptEase ISDK exactly to your
liking.

First, you must untar the distribution and put it somewhere. A common place
might be '/usr/src'. For this example, we will assume you have copied the
'seisdkli.tgz' file (the ScriptEase distribution, it will be named
differently for different flavors of Unix, but the procedure is the same)
to '/usr/src/scriptease/linux' and unpacked it. Here is a short example of doing
this ('$' represents the shell prompt, don't type it in:)

$ mkdir /usr/src/scriptease
$ mkdir /usr/src/scriptease/linux
$ cd /usr/src/scriptease/linux
(note on this next line, replace /tmp/ with wherever seisdkli.tgz currently
resides)
$ cp /tmp/seisdkli.tgz .
$ gunzip seisdkli.tgz
$ tar -xf seisdkli.tar

EXAMPLE 1:

You don't care about our example libraries since you will provide wrappers
for any functions you want the user to have. In this case, you must
initialize the engine, invoke any jse calls you might want (such as running
scripts as macros when the user desires) and shut down the engine. Here is
some sample code to add to your application. You can simply cut all of the
code between the '---start---' and '---end---' and paste it verbatim into
your application. You can put it into an existing source file, or create a
new source file solely for it. However, it must be put into a C++ source
file, not a C source file.

---start---
#include "jseopt.h"
#include "fsearch.h"

jsebool JSE_CFUNC FAR_CALL
ContinueFunction(jseContext)
{
return True;
}

void JSE_CFUNC FAR_CALL
ErrorFunction(jseContext jsecontext, JSE_CPP_CONST char _FAR_ *ErrorString)
{
fprintf(stderr,"%s",ErrorString);
}

jsebool JSE_CFUNC FAR_CALL
ToolkitAppFileSearch(jseContext,JSE_CPP_CONST char _FAR_ * FileSpec,char _FAR_ * FilePathResults,uint FilePathLen,jsebool)
{
strncpy(FilePathResults,FileSpec,FilePathLen);
return True;
}

jseContext initialize_scriptease(const char *access_key)
{
struct jseExternalLinkParameters LinkParms;
char fullname[_MAX_PATH];

long ver = jseInitializeEngine();
if( JSE_ENGINE_VERSION_ID != ver ) {
printf("Failed to initialize interpreter engine\n");
}

memset(&LinkParms,0,sizeof(jseExternalLinkParameters));
LinkParms.PrintErrorFunc = ErrorFunction;
LinkParms.MayIContinue = ContinueFunction;
LinkParms.FileFindFunc = ToolkitAppFileSearch;
jseContext jsecontext = jseInitializeExternalLink(NULL,&LinkParms,"global",access_key);
if( jsecontext==NULL ) return NULL;

// Remove the '//' from the following line during EXAMPLE 2.
// InitializeInternalLibraries(jsecontext);

// Initialize any wrapper functions you'd like to make available here.
// Please see the toolkit manual for how to do this.

return jsecontext;
}

void terminate_scriptease(jseContext jsecontext)
{
jseTerminateExternalLink(jsecontext);
jseTerminateEngine();
}
---end---

When compiling the file containing this code, (again assuming you installed
the toolkit as described above), add this snipped to your makefile:

---start---
SELOC = /usr/src/scriptease/linux

SCRIPTEASE_FLAGS = -DNDEBUG -DJSETOOLKIT_APP -D__JSE_LIB__ \
-DJSE_LINK=1 -D__JSE_UNIX__ -D__SEISDKSAMPLES__ \
-I$(SELOC)/samples/inclnone/ \
-I$(SELOC)/incjse/ \
-I$(SELOC)/srcmisc/ \
-I$(SELOC)/seclib/ -I$(SELOC)/seclib/pro/ -I$(SELOC)/seclib/unix/ \
-I$(SELOC)/srcapp/ \
-I$(SELOC)/ecmalib/
---end---

And change your compile to use it. For example, if you copied the above code
into your source file 'main.cc' and you were compiling it using:

$ gcc -c -o main.o main.cc

change that to

$ gcc $(SCRIPTEASE_FLAGS) -c -o main.o main.cc

To use the engine, add:

jseContext jsecontext = initialize_scriptease(<your access key>);
if( jsecontext==NULL ) { exit(0); /* BAD! */ }

near the beginning of your program (near the top of main() is perfect).
You must replace <your access key> with whatever access key was provided
to you by Nombas. You may also want to have more graceful error recovery.

Use the jseInterpret() API call to actually interpret Scripts using
the jsecontext you just saved in your program (see the manual for using
this call.) Here is an example:

char *script_file = "myscript.jse";
int ReturnCode;
jseInterpret(jsecontext,script_file,NULL,NULL,jseNewNone,0,NULL,&ReturnCode);

which simply interprets the file named "myscript.jse". Finally, before you
exit your program, add the following line:

terminate_scriptease(jsecontext);

Putting this right at the end of main() is appropriate. When you link your
executable, you must link the ScriptEase core to it. It is simply an
additional object to be linked with the name
'/usr/src/scriptease/linux/seisdk/libs/linux/libserte40.a' (or
wherever you put it on your system.) Also, you must link in the math library
if you have not already done so using the '-lm' switch. For example, suppose your
link was:

gcc -o myapp main.o

In this case, you'd simply change it to:

gcc -o myapp main.o $(SELOC)/seisdk/libs/linux/libserte40.a -lm

Finally, on some systems, the library 'dl' is required to get access to
the dynamic loader functions. If your link complains about undefined references
to 'dlopen', 'dlclose' and so forth, add '-ldl' to your link line.
Continuing with the above example, change it to:

gcc -o myapp main.o $(SELOC)/seisdk/libs/linux/libserte40.a -lm -ldl

Recompile and link your program, and away you go. You can now go about adding your
own wrapper functions, which is fully covered in the toolkit manual.

EXAMPLE 2:

You still don't want any ScriptEase function libraries, but you do want the
ECMAScript standard objects, such as Date, Math, String, and so forth. Start
by adding the base toolkit to your application as was described in example 1.
Now, you will make a few changes to get everything working. After
you have done so, uncomment the line:

// InitializeInternalLibraries(jsecontext);

in the initialize_scriptease() function. Change it to:

InitializeInternalLibraries(jsecontext);

Also note that there is a full version of ToolkitAppFileSearch() included
in the libraries, so you can remove the one in the example source if you
like. Alternately, you can keep it and determine the locations of files
as you choose. This is documented fully in the toolkit manual.

In addition, you need to add several source files to your compile. First,
add all the files in the 'ecamlib' directory to your makefile as the
define 'ECMALIB'. You can accomplish this easily by executing the following
shell command:

$ cd /usr/src/scriptease/linux/ecmalib
$ echo "ECMALIB = " *.cc | sed -e s,\\.cc,\\.o,g >> <your makefile>

Then edit your makefile. First, find the define of ECMALIB which will be
at the bottom of the makefile, and move it to the top. Then add the following
lines just after it.

---start---

SEGLUE = selib.o setxtlib.o
SESTUFF = $(ECMALIB) $(SEGLUE)

%.o: $(SELOC)/ecmalib/%.cc
gcc -c -o $*.o $(SCRIPTEASE_FLAGS) $(SELOC)/ecmalib/$*.cc
%.o: $(SELOC)/seclib/%.cc
gcc -c -o $*.o $(SCRIPTEASE_FLAGS) $(SELOC)/seclib/$*.cc

---end---

Also, find the lines that define SCRIPTEASE_FLAGS, and change the reference
to the directory 'inclnone' to 'inclecma'. Finally, add $(SESTUFF) to the
dependencies for you application and link with the same. For example, if your
old makefile entry was

myapp: main.o
gcc -o myapp main.o $(SELOC)/seisdk/libs/linux/libserte40.a -lm -ldl

you would change that to:

myapp: main.o $(SESTUFF)
gcc -o myapp main.o $(SESTUFF) $(SELOC)/seisdk/libs/linux/libserte40.a -lm -ldl

Remake your application, and now all of the standard ECMAScript functions are
available. Hopefully, that hasn't been too hard so far. Lets move on to the next
example.

EXAMPLE 3:

You want to add the ScriptEase engine to your program and you may have some
functions you want available to the user. However, you'd also like the user
to have access to all of the ECMAScript objects as well as the standard
library functions Nombas provides such as printf(), fopen(), directory(),
and so forth. You aren't going to pick and choose and just want them all.

Start by adding the base toolkit to your application as was described in
example 1. Now, you will make a few changes to get everything working.
After you have done so, uncomment the line:

// InitializeInternalLibraries(jsecontext);

in the initialize_scriptease() function. Change it to:

InitializeInternalLibraries(jsecontext);

Also note that there is a full version of ToolkitAppFileSearch() included
in the libraries, so you can remove the one in the example source if you
like. Alternately, you can keep it and determine the locations of files
as you choose. This is documented fully in the toolkit manual.

In addition, you need to add several source files to your compile. First,
add all the files in the 'ecamlib' directory to your makefile as the
define 'ECMALIB'. You can accomplish this easily by executing the following
shell command:

$ cd /usr/src/scriptease/linux/ecmalib
$ echo "ECMALIB = " *.o >> <your makefile>

Next, do the same for the files in 'seclib' and its subdirectories
'pro' and 'unix as well as 'srcapp'. Again, some shell commands to accomplish
this are:

$ cd /usr/src/se403/linux/srcapp
$ echo "SEAPP = " *.cc | sed -e s,\\.cc,\\.o,g >> <your makefile>
$ cd /usr/src/se403/linux/seclib
$ echo "SECLIB = " *.cc | sed -e s,\\.cc,\\.o,g >> <your makefile>
$ cd pro
$ echo "SECLIBPRO = " *.cc | sed -e s,\\.cc,\\.o,g >> <your makefile>
$ cd ../unix
$ echo "SECLIBUNIX = " *.cc | sed -e s,\\.cc,\\.o,g >> <your makefile>

Then edit your makefile. First, find the defines of ECMALIB, SECLIB, SECLIBPRO,
SEAPP, and SECLIBUNIX which will be at the bottom of the makefile and move them
to the top. Then add the following lines just after them.

Then edit your makefile, and add the following lines to the bottom.

---start---

SESTUFF = $(ECMALIB) $(SECLIB) $(SECLIBPRO) $(SECLIBUNIX) $(SEAPP)

%.o: $(SELOC)/ecmalib/%.cc
gcc -c -o $*.o $(SCRIPTEASE_FLAGS) $(SELOC)/ecmalib/$*.cc
%.o: $(SELOC)/seclib/%.cc
gcc -c -o $*.o $(SCRIPTEASE_FLAGS) $(SELOC)/seclib/$*.cc
%.o: $(SELOC)/seclib/pro/%.cc
gcc -c -o $*.o $(SCRIPTEASE_FLAGS) $(SELOC)/seclib/pro/$*.cc
%.o: $(SELOC)/seclib/unix/%.cc
gcc -c -o $*.o $(SCRIPTEASE_FLAGS) $(SELOC)/seclib/unix/$*.cc
%.o: $(SELOC)/srcapp/%.cc
gcc -c -o $*.o $(SCRIPTEASE_FLAGS) $(SELOC)/srcapp/$*.cc

---end---

Also, find the lines that define SCRIPTEASE_FLAGS, and change the reference
to the directory 'inclnone' to 'inclall'. Finally, add $(SESTUFF) to the
dependencies for you application and link with the same. For example, if your
old makefile entry was

myapp: main.o
gcc -o myapp main.o $(SELOC)/seisdk/libs/linux/libserte40.a -lm -ldl

you would change that to:

myapp: main.o $(SESTUFF)
gcc -o myapp main.o $(SESTUFF) $(SELOC)/seisdk/libs/linux/libserte40.a -lm -ldl

Rebuild your application, and every ScriptEase function provided by Nombas
is usable from within your scripts.

----

Of course, these three examples represent only a small fraction of what you
can do with the ScriptEase ISDK. Much more information is available in
the manual. If you have any questions about the toolkit, please visit
http://support.nombas.com/.

Notes:
1) DOS applications will also need utilhuge,cpp, hmemcpy.asm from the
srcmisc directory.

2) MSVC 1.52 users will need to include setxtlib.cpp from the seclib
directory as well.

 

 

 

Home | Scripting | Products | Purchase | Download | Support | Company

Copyright ©2001, Nombas, Inc. All Rights Reserved.
Questions? Visit
http://support.nombas.com/