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