Here are some useful patches to rn for A/UX

Michael Pickers mp at unido.UUCP
Thu Dec 6 04:21:59 AEST 1990


In article <#-1qg2.0-5 at smurf.sub.org> urlichs at 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 at unido.uucp (...uunet!mcsun!unido!mp)
          Internet: mp at unido.informatik.uni-dortmund.de
          BITNET: mp at unido.bitnet



More information about the Comp.unix.aux mailing list