Back to Contents


Tools and Components

Summary:

See also: Installation and Setup.


fpi

Purpose:

The fpi utility program is provided to display product information, such as the version number.

Syntax:

fpi [options]

Notes:

  1. options are described below.

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.

Usage:

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. 


fglmkrun

Purpose:

The fglmkrun tool creates a DVM runtime system program that can execute BDL programs compiled with fglcomp or fgl2p.

Syntax:

fglmkrun [options]

Notes:

  1. options are described below.

Warnings:

  1. A C++ compiler and linker must exist on the system. It is strongly recommended that you have the GNU compiler installed (gcc/g++).
  2. The target database client software must be installed on the system in order to link the database client libraries.
  3. The target database client software environment must be set (for example, INFORMIXDIR, ORACLE_HOME environment variables).
  4. When using Informix ESQL/C, you must set the INFORMIXC environment variable to a C++ linker (g++).

Tips:

  1. If you create a DVM with a name other than "fglrun", be certain that you set the FGLRUN environment variable so that other tools run properly.

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).
-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.

Usage:

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.

fglrun

Purpose:

The fglrun tool is the runtime system program that executes p-code BDL programs.

Syntax:

fglrun [options] program[.42r] [argument [...]]

Notes:

  1. options are described below.
  2. program.42r is the program name.
  3. argument is a program argument passed to the program.
  4. The .42r form file extension is optional.

Warnings:

  1. This tool is not provided by default (except on Windows platforms). It must be created with the fglmkrun tool.
  2. This tool may have a different name, according to the name provided to the -o option of fglmkrun.

Options:

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.

Usage:

This tool executes BDL programs.

fglrun myprogram.42r -x 123

fglmksdl

Purpose:

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. 

Syntax:

fglmksdl [options]

Notes:

  1. options are described below

Warnings:

  1. A C++ compiler and linker must exist on the system. It is strongly recommended that you have the GNU compiler installed (gcc/g++).
  2. The database client API library corresponding to the target database engine must exist. (For example, INFORMIX ESQL/C).
  3. The target database client software environment must be set. (For example, INFORMIXDIR, ORACLE_HOME environment variables).

Options:

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.

Example:

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.


fglform

Purpose:

The fglform tool compiles form specification files into XML formatted files used by the programs.

Syntax:

fglform [options] srcfile[.per]

Notes:

  1. options are described below.
  2. srcfile.per is the form specification file.
  3. The .per form file extension is optional.

Warning:

  1. All .per form specification files used by the program must be compiled before usage.

Options:

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.

Usage:

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.


fglmkmsg

Purpose:

The fglmkmsg tool compiles message files into a binary version used by the BDL programs.

Syntax:

fglmkmsg [options] srcfile [outfile]

Notes:

  1. options are described below.
  2. srcfile is the source message file.
  3. outfile is the destination file.

Warning:

  1. All .msg message files used by the program must be compiled before usage.

Options:

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.

Usage:

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.


fglcomp

Purpose:

The fglcomp tool compiles BDL program sources files into a p-code version.

Syntax:

fglcomp [options] srcfile[.4gl]

Notes:

  1. options are described below.
  2. srcfile.4gl is the program source file.
  3. The .4gl extension is optional.

Warnings:

  1. The .42m p-code modules must be linked together with fgllink or fgl2p in order to create a runable program. 

Options:

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.

Usage:

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. 


fgllink

Purpose:

The fgllink tool assembles p-code modules compiled with fglcomp into a .42r program or a .42x library.

Syntax:

To create a library:

fgllink [options] -o outfile.42x module.42m [...]

To create a program:

fgllink [options] -o outfile.42r { module.42m | library.42x } [...]

Notes:

  1. options are described below.
  2. outfile.42r is the name of the program to be created.
  3. outfile.42x is the name of the library to be created.
  4. module.42m is a p-code module compiled with fglcomp.
  5. library.42x is the name of a library to be linked.

Warning:

  1. This tool uses the runtime system program to proceed with the link. If you have created a runner with a name other than "fglrun", you must set the FGLRUN environment variable.

Options:

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.

Usage:

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


fgl2p

Purpose:

The fgl2p tool compiles source files and assembles p-code modules into a .42r program or a .42x library.

Syntax:

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 } [...]

Notes:

  1. options are described below.
  2. outfile.42r is the name of the program to be created.
  3. outfile.42x is the name of the library to be created.
  4. pcodem.42m is a p-code module compiled with fglcomp.
  5. source.4gl is a program source file.
  6. library.42x is the name of a library to be linked.

Warning:

  1. This tool uses the runtime system program to proceed with the link. If you have created a runner with a name other than "fglrun", you must set the FGLRUN environment variable.

Options:

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.

Usage:

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.


fgldbsch

Purpose

The schema extractor is the tool provided to generate the database schema files from an existing database.

Syntax:

fgldbsch -db dbname [options]

Notes:

  1. dbname is the name of the database from which the schema is to be extracted.
  2. options are described below.

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.

Usage:

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.

Warning: The 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.


fglinstall

Purpose:

The fglinstall tool installs all library files needed to run programs.

Syntax:

fglinstall [options]

Notes:

  1. options are described below.

Warnings:

  1. This tool uses the runtime system program to link some utility programs. If you have created a runner with a name other than "fglrun", you must set the FGLRUN environment variable.

Options:

Option Description
-V Display version information for the tool.
-h Displays options for the tool. Short help.

Usage:

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


fglmkrtm

Purpose:

The fglmkrtm tool installs all files needed to have a complete development or runtime environment.

Syntax:

fglmkrtm [options]

Notes:

  1. options are described below.

Warnings:

  1. This tool uses the runtime system program to link some utility programs. If you have created a runner with a name different from "fglrun", you must set the FGLRUN environment variable.

Options:

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)

Usage:

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.


fglmkstr

Purpose:

The fglmkstr tool compiles localized string files.

Syntax:

fglmkstr [options] source-file[.str]

Notes:

  1. options are described below.
  2. source-file is the .str string file. You can omit the file extension.

Options:

Option Description
-V Display version information for the tool.
-h Displays options for the tool. Short help.

Usage:

This tool is used to compile .str localized string files into .42s files. 

For more details, see Localized Strings.


fesqlc

Purpose:

The fesqlc tool compiles ESQL/C sources.

Syntax:

fesqlc [options] source-file.ec [...]

Notes:

  1. options are described below.
  2. source-file is the .ec source file.

Options:

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.

Usage:

This tool is used to compile ESQL/C sources. 

For more details, see FESQLC Manual.