PORTING 3.2 KB

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