Normal vs. Standalone FreeBASIC
 

When built from source, FreeBASIC can be configured for and installed in one of these two different setups:

Normal build (default)
Standalone build
 
Normal directory layout:
  • bin/
    • fbc.exe
    • ld.exe
    • <target>-ld.exe
    • other native and cross-compilation tools...
  • include/
    • freebasic/
      • fbgfx.bi
      • other headers...
  • lib/
    • freebasic/
      • libfb.a (native)
      • other libraries...
    • <target>-freebasic/
      • libfb.a (for other target)
      • other libraries for that target...
Standalone directory layout:
  • bin/
    • <target>/
      • ld.exe
      • other tools...
  • inc/
    • fbgfx.bi
    • other headers...
  • lib/
    • <target>/
      • libfb.a
      • other libraries...
  • fbc.exe
 
Differences to the standalone build:

  • fbc is located in bin/, like other programs
  • looks for includes in include/freebasic/, instead of inc/ or include/
  • looks for its own libraries in lib/freebasic/ instead of lib/
  • looks for binutils/gcc 1) in bin/ and 2) by relying on PATH
  • looks for crt/gcc libraries 1) in lib/freebasic/ and 2) by running "gcc -print-file-name=..."
  • -target accepts system triplets such as "i686-pc-linux-gnu"
  • the target name given to -target is prepended to the gcc/binutils program names when cross-compiling
  • compatible with the standard /usr or /usr/local directories
  • typically used for the FB-linux release
  • uses windres from binutils to compile win32 resource scripts

This makes the normal FB build integrate with GNU/Linux distributions and other Unix-like systems pretty well, and also allows installing FreeBASIC into MinGW or DJGPP trees, and even allows FB to work with binutils/gcc cross-compiling toolchains.
Differences to the normal build:

  • the fbc binary is located at the toplevel, not inside bin/
  • looks for tools inside bin/<target>/, not just bin/
  • looks for FB includes in inc/, not in include/freebasic/
  • looks for libraries in lib/<target>/, not in lib/freebasic/
  • does not try to rely on PATH and use system tools
  • does not try to query gcc to find files
  • -target only accepts simple FB target names, no system triplets
  • typically used for the FB-dos and FB-win32 releases
  • uses GoRC to compile win32 resource scripts

The standalone build is intended to be used for self-contained installations such as the traditional FB-win32 and FB-dos releases. It also allows adding fbc to the PATH, without having to add the whole bin/ directory.