[go: up one dir, main page]

Menu

[22506c]: / configure.in  Maximize  Restore  History

Download this file

196 lines (155 with data), 5.1 kB

dnl Process this file with autoconf to produce a configure script.

AC_PREREQ(2.54)

dnl Name your plug-in here
m4_define([plugin_name], [gimp-apng])

dnl These three define the plug-in version number
m4_define([plugin_major_version], [0])
m4_define([plugin_minor_version], [2])
m4_define([plugin_micro_version], [0])

m4_define([plugin_version],
          [plugin_major_version.plugin_minor_version.plugin_micro_version])

AC_INIT([plugin_name], [plugin_version])

AC_DEFINE(PLUGIN_NAME, PACKAGE_NAME, [Plug-In name])
AC_DEFINE(PLUGIN_VERSION, PACKAGE_VERSION, [Plug-In version])

AC_DEFINE(PLUGIN_MAJOR_VERSION, plugin_major_version, [Plug-In major version])
AC_DEFINE(PLUGIN_MINOR_VERSION, plugin_minor_version, [Plug-In minor version])
AC_DEFINE(PLUGIN_MICRO_VERSION, plugin_micro_version, [Plug-In micro version])

AC_CONFIG_AUX_DIR([config])
AC_CONFIG_SRCDIR([src/file-apng.c])
AM_CONFIG_HEADER(config.h)

AM_INIT_AUTOMAKE(no-define)

dnl
dnl Set the general plugins install policy here
dnl
AC_ARG_WITH([plugins-install],
  [AS_HELP_STRING([--with-plugins-install=system|user|prefix],
                  [Policy for plugins install. Default: user.])],
        [case "${withval}" in
          user) PLUGINS_INSTALL_POLICY=user ;;
          system) PLUGINS_INSTALL_POLICY=system ;;
          prefix) PLUGINS_INSTALL_POLICY=prefix ;;
          *)  AC_MSG_ERROR([bad value ${withval} for --with-plugins-install]) ;;
         esac
        ], [PLUGINS_INSTALL_POLICY=user])

dnl
dnl Set for the libpng here
dnl
AC_ARG_WITH([libpng-include],
  [AS_HELP_STRING([--with-libpng-include=DIR],
                  [location of PNG library headers])],,)
AC_ARG_WITH([libpng-lib],
  [AS_HELP_STRING([--with-libpng-lib=DIR],
                  [location of PNG library binary])],,)

AC_ISC_POSIX
AC_PROG_CC
AM_PROG_CC_STDC
AC_HEADER_STDC
PKG_PROG_PKG_CONFIG


ACLOCAL="$ACLOCAL $ACLOCAL_FLAGS"

AM_MAINTAINER_MODE


dnl Use -Wall if we have gcc.
changequote(,)dnl
if test "x$GCC" = "xyes"; then
  case " $CFLAGS " in
  *[\ \	]-Wall[\ \	]*) ;;
  *) CFLAGS="$CFLAGS -Wall" ;;
  esac
fi
changequote([,])dnl


GIMP_REQUIRED_VERSION=2.8.0

PKG_CHECK_MODULES(GIMP,
  gimp-2.0 >= $GIMP_REQUIRED_VERSION gimpui-2.0 >= $GIMP_REQUIRED_VERSION)

AC_SUBST(GIMP_CFLAGS)
AC_SUBST(GIMP_LIBS)

GIMP_LIBDIR=`$PKG_CONFIG --variable=gimplibdir gimp-2.0`
AC_SUBST(GIMP_LIBDIR)


dnl i18n stuff

GETTEXT_PACKAGE=gimp20-apng-plugin
AC_SUBST(GETTEXT_PACKAGE)
AC_DEFINE_UNQUOTED(GETTEXT_PACKAGE, "$GETTEXT_PACKAGE",
				    [The gettext translation domain.])

dnl Add the languages which your application supports here.
ALL_LINGUAS=""

AC_PROG_INTLTOOL
AM_GLIB_GNU_GETTEXT

