This commit was generated by cvs2svn to track changes on a CVS vendor
[unix-history] / usr.bin / file / PORTING
CommitLineData
15637ed4 1Portability of the new file(1) command.
286a6f32 2@(#) PORTING,v 1.2 1993/06/10 00:38:00 jtc Exp
15637ed4
RG
3
4Read this file only if the program doesn't compile on your system.
5
286a6f32
C
6This release has been around UNIX; it has been compiled and tested
7in the following environments:
8
9SunOS sqarc 4.1.1 8 sun4
10 No problems.
11ULTRIX squint 4.2 0 RISC
12 No problems.
13A/UX sqmac 3.0a9 SVR22 mc68020
14 No problems.
15AIX sqibm 2 3 000XXXXXX100
16 Had weird "make" problems making "magic" file automatically; just
17 built it by hand. Your mileage may vary.
18SCO sqwang 3.2 2 i386
19 Compiles fine; their weird make can't handle "[a-z]*" as a dependancy,
20 so build magic by hand. Runs fine.
21sqzme sqzme 3.1.1 3 3B2
22 The 3B2 SVR3 needed a few tweaks as well as COPTS = -Ilocalinc
23 in order to compile.
24
25This version, reluctanly, includes <stdlib.h>, which won't exist
26on older systems or those that aren't even close to the ANSI C
27standard. There is a null "stdlib.h", and some other bogus headers,
28in subdirectory "localinc"; if you get complaints about missing
29stdlib.h and others, uncomment the line with COPTS=-Ilocalinc
30in the Makefile, and try again.
31
32You must have either <stdarg.h> or the older <varargs.h>, otherwise you'll
33have to butcher some routines in print.c.
34
35Beyond that, I have tried to make a program that doesn't need any
36command-line defines (-D) to specify what version of UNIX is in use,
15637ed4
RG
37by using the definitions available in the system #include
38files. For example, the lstat(2) call is normally found in
394BSD systems, but might be grafted into some other variant
40of UNIX. If it's done right (ie., using the same definitions),
41my program will compile and work correctly. Look at the #ifdefs
42to see how it's done.
43
286a6f32 44I've also tried to include source for all the non-portable library routines
15637ed4
RG
45I used (getopt, str*). Non-portable here means `not in every
46reasonably standard UNIX out there: V7, System V, 4BSD'.
286a6f32
C
47These are in subdirectory "localsrc", and not used unless you
48need them; again, see the Makefile.
15637ed4
RG
49
50There is one area that just might cause problems. On System
51V, they moved the definition of major() and minor() out of
52<sys/types.h> into <sys/sysmacros.h>. Hence, if major isn't
53defined after including types.h, I automatically include sys/sysmacros.h.
54This will work for 99% of the systems out there. ONLY if you
55have a system in which neither types.h nor sysmacros.h defines
56`major' will this automatic include fail (I hope). On such
57systems, you will get a compilation error in trying to compile
58a warning message. Please do the following:
59
286a6f32 60 1) change the appropriate #include at the start of fsmagic.c
15637ed4
RG
61and 2) let me know the name of the system, the release number,
62 and the name of the header file that *does* include
63 this "standard" definition.
64
65If you are running the old Ritchie PDP-11 C compiler or
66some other compiler that doesn't know about `void', you will have
286a6f32 67to include `-Dvoid=int' in the variable COPTS in the Makefile.
15637ed4
RG
68
69Other than this, there should be no portability problems,
70but one never knows these days. Please let me know of any
71other problems you find porting to a UNIX system. I don't much
286a6f32 72care about non-UNIX systems but will collect widely-used magic
15637ed4
RG
73numbers for them as well as for UNIX systems.
74
75Ian Darwin
286a6f32 76(address in README)