home *** CD-ROM | disk | FTP | other *** search
/ linuxmafia.com 2016 / linuxmafia.com.tar / linuxmafia.com / pub / linux / backup / star-1.3.1.tar.gz / star-1.3.1.tar / star-1.3.1 / PORTING < prev    next >
Text File  |  2001-04-13  |  4KB  |  143 lines

  1. Porting FAQ for SING (Schily Is Not Gnu) utilities.
  2.  
  3. -    The base for porting is the makefile system.
  4.     Always look into:
  5.         ftp://ftp.fokus.gmd.de/pub/unix/makefiles
  6.     for a version that might be newer than the one used
  7.     inside the program that should be ported.
  8.  
  9.     If you want to know more about the makefile system,
  10.     read the man pages makefiles4 and makerules.4,
  11.     they are located in man/man4/*
  12.  
  13.         to convert a manpage troff->postscript use:
  14.             gtroff -man file.tr | grops > file.ps
  15.  
  16.         to convert a manpage troff->Terminal use:
  17.             nroff -man file.tr | more -s
  18.  
  19.  
  20. -    To be able to use the makefile system, you need a
  21.     make program that meets the minimum requirements 
  22.     for a make program (see makerules(4) man page)
  23.     Currently, the following make programs meet this
  24.     minimum requirements: Smake (my program), SunPro Make and Gmake
  25.  
  26.     A good idea is to first compile 'smake' if you don't
  27.     have it already.
  28.  
  29.     The smake source can be found on:
  30.  
  31.         ftp://fokus.gmd.de/pub/unix/smake/
  32.     or
  33.         ftp://fokus.gmd.de/pub/unix/smake/alpha
  34.  
  35.     for the most recent version.
  36.  
  37. -    To be able to use the makefile system with gmake,
  38.     the operating system must have a command named 'uname'.
  39.     If not, you have to provide it as a shell script.
  40.  
  41.  
  42. 1)    If you are using smake release 1.1 or newer and 
  43.     a recent makefile system, the next step should be done
  44.     automagically (smake-1.1 or newer implement a -version
  45.     option to retrieve the version number).
  46.  
  47.     If you are using gmake, you need to do this by hand.
  48.  
  49.     First step for adding a new architecture is creating
  50.     the appropriate rule files in the RULES directory:
  51.  
  52.         RULES/os-{newos}.id    For OS identification
  53.         RULES/os-{newos}.def    For OS definition (man style)
  54.         RULES/{newarch}-{newos}-cc.rul
  55.         RULES/{newarch}-{newos}-gcc.rul
  56.  
  57.     And create a file:
  58.  
  59.         DEFAULTS/Defaults.{newos}
  60.  
  61.     Have a look in similar files for a template.
  62.  
  63.     If the files hae been generated automagically by smake,
  64.     please check the content and mail me a working set for your OS.
  65.  
  66. 2)    All C-porting control is located in include/mconfig.h
  67.     and in the file incs/{newarch}-{newos}-{cc!gcc}/xconfig.h
  68.     The later file is created automatically using GNU 
  69.     configure. The File conf/xconfig.h.in contains all
  70.     templates and comments for the various things that are tested.
  71.  
  72.     In any case, it is recommended to carefully watch the
  73.     outout from the 'configure' run (which is automatically
  74.     started from within 'make'). You may also wish to check all
  75.     files that are created in the directory 
  76.     incs/{newarch}-{newos}-{cc!gcc}/
  77.  
  78. 3)    Everything should compile now.
  79.     If not, try to hack the files and mail me your problems.
  80.  
  81.     You should have a closer look at the sources as it may be that
  82.     the first attempt to port a utility will not support
  83.     all possible features of the new OS.
  84.     If your OS supportes these features in a non standard way,
  85.     you need to hack conf/configure.in and the source and add 
  86.     support for the non standard behaviour of your OS.
  87.  
  88.     This is definitely recommended if you want to port programs 
  89.     like 'cdrecord' 'star' and similar which need fork(2) and
  90.     mmap(2) or setprioriry(2) or if you check programs on
  91.     non POSIX operating systems like W95/W98/WNT OS/2 and
  92.     similar.
  93.  
  94.  
  95. Notice for porting tools, that use the SCSI library libscg:
  96.  
  97. I)    Cdrecord should compile at this moment if you are using
  98.     a new architecture. The SCSI transport however will not work.
  99.     Check this!
  100.  
  101.     All files that contain low level code for SCSI transport are 
  102.     located in the directory libscg/
  103.  
  104. II)    Implementing a SCSI Transport Layer for your architecture:
  105.  
  106.     You need to add a new block into scsihack.c that will add
  107.     support for your OS. Copy the block:
  108.  
  109.     #ifdef  __NEW_ARCHITECTURE
  110.     #define SCSI_IMPL               /* We have a SCSI implementation for XXX */
  111.     /*
  112.      * Add new hacks here
  113.      */
  114.     #include "scsi-new-arch.c"
  115.     #endif
  116.  
  117.     and rename __NEW_ARCHITECTURE to reflect your new architecture.
  118.  
  119.     Add a new file that will be called scsi-{newarch}.c
  120.     Have a look into scsi-linux-sg.c for a template how to do this.
  121.  
  122.     More hints for writing the needed SCSI low level transport functions
  123.     is in:
  124.  
  125.         ftp://fokus.gmd.de/pub/unix/cdrecord/README.scsi-IF
  126.  
  127. 4)    Test your ported program.
  128.  
  129. 5)    You may check other programs from me to see if everything compiles
  130.     and works.
  131.  
  132. 6)    Send me your changes
  133.  
  134. Joerg Schilling
  135.  
  136. schilling@fokus.gmd.de
  137. joerg@schily.isdn.cs.tu-berlin.de
  138. js@cs.tu-berlin.de
  139.  
  140.  
  141.  
  142.  
  143.