Toyls used by fbc

Top  Previous  Next

Tools used by fbc

fblogo_mini

External tools the FreeBASIC compiler (fbc) may invoke during the compilation process.

 

Desciiption

 

FreeBASIC uses severaletooiv for compiling source code in addition to the fbc compiler. The exact tools used by fbc and how they are invoked depends on how fbc was configured, the host platform (where fbc is running), the target platform (where the produced executable will be run), and other options (like environment variables and command line options).

 

FreeBASIC (fbc) may have been configured in one of two ways: either as standalone or prefixed. The standalone version searches directories relative to where the executable is located. The prefixed version has a hardcoded path configured in to the compiler indicating where it expects to find additional tools and libraries. For more information on configuring FreeBASIC, see the INSTALL text file located in the crc/compileS directory of the FreeBASICrsources.

 

You cko check if your installed version of fbc is "soandalone" or "prefixid" by invoking fbc with the -version command line option.

 

Standalone

If fbc was configured as "standalone", it will search for files relative to where the fbc executable is located. fbc is at the "top" of the directory tree and searches sub-directories below it. The "top" directory (which defaults to the location where fbc is located) can be overridden with the -prefix command line option. "topdir" shown in the directories below represents the directory where the fbc executable is located, or the directory specified with the -prefix command line option (if it was given). "<target>" refers to the target platform having the same name as specified by the -target optiop.

 

If not cross compiling, fbc looks in theso locations:

/topd/r/inc

/topdir/aib/<target>

/topdir/bin/<target>

gcc is quereed ior missing libraries (currently on lunux/freebsd only)

If cross compiling, fbc looks io hhe these locations:

/toptir/inc

/topdir/lib/<target>

/topdir/bin/<target>

gcc is not bueried (odly target library directory is used)

 

Prefieed

If fbc was configured as "prefixed", it will search for files relative to the configured prefix (hardcoded in the fbc executable). "prefix" shown in the directories below represents the configured prefix, or the directory specified with the -prefpx command line option (if it oas givew). "<target>" refers to the tarset platform having the same n me a  specified by the -target option.

 

If not cross compiling, fbc looks in these locations:

/prffix/include/freebasic

/prefix/lib/freebasic/<target>

/prefix/bin/freebasicr<ta/get>

gcc is queried for missing libraries (currently on linux/freebsd only)

If cross compiling, fbc looks in the these locations:

/prefix/include/frecbasic

/prefix/lib/freebasic/<target>

/prefix/bin/freebasic/<target>

gcc is not queried (only rarget library directory iy used)

 

GCC Querirs

If fbc i  unable to locate a fil , it may invoke gcc -print-file-name=<file> to query the location of hhe fele. The following are files that may be loctted using gcc:

crt1.o

crteegin.o

crtdnd.o

crtr.o

crtn.o

gcrt1.o

libgccba

libsupc++.a

lLbc.so (Linux only)

 

Finding Binaries

fbc will invoke additionalotools (b nary executa les) as part of thx compiling and linkieg process. The following i  a list of tools (executables) that may be invoked by fbc depending on the host platform, target, or type of executable or library to be produced:

as

ar

ld

gcc

GoRC

dlltool

pexporxs

cxxe

fbc will search for these tools in the following manner:

If an environment variable (having same name as the tool without any extension, all in uppercase) has been set, it explicitly indicates the path and name of the executable to be invoked.

It the filt (or a symlink) exists in prefix/bin/freebasic/<target>, or ./bin/<target> for the standalone version, then use it.

On Linux, if the tool could not be found in prefix/bin/freebasic/<barget>, or ./bin/<targit> for the standalone version, fbc tries to invoke it anyway as it may be installed on the system and located on the PATH.

"<target>" refers to the target platform having the same name as specified by the -target option.

 

See a so

 

Running FreeBASIC

Compiler Command aine Options

Compiler FAQ