TOC PREV NEXT



E.7 pLUGINS+ Scripts

There are two types of plugins scripts: scripts which are used for creating SNiFF+ projects for pSOSystem+ and scripts which integrate pmanager with SNiFF+/pSOSystem+.

E.7.1 Scripts to Create SNiFF+ Projects for pSOSystem

These scripts exist in the $PSS_ROOT/bin/source/plugins/scripts directory. They run on Unix in the Bourne Shell and on Windows in the mks shell. These scripts are shipped with pSOSystem+ and can be used to facilitate the creation of SNiFF+ projects that have a complex code directory structure. These scripts (with some changes, if needed) automate the creation of a SNiFF+ project for the inclusion of the project's code. A project created using these scripts works on Unix as well as Windows platforms.

plugins_create_proj

Given a file list, relative to PSS_ROOT, this script creates a SNiFF+ project. It creates the main SNiFF+ project in the directory where the first file of the list exists. Since SNiFF+ does not support files from different directories in a single project, this script creates projects for every directory in the list. These projects are added to the main project as subproject.

By default, the PDF (Project Description File) file of the main project has the name 'basename MAIN_PROJ_DIR'.shared. The remainder of the PDF files have the name 'basename project_dir'_<TAG>.shared, where TAG is the basename of the main project directory. An alternative name for the main project can be specified using -n <main_proj_name> option, where main_proj_name is the name of the main project without the extension. An alternative TAG name can also be specified using -t <TAG> option.

By default, the lists of files are read from the .snifffl.lst file from the current directory. Alternatively, -f <filename> option can be used to specify a filename.

Option -p <ProjectTemplateName> specifies the project template to be used in the Project Template Directory of SNiFF+ (default: $SNIFF_DIR/config/project).

Usage: plugin_create_proj [-f <filename> ] [-n <main_proj_name>] [-t <TAG>] -p <ProjectTemplateName>

The script assumes that SNiFF+ is running (session0).

When creating SNiFF+ projects for the pSOSystem, the directory attribute of the 'Project Description' FileType in the preferences file is set to sniffprj. As a result, project PDFS files are created under the sniffprj subdirectory of the main project directory.

plugins_create_app

This script uses the plugins_create_proj and plugins_add_target scripts and creates a SNiFF+ project for a pSOSystem+ application. It first creates the main project using the plugins_create_prj script. It then adds generic pSOSystem+ projects and bsp projects to the main project and if referred to by the application, it also adds drivers projects.

This script modifies the application project to use the PSS_BSP environment variable to refer to bsp projects bsp.shared and bsp_src.shared. The application project is also modified to add the build targets (ram.elf, ram.axf, ram.BD, etc., for example).

This script modifies the application makefile by adding a make target for the BSP library

These templates are to be found in $PSS_ROOT/bin/source/plugins/scripts/apps_makefile*.add.

The plugins_create_all script is used to create pSOSystem application projects. To use plugins_create_app in stand-alone mode to create an application project the following must apply:

Usage: plugins_create_app

plugins_create_all

This is the master script which creates SNiFF+ projects for the entire pSOSystem+. The following must be setup before you start this script:

This script creates the following SNiFF+ projects:

Table E-1 SNiFF+ Projects 
Project
Description
Generic pSOSystem Projects
include.shared
Project for $PSS_ROOT/include and its subdirectories. No file list needed. Should have automatic add remove property for .h files.
sys_os.shared
Project for sys/os directory. Should have automatic add remove for .s and .o files. No file list needed.
configs_std.shared
Project for configs/std. No file list needed.
sysclass.shared
Project for sys/libc/src/sysclass. No file list needed.
profiler.shared
Project for sys/libc/src/profiler. No file list needed.
NOTE: The list of directories under sys/os/src is not hard coded. This script looks for subdirectories under $PSS_ROOT/sys/libc/src and creates projects for every one of them.
Drivers Projects
enetdlpi.shared
Project for drivers/enetdlpi. No file list needed.
lap.shared
Project for drivers/lap. No file list needed.
modem.shared
Project for drivers/modem. No file list needed.
otcp.shared
Project for drivers/otcp. No file list needed.
ppp.shared
Project for drivers/ppp. No file list needed.
slip.shared
Project for drivers/slip. No file list needed.
x25.shared
Project for drivers/x25. No file list needed.
NOTE: The list of drivers is not hard coded. This scripts looks for subdirectories under the $PSS_ROOT/drivers directory and creates projects for every one of them.
Bsp Projects
bsp_src.shared
For each bsps/<bsp_name>/src. Created using plugins_create_prj.
bsp.shared
Project for each bsps/<bsp_name>. No file list needed.
App Projects
<app_name>.shared
Project for each apps/<app_name>. Created using plugins_create_app script. Application projects should be created at the end of the script because they refer to the projects created above.

