Skip to content

Command-line Tools

The Aubit 4GL toolset is a set of command-line programs that live in the Aubit bin directory (on your PATH once AUBITDIR is set — see Getting Started). This page is the reference for each tool and its options. For the step-by-step "how do I build my app" walk-through, see Building and Running.


Compilers

4glpc — program compiler (the everyday one)

Compiles one or more .4gl files all the way to a runnable program. This is the tool you use most.

4glpc -o app.4ae main.4gl customers.4gl orders.4gl
Option Effect
-o file Name the output (a .4ae program, or a .ao object)
-K Delete the intermediate C files after compiling
-debug / -g Include debugging information
-shared Compile as a shared object
-echo Show the underlying commands without running them

A few environment variables change its behaviour:

Variable Effect
A4GLVERBOSE=yes Print extra detail while compiling
USE_SHARED=Yes Compile against shared libraries
DOIT=echo Print the compile command instead of running it

Built-in help: 4glpc --help-options, --help-env, --help-types, --help-examples.

4glc — the core compiler

The lower-level compiler. Use it to compile a single module to an object file, to generate globals, or to build a shared library.

4glc -o customers.ao customers.4gl     # compile one module to an object
4glc --as-dll -o libhelpers.so a.4gl b.4gl   # link sources into a shared library
Option Effect
-o file Name the output
-G, --globals Generate the globals map for a globals file
-h, --as-dll Link the compiled objects into a shared library
-K, --clean Remove intermediate files when done
-k, --keep Keep intermediate files (default)
-S, --silent Errors only
-V, --verbose Verbose output
-N name, --namespace Prefix generated functions with name
-v, --version Show the compiler version

fcompile — form compiler

Compiles a form (.per) into the form the client renders.

fcompile -xml customer.per
Option Effect
-xml Produce an XML form (use this for the VDC client)
-d dbname Use dbname instead of the database named in the form
-c Generate a C file that can be linked into a program
-s, -q Silent mode
-v, -vfull Show version information

File types

Extension What it is Produced by
.4gl 4GL source code you
.per Form source you
.ao Compiled object (one module) 4glc / 4glpc
.so Shared library 4glc --as-dll
.4ae Runnable program (an executable) 4glpc
.xml Compiled form fcompile -xml

Database tools

adbaccess — interactive SQL

An interactive SQL shell (similar to dbaccess). Type queries, browse schemas, or run a script in batch.

adbaccess sales_db                 # interactive
adbaccess sales_db schema.sql      # run a script
Option Effect
-pg PostgreSQL mode
-ifx Informix mode
-odbc Generic / ODBC mode
-help Show instructions

adbschema — schema extraction

Prints or generates a database schema. Indispensable for confirming real column names before you write SQL.

adbschema -d sales_db                  # whole schema
adbschema -d sales_db -t customers     # one table
adbschema -d sales_db > schema.sql     # save it
Option Effect
-d dbname Database name (required)
-t table Limit to one table
-noperms Omit GRANT/REVOKE statements
-U / -L Generate unload / load statements
-U4GL / -L4GL Generate a 4GL unload / load program

(adbload is the companion bulk data-loading tool.)


Build and library tools

fglmklib — build a library

Bundles compiled object files into a library.

fglmklib mylib.aox module1.ao module2.ao module3.ao

genmake — generate a Makefile

Generates a Makefile for a project, so repeated builds only recompile what changed.

genmake

Analysis and quality tools

fglcalltree — call graphs

Builds a function call tree / dependency graph from compiled objects, in formats you can visualise (GraphViz), feed to a viewer, or load into a database.

fglcalltree module1.ao module2.ao
dot -Tpng calltree.dot -o dependencies.png    # render with GraphViz
Option Effect
-s / -S Detailed (with line numbers) / simple output
-P Include links to external functions
-G Group by module
-start func Start the tree from a given function
-end func Show all callers of a given function

fgldoc — documentation generator

Extracts function definitions and comments from your source into documentation.

fgldoc myprogram.4gl > documentation.txt

fgllint — static checker

Checks source for common problems. Run it over your modules to catch issues the compiler does not flag.

4glunit — unit testing

A unit-testing framework for writing and running automated tests of your 4GL functions.


Configuration

aubit-config — installation paths and flags

Reports where Aubit 4GL is installed and the flags needed to compile/link against it — handy in build scripts.

aubit-config AUBITDIR     # installation directory
aubit-config VERSION      # version
aubit-config LIBS         # linker flags
aubit-config CFLAGS       # compiler flags

a4gl and asql

Tool Purpose
a4gl The integrated development environment / project manager
asql An interactive SQL development environment

Typical workflow, end to end

# 1. explore the database
adbschema -d sales_db -t customers

# 2. compile forms
fcompile -xml customer.per

# 3. compile and link the program
4glpc -o app.4ae g_app.4gl main.4gl customers.4gl

# 4. run it (with the client listening)
./app.4ae

For the full build guide — multi-file projects, shared libraries, project layout and troubleshooting — see Building and Running.