From db4820447fae020625e210e42569671d0c865c5f Mon Sep 17 00:00:00 2001 From: Stig Bakken Date: Wed, 29 Sep 1999 15:13:25 +0000 Subject: [PATCH] The $shared variable should normally never be used outside of a call to AC_ARG_(ENABLE|WITH). If it is necessary anyway, make sure it is set to "no" before starting. --- ext/gd/config.m4 | 39 ++++++++++++++------------------------- 1 file changed, 14 insertions(+), 25 deletions(-) diff --git a/ext/gd/config.m4 b/ext/gd/config.m4 index 41110cb2a1..35bac5b546 100644 --- a/ext/gd/config.m4 +++ b/ext/gd/config.m4 @@ -1,3 +1,4 @@ +shared=no AC_MSG_CHECKING(whether to include GD support) AC_ARG_WITH(gd, [ --without-gd Disable GD support. @@ -5,19 +6,7 @@ AC_ARG_WITH(gd, 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 + PHP_WITH_SHARED case "$withval" in no) @@ -59,16 +48,16 @@ dnl A whole whack of possible places where this might be if test -n "$GD_INCLUDE" && test -n "$GD_LIB" ; then AC_DEFINE(HAVE_LIBGD) - if test "$shared" != "yes"; then - AC_MSG_RESULT(yes (static)) - AC_ADD_LIBRARY_WITH_PATH(gd, $GD_LIB) - else + if test "$shared" = "yes"; then AC_MSG_RESULT(yes (shared)) GD_LIBS="-lgd" GD_LFLAGS="-L$GD_LIB" + else + AC_MSG_RESULT(yes (static)) + AC_ADD_LIBRARY_WITH_PATH(gd, $GD_LIB) fi AC_CHECK_LIB(gd, gdImageString16, [ AC_DEFINE(HAVE_LIBGD13) ]) - ac_cv_lib_gd_gdImageLine=yes + ac_cv_lib_gd_gdImageLine=yes else AC_MSG_ERROR([Unable to find libgd.(a|so) anywhere under $withval]) fi ;; @@ -100,25 +89,25 @@ if test "$ac_cv_lib_gd_gdImageLine" = "yes"; then done if test -n "$FREETYPE_DIR" ; then AC_DEFINE(HAVE_LIBFREETYPE) - if test "$shared" != "yes"; then - AC_ADD_LIBRARY_WITH_PATH(freetype, $FREETYPE_DIR/lib) - AC_ADD_INCLUDE($FREETYPE_DIR/include) - else + if test "$shared" = "yes"; then GD_LIBS="$GD_LIBS -lfreetype" GD_LFLAGS="$GD_LFLAGS -L$FREETYPE_DIR/lib" GD_INCLUDES="$GD_INCLUDES -I$FREETYPE_DIR/include" + else + AC_ADD_LIBRARY_WITH_PATH(freetype, $FREETYPE_DIR/lib) + AC_ADD_INCLUDE($FREETYPE_DIR/include) fi AC_MSG_RESULT(yes) else if test -n "$TTF_DIR" ; then AC_DEFINE(HAVE_LIBTTF) 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" + else + AC_ADD_LIBRARY_WITH_PATH(ttf, $TTF_DIR/lib) + AC_ADD_INCLUDE($TTF_DIR/include) fi AC_MSG_RESULT(yes) else -- 2.40.0