Path: utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!usc!sdd.hp.com!wuarchive!mit-eddie!bloom-beacon!eru!hagbard!sunic!mcsun!unido!mp From: mp@unido.UUCP (Michael Pickers) Newsgroups: comp.unix.aux Subject: Re: Here are some useful patches to rn for A/UX Summary: How to use cc Keywords: rn patches Message-ID: <3112@unido.UUCP> Date: 5 Dec 90 17:21:59 GMT References: <1990Nov30.015100.6211@wiskit.pdx.com> <1990Dec2.014221.12113@panix.uucp> <#-1qg2.0-5@smurf.sub.org> Reply-To: mp@unido.UUCP (Michael Pickers) Organization: The German Eunet Backbone, University of Dortmund Lines: 56 In article <#-1qg2.0-5@smurf.sub.org> urlichs@smurf.sub.org (Matthias Urlichs) writes: >Man pages? Following various discussions about porting software to A/UX I have the impression that nobody ever took the time to read the man-page of cc(1) to the end. You should all do that (there is other interesting stuff in there). >Distinguished from this are the various defining flags for cc which make >your C code compile in the first place: > >-D_SYSV_SOURCE >-D_BSD_SOURCE >-D_POSIX_SOURCE >-D_AUX_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 ? 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...:-) :-) Here ist the relevant part (not all options shown): ---- -Zflags Special flags to override the default behavior (see NOTES in this section). Currently recognized flags are: S Compile to be SVID-compatible. Link the pro- gram with a library module that calls setcompat(2) with the COMPAT_SVID flag set. Define only the SYSV_SOURCE feature test macro. P Compile for the POSIX environment. Link the program with a library module that calls setcompat(2) with the COMPAT_POSIX flag set. Define only the POSIX_SOURCE feature test mac- ro. B Compile to be BSD-compatible. Link the program with a library module that calls setcompat(2) with the COMPAT_BSD flag set. Define only the BSD_SOURCE feature test macro. ---- 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. Michael Pickers Computer Science Department, University of Dortmund IRB - Informatik Rechner Betriebsgruppe 4600 Dortmund 50, P.O. Box 500500, W.-Germany E-mail address UUCP: mp@unido.uucp (...uunet!mcsun!unido!mp) Internet: mp@unido.informatik.uni-dortmund.de BITNET: mp@unido.bitnet