cvs commit: src/include Makefile

Dejan Lesjak dejan.lesjak at ijs.si
Wed Sep 14 12:47:06 PDT 2005


Stefan Farfeleder wrote:

> On Wed, Sep 14, 2005 at 09:30:26AM -0700, Marcel Moolenaar wrote:
>> On Sep 14, 2005, at 2:52 AM, Stefan Farfeleder wrote:
>> 
>> >>  Back out 1.247.  On ia64 <osreldate.h> is included from
>> >>assembler source,
>> >>  the prototype broke buildword.
>> >
>> >I waver between guarding the prototype with #ifndef __ASSEMBLER__ and
>> >moving it to another header, eg. <unistd.h>.  Opinions?
>> 
>> I would go with #ifndef __ASSEMBLER__. I think the prototype is
>> essentially in the right header. I did test your patch and it does
>> the trick...
> 
> That would require fixing xorg-server's usage of the header too.  I
> don't know how difficult this is.

The trouble is rather in imake. To enable/disable some stuff imake grabs
__FreeBSD_version (basically similarly that ports system uses OSVERSION
variable). Since imake is basically cpp all it needs to do here is include
osreldate.h and it gets the proper #define.
Imake doesn't care much if there's a prototype for getosreldate there. It
just blindly includes it in generated Makefile. make(1) is the one that
then gets confused :) Example from x11-clocks/xtimer:

===>  Configuring for xtimer-0.8089
imake -DUseInstalled -I/usr/X11R6/lib/X11/config
make Makefiles
"Makefile", line 33: Need an operator
make: fatal errors encountered -- cannot continue
*** Error code 1

The part of imake configuration (file FreeBSD.cf) that includes osreldate.h
looks like this:

#ifndef OSRelVersion
/* Include this to get finer-grained information about the OS version */
#include "/usr/include/osreldate.h"
#define OSRelVersion __FreeBSD_version
#endif

Now if the prototype would be guarded with #ifndef __ASSEMBLER__, we could
change that part to something like:

#ifndef OSRelVersion
/* Include this to get finer-grained information about the OS version */
#define __ASSEMBLER__
#include "/usr/include/osreldate.h"
#undef __ASSEMBLER__
#define OSRelVersion __FreeBSD_version
#endif

which seems a bit silly but it works :)


Dejan


More information about the cvs-src mailing list