Path: utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!swrinde!zaphod.mps.ohio-state.edu!sol.ctr.columbia.edu!ira.uka.de!smurf!urlichs From: urlichs@smurf.sub.org (Matthias Urlichs) Newsgroups: comp.unix.aux Subject: Re: Here are some useful patches to rn for A/UX Message-ID: <%4yrg2."da@smurf.sub.org> Date: 6 Dec 90 01:08:13 GMT References: <1990Dec2.014221.12113@panix.uucp> <#-1qg2.0-5@smurf.sub.org> <3112@unido.UUCP> Organization: University of Karlsruhe, FRG Lines: 49 In comp.unix.aux, article <3112@unido.UUCP>, mp@unido.UUCP (Michael Pickers) writes: < In article <#-1qg2.0-5@smurf.sub.org> urlichs@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@smurf.sub.org -- urlichs@smurf.ira.uka.de /(o\ Humboldtstrasse 7 - 7500 Karlsruhe 1 - FRG -- +49+721+621127(0700-2330) \o)/