home *** CD-ROM | disk | FTP | other *** search
/ The World of Computer Software / World_Of_Computer_Software-02-387-Vol-3of3.iso / p / prolg386.zip / pl / src / md-386bsd.h
Text File  |  1992-08-29  |  10KB  |  244 lines

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