Summary:
See also: Installation and Setup.
The fpi utility program is provided to display product information, such as the version number.
fpi [options]
Option | Description |
-V | Display version information for the tool. |
-h | Displays options for the tool. Short help. |
-l | Displays version information for all BDL tools and components. |
This tool displays the product version number. This version number is useful if you need to identify the installed software. For example, you must reference the product version when you declare a bug.
The fglmkrun tool creates a DVM runtime system program that can execute BDL programs compiled with fglcomp or fgl2p.
fglmkrun [options]
fglrun
",
be certain that you set the FGLRUN
environment variable so that other tools run properly.Option | Description |
-V | Display version information for the tool. |
-h | Displays options for the tool. Short help. |
-H | Display long help. |
-v | Enable verbose mode (display information messages). |
-o outfile | Output file specification. Unix: If this option is not used, fglmkrun uses the value defined in the FGLRUN environment variable. If FGLRUN is not set, the output file name defaults to "$FGLDIR/bin/fglrun". Windows: If this option is not used, fglmkrun uses "%FGLDIR%\bin\fglrun.exe". |
-d dbspec | Database interface type. Defines the type of database driver to be linked to the runtime system. Use the -dl option to see the list of available database drivers. |
-dcl Unix Only! | Specifies the database client software libraries. |
-l command | Command to be used to link the runner. Unix: If this option is not used, fglmkrun uses the value defined in the FGLCC environment variable. If FGLCC is not set, fglmkrun uses the value defined in the CC environment variable. If CC is not set, it defaults to "g++" if GNU gcc is found, otherwise it defaults to "cc". Windows: If this option is not used, the link command defaults to "link". On both UNIX and Windows systems, if Informix CSDK environment is set, the linker defaults to "esql". |
-ext filename | Specifies the C Extensions interface file. See C Extensions for more details. |
-acs filelist | Specifies a list of C Extensions source files. filelist must follow the shell specifications to be interpreted as a unique parameter; therefore, enclose the files in double quotes (on UNIX and Windows). These files will be compiled and added to the link command. |
-aob filelist | Specifies a list of C Extensions object files. filelist must follow the shell specifications to be interpreted as a unique parameter; therefore, enclose the files in double quotes (on UNIX and Windows). These files will be added to the link command. |
-alb filelist | Specifies a list of C Extensions libraries. filelist must follow the shell specifications to be interpreted as a unique parameter; therefore, enclose the files in double quotes (on UNIX and Windows). These libraries will be added to the link command. |
-cpf flags | Specifies a list of compile flags to be added to the C compiler command. flags must follow the shell specifications to be interpreted as a unique parameter; therefore, enclose the flags in double quotes (on UNIX and Windows). |
-lkf flags | Specifies a list of link flags to be added to the link command. flags must follow the shell specifications to be interpreted as a unique parameter; therefore, enclose the flags in double quotes (on UNIX and Windows). |
-dl | Display the list of database interfaces supported by the tool. |
-s osident | Force operating system identification, where osident is one of the operating system identifiers listed with the -sl option. |
-sl Unix Only! | Display the list of operating system types recognized by the tool. |
-usl Unix Only! | Specifies the utility and system libraries. When not used, defaults to "-lm -lsocket" on most systems. |
The fglmkrun tool links C++ object files and libraries in order to create a p-code interpreter. This interpreter can execute BDL programs compiled with the fglcomp or fgl2p tools.
When you create a runtime system program, you specify the following features:
For more details about runner creation, see also Installation and Setup.
Database Interface
With fglmkrun, a DVM may be created with a static or dynamic database interface. DVMs created with a static interface are statically linked to a database interface library and can only connect to the database server for which the library was designed.
Runners with the dynamic database interface can load database drivers at runtime according to FGLPROFILE settings (see "Connections" for more details). With dynamic runners, BDL programs can connect to different database servers simultaneously, using 'CONNECT TO' instructions.
To create a static runner, use the -d option (described below) with one of the database identifiers that is listed using the -dl option (described below).
fglmkrun -o fglrun -d ora901 -v
To create a dynamic runner, use the "-d dynamic" option.
fglmkrun -o fglrun -d dynamic -v
To create a shared database library to be used with a dynamic runner use the fglmksdl tool.
C Extensions
The runtime system program can be extended with C libraries implementing global functions that can be called from the BDL program.
See "C Extensions" for more details.
Environment Variables
Variable name | Description |
FGLDIR | Used to install the DVM program in bin directory, when -o
option is not provided. |
FGLDBS | Defines the database interface type. Can be overwritten with the -d option. |
FGLLIBSQL | Defines the target database libraries used for linking. Can be overwritten with the -dcl option. |
FGLLIBSYS | Defines the system libraries used for linking. Can be overwritten with the -usl option. |
FGLCC | Defines the command for C sources compilation and linking. |
FGLCFLAGS | Defines the flags for C sources compilation. Can be overwritten with the -cpf option. |
FGLLFLAGS | Defines the flags to link the runner. Can be overwritten with the -lkf option. |
The fglrun tool is the runtime system program that executes p-code BDL programs.
fglrun [options] program[.42r] [argument
[...]]
Option | Description |
-V | Display version information for the tool. |
-h | Displays options for the tool. Short help. |
-i info | Displays information (info can be mbcs). |
-d | Start in debug mode. See Debugger for more details. |
-e extension | Specify a Dynamic C extension to be loaded by the runner. |
-l | Link pcode nodules together. |
-o outfile | Specify the output file for the link mode (-l option). |
-p | Generate profiling information to stderr (UNIX only). See Profiler for more details. |
-s | Displays size information in bytes about the module (size used by the code, global and local variables). |
-b | Displays build information about the module (the version of the compiler used to create the module). |
-M | Display a memory usage diagnostic when program ends. |
This tool executes BDL programs.
fglrun myprogram.42r -x 123
The fglmksdl tool creates a database driver shared library to be used with a 4gl p-code runner created with the 'dynamic' database interface option.
fglmksdl [options]
Notes:
Option | Description |
-V | Display version information for the tool. |
-h | Displays options for the tool. Short help. |
-H | Display complete help. |
-v | Verbose mode (default is silent). |
-o name | Defines the target file to be created. By default, the tool creates a library in $FGLDIR/bin with the name of the database interface type given by the -d option. |
-d name | Database interface type. |
-l "cmd" | Specifies the command to create a shared library. This option is system and database API
dependent. Default is ' gcc -shared -fPIC '. |
-a "cmd" | Specifies the command line to extract the object files of an archive file (.a). Default is ' ar x '. |
-dcl "lib .." | Defines the database vendor client libraries to be used during link. This option overwrites the FGLLIBSQL environment variable. |
-lkf "flag ..." | Specifies link flags. Default is '' . |
-dl | Displays the list of supported database types you can give to the -d option. |
This tool creates a database driver shared library to be used with a 4gl p-code runner created with the 'dynamic' database interface option.
Linking a shared library for Oracle 8.1.6 on AIX 64bits:
$ fglmksdl -o dbmora816.so -d ora816 \
-a "ar -X64 x" \
-l "ld -G -bexpall -bnoentry -b64"
Special considerations:
INFORMIX:
To create an INFORMIX driver, we strongly recommend to use the esql compiler provided in the INFORMIX CSDK package. You must
set the INFORMIXC environment variable to create a shared lib as in the following example:
$ INFORMIXC="gcc -shared"
$ export INFORMIXC
$ fglmksdl -o dbmifx914.so -d ifx914 -l esql
HP/UX platforms:
On HP/UX 11, the shared library loader cannot load libraries using thread local storage, like Oracle libclntsh. So you may
not be able to use shared libraries on this system. For more details, search for shl_load + Thread Local Storage
on the HP support site.
IBM AIX platforms:
You can check the library dependences with the dump unix command.
You may need to use the ld system linker with special flags as in the following example :
$ fglmksdl -d ora815 -l "ld -bM:SRE -bnoentry -bexpall -lc"
You may need to use the slibclean unix command to unload a shared library from the system shared library segment. Once
a shared library is loaded by the system, you cannot rebuild the executable file unless you unload the library from the
system with slibclean.
SCO Unixware platforms:
Unixware 7.1 does not provide shared library version of libm.a and libgen.a. So you
cannot use shared libraries on
this system.
Other platforms:
If you have the GNU tools installed, you can check the library dependences with the ldd unix command.
See also : fglmkrun tool, FGLLIBSQL
environment variable.
The fglform tool compiles form specification files into XML formatted files used by the programs.
fglform [options] srcfile[.per]
Option | Description |
-V | Display version information for the tool. |
-h | Displays options for the tool. Short help. |
-i info | Displays information (info can be mbcs). |
-m | Extract localized strings. |
-M | Write error messages to standard output instead of creating a .err error file. |
-W | Display warning messages. |
-p preprocessor | Instructs the compiler to preprocess the source file using the specified preprocessor. |
This tool compiles a .per form specification file into a .42f compiled version:
fglform custform.per
The .42f compiled version is an XML formatted file used by BDL programs when a form definition is loaded with the OPEN FORM or OPEN WINDOW WITH FORM instructions.
The fglmkmsg tool compiles message files into a binary version used by the BDL programs.
fglmkmsg [options] srcfile [outfile]
Option | Description |
-V | Display version information for the tool. |
-h | Displays options for the tool. Short help. |
-r msgfile | De-compiles a binary message file. |
This tool compiles a .msg message file into a .iem compiled version:
fglmkmsg mess01.msg
For backward compatibility, you can specify the output file as second argument:
fglmkmsg mess01.msg mess01.iem
The .iem compiled version can be used by BDL programs, for example, when the HELP clause is used in a MENU or INPUT instruction.
See message files for more details.
The fglcomp tool compiles BDL program sources files into a p-code version.
fglcomp [options] srcfile[.4gl]
Option | Description |
-V | Display version information for the tool. |
-h | Displays options for the tool. Short help. |
-i info | Displays information (info can be mbcs). |
-S | Dump Static SQL statements found in the source. |
-R | Ignore number of returned values for function calls. |
-m | Extract localized strings. |
-M | Write error messages to standard output instead of creating a .err error file. |
-W { return | unused | stdsql | all } |
Display warning messages. -W return displays a warning if the same function has returns different number of values with several RETURN. -W unused displays a message for all unused variables. -W stdsql displays a message for all non-portable SQL statements or language instructions. -W all turns on all warnings. |
-p preprocessor | Instructs the compiler to preprocess the source file using the specified preprocessor. |
This tool compiles a .4gl into a .42m p-code module that can be linked to other modules to create a program or a library.
fglcomp customers.4gl
If a compilation error occurs, the tool generates a file that has the .err extension, with the error message inserted at the line where the error occurred. You can change this behavior by using the -M option to display the error message to the standard output.
To create a runable program, the fgllink or fgl2p tool must be used to link the .42m compiled file with other modules.
The fgllink tool assembles p-code modules compiled with fglcomp into a .42r program or a .42x library.
To create a library:
fgllink [options] -o outfile.42x module.42m [...]
To create a program:
fgllink [options] -o outfile.42r { module.42m
| library.42x } [...]
fglrun
",
you must set the FGLRUN
environment variable.Option | Description |
-V | Display version information for the tool. |
-h | Displays options for the tool. Short help. |
-o outfile.ext | Output file specification, where ext can be 42r for a program or 42x for a library. |
otheroption | Other options are passed to the linker or compiler. |
This tool links .42m p-code modules together to create a .42x library or a .42r program file that can be interpreted by a runtime system program created with the fglmkrun tool.
fgllink -o myprog.42x module1.42m module2.42m lib1.42x
The fgl2p tool compiles source files and assembles p-code modules into a .42r program or a .42x library.
To create a library:
fgl2p [options] -o outfile.42x { pcodem.42m |
srcfile.4gl } [...]
To create a program:
fgl2p [options] -o outfile.42r { pcodem.42m
| srcfile.4gl | library.42x } [...]
fglrun
",
you must set the FGLRUN
environment variable.Option | Description |
-V | Display version information for the tool. |
-h | Displays options for the tool. Short help. |
otheroption | Other options are passed to the linker or compiler. |
This tool can compile .4gl source files and link .42m p-code modules together, to create a .42x library or a .42r program file that can be interpreted by a runtime system program created with the fglmkrun tool.
fgl2p -o myprog.42x module1.4gl module2.42m lib1.42x
This tool is provided for convenience, in order to create programs or libraries in one command line. It uses the fglcomp and the fgllink tools to compile and link modules together.
The schema extractor is the tool provided to generate the database schema files from an existing database.
fgldbsch -db dbname [options]
Option | Description |
-V | Display version information for the tool. |
-h | Displays options for the tool. Short help. |
-H | Display long help. |
-v | Enable verbose mode (display information messages). |
-ct | Display data type conversion tables. |
-db dbname | Specify the database as dbname. This option is required to generate the schema files. |
-dv dbdriver | Specify the database driver to be used. |
-un user | Define the user name for database connection as user. |
-up pswd | Define the user password for database connection as pswd. |
-ow owner | Define the owner of the database tables as owner. |
-cv string | Specify the data type conversion rules by character positions in string. |
-of name | Specify output files prefix, default is database name. |
-ie | Ignore tables with columns having data types that cannot be converted. |
-cu | Generate upper case table and column names. |
-cl | Generate lower case table and column names. |
-cc | Generate case-sensitive table and column names. |
-ns | Generate without database system tables. |
The fgldbsch
tool can generate schema files for any database
supported by the product. The fglschema
tool is specific to
INFORMIX databases, supported for backward compatibility.
The database system must be available and the database client environment must be set properly in order to generate the schema files with these tools.
fgldbsch
tool is a 4GL program using the configured
FGLRUN command. With BDL v1.33, you have to intialize the FGLRUN
environment variable with a runner compatible with the databse system
destination, else the fgldbsch
tool will use the INFORMIX
Standard FGLRUN runner. For example, you can define the FGLRUN to
fglrundyn
tool wich can use all Database Interfaces or make a specific
runner (see. fglmkrun
in V1.33 documentation). With BDL
v2.0, the standard FGLRUN runner is a dynamic one (like fglrundyn
),
so you have nothing to do.To generate schema files, you must run fgldbsch with the -db dbname option to identify the database to which to connect.
The database type is automatically detected after connection; you do not have to specify any database server type.
The database driver can be specified with the -dv dbdriver option, if the default driver is not appropriate.
The BDL compiler expects SQL data types in the schema file. Most data types correspond to Informix SQL data types. But non-Informix databases have different data types. Therefore, data types are generated from the system catalog tables according to some conversion rules. You can control the conversion method with the -cv option. Each character position of the string passed by this option corresponds to a line in the conversion table. You must give a conversion code for each data type (for example: -cv AABAAAB). Run the tool with the -ct option to see the conversion tables.
If the operating system user is not the database user, you can provide a database login and password with the -un and -up options.
With some databases, the owner of tables is mandatory to extract a schema,
otherwise you would get multiple definitions of the same table in the .sch
schema file. To prevent such mistakes, you can specify the schema owner with the
-ow owner option. If this option is not used, fgldbsch
will use the login name passed with the -un user option.
By default, table and column names are converted to lower case letters to enforce compatibility with Informix. You can force lower case, upper case or case-sensitive generation by using the -cl, -cu or -cc options.
The fglinstall tool installs all library files needed to run programs.
fglinstall [options]
fglrun
",
you must set the FGLRUN
environment variable.Option | Description |
-V | Display version information for the tool. |
-h | Displays options for the tool. Short help. |
This tool compiles all message files, form files, libraries and programs needed to run applications. This operation is automatically done during installation, but you might need to re-run this tool if some runtime system libraries or forms are changed by hand.
fglinstall
The fglmkrtm tool installs all files needed to have a complete development or runtime environment.
fglmkrtm [options]
fglrun
",
you must set the FGLRUN
environment variable.Option | Description |
-V | Display version information for the tool. |
-h | Displays options for the tool. Short help. |
-v | Verbose mode. |
-t type | Environment type. Values can be: dev (development) or rtm
(runtime) |
This tool is used by the installation program to set up the environment and compile required files (it calls fglinstall).
fglmkrtm -v -m ASCII -t dev
If you set the database client environment (INFORMIXDIR, ORACLE_HOME) before running this tool, it automatically creates a runtime system program corresponding to the database client environment.
The fglmkstr tool compiles localized string files.
fglmkstr [options] source-file[.str]
Option | Description |
-V | Display version information for the tool. |
-h | Displays options for the tool. Short help. |
This tool is used to compile .str localized string files into .42s files.
For more details, see Localized Strings.
The fesqlc tool compiles ESQL/C sources.
fesqlc [options] source-file.ec [...]
Option | Description |
-V | Display version information for the tool. |
-h | Displays options for the tool. Short help. |
-v | Verbose mode, displays compilation details. |
-e | Preprocess only .ec to .c source. |
-G | Do not generate preprocessor line numbers (debug purpose). |
-c | Compile .c to object file. |
-o name | Specify the name of the binary file. |
-d name | Database interface type. |
-I path | Specify an include path for C and ESQL/C includes (#include and EXEC SQL include). |
-ED name | Define a preprocessor macro for ESQL/C macros (EXEC SQL ifdef). |
-EU name | Undefine a preprocessor macro for ESQL/C macros (EXEC SQL ifdef). |
-D name | Define a preprocessor macro for C macros (#ifdef). |
-U name | Undefine a preprocessor macro for C macros (#ifdef). |
-W option | Warnings. Only one option is supported: all. |
-cpf | Specify C compiler flags. |
-lkf | Specify link flags. |
-dcl | Overwrite default database client libraries. |
-usl | Overwrite default system libraries. |
-dl | Display supported database interface types to be used with -d option. |
This tool is used to compile ESQL/C sources.
For more details, see FESQLC Manual.