home *** CD-ROM | disk | FTP | other *** search
/ The World of Computer Software / World_Of_Computer_Software-02-387-Vol-3of3.iso / p / plbin.zip / pl / src / md-gener.h < prev    next >
Text File  |  1992-09-10  |  10KB  |  257 lines

  1. /*  md-gener.h,v 1.2 1992/09/10 19:47:08 jan Exp
  2.  
  3.     Copyright (c) 1990 Jan Wielemaker. All rights reserved.
  4.     See ../LICENCE to find out about your rights.
  5.     jan@swi.psy.uva.nl
  6.  
  7.     Purpose: Generic machine description file
  8. */
  9.  
  10. /* - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
  11.             COMPILER FLAGS
  12.  
  13. Compiler  flags for  making `xmakefile'   from  `Makefile' using  cpp.
  14. Default is  gcc,  which is   preferred  on   machines  that  have  it.
  15. SWI-Prolog needs   to   be loaded statically   when   using O_SAVE  or
  16. O_STORE_PROGRAM.  Hence the -static.   If  gcc complains it  does  not
  17. know -static,  this   probably implies the   operating   system has no
  18. dynamic libraries so you may safely drop -static then.
  19. - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
  20.  
  21. #define M_CC            gcc
  22. #define M_OPTIMIZE            -O2
  23. #define M_LDFLAGS        -static
  24. #define M_CFLAGS        -Wall
  25. #define M_LIBS            -lm -ltermcap
  26.  
  27.  
  28. /* - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
  29.             COMPILER OPTIONS
  30.  
  31. If   it exists for your   machine, I suggest to   use  the GNU project
  32. C-compiler GCC.  It is the only compiler I've seen which is capable of
  33. optimising  the virtual  machine  interpreter.   Many  compilers don't
  34. understand the complex   flow control of  this gigantic  function  and
  35. either tell you they refuse  to optimise,  silently refuse to optimise
  36. or even crash.  GCC passes small structures often  more efficient than
  37. the native compiler.  Notably the implementation of clause indexing is
  38. improved by this.
  39.  
  40.   ANSI
  41.       This flag indicates the compiler provides ANSI prototypes and  the
  42.       standard ANSI header files.
  43.  
  44.   PROTO
  45.       This flag indicates the compiler accepts ANSI prototypes, but does
  46.       not offer the standard ANSI include files.
  47.  
  48.   O_NO_LEFT_CAST
  49.       Compiler does not understand ``(cast)variable = value''.
  50.  
  51.   O_NO_VOID_POINTER
  52.       Compiler does not understand ``void *'' as  an  anonymous  pointer
  53.       type.   Any ANSI compiler should understand this and many non-ANSI
  54.       compilers appear to do.
  55.  
  56.   O_SHORT_SYMBOLS
  57.       Ancient compiler, whose symbols are taken to be equal if the first
  58.       8 characters are equal.  If your cpp accepts  longer  symbols  you
  59.       are  alright  with this option.  Otherwise you will have to change
  60.       names of identifiers.  I do not know if pl-ssymb.h still  is  upto
  61.       date.
  62.  
  63.   O_ULONG_PREDEFINED
  64.       The  data type  ulong has been  predefined by the compiler.  Its
  65.       definition should be `typedef unsigned long ulong'.
  66.  
  67.   O_UCHAR_PREDEFINED
  68.       The data type uchar has  been predefined by  the compiler.   Its
  69.       definition should be `typedef unsigned char uchar'.
  70.  
  71.   TIME_INCLUDE
  72.       Include file to get `struct tm'.  Define when not <sys/time.h>
  73.  
  74.  
  75.                OPERATING SYSTEM OPTIONS
  76.  
  77.   O_16_BITS
  78.       Indicate global declared structures may be aligned  at  two  bytes
  79.       instead  of  4  bytes  or  malloc()  may  return a 2 bytes aligned
  80.       address.  Normally the low 2 bits of pointers  are  used  for  the
  81.       garbage collector.  With this flag, the low bit and a high bit are
  82.       used for this purpose.  As a result, addressable memory is limited
  83.       to  256 MB instead of 512 MB, but this is unlikely to be a problem
  84.       on 16 bit machines.  If you change this flag, recompile the entire
  85.       source!
  86.  
  87.   O_DATE_AT_0X1
  88.       The data segment starts at 0x10000000.  Many Ultrix machines
  89.  
  90.   O_DATA_AT_0X2
  91.       The data segment starts at 0x20000000.  Many AIX machines
  92.  
  93.   DATA_START
  94.       Start     of   the  data  segment.    Needed     when O_SAVE  or
  95.       O_STORE_PROGRAM  is  defined.   For    O_SAVE  (preferred), only
  96.       necessary  when not equal   to    &environ  (true for most   BSD
  97.       systems).  Must often be set on System-V machines.
  98.  
  99.   TEXT_START
  100.       Start of the text-segment.  Needed when O_STORE_PROGRAM is set
  101.  
  102.   SIGNAL_HANDLER_TYPE
  103.       Type returned by signal handlers.  If not defined, this defaults
  104.       to void.  See signal.h for the value used on your operating system.
  105.  
  106.   O_PROFILE
  107.       Include the Prolog execution profiler (like Unix prof  (1)).   The
  108.       profiler  is  a useful tool to find performance pigs in the system
  109.       predicates or user programs.  It  can  only  be  included  if  the
  110.       system supports the signal SIGPROF, which signals every time slice
  111.       Prolog becomes active.  Including it increases the amount of space
  112.       used  to  store  predicates  with  8 bytes per predicate.  It also
  113.       slightly decreases overall performance (about 1%).
  114.  
  115.   O_SIG_AUTO_RESET
  116.       Signals set with signal() automatically
  117.  reset after  a  signal  has
  118.       been catched.  Use this with v7 Unix systems.
  119.  
  120.   DEFAULT_PATH
  121.       The search path for executables, used if $PATH is not  set.   This
  122.       value  is necessary to find the running executable if $PATH is not
  123.       a defined environment variable.  The path  of  the  executable  is
  124.       used  by the foreign language interface, creating saved states and
  125.       the intermediate code compiler.
  126.  
  127.                   DYNAMIC STACKS
  128.  
  129.       Dynamic stacks indicate we can get  access  to  the  machines  MMU
  130.       (Memory  Management  Unit).   In  some  unix  systems  this can be
  131.       accomplished via file mapping using the mmap()  system  call  (see
  132.       O_CAN_MAP).   In  others via shared memory.  If both are possible,
  133.       choose the O_CAN_MAP option as shared memory is normally a limited
  134.       resource.
  135.  
  136.   O_SHARED_MEMORY
  137.       System has a (properly working) system-V compatible shared  memory
  138.       system  (shmget(), shmat(), shmdt()). If set, O_DYNAMIC_STACK will
  139.       be set automatically.  Only  choose  one  of  O_SHARED_MEMORY  and
  140.       O_CAN_MAP.   O_CAN_MAP  is to be preferred as there is no limit on
  141.       the number of maps that can be established.
  142.  
  143.   O_CAN_MAP
  144.       System  has  mmap()  and  munmap()   system   calls.    See   also
  145.       O_SHARED_MEMORY.
  146.  
  147.   O_NO_SEGV_ADDRESS
  148.       If the  system  provides  O_DYNAMIC_STACKS,  this  flag  indicates
  149.       whether  the  signal  handler  is provided with the address of the
  150.       segmentation fault.  If not, set this flag.  Prolog  will  try  to
  151.       find  the  faulting stack using heuristics.  This takes (slightly)
  152.       longer and might result in a stack being expanded  that  did  not
  153.       actually require expansion, but otherwise it works fine.
  154.  
  155.   MAX_VIRTUAL_ADDRESS
  156.       Highest virtual address we can use for  mapping  the  stacks.   On
  157.       many  machine  the  C-stack grows from the maximum virtual address
  158.       downwards.  In this case leave enough space  for  the  C-stack  to
  159.       grow.  SWI-Prolog places the stacks downwards from this address.
  160.  
  161.   O_FOREIGN
  162.       Include foreign language code linker.  This  requires the (Unix)
  163.       linker to  accept  the -A flag that  allows  you to  generate an
  164.       image  fitting with  a existing image.   Some systems  (AIX  and
  165.       MACH) define  functions to load  object-files.  Scan the various
  166.       existing md-files and pl-load.c
  167.  
  168.   O_SAVE
  169.       Define save/[1,2], save_program/[1,2] and restore/1 for handling
  170.       saved execution states.   This is  the  new and   hopefully more
  171.       portable   alternative to  O_STORE_PROGRAM.  The  file pl-save.c
  172.       describes  how  it works.    Only  define   one of   O_SAVE   or
  173.       O_STORE_PROGRAM.
  174.  
  175.   O_STORE_PROGRAM
  176.       Include saved states.  This is difficult  to  port.   The  current
  177.       version  uses the GNU-emacs code for generating the dump (slightly
  178.       modified).  O_SAVE is to be preferred.
  179.  
  180.   DESCRIPTOR_TABLE_SIZE
  181.       If this macro is defined, it should evaluate to the  size  of  the
  182.       file  descriptor  table.   If  it  is  not  defined  the  function
  183.       getdtablesize() is called to resolve the descriptor table size.
  184.  
  185.  
  186.                 TERMINAL DRIVER OPTIONS
  187.  
  188.   O_TERMIOS
  189.       Use the System-V termio terminal driver. If not set the BSD sgtty
  190.       package is used.  Set this flag if you can!
  191.  
  192.   O_EXTEND_ATOMS
  193.       Include automatic extension of atoms if the user  types  ^[  (ESC)
  194.       and inform the user about existing atoms on ^D similar to the Unix
  195.       4.2  and  newer  csh(1)  do  to  files.  It can be included if the
  196.       terminal driver allows for a second end-of-line character  (t_brkc
  197.       in  struct tchars) or has the new `termios' terminal driver.  This
  198.       is still somewhat experimental (in particular we should try to  be
  199.       a bit more selective than returning any atom).
  200.  
  201.       The current implementation  also  allows  this  option  if  it  is
  202.       possible to read characters without waiting for a return.  See the
  203.       O_LINE_EDIT option.
  204.  
  205.   O_LINE_EDIT
  206.       Makes Prolog reading terminal input in  Unix  cbreak  mode.   Line
  207.       editing  capabilities  are  provided by Prolog itself.  Allows for
  208.       O_EXTEND_ATOMS, even if the terminal driver does not  support  the
  209.       necessary options.
  210.  
  211.   O_MAP_TAB_ON_ESC    1
  212.       Makes the prolog reader mapping the TAB character on ESC (for
  213.       extending atoms) when reading from a terminal.
  214.  
  215.   O_FOLD
  216.       Integer specifying default line folding for your  OS.   0  implies
  217.       Prolog does not do line folding.
  218.  
  219.             /*** WINDOWING INTERFACE ***/
  220.  
  221.   O_PCE
  222.       Includes hooks for   the XPCE  object-oriented  user   interface
  223.       package.  XPCE runs on  various  platforms supporting X11.   For
  224.       more information contact:
  225.  
  226.               jan@swi.psy.uva.nl (Jan Wielemaker)
  227. - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
  228.  
  229.             /* compiler */
  230. #define ANSI            1
  231. /*#define PROTO            0 not needed when ANSI is set*/
  232. #define O_NO_LEFT_CAST        0
  233. #define O_NO_VOID_POINTER    0
  234. #define O_SHORT_SYMBOLS        0
  235.             /* Operating system */
  236. #define O_PROFILE        0
  237. #define O_SIG_AUTO_RESET    0
  238. #define O_SHARED_MEMORY        0
  239. #define O_CAN_MAP        0
  240. #define O_NO_SEGV_ADDRESS    0
  241. #define MAX_VIRTUAL_ADDRESS    (220 * 1024 * 1024)
  242. #define O_FOREIGN        0
  243. #define O_SAVE            0
  244. #define DEFAULT_PATH        ":/usr/ucb:/bin:/usr/bin:/usr/local:.:"
  245.  
  246.             /* terminal driver */
  247. #define O_TERMIOS         1
  248. #define O_EXTEND_ATOMS         1
  249. #define O_LINE_EDIT         1
  250. #define O_MAP_TAB_ON_ESC    1
  251. #define O_FOLD             0
  252.             /* Interfaces */
  253. #define O_PCE             0
  254.  
  255. #define MACHINE            "generic"
  256. #define OPERATING_SYSTEM    "generic"
  257.