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