Re: Bug #13796 Updated: Configure sets both HAVE_GD_STRINGTTF and HAVE_GD_STRINGFT

From: Date: Wed, 24 Oct 2001 20:49:10 +0000
Subject: Re: Bug #13796 Updated: Configure sets both HAVE_GD_STRINGTTF and HAVE_GD_STRINGFT
References: 1  Groups: php.dev 
Request: Send a blank email to php-dev+get-68973@lists.php.net to get a copy of this message

Ah..I see..the GD library is nice and still enables that
function which PHP's configure looks. This is done even if
you leave out HAVE_LIBTTF..

# nm libgd.a | grep StringTTF
00000000 T gdImageStringTTF

But it's not an issue anymore since the fix I committed (thanks again for
noticing it) fixes this. GD should not enable dummy functions like this.
So if you want, you can send a bug report to the libgd author. :)

--Jani


On Wed, 24 Oct 2001, Johan Ekenberg wrote:

>I'm mailing you directly since I saw that you closed down the report.
>However, I'm still not sure about the autoconf stuff, are you really sure it
>should set both defines on a system with only freetype 2?
>
>There is only one libgd.a|so on my system, namely libgd.a - found here if
>you'd like to examine it: http://www14.aname.net/~johan/libgd.a
>
>The gd distribution (as you surely know) comes with two testprograms for
>ttf: gdtestft and gdtestttf. Running gdtestttf after compiling gd also
>confirms that there is no ttf support in my gd:
>
># ./gdtestttf
>gd was not compiled with HAVE_LIBTTF defined.
>Install the FreeType library, including the
>header files. Then edit the gd Makefile, type
>make clean, and type make again.
>
>gdtestft however works and produces this proof of that:
>http://www14.aname.net/~johan/fttest.png
>
>Best regards,
>/Johan
>
>> -----Ursprungligt meddelande-----
>> Från: Bug Database [mailto:php-dev@lists.php.net]
>> Skickat: den 24 oktober 2001 12:30
>> Till: johan@ekenberg.se
>> Ämne: Bug #13796 Updated: Configure sets both HAVE_GD_STRINGTTF and
>> HAVE_GD_STRINGFT
>>
>>
>> ID: 13796
>> Updated by: sniper
>> Reported By: johan@ekenberg.se
>> Old Status: Open
>> Status: Feedback
>> Bug Type: GD related
>> Operating System: Linux
>> PHP Version: 4.0CVS-2001-10-23
>> New Comment:
>>
>> Please check your system for all libg.a (or .so) files.
>> You most likely have old one there somewhere.
>> And if this is not the case, send me the libgd.a|so file
>> so I can check it out myself. (sniper@php.net)
>>
>> --Jani
>>
>>
>> Previous Comments:
>> ------------------------------------------------------------------------
>>
>> [2001-10-24 06:25:05] johan@ekenberg.se
>>
>> Yes, GD is compiled with freetype 2. Please observe that
>> everything works perfectly when I edit main/php_config.h manually
>> (removing HAVE_GD_STRINGTTF) before compiling.
>>
>> It doesn't seem to matter what prefix I enter at
>> --with-freetype-dir, configure reports that it finds freetype 2
>> anyway. And it apparently works.
>>
>> In my view there are two issues here:
>> 1. Something is wrong in the autoconf stuff which makes both
>> HAVE_GD_STRINGTTF and HAVE_GD_STRINGFT be defined in
>> main/php_config.h although there is no libttf (freetype 1) on the
>> system and HAVE_GD_STRINGTTF should (as far as I understand) not
>> be defined.
>>
>> 2. The if/else preprocessor stuff in ext/gd/gd.c around line 2765
>> is strange (or wrong):
>>
>> # if HAVE_GD_STRINGFT
>>     error = gdImageStringFT(...);
>> # endif
>>
>> # if HAVE_GD_STRINGTTF
>>     error = gdImageStringTTF(...);
>> # endif
>>
>> Shouldn't this be changed to:
>>
>> #if HAVE_GD_STRINGFT
>>     error = gdImageStringFT(...);
>> #elif HAVE_GD_STRINGTTF
>>     error = gdImageStringTTF(...);
>> #endif
>>
>> Or is there a hidden point in both gdImageStringFT() and
>> gdImageStringTTF() being called in sequence if both
>> HAVE_GD_STRINGTTF and HAVE_GD_STRINGFT are defined?
>>
>> ------------------------------------------------------------------------
>>
>> [2001-10-24 05:47:24] sniper@php.net
>>
>> Sorry, I didn't notice that you're using invalid configure
>> option value here. --with-freetype-dir expects the
>> install prefix dir for freetype2.
>>
>> # ./configure --help |grep freetype
>> --with-freetype-dir=DIR   GD: Set the path to freetype2 install prefix.
>>
>> Also, is your GD library compiled with freetype 2?
>>
>> --Jani
>>
>>
>>
>>
>> ------------------------------------------------------------------------
>>
>> [2001-10-24 04:20:01] johan@ekenberg.se
>>
>> No, still the same problem:
>>
>> $ grep HAVE_GD_STRING main/php_config.h
>> #define HAVE_GD_STRINGFT 1
>> /* #undef HAVE_GD_STRINGFTEX */
>> #define HAVE_GD_STRINGTTF 1
>>
>> Gives the same error when compiled and tried with imagettf*().
>>
>> ------------------------------------------------------------------------
>>
>> [2001-10-24 00:46:11] sniper@php.net
>>
>> Could you check if this works in latest CVS now?
>>
>> --Jani
>>
>>
>> ------------------------------------------------------------------------
>>
>> [2001-10-23 04:10:40] johan@ekenberg.se
>>
>> Configuring with freetype 2 and NOT freetype 1.* installed:
>>
>> ./configure \
>> --with-gd \
>> --with-freetype-dir=/usr/local/include/freetype2
>>
>> results in both HAVE_GD_STRINGTTF and HAVE_GD_STRINGFT being
>> defined in main/php_config.h
>>
>> This produces this error when trying to use the imagettf*()
>> functions in GD:
>>
>> "libgd was not built with TrueType font support"
>>
>> Removing HAVE_GD_STRINGTTF from main/php_config.h before
>> compiling fixes this issue. But of course it should be
>> permanently fixed in autoconf.
>>
>> ------------------------------------------------------------------------
>>
>>
>>
>> ATTENTION! Do NOT reply to this email!
>> To reply, use the web interface found at
>http://bugs.php.net/?id=13796&edit=2
>



Thread (9 messages)

« previous php.dev (#68973) next »