7.2.4 Unit searching strategy

When you compile a unit, the compiler will by default always look for unit les.

To be able to dierentiate between units that have been compiled as static or dynamic libraries, there are 2 switches:

-XD: 
This will dene the symbol FPC_LINK_DYNAMIC
-XS: 
This will dene the symbol FPC_LINK_STATIC

Denition of one symbol will automatically undene the other.

These two switches can be used in conjunction with the conguration le fpc.cfg. The existence of one of these symbols can be used to decide which unit search path to set. For example, on linux:

# Set unit paths  
 
#IFDEF FPC_LINK_STATIC  
-Up/usr/lib/fpc/linuxunits/staticunits  
#ENDIF  
#IFDEF FPC_LINK_DYNAMIC  
-Up/usr/lib/fpc/linuxunits/sharedunits  
#ENDIF

With such a conguration le, the compiler will look for it's units in dierent directories, depending on whether -XD or -XS is used.