Porting FAQ for SING (Schily Is Not Gnu) utilities.

-	The base for porting is the makefile system.
	Always look into:
		ftp://ftp.fokus.gmd.de/pub/unix/makefiles
	for the newest version.

	Then read the man pages located in man/man4/*

		to convert a manpage troff->postscript:
			gtroff -man file.tr | grops > file.ps
		to convert a manpage troff->Terminal:
			nroff -man file.tr | more -s


-	To be able to use the makefile system, you need a
	make program that meets the minimum requirements 
	for a make program (see makerules(4) man page)
	Currently, the following make programs meet this
	minimum requirements: Smake (my program), SunPro Make and Gmake

	The most recent 'smake' binaries that I have created so far
	can be found in:

		ftp://fokus.gmd.de/pub/unix/makefiles/bin

-	To be able to use the makefile system with gmake,
	the operating system must have a command named 'uname'.
	If not, you have to provide it as a shell script.


1)	First step for adding a new architecture is creating
	the appropriate rule files in the RULES directory:

		RULES/os-{newos}.id	For OS identification
		RULES/os-{newos}.def	For OS definition (man style)
		RULES/{newarch}-{newos}-cc.rul
		RULES/{newarch}-{newos}-gcc.rul

	And create a file:

		DEFAULTS/Defaults.{newos}

	Have a look in similar files for a template.

2)	All porting control is located in include/mconfig.h
	and in the file incs/{newarch}-{newos}-{cc!gcc}/xconfig.h
	The later file is created automatically using GNU 
	configure. The File conf/xconfig.h.in contains all
	templates and comments for the various things that are tested.

	In any case, it is recommended to carefully watch the
	outout from the 'configure' run (which is automatically
	started from within 'make'). You may also wish to check all
	files that are created in the directory 
	incs/{newarch}-{newos}-{cc!gcc}/

	In general, unlike the way that is used in typical GNU 
	programs, all portability issued (as far as possible) are 
	moved into file located in the include/ directory.

	If some time, GNU autoconf will deal with all I need,
	this file will be created by autoconf.

3)	Everything should compile now.
	If not, try to hack the files and mail me your problems.

	You should have a closer look at the sources as it may be that
	the first attempt to port a utility will not support
	all possible features of the new OS as it may be that your
	OS supportes them in a non standard way.

	This is definitely recommended if you want to port programs 
	like 'cdrecord' 'star' and similar which need fork(2) and
	mmap(2) or setprioriry(2) or if you check programs on
	non POSIX operating systems like W95/W98/WNT OS/2 and
	similar.


Notice for porting tools, that use the SCSI library libscg:

I)	Cdrecord should compile at this moment if you are using
	a new architecture. The SCSI transport however will not work.
	Check this!

	All files that contain low level code for SCSI transport are 
	located in the directory libscg/

II)	Implementing a SCSI Transport Layer for your architecture:

	You need to add a new block into scsihack.c that will add
	support for your OS. Copy the block:

	#ifdef  __NEW_ARCHITECTURE
	#define SCSI_IMPL               /* We have a SCSI implementation for XXX */
	/*
	 * Add new hacks here
	 */
	#include "scsi-new-arch.c"
	#endif

	and rename __NEW_ARCHITECTURE to reflect your new architecture.

	Add a new file that will be called scsi-{newarch}.c
	Have a look into scsi-linux-sg.c for a template how to do this.

	More hints for writing the needed SCSI low level transport functions
	is in:

		ftp://fokus.gmd.de/pub/unix/cdrecord/README.scsi-IF

4)	Test your ported program.

5)	You may check other programs from me to see if everything compiles
	and works.

6)	Send me your changes

Joerg Schilling

schilling@fokus.gmd.de
joerg@schily.isdn.cs.tu-berlin.de
js@cs.tu-berlin.de




