cvs: /php4/ext/gd Makefile.am config.m4 gd.c

From: Date: Mon, 06 Sep 1999 16:50:11 +0000
Subject: cvs: /php4/ext/gd Makefile.am config.m4 gd.c
Groups: php.version4 
Request: Send a blank email to php-version4+get-4162@lists.php.net to get a copy of this message
gorgo Mon Sep 6 12:50:11 1999 EDT Modified files: /php4/ext/gd Makefile.am config.m4 gd.c Log: Enabled shared build of gd module Index: php4/ext/gd/Makefile.am diff -u php4/ext/gd/Makefile.am:1.1 php4/ext/gd/Makefile.am:1.2 --- php4/ext/gd/Makefile.am:1.1 Fri Apr 16 20:37:06 1999 +++ php4/ext/gd/Makefile.am Mon Sep 6 12:50:11 1999 @@ -1,4 +1,17 @@ ## 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 + +phplibdir=$(libdir)/php + +SRC=gd.c gdcache.c gdttf.c +INCLUDES=@INCLUDES@ -I@GD_INCLUDES@ -I@top_srcdir@ -I@top_srcdir@/libzend +noinst_LIBRARIES=@GD_STATIC@ +EXTRA_LIBRARIES=libphpext_gd.a +libphpext_gd_a_SOURCES=$(SRC) + +phplib_LTLIBRARIES=@GD_SHARED@ +EXTRA_LTLIBRARIES=gd.la +gd_la_SOURCES=$(SRC) +gd_la_LIBADD=@GD_LFLAGS@ @GD_LIBS@ +gd_la_LDFLAGS=-avoid-version -module -rpath $(phplibdir) +EXTRA_LIBS= + Index: php4/ext/gd/config.m4 diff -u php4/ext/gd/config.m4:1.7 php4/ext/gd/config.m4:1.8 --- php4/ext/gd/config.m4:1.7 Sun Jul 25 11:06:49 1999 +++ php4/ext/gd/config.m4 Mon Sep 6 12:50:11 1999 @@ -1,15 +1,36 @@ 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).], + --with-gd[=DIR] Include GD support (DIR is GD's install dir). + Set DIR to "shared" to build as a dl, or + "shared,DIR" to build as a dl and still specify DIR.], [ + case $withval in + shared) + shared=yes + withval=yes + ;; + shared,*) + shared=yes + withval=echo $withval | sed -e 's/^shared,//' + ;; + *) + shared=no + ;; + esac + case "$withval" in no) AC_MSG_RESULT(no) ;; yes) - AC_ADD_LIBRARY(gd) AC_DEFINE(HAVE_LIBGD) - AC_MSG_RESULT(yes) + if test "$shared" = "yes"; then + AC_MSG_RESULT(yes (shared)) + GD_LIBS="-lgd" + else + AC_MSG_RESULT(yes (static)) + AC_ADD_LIBRARY(gd) + fi AC_CHECK_LIB(gd, gdImageString16, [ AC_DEFINE(HAVE_LIBGD13) ]) ac_cv_lib_gd_gdImageLine=yes ;; @@ -37,9 +58,15 @@ test -f $withval/gd1.3/libgd.a && GD_LIB="$withval/gd1.3" if test -n "$GD_INCLUDE" && test -n "$GD_LIB" ; then - AC_ADD_LIBRARY_WITH_PATH(gd, $GD_LIB) AC_DEFINE(HAVE_LIBGD) - AC_MSG_RESULT(yes) + if test "$shared" != "yes"; then + AC_MSG_RESULT(yes (static)) + AC_ADD_LIBRARY_WITH_PATH(gd, $GD_LIB) + else + AC_MSG_RESULT(yes (shared)) + GD_LIBS="-lgd" + GD_LFLAGS="-L$GD_LIB" + fi AC_CHECK_LIB(gd, gdImageString16, [ AC_DEFINE(HAVE_LIBGD13) ]) ac_cv_lib_gd_gdImageLine=yes else @@ -73,14 +100,26 @@ done if test -n "$FREETYPE_DIR" ; then AC_DEFINE(HAVE_LIBFREETYPE) - AC_ADD_LIBRARY_WITH_PATH(freetype, $FREETYPE_DIR/lib) - AC_ADD_INCLUDE($FREETYPE_DIR/include) + if test "$shared" != "yes"; then + AC_ADD_LIBRARY_WITH_PATH(freetype, $FREETYPE_DIR/lib) + AC_ADD_INCLUDE($FREETYPE_DIR/include) + else + GD_LIBS="$GD_LIBS -lfreetype" + GD_LFLAGS="$GD_LFLAGS -L$FREETYPE_DIR/lib" + GD_INCLUDES="$GD_INCLUDES -I$FREETYPE_DIR/include" + fi AC_MSG_RESULT(yes) else if test -n "$TTF_DIR" ; then AC_DEFINE(HAVE_LIBTTF) - AC_ADD_LIBRARY_WITH_PATH(ttf, $TTF_DIR/lib) - AC_ADD_INCLUDE($TTF_DIR/include) + if test "$shared" != "yes"; then + AC_ADD_LIBRARY_WITH_PATH(ttf, $TTF_DIR/lib) + AC_ADD_INCLUDE($TTF_DIR/include) + else + GD_LIBS="$GD_LIBS -lttf" + GD_LFLAGS="$GD_LFLAGS -L$TTF_DIR/lib" + GD_INCLUDES="$GD_INCLUDES -I$TTF_DIR/include" + fi AC_MSG_RESULT(yes) else AC_MSG_RESULT(no) @@ -107,6 +146,20 @@ AC_MSG_RESULT(no) ]) - PHP_EXTENSION(gd) - AC_ADD_INCLUDE($GD_INCLUDE) + PHP_EXTENSION(gd, $shared) + if test "$shared" != "yes"; then + AC_ADD_INCLUDE($GD_INCLUDE) + GD_STATIC="libphpext_gd.a" + else + if test -n "$GD_INCLUDE"; then + GD_INCLUDES="$GD_INCLUDES -I$GD_INCLUDE" + fi + GD_SHARED="gd.la" + fi fi + +AC_SUBST(GD_LFLAGS) +AC_SUBST(GD_LIBS) +AC_SUBST(GD_INCLUDES) +AC_SUBST(GD_STATIC) +AC_SUBST(GD_SHARED) Index: php4/ext/gd/gd.c diff -u php4/ext/gd/gd.c:1.15 php4/ext/gd/gd.c:1.16 --- php4/ext/gd/gd.c:1.15 Thu Aug 5 12:25:09 1999 +++ php4/ext/gd/gd.c Mon Sep 6 12:50:11 1999 @@ -18,12 +18,16 @@ +----------------------------------------------------------------------+ */ -/* $Id: gd.c,v 1.15 1999/08/05 16:25:09 steinm Exp $ */ +/* $Id: gd.c,v 1.16 1999/09/06 16:50:11 gorgo Exp $ */ /* gd 1.2 is copyright 1994, 1995, Quest Protein Database Center, Cold Spring Harbor Labs. */ /* Note that there is no code from the gd package in this file */ + +#ifdef PIC +# define COMPILE_DL 1 +#endif #include "php.h" #include "ext/standard/head.h"

« previous php.version4 (#4162) next »