summaryrefslogtreecommitdiff
path: root/ext/gd
diff options
context:
space:
mode:
Diffstat (limited to 'ext/gd')
-rw-r--r--ext/gd/Makefile.am4
-rw-r--r--ext/gd/config.m454
-rw-r--r--ext/gd/gd.c2
-rw-r--r--ext/gd/php3_gd.h102
-rw-r--r--ext/gd/setup.stub6
5 files changed, 167 insertions, 1 deletions
diff --git a/ext/gd/Makefile.am b/ext/gd/Makefile.am
new file mode 100644
index 0000000000..b2deac251d
--- /dev/null
+++ b/ext/gd/Makefile.am
@@ -0,0 +1,4 @@
+## Process this file with automake to produce Makefile.in
+INCLUDES=@INCLUDES@ -I@top_srcdir@ -I@top_srcdir@/libzend
+noinst_LIBRARIES=libphpext_gd.a
+libphpext_gd_a_SOURCES=gd.c gdcache.c gdttf.c
diff --git a/ext/gd/config.m4 b/ext/gd/config.m4
new file mode 100644
index 0000000000..16fdbd2bd1
--- /dev/null
+++ b/ext/gd/config.m4
@@ -0,0 +1,54 @@
+AC_MSG_CHECKING(whether to include GD support)
+AC_ARG_WITH(gd,
+[ --without-gd Disable GD support.
+ --with-gd[=DIR] Include GD support (DIR is GD's install dir).],
+[
+ case "$withval" in
+ no)
+ AC_MSG_RESULT(no) ;;
+ yes)
+ GD_LIBS="-lgd"
+ AC_DEFINE(HAVE_LIBGD)
+ AC_MSG_RESULT(yes)
+ AC_CHECK_LIB(gd, gdImageString16, [ AC_DEFINE(HAVE_LIBGD13) ])
+ ac_cv_lib_gd_gdImageLine=yes
+ ;;
+ *)
+dnl A whole whack of possible places where this might be
+ test -f $withval/include/gd1.3/gd.h && GD_INCLUDE="-I$withval/include/gd1.3"
+ test -f $withval/include/gd/gd.h && GD_INCLUDE="-I$withval/include/gd"
+ test -f $withval/include/gd.h && GD_INCLUDE="-I$withval/include"
+ test -f $withval/gd1.3/gd.h && GD_INCLUDE="-I$withval/gd1.3"
+ test -f $withval/gd/gd.h && GD_INCLUDE="-I$withval/gd"
+ test -f $withval/gd.h && GD_INCLUDE="-I$withval"
+
+ test -f $withval/lib/libgd.a && GD_LIB="$withval/lib"
+ test -f $withval/lib/gd/libgd.a && GD_LIB="$withval/lib/gd"
+ test -f $withval/lib/gd1.3/libgd.a && GD_LIB="$withval/lib/gd1.3"
+ test -f $withval/libgd.a && GD_LIB="$withval"
+ test -f $withval/gd/libgd.a && GD_LIB="$withval/gd"
+ test -f $withval/gd1.3/libgd.a && GD_LIB="$withval/gd1.3"
+
+ if test -n "$GD_INCLUDE" && test -n "$GD_LIB" ; then
+ GD_LIBS="-L$GD_LIB -lgd"
+ AC_DEFINE(HAVE_LIBGD)
+ AC_MSG_RESULT(yes)
+ AC_CHECK_LIB(gd, gdImageString16, [ AC_DEFINE(HAVE_LIBGD13) ])
+ ac_cv_lib_gd_gdImageLine=yes
+ else
+ AC_MSG_RESULT(no)
+ fi ;;
+ esac
+],[
+ AC_CHECK_LIB(gd, gdImageLine)
+ AC_CHECK_LIB(gd, gdImageString16, [ AC_DEFINE(HAVE_LIBGD13) ])
+])
+if test "$ac_cv_lib_gd_gdImageLine" = "yes"; then
+ if test -f /usr/pkg/include/gd/gd.h -a -z "$GD_INCLUDE" ; then
+ GD_INCLUDE="-I/usr/pkg/include/gd"
+ fi
+ AC_CHECK_LIB(ttf, TT_Open_Face)
+ PHP_EXTENSION(gd)
+ LIBS="$LIBS $GD_LIBS"
+ INCLUDE="$INCLUDE $GD_INCLUDE"
+fi
diff --git a/ext/gd/gd.c b/ext/gd/gd.c
index 5edcc9ade1..32a980254f 100644
--- a/ext/gd/gd.c
+++ b/ext/gd/gd.c
@@ -39,7 +39,7 @@
# include "tls.h"
#endif
#include "php.h"
-#include "head.h"
+#include "functions/head.h"
#include <math.h>
#include "php3_gd.h"
diff --git a/ext/gd/php3_gd.h b/ext/gd/php3_gd.h
new file mode 100644
index 0000000000..d65213f9ef
--- /dev/null
+++ b/ext/gd/php3_gd.h
@@ -0,0 +1,102 @@
+/*
+ +----------------------------------------------------------------------+
+ | PHP HTML Embedded Scripting Language Version 3.0 |
+ +----------------------------------------------------------------------+
+ | Copyright (c) 1997 PHP Development Team (See Credits file) |
+ +----------------------------------------------------------------------+
+ | This program is free software; you can redistribute it and/or modify |
+ | it under the terms of one of the following licenses: |
+ | |
+ | A) the GNU General Public License as published by the Free Software |
+ | Foundation; either version 2 of the License, or (at your option) |
+ | any later version. |
+ | |
+ | B) the PHP License as published by the PHP Development Team and |
+ | included in the distribution in the file: LICENSE |
+ | |
+ | This program is distributed in the hope that it will be useful, |
+ | but WITHOUT ANY WARRANTY; without even the implied warranty of |
+ | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
+ | GNU General Public License for more details. |
+ | |
+ | You should have received a copy of both licenses referred to here. |
+ | If you did not, or have any questions about PHP licensing, please |
+ | contact core@php.net. |
+ +----------------------------------------------------------------------+
+ | Authors: Rasmus Lerdorf <rasmus@lerdorf.on.ca> |
+ | Stig Bakken <ssb@guardian.no> |
+ +----------------------------------------------------------------------+
+ */
+
+
+/* $Id$ */
+
+#ifndef _PHP3_GD_H
+#define _PHP3_GD_H
+
+#if COMPILE_DL
+#undef HAVE_LIBGD
+#define HAVE_LIBGD 1
+#endif
+
+#if HAVE_LIBGD
+
+#include <gd.h>
+
+extern php3_module_entry gd_module_entry;
+#define gd_module_ptr &gd_module_entry
+
+/* gd.c functions */
+extern void php3_info_gd(void);
+extern int php3_minit_gd(INIT_FUNC_ARGS);
+extern int php3_mend_gd(void);
+extern int gdImageColorResolve(gdImagePtr, int, int, int);
+extern void php3_imagearc(INTERNAL_FUNCTION_PARAMETERS);
+extern void php3_imagechar(INTERNAL_FUNCTION_PARAMETERS);
+extern void php3_imagecharup(INTERNAL_FUNCTION_PARAMETERS);
+extern void php3_imagecolorallocate(INTERNAL_FUNCTION_PARAMETERS);
+extern void php3_imagecolorat(INTERNAL_FUNCTION_PARAMETERS);
+extern void php3_imagecolorclosest(INTERNAL_FUNCTION_PARAMETERS);
+extern void php3_imagecolordeallocate(INTERNAL_FUNCTION_PARAMETERS);
+extern void php3_imagecolorresolve(INTERNAL_FUNCTION_PARAMETERS);
+extern void php3_imagecolorexact(INTERNAL_FUNCTION_PARAMETERS);
+extern void php3_imagecolorset(INTERNAL_FUNCTION_PARAMETERS);
+extern void php3_imagecolorstotal(INTERNAL_FUNCTION_PARAMETERS);
+extern void php3_imagecolorsforindex(INTERNAL_FUNCTION_PARAMETERS);
+extern void php3_imagecolortransparent(INTERNAL_FUNCTION_PARAMETERS);
+extern void php3_imagecopy(INTERNAL_FUNCTION_PARAMETERS);
+extern void php3_imagecopyresized(INTERNAL_FUNCTION_PARAMETERS);
+extern void php3_imagecreate(INTERNAL_FUNCTION_PARAMETERS);
+extern void php3_imagecreatefromgif (INTERNAL_FUNCTION_PARAMETERS);
+extern void php3_imagedestroy(INTERNAL_FUNCTION_PARAMETERS);
+extern void php3_imagefill(INTERNAL_FUNCTION_PARAMETERS);
+extern void php3_imagefilledpolygon(INTERNAL_FUNCTION_PARAMETERS);
+extern void php3_imagefilledrectangle(INTERNAL_FUNCTION_PARAMETERS);
+extern void php3_imagefilltoborder(INTERNAL_FUNCTION_PARAMETERS);
+extern void php3_imagefontwidth(INTERNAL_FUNCTION_PARAMETERS);
+extern void php3_imagefontheight(INTERNAL_FUNCTION_PARAMETERS);
+extern void php3_imagegif (INTERNAL_FUNCTION_PARAMETERS);
+extern void php3_imageinterlace(INTERNAL_FUNCTION_PARAMETERS);
+extern void php3_imageline(INTERNAL_FUNCTION_PARAMETERS);
+extern void php3_imageloadfont(INTERNAL_FUNCTION_PARAMETERS);
+extern void php3_imagepolygon(INTERNAL_FUNCTION_PARAMETERS);
+extern void php3_imagerectangle(INTERNAL_FUNCTION_PARAMETERS);
+extern void php3_imagesetpixel(INTERNAL_FUNCTION_PARAMETERS);
+extern void php3_imagestring(INTERNAL_FUNCTION_PARAMETERS);
+extern void php3_imagestringup(INTERNAL_FUNCTION_PARAMETERS);
+extern void php3_imagesxfn(INTERNAL_FUNCTION_PARAMETERS);
+extern void php3_imagesyfn(INTERNAL_FUNCTION_PARAMETERS);
+extern void php3_free_gd_font(gdFontPtr);
+extern void _php3_gdimagecharup(gdImagePtr, gdFontPtr, int, int, int, int);
+extern void php3_imagedashedline(INTERNAL_FUNCTION_PARAMETERS);
+#ifdef HAVE_LIBTTF
+extern void php3_imagettfbbox(INTERNAL_FUNCTION_PARAMETERS);
+extern void php3_imagettftext(INTERNAL_FUNCTION_PARAMETERS);
+#endif
+#else
+
+#define gd_module_ptr NULL
+
+#endif
+
+#endif /* _PHP3_GD_H */
diff --git a/ext/gd/setup.stub b/ext/gd/setup.stub
new file mode 100644
index 0000000000..64668ae0fb
--- /dev/null
+++ b/ext/gd/setup.stub
@@ -0,0 +1,6 @@
+define_option with-gd 'GD support?' yesnodir \
+ "yes /usr GD install" \
+' Whether to include GD support. If PHP can find the GD libraries\n
+ on your system, it will be included automatically. You should enter\n
+ something here if you do not want to include GD support or if you\n
+ have installed GD in some unusual directory.'