When a project contains files only from a single directory and all the files from that directory go into the project, no file list is needed to create the project. In this case a SNiFF+ project created by default, will be accurate.

The include.shared and sys_os.shared files need to have the automatic add and remove property for files because files under these directories depend upon what components of pSOSystem are installed.

The pSOSystem projects are generated using project templates. These templates are located in $SNIFF_DIR/config/project and have the name pRISM-<ProjectType>-Project.ptmpl,
where <ProjectType> is one of:

The following scripts are used by plugins_create_all:

Usage: plugins_create_all

plugins_clean_all

This script deletes all the SNiFF+ projects and .sniffdir from $PSS_ROOT. It can be used to restore the pSOSystem to its previous state in the event that plugins_create_all script fails to complete properly.

Usage: plugins_clean_all

plugins_switch_CMVC_tool

This script selects the CMVC (Configuration Management/Version Control tool) for all projects used under SNiFF+ in pRISM+. These projects use the project templates stored in $SNIFF_DIR/config/project. The script replaces the CMVC tool setting against one of the installed ones. The first parameter is the name of the new CMVC tool.
After the use of this script, you must call the script sniffproj_rebuild.ksh to regenerate all the pSOSystem/pRISM+ projects.

Usage: plugins_switch_CMVC_tool <CMVC tool name>

E.7.2 Integration scripts

These scripts integrate pRISM+ Manager with SNiFF+/pSOSystem.

plugins_open_proj

This script is invoked by the pmanager when user selects File>New>SNiFF+>`Start from the pSOSystem sample application'. This script is also invoked when the SNiFF+ button is pressed for an existing pRISMSpace. It opens an existing SNiFF+ project in the user's PWE. It takes the project directory name as the input parameter and looks for the SNiFF+ project file under this directory using the following order:

This script maps the pSOSystem variable $PSS_BSP from being absolute to being relative to the Working Environment. This is needed for file sharing and file overriding in SNiFF+.

Usage: plugins_open_proj <dir_name>

plugins_create_uproj

This script is invoked by the pmanager when user selects File>New>SNiFF+>`Start from an existing code base'. It creates a SNiFF+ project (recursively) for the given directory. The directory should be a subdirectory of $PSS_USER_SSWE. This script then opens the project in user's PWE. This script also adds relinkable_obj_name as a relinkable target for the SNiFF+ project.

This script maps the pSOSystem variable $PSS_BSP from being absolute to being relative to the Working Environment. This is needed for file sharing and file overriding in SNiFF+.

The following scripts are used by plugins_create_uproj:

For further details on plugins_convert_proj refer to the next section.

Usage: plugins_create_uproj <prj_dir> [<relinkable_obj_name>]

plugins_convert_proj

This script is invoked from the script plugins_create_uproj. It converts a SNiFF+ project to the pSOSystem application project pss_main.shared.
It performs the following:

The following script is used by plugins_convert_proj:

Usage: plugins_convert_proj <proj_name>

plugins_add_target

This script modifies a SNiFF+ project to add pSOSystem target names. These targets are then displayed by SNiFF+ under PE>Target>Make menu. The list of targets are hard coded in this script and should be changed whenever there is a change in targets defined in config.mk.

Usage: plugins_add_target <project_name>

plugins_create_bsp

This script creates SNiFF+ projects for a custom BSP. These projects are required to integrate custom BSPs into pRISM+. The BSP should be located under $PSS_ROOT/bsps and should follow the standard pSOSystem BSP format, (<custom_bsp>/src source format). Before you invoke this command you would need to create a file containing a list of files which make this BSP. The default name of this file is .snifffl.lst and should exist under <custom_bsp>/src.

