Last commit for config.m4: fd3e80fb30194c7c5dc4e8069852559ab054b204

- added makefile fragment to automatically compile and install filter modules with the extension

pp [2011-05-04 22:44:12]
- added makefile fragment to automatically compile and install filter modules with the extension


git-svn-id: https://siedziba.pl:790/svn/repos/php-imlib/trunk@337 455248ca-bdda-0310-9134-f4ebb693071a
PHP_ARG_WITH(imlib, for Imlib2 support,
  [[  --with-imlib            Include php-imlib extension (Imlib2 support).]])
PHP_ARG_WITH(t1lib, for Imlib2 Type1 font support,
  [[  --with-t1lib[=DIR]      Include Type1 font support in php-imlib.]])

echo "imlib: $PHP_IMLIB"
echo "t1lib: $PHP_T1LIB"

if test "$PHP_IMLIB" != "no"; then

  AC_MSG_CHECKING(for Imlib2 version)

  if test -x $(which imlib2-config); then
    IMLIB2_VERSION=$(imlib2-config --version)
    AC_MSG_RESULT($IMLIB2_VERSION)
    PHP_EVAL_LIBLINE($(imlib2-config --libs), IMLIB_SHARED_LIBADD)
    PHP_EVAL_INCLINE($(imlib2-config --cflags))
    AC_DEFINE(HAVE_IMLIB,1,[ ])
    CPPFLAGS="-DPHP_IMLIB_FILTER_PATH=\"\\\"$EXTENSION_DIR/php_imlib_filters\\\"\" $CPPFLAGS"
  else
    AC_MSG_ERROR(imlib2-config script not found)
  fi

  if test "$PHP_T1LIB" != "no"; then

    for i in $PHP_T1LIB /usr/local /usr; do
      test -f "$i/include/t1lib.h" && IMLIB_T1_DIR=$i && break
    done

    if test -z "$IMLIB_T1_DIR"; then
      AC_MSG_ERROR([Your t1lib distribution is not installed correctly. Please reinstall it.])
    fi

    PHP_CHECK_LIBRARY(t1, T1_LoadFont,
    [
      AC_DEFINE(HAVE_LIBT1,1,[ ])
      PHP_ADD_INCLUDE($IMLIB_T1_DIR/include)
      PHP_ADD_LIBRARY_WITH_PATH(t1, $IMLIB_T1_DIR/lib, IMLIB_SHARED_LIBADD)
    ],[
      AC_MSG_ERROR([Problem with libt1.(a|so). Please check config.log for more information.])
    ],[
      -L$IMLIB_T1_DIR/lib
    ])
  fi
  PHP_ADD_LIBRARY_WITH_PATH(ltdl, /usr/lib, IMLIB_SHARED_LIBADD)
  PHP_SUBST(IMLIB_SHARED_LIBADD)
  PHP_NEW_EXTENSION(imlib, php_imlib.c, $ext_shared)
fi
ViewGit