Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 24 Sep 2008 22:30:07 GMT
From:      Jeremy Chadwick <koitsu@FreeBSD.org>
To:        gnome@FreeBSD.org
Subject:   Re: ports/127297: Redefinition warnings in print/freetype2
Message-ID:  <200809242230.m8OMU7YJ062027@freefall.freebsd.org>

next in thread | raw e-mail | index | archive | help
The following reply was made to PR ports/127297; it has been noted by GNATS.

From: Jeremy Chadwick <koitsu@FreeBSD.org>
To: Jeremy Messenger <mezz7@cox.net>
Cc: bug-followup@freebsd.org
Subject: Re: ports/127297: Redefinition warnings in print/freetype2
Date: Wed, 24 Sep 2008 15:07:20 -0700

 On Wed, Sep 24, 2008 at 11:58:26AM -0500, Jeremy Messenger wrote:
 >> The pre-patch section comments out #define
 >> TT_CONFIG_OPTION_BYTECODE_INTERPRETER in
 >> include/freetype/config/ftoption.h (when WITHOUT_TTF_BYTECODE_ENABLED is
 >> not defined by the user), but then earlier in the Makefile, it
 >> re-enables it:
 >
 > I am not seeing any bug. When the WITHOUT_TTF_BYTECODE_ENABLED is not  
 > defined then the TT_CONFIG_OPTION_BYTECODE_INTERPRETER will be enable,  
 > which is a correct behavior. Unless I am blind?
 >
 > {snip}
 >
 > There is no problem. As for the redefine warning, I think it's harmless  
 > since it's still enable with no change as it's merely enable again.
 
 The bug is in the port Makefile as I described.  The CFLAGS addition of
 -DTT_CONFIG_OPTION_BYTECODE_INTERPRETER is 100% worthless, and induces
 the warnings.
 
 Let's step through each piece of the build process.
 
 Someone ultimately does "make" in ports/print/freetype2.  They do not
 have WITHOUT_TTF_BYTECODE_ENABLED defined.
 
 In the port Makefile:
 
 .if !defined(WITHOUT_TTF_BYTECODE_ENABLED)
 CFLAGS+=        -DTT_CONFIG_OPTION_BYTECODE_INTERPRETER
 .endif
 
 At this point TT_CONFIG_OPTION_BYTECODE_INTERPRETER will be defined
 during the build of the actual program.  You can even see it being
 defined forcefully in "cc".
 
 Then later, in the port Makefile, we find this:
 
 .if !defined(WITHOUT_TTF_BYTECODE_ENABLED)
 	@${REINPLACE_CMD} -e '/#define TT_CONFIG_OPTION_BYTECODE_INTERPRETER/s,/\* \(.*\) \*/,\1,; /#define TT_CONFIG_OPTION_UNPATENTED_HINTING/s,^\(.*\),/* \1 \*/,' \
 		${WRKSRC}/include/freetype/config/ftoption.h
 .endif
 
 The $REINPLACE_CMD code never gets executed, which makes sense because
 WITHOUT_TTF_BYTECODE_ENABLED is not defined.
 
 So let's see what include/freetype/config/ftoption.h contains shall we?
 
 $ egrep '(#define|#undef) TT_CONFIG_OPTION_BYTECODE_INTERPRETER' work/freetype-2.3.7/include/freetype/config/ftoption.h
 #define TT_CONFIG_OPTION_BYTECODE_INTERPRETER
 
 Oh look, it's being #define'd in the .h file already!
 
 So what's the purpose of the CFLAGS part?  To induce warnings?  :-)
 Seeing this per *every C file* for no good reason is absurd:
 
 In file included from ./builds/unix/ftconfig.h:42, from
 /usr/ports/print/freetype2/work/freetype-2.3.7/include/freetype/freetype.h:41, from
 /usr/ports/print/freetype2/work/freetype-2.3.7/include/freetype/ftmodapi.h:24, from
 /usr/ports/print/freetype2/work/freetype-2.3.7/include/freetype/ftrender.h:24, from
 /usr/ports/print/freetype2/work/freetype-2.3.7/include/freetype/internal/ftobjs.h:30, from
 /usr/ports/print/freetype2/work/freetype-2.3.7/src/smooth/ftgrays.c:141, from
 /usr/ports/print/freetype2/work/freetype-2.3.7/src/smooth/smooth.c:22:
 /usr/ports/print/freetype2/work/freetype-2.3.7/include/freetype/config/ftoption.h:462:1: warning: "TT_CONFIG_OPTION_BYTECODE_INTERPRETER" redefined
 <command-line>: warning: this is the location of the previous definition
 
 I'm begging you to try it for yourself.  Remove the CFLAGS modifier
 portion of the Makefile and then:
 
 # cd /usr/ports/print/freetype2
 # make clean
 # make
 
 You won't see any warnings.
 
 And try it with WITHOUT_TTF_BYTECODE_ENABLED=true too:
 
 # cd /usr/ports/print/freetype2
 # make clean
 # make WITHOUT_TTF_BYTECODE_ENABLED=true
 
 No warnings, and TT_CONFIG_OPTION_BYTECODE_INTERPRETER will be
 commented out in the .h file (as expected), because the $REINPLACE_CMD
 code will take care of it.
 
 Please reconsider your "there is no bug here" comment.  There is most
 definitely a bug -- the FreeBSD port Makefile is causing tons of
 unnecessary warnings for *no good reason*.
 
 -- 
 | Jeremy Chadwick                                jdc at parodius.com |
 | Parodius Networking                       http://www.parodius.com/ |
 | UNIX Systems Administrator                  Mountain View, CA, USA |
 | Making life hard for others since 1977.              PGP: 4BD6C0CB |
 



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200809242230.m8OMU7YJ062027>