Dear Alex, dear List,

Alcor6L uses platform configuration files to configure the PicoLisp
build for a specific hardware target. One may then edit this file
(platform_conf.h) to include/exclude Lisp support for specific hardware
peripherals. For example, if one does not require the pulse width
modulation functions, she can simply disable the compilation of the
PWM PicoLisp module by commenting it out.

#define PICOLISP_PLATFORM_LIBS_ROM\
  _ROM(PD)\
  _ROM(TERM)\
  _ROM(MIZAR32_LCD)\
  _ROM(ELUA)\
  _ROM(CPU)\
  _ROM(TIMER)\
  _ROM(I2C)\
  _ROM(SPI)\
  _ROM(PIO)\
  _ROM(UART)\
  ADCLINE
  /* _ROM(PWM) */

In the older miniPicoLisp (before miniCodeROM), I had placed these
conditionally compilable modules (like PWM) in tab.c like this:

static symInit Symbols[] = {
#if defined PICOLISP_PLATFORM_LIBS_ROM
#  undef _ROM
#  define _ROM(module)\
   PICOLISP_MOD_##module
   PICOLISP_PLATFORM_LIBS_ROM
#if defined PICOLISP_TARGET_SPECIFIC_LIBS
   PICOLISP_TARGET_SPECIFIC_LIBS
#endif
#endif
   {doAbs, "abs"},
   // More code here

Now with miniCodeROM, I must (in theory) place the above conditions
(#ifdefs, other application specific macros for conditional compilation)
in init.s and expect to find them in ram.d/rom.d. The main.c file
(which then includes ram.d and rom.d) will then know the PicoLisp HW
modules it has to include in the build.

However, I see there's no direct way to put user specific code/macros
(like the one above) in init.s. A feature in gen3m which (blindly) copies
user text to ram.d may help in this situation but even if this were
possible, there is no direct way to produce this information alongside
what is already generated in rom.d.

While this might require a tweak in gen3m.c, is there an easier way to
conditionally include ROM and RAM references in main.c? (rom.d &
ram.d includes).

R

P.S. The same applies to internal immutable symbols. For example, if
the terminal module isn't included in the build, there's no need to
include the internal symbols *term-wait* & *term-nowait*.

Reply via email to