Here are some useful patches to rn for A/UX

Matthias Urlichs urlichs at smurf.sub.org
Thu Dec 6 12:08:13 AEST 1990


In comp.unix.aux, article <3112 at unido.UUCP>,
  mp at unido.UUCP (Michael Pickers) writes:
< In article <#-1qg2.0-5 at smurf.sub.org> urlichs at smurf.sub.org (Matthias Urlichs) writes:
< >Distinguished from this are the various defining flags for cc which make
< >your C code compile in the first place:
< >
< >-D_SYSV_SOURCE    [...]
< 
< NO! Your not supposed to define that youself! Why do you think that
< Apple was so nasty to put those annoying underscores in front of the
< defines ?
< 
Probably to make sure that they don't collide with anything the program in
question might want to define for itself.

< What you should do instead is using the '-Z' flag of cc. (Ok, you'll have
< to read until page 4 of manual to find that...:-) :-)
< 
< 	  -Zflags Special flags to override the default behavior (see
< 		  NOTES in this section).  Currently recognized flags
< 		  are:
<                   S    Compile to be SVID-compatible.     [...]
<                   P    Compile for the POSIX environment. [...]
< 		    B    Compile to be BSD-compatible.      [...]
< 
< This will not only set the proper define for the preprocessor but also
< link your program with the right compatibility library from /lib automaticly.
< So you should also remove any -lbsd -lposix or -lsvid options. 
< 
Unfortunately, there are some problems with -Zx (for x in [SPB]):
- There doesn't seem to be a way to define more than one flag. For instance,
  as I mentioned in my last posting, the include files for networking can't
  be compiled unless _BSD_SOURCE is defined; same for Streams and _SYSV_SOURCE.
- There doesn't seem to be a way to define _AUX_SOURCE, which you need if you
  want to use some of A/UX's special features. (Grep the include files if you
  need examples.)
- For some hybrid SysV/BSD programs, one compatibility flag alone will still
  create numerous errors. The alternate approach, saying 
  "-D_SYSV_SOURCE -D_BSD_SOURCE" on the cc command line, works very well in
  these cases.
- Which compatibility library, if any, is to be linked in also is a somewhat
  open question which you'll habe to decide by trial and error in some cases.

Lastly, the fact that I decide to do things differently doesn't mean that I
didn't read the man pages.

-- 
Matthias Urlichs -- urlichs at smurf.sub.org -- urlichs at smurf.ira.uka.de     /(o\
Humboldtstrasse 7 - 7500 Karlsruhe 1 - FRG -- +49+721+621127(0700-2330)   \o)/



More information about the Comp.unix.aux mailing list