First file name in this file should be from <custom_bsp>/src. An example can be found in one of the standard BSPs. This script creates bsp_src.shared under $PSS_ROOT/bsps/<custom_bsp>/src/sniffprj and bsp.shared under $PSS_ROOT/bsps/<custom_bsp>/sniffprj and assumes that the pRISM+ environment setup the makefile derived from pSOSystem BSP makefile.

The following scripts are used by plugins_create_bsp:

Usage: plugins_create_bsp <bsp_dir> [ -f <file_list_file> ]

Where bsp_dir is $PSS_ROOT/bsps/<custom_bsp>

plugins_edit_file

This script opens a file in the SNiFF+ source editor. It assumes that SNiFF+ is running with session0 and one of the open projects contains this file. This script is typically used with SDS to replace its editor with SNiFF+ SE. User should alias _edit to

On Unix: alias _edit 'plugins_edit_file \!:2 \!:1'

On PC: alias _edit 'sh -f plugins_edit_file \!:2 \!:1'

This can be done in SDS command window or in the sstep.ini file. Output of this script (such as errors) is displayed in the SDS cmd window.

Usage: plugins_edit_file <filename> [<linenumber>]

plugins_pwizard

solaris/plugins_pwizard, hpux/plugins_pwizard, or win32/plugins_pwizard.bat are invoked by SNiFF+ as a result of a double click on the sys_conf.h file. This script invokes pRISM+ wizard on the sys_conf.h file.

Usage: plugins_pwizard <full path to sys_conf.h>

psosmake

This is a wrapper to the actual make command and is host specific. There are three different scenarios in which make is called:

This wrapper, depending upon the make situation, calls the appropriate make commands.
The environment detection checks for the existence of the environment variable PSS_ABS_PWE_BSP. If yes, the variable PSS_BSP gets the absolute path copied from $PSS_ABS_PWE_BSP.
The SNiFF+ makefile detection checks for the existence of the string "_XX_SNIFF_GEN_MAKEFILE_SIGN_XX_" in the makefile. If detected, the SNiFF+ gmake command is called. If not, the pSOSystem make command is called to create the Compiler and Linker options and then called again for the desired target.

Usage: psosmake [<target_name>]

E.7.3 Startup scripts

plugins_remove_duplicates

This script removes the entries in the file to be modified (usually the file .snifffl.lst). These entries are found twice in a pSOSystem project, which has to prevented.
A BSP comes with two projects:

There is a reference file, containing the entries to be removed fron the file to be modified. This reference file is $SNIFF_DIR/integrations/pRISM2.0/pRISM2.0/remove_from_snifffl.lst and contains:
  • bsps/XbspnameX/README
  • bsps/XbspnameX/readme.txt
  • bsps/XbspnameX/bsp.mk
  • bsps/XbspnameX/bsp.h
  • configs/std/snf_gnu.mk
where "XbspnameX" is replaced by the real BSP name found in the first entry of the file to be modified.

Usage: plugins_remove_duplicates <file to be modified> <file containing entries to be removed>

plugins_patch_makefiles

This script patches the makefiles in the directories:


The references to the variables are replaced by references to the variables

Usage: plugins_patch_makefiles

plugins_upgrade_siteprefs

This script updates the preferences definitions file SitePrefs.sniff in the directory $SNIFF_DIR. It is called at installation time only.

The following script is used by plugins_upgrade_siteprefs:

Usage: plugins_upgrade_siteprefs <full path to sys_conf.h>

plugins_upgrade_userprefs

This script updates the preferences definitions file UserPrefs.sniff. It is called from the startup script (On Windows env$CPU_FAMILY.ksh, on UNIX envv$CPU_FAMILY.csh or envv$CPU_FAMILY.sh

The following script is used by plugins_upgrade_userprefs:

Usage: plugins_upgrade_userprefs

plugins_change_prefs

This script changes a preference file and prints the result to standard out. To prevent this file from subsequent changes, a signature is appended to the file: "SNiFF32_pRISM20_Integration". When this signature is found, no changes take place!

The following keywords are touched:

Usage: plugins_change_prefs <full path to the preference file>


TOC PREV NEXT