bugThe FreeType Project - Bugs: bug #43976, Build failure: incorrect...

 
 

bug #43976: Build failure: incorrect precedence of CPPFLAGS

Submitted by:  Daniel Macks <dmacks>
Submitted on:  Sun 11 Jan 2015 12:48:09 PM UTC  
 
Severity: 3 - NormalItem Group: Incorrect behaviour
Status: FixedPrivacy: Public
Assigned to: Werner LEMBERG <wl>Open/Closed: Closed
Planned Release: 2.6.0

Add a New Comment(Rich Markup)
   

You are not logged in

Please log in, so followups can be emailed to you.

 

(Jump to the original submission Jump to the original submission)

Wed 14 Jan 2015 06:21:24 AM UTC, comment #6:

Thanks for testing. Admittedly, I would never have thought of such a complicated setup by myself; consequently, I've never taken care of those subtle issues before. Now I know better :-)

Werner LEMBERG <wl>
Project AdministratorIn charge of this item.
Wed 14 Jan 2015 03:47:17 AM UTC, comment #5:

Build succeeded for me. Yay! And I tried a few 'grep's on the build transcript and could not find any others that were similarly fragile.

Daniel Macks <dmacks>
Mon 12 Jan 2015 10:28:33 AM UTC, comment #4:

Fixed in git. Please test!

Werner LEMBERG <wl>
Project AdministratorIn charge of this item.
Sun 11 Jan 2015 10:36:00 PM UTC, comment #3:

I have lots of things in /sw (/sw/include /sw/lib and so on, a unified prefix for things all supplied by the same vendor). And therein, some libraries have files stored in their own subdir (/sw/lib/libFOO/{include,lib}). I am setting:

CPPFLAGS=-I/sw/include
LDFLAGS=-L/sw/lib

and pkgconfig has /sw/lib/pkgconfig before /usr/lib/pkgconfig in its default search path. OS X has zlib, bzip2, and libpng, /sw has newer bzip2 and libpng, so these settings should give unified priority to whatever /sw has, overlaying OS X. Pretty standard for autoconf-based packages and in accord with documentation.

For freetype, the binary library components will be sent to a package-specific /sw/lib subdir for ABI-compatibility reasons, while the other things go into the main /sw subdirs. I am thus using the following as my build recipe (with its main diagnostic reports):

./configure --prefix=/sw --libdir=/sw/lib/freetype219/lib --with-old-mac-fonts --disable-static
[module-detection]
cd builds/unix; /bin/sh ./configure '--prefix=/sw' '--libdir=/sw/lib/freetype219/lib' '--with-old-mac-fonts' '--disable-static'
[all the checking for...]
Library configuration:
external zlib: yes (autoconf test)
bzip2: yes (autoconf test)
libpng: yes (pkg-config)
harfbuzz: no

Then I run:

make

Daniel Macks <dmacks>
Sun 11 Jan 2015 01:19:52 PM UTC, comment #2:

Thanks for the report, however, your description is too confusing for me. Showing the makefile output is not sufficient to get a clear picture of what's going on.

How exactly do you call the configure script and/or make (or which environment variables are you using), and where is your old and new software located?

Werner LEMBERG <wl>
Project AdministratorIn charge of this item.
Sun 11 Jan 2015 01:04:37 PM UTC, comment #1:

Main source of the ordering mixup is in builds/freetype.mk, where $(CPPFLAGS) is first (before $(INCLUDE_FLAGS) and others that likely contain builddir -I flags). Switching $(CPPFLAGS) allows freetype to compile successfully for me. There is still a pedantic mistake of ordering in the various subdirs of src/ where each rules.mk appends its -I flag (therefore putting it after the pre-assembled FT_COMPILE that was fixed in builds/freetype.mk. Seems to be the nature of this makefile setup I guess:(

Daniel Macks <dmacks>
Sun 11 Jan 2015 12:48:09 PM UTC, original submission:

I have lots of packages installed at a nonstandard location, so I use the CPPFLAGS variable to specify -I to there (and likewise LDFLAGS for its -L). That's where my libpng16 is, and also an older version of freetype. I get a build failure with freetype-2.5.4:

./builds/unix/libtool --mode=compile gcc -ansi -MD -I/sw/include -I/sw/build.build/freetype219-2.5.4-1/freetype-2.5.4/objs -I./builds/unix -I/sw/build.build/freetype219-2.5.4-1/freetype-2.5.4/include -c -Wall -g -O2 -DFT_MACINTOSH -DHAVE_ANSI_OS_INLINE=1 -DHAVE_TYPE_RESOURCE_INDEX=1 -DFT_CONFIG_OPTION_SYSTEM_ZLIB -DFT_CONFIG_OPTION_USE_BZIP2 -I/sw/include/libpng16 -DFT_CONFIG_OPTION_USE_PNG -DFT_CONFIG_CONFIG_H="<ftconfig.h>" -DFT2_BUILD_LIBRARY -DFT_CONFIG_MODULES_H="<ftmodule.h>" -o /sw/build.build/freetype219-2.5.4-1/freetype-2.5.4/objs/ftdebug.lo /sw/build.build/freetype219-2.5.4-1/freetype-2.5.4/src/base/ftdebug.c
libtool: compile: gcc -ansi -MD -I/sw/include -I/sw/build.build/freetype219-2.5.4-1/freetype-2.5.4/objs -I./builds/unix -I/sw/build.build/freetype219-2.5.4-1/freetype-2.5.4/include -c -Wall -g -O2 -DFT_MACINTOSH -DHAVE_ANSI_OS_INLINE=1 -DHAVE_TYPE_RESOURCE_INDEX=1 -DFT_CONFIG_OPTION_SYSTEM_ZLIB -DFT_CONFIG_OPTION_USE_BZIP2 -I/sw/include/libpng16 -DFT_CONFIG_OPTION_USE_PNG "-DFT_CONFIG_CONFIG_H=<ftconfig.h>" -DFT2_BUILD_LIBRARY "-DFT_CONFIG_MODULES_H=<ftmodule.h>" /sw/build.build/freetype219-2.5.4-1/freetype-2.5.4/src/base/ftdebug.c -fno-common -DPIC -o /sw/build.build/freetype219-2.5.4-1/freetype-2.5.4/objs/.libs/ftdebug.o
In file included from /sw/build.build/freetype219-2.5.4-1/freetype-2.5.4/src/base/ftdebug.c:44:
/sw/include/ft2build.h:56:10: fatal error: 'freetype/config/ftheader.h' file not found
In file included from builds/unix/ftsystem.c:19:
/sw/include/ft2build.h:56:10: fatal error: 'freetype/config/ftheader.h' file not found
#include <freetype/config/ftheader.h>
^
#include <freetype/config/ftheader.h>
^
1 error generated.

The problem is that the compiler is finding freetype headers from the previously-installed older version of freetype rather than the one currently being build. The reason is that CPPFLAGS (my global -I, and also -MD to help diagnose it) is listed before the -I for the source-distro build locations rather than allowing the current source to take precedence.

Daniel Macks <dmacks>

 

(Note: upload size limit is set to 16384 kB, after insertion of the required escape characters.)

Attach File(s):
   
   
Comment:
   

No files currently attached

 

Depends on the following items: None found

Items that depend on this one: None found

 

Carbon-Copy List
  • -unavailable- added by wl (Posted a comment)
  • -unavailable- added by dmacks (Submitted the item)
  •  

    Do you think this task is very important?
    If so, you can click here to add your encouragement to it.
    This task has 0 encouragements so far.

    Only logged-in users can vote.

     

    Please enter the title of George Orwell's famous dystopian book (it's a date):

     

     

    Follow 5 latest changes.

    Date Changed By Updated Field Previous Value => Replaced By
    Mon 12 Jan 2015 10:28:33 AM UTCwlItem GroupNone=>Incorrect behaviour
      StatusNone=>Fixed
      Assigned toNone=>wl
      Open/ClosedOpen=>Closed
      Planned ReleaseNone=>2.6.0

    Back to the top


    Powered by Savane 3.1-cleanup1