AC_CHECK_FUNCS(bind_textdomain_codeset)

LOCALEDIR="${datadir}/locale"
if test "$DATADIRNAME" = "lib"; then
   LOCALEDIR="$libdir/locale"
fi
AC_SUBST(LOCALEDIR)

DATADIR="${datadir}/plugin_name"
AC_SUBST(DATADIR)


AC_MSG_CHECKING([if GTK+ is version 2.7.0 or newer])
if $PKG_CONFIG --atleast-version=2.7.0 gtk+-2.0; then
  have_gtk_2_7=yes
else
  have_gtk_2_7=no
fi
AC_MSG_RESULT($have_gtk_2_7)

if test "x$have_gtk_2_7" != "xyes"; then
  CPPFLAGS="$CPPFLAGS -DG_DISABLE_DEPRECATED -DGDK_DISABLE_DEPRECATED -DGTK_DISABLE_DEPRECATED"
fi


AC_MSG_CHECKING([if GIMP is version 2.3.0 or newer])
if $PKG_CONFIG --atleast-version=2.3.0 gimp-2.0; then
  have_gimp_2_3=yes
else
  have_gimp_2_3=no
fi
AC_MSG_RESULT($have_gimp_2_3)

if test "x$have_gimp_2_3" != "xyes"; then
  CPPFLAGS="$CPPFLAGS -DGIMP_DISABLE_DEPRECATED"
fi

dnl
dnl Set for libpng
dnl
if test "x$with_libpng_lib" = "x" -a "x$with_libpng_include" = "x" ; then
  PKG_CHECK_MODULES(PNG, libpng)
else
  if test "x$with_libpng_lib" != "x" ; then
    _save_LIBS="$LIBS"
    LIBS="-L$with_libpng_lib -lpng"
    AC_CHECK_LIB([png], [png_init_io], [PNG_LIBS="$LIBS"],
      [AC_MSG_ERROR([PNG library not found at $with_libpng_lib])])
    LIBS="$_save_LIBS"
  else
    AC_CHECK_LIB([png], [png_init_io], [PNG_LIBS="-lpng"],
      [AC_MSG_ERROR([PNG library not found])])
  fi
  if test "x$with_libpng_include" != "x" ; then
    _save_INCLUDES="$INCLUDES"
    INCLUDES="-I$with_libpng_include"
    AC_CHECK_HEADERS([png.h], [PNG_CFLAGS="$INCLUDES"],
      [AC_MSG_ERROR([PNG header not found at $with_libpng_include])])
    INCLUDES="$_save_INCLUDES"
  else
    AC_CHECK_HEADERS([png.h], [PNG_CFLAGS=""],
      [AC_MSG_ERROR([PNG header not found])])
  fi
fi
_save_LIBS="$LIBS"
LIBS="$PNG_LIBS"
AC_CHECK_LIB([png], [png_get_acTL], ,
  [AC_MSG_ERROR([PNG library doesn't have APNG support])])
LIBS="$_save_LIBS"

dnl
dnl Set the plugins install directory
dnl
if test "x$PLUGINS_INSTALL_POLICY" = "xuser"; then
  GIMP_USER_VERSION=`$PKG_CONFIG --modversion gimp-2.0 | sed -e 's/^\([0-9]\+\.[0-9]\+\)\.[0-9]\+/\\1/'`
  PLUGINDIR="$HOME/.gimp-$GIMP_USER_VERSION"
elif test "x$PLUGINS_INSTALL_POLICY" = "xsystem"; then
  PLUGINDIR="\$(GIMP_LIBDIR)"
elif test "x$PLUGINS_INSTALL_POLICY" = "xprefix"; then
  PLUGINDIR="\$(pkglibdir)"
fi
AC_SUBST(PLUGINDIR)

AC_CONFIG_FILES([
Makefile
src/Makefile
ui/Makefile
po/Makefile.in
help/Makefile
help/en/Makefile
])

AC_OUTPUT