From 00238ad1ba0e51b868edf5eb685ae55ceb027028 Mon Sep 17 00:00:00 2001 From: Zeev Suraski Date: Fri, 23 Jul 1999 15:18:37 +0000 Subject: [PATCH] Added check for freetype.h --- ChangeLog | 1 + ext/gd/config.m4 | 1 + ext/gd/gd.c | 10 +++++----- ext/gd/gdcache.c | 6 +++--- ext/gd/gdttf.c | 4 ++-- ext/gd/php3_gd.h | 7 ++++++- 6 files changed, 18 insertions(+), 11 deletions(-) diff --git a/ChangeLog b/ChangeLog index 251661142f..ff7843ef54 100644 --- a/ChangeLog +++ b/ChangeLog @@ -2,6 +2,7 @@ PHP 4.0 CHANGE LOG ChangeLog ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||| ??? ?? 1999, Version 4.0 Beta 2 +- Added a check for freetype.h - fixed build on RedHat 6.0 (Zeev) - Fixed array_walk() to work in PHP4 (Andrey) - Ported all remaining date() format options from PHP3 (Andrey) - $php_errormsg now works (Andrey) diff --git a/ext/gd/config.m4 b/ext/gd/config.m4 index 6378535f0a..12c6e7bb76 100644 --- a/ext/gd/config.m4 +++ b/ext/gd/config.m4 @@ -48,6 +48,7 @@ if test "$ac_cv_lib_gd_gdImageLine" = "yes"; then GD_INCLUDE="-I/usr/pkg/include/gd" fi AC_CHECK_LIB(ttf, TT_Open_Face) + AC_CHECK_HEADERS(freetype.h) PHP_EXTENSION(gd) EXTRA_LIBS="$EXTRA_LIBS $GD_LIBS" INCLUDES="$INCLUDES $GD_INCLUDE" diff --git a/ext/gd/gd.c b/ext/gd/gd.c index 511e349586..efa03ea71b 100644 --- a/ext/gd/gd.c +++ b/ext/gd/gd.c @@ -49,7 +49,7 @@ #include /* 3 Medium bold font */ #include /* 4 Large font */ #include /* 5 Giant font */ -#if HAVE_LIBTTF +#ifdef ENABLE_GD_TTF # include "gdttf.h" #endif @@ -57,7 +57,7 @@ #define M_PI 3.14159265358979323846 #endif -#if HAVE_LIBTTF +#ifdef ENABLE_GD_TTF static void php3_imagettftext_common(INTERNAL_FUNCTION_PARAMETERS, int); #endif @@ -118,7 +118,7 @@ function_entry gd_functions[] = { {"imagesx", php3_imagesxfn, NULL}, {"imagesy", php3_imagesyfn, NULL}, {"imagedashedline", php3_imagedashedline, NULL}, -#if HAVE_LIBTTF +#ifdef ENABLE_GD_TTF {"imagettfbbox", php3_imagettfbbox, NULL}, {"imagettftext", php3_imagettftext, NULL}, #endif @@ -175,7 +175,7 @@ void php3_info_gd(ZEND_MODULE_INFO_FUNC_ARGS) #else php3_printf("Version 1.2"); #endif -#if HAVE_LIBTTF +#ifdef ENABLE_GD_TTF php3_printf(" with FreeType support"); #endif } @@ -1671,7 +1671,7 @@ PHP_FUNCTION(imagesyfn) } /* }}} */ -#if HAVE_LIBTTF +#ifdef ENABLE_GD_TTF #define TTFTEXT_DRAW 0 #define TTFTEXT_BBOX 1 diff --git a/ext/gd/gdcache.c b/ext/gd/gdcache.c index 1662ebb184..e9c628607b 100644 --- a/ext/gd/gdcache.c +++ b/ext/gd/gdcache.c @@ -38,11 +38,11 @@ /* This just seems unessacary */ #if (WIN32|WINNT) -#define HAVE_LIBTTF 1 +#define ENABLE_GD_TTF #else #include "php_config.h" #endif -#if HAVE_LIBTTF +#ifdef ENABLE_GD_TTF #include "gdcache.h" @@ -198,4 +198,4 @@ main(char *argv[], int argc) #endif -#endif /* HAVE_LIBTTF */ +#endif /* ENABLE_GD_TTF */ diff --git a/ext/gd/gdttf.c b/ext/gd/gdttf.c index 93bb3528d1..33019e030a 100644 --- a/ext/gd/gdttf.c +++ b/ext/gd/gdttf.c @@ -9,7 +9,7 @@ #else #include "php_config.h" #endif -#if HAVE_LIBTTF +#ifdef ENABLE_GD_TTF #include #include #include @@ -852,7 +852,7 @@ gdttf(gdImage *im, int *brect, int fg, char *fontname, return (char *)NULL; } -#endif /* HAVE_LIBTTF */ +#endif /* ENABLE_GD_TTF */ /* * Local variables: diff --git a/ext/gd/php3_gd.h b/ext/gd/php3_gd.h index d3f4dfced3..d6ef1d53b1 100644 --- a/ext/gd/php3_gd.h +++ b/ext/gd/php3_gd.h @@ -34,6 +34,11 @@ #ifndef _PHP3_GD_H #define _PHP3_GD_H + +#if defined(HAVE_LIBTTF) && defined(HAVE_FREETYPE_H) +#define ENABLE_GD_TTF +#endif + #if COMPILE_DL #undef HAVE_LIBGD #define HAVE_LIBGD 1 @@ -89,7 +94,7 @@ PHP_FUNCTION(imagesyfn); void php3_free_gd_font(gdFontPtr); void _php3_gdimagecharup(gdImagePtr, gdFontPtr, int, int, int, int); PHP_FUNCTION(imagedashedline); -#ifdef HAVE_LIBTTF +#ifdef ENABLE_GD_TTF PHP_FUNCTION(imagettfbbox); PHP_FUNCTION(imagettftext); #endif -- 2.40.0