gfx freetype sets local defines which are not tracked by the dependency system

RESOLVED FIXED in mozilla1.4beta

Status

SeaMonkey
Build Config
RESOLVED FIXED
15 years ago
14 years ago

People

(Reporter: Steven Augart, Assigned: hacker formerly known as seawood@netscape.com)

Tracking

Trunk
mozilla1.4beta
x86
Linux

Firefox Tracking Flags

(Not tracked)

Details

Attachments

(7 attachments, 1 obsolete attachment)

(Reporter)

Description

15 years ago
User-Agent:       Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.4a) Gecko/20030415
Build Identifier: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.4a) Gecko/20030415

I built mozilla from the CVS source last night (April 16, 2003) on Linux.  My
system has a version of freetype2, which Mozilla cheerfully detected during its
configuration process:
  checking for freetype-config... (cached) /usr/bin/freetype-config
  checking for FreeType - version >= 6.1.0... yes
However, MOZ_ENABLE_FREETYPE2 is not enabled in mozilla-config.h

Reproducible: Didn't try

Steps to Reproduce:
1. Download a source tarball (I used the 1.4a source)
2. Install the .mozconfig file I will attach as attachment #1 [details] [diff] [review].
3. make -f client.mk 2>&1 | tee make.out
4) dist/bin/mozilla

Actual Results:  
Mozilla downloaded the latest CVS, configured, and built.

When I started mozilla, I got the warning:
  WARNING: freetype not compiled in, file nsFT2FontNode.cpp, line 51

There is no MOZ_ENABLE_FREETYPE2 defined in mozilla-config.h.

Expected Results:  
Had freetype2 support compiled in.  Not displayed the warning.  Had
MOZ_ENABLE_FREETYPE2 defined in mozilla-config.h.

I'm attaching the make.out file (make's output) as attachment #2 [details] [diff] [review].
(Reporter)

Comment 1

15 years ago
Created attachment 120844 [details]
The .mozconfig file I used.
(Reporter)

Comment 2

15 years ago
Created attachment 120845 [details]
The output from the make command, bzip2 compressed

The uncompressed version is long: 2 MB; 31,000 lines.
The bzip2'd version is 172 KB.
When changing configure options, you need to run a 'make distclean' between
builds.  The MOZ_ENABLE_FREETYPE2 define is set by the local Makefile based upon
the MOZ_ENABLE_FREETYPE2 environment definition.  I don't see nsFT2FontNode.cpp
being recompiled in your log so it appears to have been compiled already with a
previous configuration.

There's no logic in the local Makefile to make sure that the files which depend
upon the local -DMOZ_ENABLE_FREETYPE2 define are rebuilt when the env variable
changes.  Either -DMOZ_ENABLE_FREETYPE2 needs to be moved up to the global
header or a local header needs to be generated with that define.
Status: UNCONFIRMED → NEW
Ever confirmed: true
Summary: CVS Build of mozilla: MOZ_ENABLE_FREETYPE2 unexpectedly not defined → gfx freetype sets local defines which are not tracked by the dependency system
Created attachment 121012 [details] [diff] [review]
v0.5

Haven't tested the code changes but this is the basic idea for the build system
changes.
Created attachment 121017 [details] [diff] [review]
non-global defines v1.0 (checked in)


This is just the generic code to remove non-global defines from
mozilla-config.h.
Attachment #121012 - Attachment is obsolete: true
Attachment #121017 - Flags: review?(darin)

Comment 6

15 years ago
Comment on attachment 121017 [details] [diff] [review]
non-global defines v1.0 (checked in)


r=darin
Attachment #121017 - Flags: review?(darin) → review+
(Reporter)

Comment 7

15 years ago
Created attachment 121027 [details]
LXR output for searches for USE_FREETYPE, FT2_, and MOZ_ENABLE_FREETYPE2

Thanks to Christopher Seawood for Comment #3.  I could not bear the thought of
doing a "make distclean" and then presumably waiting for hours for another
build, so I cheated.  

First, I used LXR to search for all the places in the source code that mention
USE_FREETYPE, FT2_<anything>, and MOZ_ENABLE_FREETYPE2.  This gave me the
attached file:	(see my next attachment for more)
(Reporter)

Comment 8

15 years ago
Created attachment 121028 [details]
Awk program to process the list of files referring to MOZ

I then wrote a bit of awk to pull out the file names alone and generate a shell
script with a bunch of lines of the form:
   touch <filename-affected-by-config-change>
Here it is.
(Reporter)

Comment 9

15 years ago
Created attachment 121030 [details]
The Bourne Shell script that drives the awk program.

I drive the awk script with this little bit of Bourne shell.

I did manual review on the output until I was happy with it (special-cased some
files that didn't need touching), and then piped the output through "sh".  

At any rate, this probably saved me a lot of waiting, even given the time to do
some manual review, and I thought I'd share the trick.	Obviously this is not a
useful general solution to the problem -- but it can be a timesaver.
Attachment #121017 - Attachment description: non-global defines v1.0 → non-global defines v1.0 (checked in)
Created attachment 121260 [details] [diff] [review]
v1.0

This patch generates a gfx/gfx-config.h file at configure time which contains
the gfx specific defines.  Atm, that's just MOZ_ENABLE_FREETYPE2.
Attachment #121260 - Flags: superreview?(roc+moz)
Attachment #121260 - Flags: review?(blizzard)
Attachment #121260 - Flags: superreview?(roc+moz) → superreview+
Attachment #121260 - Flags: review?(blizzard) → review+
Amid much carnage, the patch was checked in.
Status: NEW → RESOLVED
Last Resolved: 15 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla1.4beta
Product: Browser → Seamonkey
You need to log in before you can comment on or make changes to this bug.