Incompatibility between FreeBSD make.conf and imake 4.3.0

Carl Mascott cmascott at att.net
Fri Jun 6 07:11:41 PDT 2003


I just discovered an incompatibility between the handling of
CFLAGS in FreeBSD 4.8-R (and other versions, I'm sure) and in
imake 4.3.0.

Let me give you the symptom first.  When building both normal
and shared libraries, using an Imakefile that uses the automatic
object rule generation provided by Library.tmpl
(ex: ports/x11-toolkits/Xaw3d), the normal library is compiled
without ANY optimization (i.e., CFLAGS is ignored).

The cause:
FreeBSD goes out of its way (in FreeBSD.cf) to ensure that
CDEBUGFLAGS will be empty, with the expectation that compiler
optimization will be gotten from CFLAGS as set in make.conf.
However, the imake object rule for normal libraries that is
used WHEN BUILDING BOTH NORMAL AND SHARED LIBRARIES (Imake.rules,
LibObjCompile) does not use CFLAGS, expecting compiler
optimization to come from CDEBUGFLAGS.

I don't know why LibObjCompile doesn't use CFLAGS.  Is it
intentional?  Is it an oversight?  Would something else break
if LibObjCompile were changed to use CFLAGS?  Imake config
files are so complex that it's hard to answer these questions
correctly.

Note that this is not an imake config bug.  This problem is
triggered by what's done in FreeBSD.cf, which is not "in
harmony" with the expectations of the imake config files
regarding CDEBUGFLAGS.

A less-than-satisfactory workaround is to put
CDEBUGFLAGS = -O
into every affected Imakefile AFTER "#include <Library.tmpl)".

I'd be tempted to modify LibObjCompile to use CFLAGS.  Anybody
else got any thoughts on how to fix this problem?

NOTE: All versions of libXaw3d.a built from ports were compiled
without any optimization.  I don't know what other libraries
may have been compiled without any optimization.


More information about the freebsd-hackers mailing list