How to link to static libraries

If you want to use some functions that are embodied in a static (instead of the preferred dynamic) library, the Tycoon Machine has to be extended. The following example changes the Tycoon Machine so that the library 'XXX' in file 'libXXX.a' on path 'XXXpath' can be used by bind.
  1. Create ${TYCOON_ROOT}/config/XXX.mk
    # File:    ${TYCOON_ROOT}/tycoon/bin/XXX.mk
    # Author:  SOMEONE
    # Date:    DATE
    # Purpose: Dependencies for XXX Tycoon machine source files 
    #          [included by Makefiles in subdirectories]
    
    # this flag is needed when compiling tm2/tmstatic.c
    CPPFLAGS   += -Dtmstatic_XXX
    
    # this arguments are needed to link the Tycoon machine
    # library is located at XXXpath
    # library is named libXXX.a
    STATIC_LIBS += -LXXXpath -lXXX
    
  2. Change ${TYCOON_ROOT}/configure
    ...
    XXX=FALSE
    ...
        MSG="Do you need the XXX libraries"
        ask
        XXX=$ANSWER
    ...
    if [ "$XXX" = "TRUE" ] ; then
      echo include \${TYCOON_ROOT}/config/XXX.mk	>>${CONFIG_HOST}
    fi
    ...
    
  3. Change ${TYCOON_ROOT}/tm2/tmstatic.c
    ...
    #ifdef tmstatic_XXX
    
    /* 
       Library: XXXpath/libXXX.a
       Author:  SOMEONE
       Date:    DATE  
    */
    
      R(name_of_function_1)
      R(name_of_function_2)
      ...
      
    #endif /* tmstatic_XXX */
    ...
    
  4. Build new Tycoon machine:
    cd ${TYCOON_ROOT}
    make
    

Gerald Schröder (10-feb-1995)