* src/xscanimage.c: reverse the #ifdef ENABLE_GIMP_1_3 logic, we

now have ENABLE_GIMP_1_2 when GIMP 1.2 is explicitely wanted.
* configure.in: make GIMP 2.0 the default.
* include/sane/config.h: replace ENABLE_GIMP_1_3 by ENABLE_GIMP_1_2.
* aclocal.m4, acinclude.m4: include the AM_PATH_GIMP_2_0 macros,
which replaces the AM_PATH_GIMP_1_4 macro.
33-incorporate-downstream-patches
Julien BLACHE 2004-01-22 10:15:42 +00:00
rodzic 1689d458ad
commit a63c2b0d1c
7 zmienionych plików z 1349 dodań i 1083 usunięć

Wyświetl plik

@ -1,3 +1,11 @@
2004-01-22 Julien BLACHE <jb@jblache.org>
* src/xscanimage.c: reverse the #ifdef ENABLE_GIMP_1_3 logic, we
now have ENABLE_GIMP_1_2 when GIMP 1.2 is explicitely wanted.
* configure.in: make GIMP 2.0 the default.
* include/sane/config.h: replace ENABLE_GIMP_1_3 by ENABLE_GIMP_1_2.
* aclocal.m4, acinclude.m4: include the AM_PATH_GIMP_2_0 macros,
which replaces the AM_PATH_GIMP_1_4 macro.
2003-12-15 Henning Meier-Geinitz <henning@meier-geinitz.de> 2003-12-15 Henning Meier-Geinitz <henning@meier-geinitz.de>
* src/xscanimage: Added debug messages to most functions. * src/xscanimage: Added debug messages to most functions.

Wyświetl plik

@ -1,7 +1,6 @@
# acinclude.m4 for sane-frontends # acinclude.m4 for sane-frontends
# AM_PATH_GTK # AM_PATH_GTK
# AM_PATH_GIMP # AM_PATH_GIMP
# AM_PATH_GIMP_1_4
# AM_PATH_SANE # AM_PATH_SANE
###################################################################### ######################################################################
@ -422,193 +421,6 @@ dnl ok, gimp does not work, so we have to use the gtk_* things again
]) ])
######################################################################
# Configure paths for GIMP-1.4
# Manish Singh 98-6-11
# Shamelessly stolen from Owen Taylor
dnl AM_PATH_GIMP_1_4([MINIMUM-VERSION, [ACTION-IF-FOUND [, ACTION-IF-NOT-FOUND]]])
dnl Test for GIMP, and define GIMP_CFLAGS and GIMP_LIBS
dnl
AC_DEFUN(AM_PATH_GIMP_1_4,
[dnl
dnl Get the cflags and libraries from the gimptool-1.3 script
dnl
AC_ARG_WITH(gimp-prefix,[ --with-gimp-prefix=PFX Prefix where GIMP is installed (optional)],
gimptool_prefix="$withval", gimptool_prefix="")
AC_ARG_WITH(gimp-exec-prefix,[ --with-gimp-exec-prefix=PFX Exec prefix where GIMP is installed (optional)],
gimptool_exec_prefix="$withval", gimptool_exec_prefix="")
AC_ARG_ENABLE(gimptest, [ --disable-gimptest Do not try to compile and run a test GIMP program],
, enable_gimptest=yes)
if test x$gimptool_exec_prefix != x ; then
gimptool_args="$gimptool_args --exec-prefix=$gimptool_exec_prefix"
if test x${GIMPTOOL+set} != xset ; then
GIMPTOOL=$gimptool_exec_prefix/bin/gimptool-1.3
fi
fi
if test x$gimptool_prefix != x ; then
gimptool_args="$gimptool_args --prefix=$gimptool_prefix"
if test x${GIMPTOOL+set} != xset ; then
GIMPTOOL=$gimptool_prefix/bin/gimptool-1.3
fi
fi
AC_PATH_PROG(GIMPTOOL, gimptool-1.3, no)
min_gimp_version=ifelse([$1], ,1.3.0,$1)
AC_MSG_CHECKING(for GIMP - version >= $min_gimp_version)
no_gimp=""
if test "$GIMPTOOL" = "no" ; then
no_gimp=yes
else
GIMP_CFLAGS=`$GIMPTOOL $gimptool_args --cflags`
GIMP_LIBS=`$GIMPTOOL $gimptool_args --libs`
GIMP_CFLAGS_NOUI=`$GIMPTOOL $gimptool_args --cflags-noui`
noui_test=`echo $GIMP_CFLAGS_NOUI | sed 's/^\(Usage\).*/\1/'`
if test "$noui_test" = "Usage" ; then
GIMP_CFLAGS_NOUI=$GIMP_CFLAGS
GIMP_LIBS_NOUI=$GIMP_LIBS
else
GIMP_LIBS_NOUI=`$GIMPTOOL $gimptool_args --libs-noui`
fi
GIMP_DATA_DIR=`$GIMPTOOL $gimptool_args --gimpdatadir`
GIMP_PLUGIN_DIR=`$GIMPTOOL $gimptool_args --gimpplugindir`
nodatadir_test=`echo $GIMP_DATA_DIR | sed 's/^\(Usage\).*/\1/'`
if test "$nodatadir_test" = "Usage" ; then
GIMP_DATA_DIR=""
GIMP_PLUGIN_DIR=""
fi
gimptool_major_version=`$GIMPTOOL $gimptool_args --version | \
sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\1/'`
gimptool_minor_version=`$GIMPTOOL $gimptool_args --version | \
sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\2/'`
gimptool_micro_version=`$GIMPTOOL $gimptool_args --version | \
sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\3/'`
if test "x$enable_gimptest" = "xyes" ; then
ac_save_CFLAGS="$CFLAGS"
ac_save_LIBS="$LIBS"
CFLAGS="$CFLAGS $GIMP_CFLAGS"
LIBS="$LIBS $GIMP_LIBS"
dnl
dnl Now check if the installed GIMP is sufficiently new. (Also sanity
dnl checks the results of gimptool-1.3 to some extent
dnl
rm -f conf.gimptest
AC_TRY_RUN([
#include <stdio.h>
#include <stdlib.h>
#include <libgimp/gimp.h>
GimpPlugInInfo PLUG_IN_INFO =
{
NULL, /* init_proc */
NULL, /* quit_proc */
NULL, /* query_proc */
NULL /* run_proc */
};
int main ()
{
int major, minor, micro;
char *tmp_version;
system ("touch conf.gimptest");
/* HP/UX 9 (%@#!) writes to sscanf strings */
tmp_version = g_strdup("$min_gimp_version");
if (sscanf(tmp_version, "%d.%d.%d", &major, &minor, &micro) != 3) {
printf("%s, bad version string\n", "$min_gimp_version");
exit(1);
}
if (($gimptool_major_version > major) ||
(($gimptool_major_version == major) && ($gimptool_minor_version > minor)) ||
(($gimptool_major_version == major) && ($gimptool_minor_version == minor) && ($gimptool_micro_version >= micro)))
{
return 0;
}
else
{
printf("\n*** 'gimptool-1.3 --version' returned %d.%d.%d, but the minimum version\n", $gimptool_major_version, $gimptool_minor_version, $gimptool_micro_version);
printf("*** of GIMP required is %d.%d.%d. If gimptool-1.3 is correct, then it is\n", major, minor, micro);
printf("*** best to upgrade to the required version.\n");
printf("*** If gimptool-1.3 was wrong, set the environment variable GIMPTOOL\n");
printf("*** to point to the correct copy of gimptool-1.3, and remove the file\n");
printf("*** config.cache before re-running configure\n");
return 1;
}
}
],, no_gimp=yes,[echo $ac_n "cross compiling; assumed OK... $ac_c"])
CFLAGS="$ac_save_CFLAGS"
LIBS="$ac_save_LIBS"
fi
fi
if test "x$no_gimp" = x ; then
AC_MSG_RESULT(yes)
ifelse([$2], , :, [$2])
else
AC_MSG_RESULT(no)
if test "$GIMPTOOL" = "no" ; then
echo "*** The gimptool-1.3 script installed by GIMP could not be found"
echo "*** If GIMP was installed in PREFIX, make sure PREFIX/bin is in"
echo "*** your path, or set the GIMPTOOL environment variable to the"
echo "*** full path to gimptool-1.3."
else
if test -f conf.gimptest ; then
:
else
echo "*** Could not run GIMP test program, checking why..."
CFLAGS="$CFLAGS $GIMP_CFLAGS"
LIBS="$LIBS $GIMP_LIBS"
AC_TRY_LINK([
#include <stdio.h>
#include <libgimp/gimp.h>
GimpPlugInInfo PLUG_IN_INFO =
{
NULL, /* init_proc */
NULL, /* quit_proc */
NULL, /* query_proc */
NULL /* run_proc */
};
], [ return 0; ],
[ echo "*** The test program compiled, but did not run. This usually means"
echo "*** that the run-time linker is not finding GIMP or finding the wrong"
echo "*** version of GIMP. If it is not finding GIMP, you'll need to set your"
echo "*** LD_LIBRARY_PATH environment variable, or edit /etc/ld.so.conf to point"
echo "*** to the installed location Also, make sure you have run ldconfig if that"
echo "*** is required on your system"
echo "***"
echo "*** If you have an old version installed, it is best to remove it, although"
echo "*** you may also be able to get things to work by modifying LD_LIBRARY_PATH"],
[ echo "*** The test program failed to compile or link. See the file config.log for the"
echo "*** exact error that occured. This usually means GIMP was incorrectly installed"
echo "*** or that you have moved GIMP since it was installed. In the latter case, you"
echo "*** may want to edit the gimptool-1.3 script: $GIMPTOOL" ])
CFLAGS="$ac_save_CFLAGS"
LIBS="$ac_save_LIBS"
fi
fi
GIMP_CFLAGS=""
GIMP_LIBS=""
GIMP_CFLAGS_NOUI=""
GIMP_LIBS_NOUI=""
ifelse([$3], , :, [$3])
fi
AC_SUBST(GIMP_CFLAGS)
AC_SUBST(GIMP_LIBS)
AC_SUBST(GIMP_CFLAGS_NOUI)
AC_SUBST(GIMP_LIBS_NOUI)
AC_SUBST(GIMP_DATA_DIR)
AC_SUBST(GIMP_PLUGIN_DIR)
rm -f conf.gimptest
])
# ******************************************************************** # ********************************************************************
# Configure paths for SANE # Configure paths for SANE
# Oliver Rauch 2000-10-30 # Oliver Rauch 2000-10-30
@ -777,3 +589,4 @@ main ()
]) ])
# ******************************************************************** # ********************************************************************

429
aclocal.m4 vendored
Wyświetl plik

@ -1,19 +1,19 @@
dnl aclocal.m4 generated automatically by aclocal 1.4-p6 # generated automatically by aclocal 1.7.9 -*- Autoconf -*-
dnl Copyright (C) 1994, 1995-8, 1999, 2001 Free Software Foundation, Inc. # Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002
dnl This file is free software; the Free Software Foundation # Free Software Foundation, Inc.
dnl gives unlimited permission to copy and/or distribute it, # This file is free software; the Free Software Foundation
dnl with or without modifications, as long as this notice is preserved. # gives unlimited permission to copy and/or distribute it,
# with or without modifications, as long as this notice is preserved.
dnl This program is distributed in the hope that it will be useful, # This program is distributed in the hope that it will be useful,
dnl but WITHOUT ANY WARRANTY, to the extent permitted by law; without # but WITHOUT ANY WARRANTY, to the extent permitted by law; without
dnl even the implied warranty of MERCHANTABILITY or FITNESS FOR A # even the implied warranty of MERCHANTABILITY or FITNESS FOR A
dnl PARTICULAR PURPOSE. # PARTICULAR PURPOSE.
# acinclude.m4 for sane-frontends # acinclude.m4 for sane-frontends
# AM_PATH_GTK # AM_PATH_GTK
# AM_PATH_GIMP # AM_PATH_GIMP
# AM_PATH_GIMP_1_4
# AM_PATH_SANE # AM_PATH_SANE
# Configure paths for GTK+ # Configure paths for GTK+
@ -432,192 +432,6 @@ dnl ok, gimp does not work, so we have to use the gtk_* things again
]) ])
# Configure paths for GIMP-1.4
# Manish Singh 98-6-11
# Shamelessly stolen from Owen Taylor
dnl AM_PATH_GIMP_1_4([MINIMUM-VERSION, [ACTION-IF-FOUND [, ACTION-IF-NOT-FOUND]]])
dnl Test for GIMP, and define GIMP_CFLAGS and GIMP_LIBS
dnl
AC_DEFUN(AM_PATH_GIMP_1_4,
[dnl
dnl Get the cflags and libraries from the gimptool-1.3 script
dnl
AC_ARG_WITH(gimp-prefix,[ --with-gimp-prefix=PFX Prefix where GIMP is installed (optional)],
gimptool_prefix="$withval", gimptool_prefix="")
AC_ARG_WITH(gimp-exec-prefix,[ --with-gimp-exec-prefix=PFX Exec prefix where GIMP is installed (optional)],
gimptool_exec_prefix="$withval", gimptool_exec_prefix="")
AC_ARG_ENABLE(gimptest, [ --disable-gimptest Do not try to compile and run a test GIMP program],
, enable_gimptest=yes)
if test x$gimptool_exec_prefix != x ; then
gimptool_args="$gimptool_args --exec-prefix=$gimptool_exec_prefix"
if test x${GIMPTOOL+set} != xset ; then
GIMPTOOL=$gimptool_exec_prefix/bin/gimptool-1.3
fi
fi
if test x$gimptool_prefix != x ; then
gimptool_args="$gimptool_args --prefix=$gimptool_prefix"
if test x${GIMPTOOL+set} != xset ; then
GIMPTOOL=$gimptool_prefix/bin/gimptool-1.3
fi
fi
AC_PATH_PROG(GIMPTOOL, gimptool-1.3, no)
min_gimp_version=ifelse([$1], ,1.3.0,$1)
AC_MSG_CHECKING(for GIMP - version >= $min_gimp_version)
no_gimp=""
if test "$GIMPTOOL" = "no" ; then
no_gimp=yes
else
GIMP_CFLAGS=`$GIMPTOOL $gimptool_args --cflags`
GIMP_LIBS=`$GIMPTOOL $gimptool_args --libs`
GIMP_CFLAGS_NOUI=`$GIMPTOOL $gimptool_args --cflags-noui`
noui_test=`echo $GIMP_CFLAGS_NOUI | sed 's/^\(Usage\).*/\1/'`
if test "$noui_test" = "Usage" ; then
GIMP_CFLAGS_NOUI=$GIMP_CFLAGS
GIMP_LIBS_NOUI=$GIMP_LIBS
else
GIMP_LIBS_NOUI=`$GIMPTOOL $gimptool_args --libs-noui`
fi
GIMP_DATA_DIR=`$GIMPTOOL $gimptool_args --gimpdatadir`
GIMP_PLUGIN_DIR=`$GIMPTOOL $gimptool_args --gimpplugindir`
nodatadir_test=`echo $GIMP_DATA_DIR | sed 's/^\(Usage\).*/\1/'`
if test "$nodatadir_test" = "Usage" ; then
GIMP_DATA_DIR=""
GIMP_PLUGIN_DIR=""
fi
gimptool_major_version=`$GIMPTOOL $gimptool_args --version | \
sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\1/'`
gimptool_minor_version=`$GIMPTOOL $gimptool_args --version | \
sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\2/'`
gimptool_micro_version=`$GIMPTOOL $gimptool_args --version | \
sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\3/'`
if test "x$enable_gimptest" = "xyes" ; then
ac_save_CFLAGS="$CFLAGS"
ac_save_LIBS="$LIBS"
CFLAGS="$CFLAGS $GIMP_CFLAGS"
LIBS="$LIBS $GIMP_LIBS"
dnl
dnl Now check if the installed GIMP is sufficiently new. (Also sanity
dnl checks the results of gimptool-1.3 to some extent
dnl
rm -f conf.gimptest
AC_TRY_RUN([
#include <stdio.h>
#include <stdlib.h>
#include <libgimp/gimp.h>
GimpPlugInInfo PLUG_IN_INFO =
{
NULL, /* init_proc */
NULL, /* quit_proc */
NULL, /* query_proc */
NULL /* run_proc */
};
int main ()
{
int major, minor, micro;
char *tmp_version;
system ("touch conf.gimptest");
/* HP/UX 9 (%@#!) writes to sscanf strings */
tmp_version = g_strdup("$min_gimp_version");
if (sscanf(tmp_version, "%d.%d.%d", &major, &minor, &micro) != 3) {
printf("%s, bad version string\n", "$min_gimp_version");
exit(1);
}
if (($gimptool_major_version > major) ||
(($gimptool_major_version == major) && ($gimptool_minor_version > minor)) ||
(($gimptool_major_version == major) && ($gimptool_minor_version == minor) && ($gimptool_micro_version >= micro)))
{
return 0;
}
else
{
printf("\n*** 'gimptool-1.3 --version' returned %d.%d.%d, but the minimum version\n", $gimptool_major_version, $gimptool_minor_version, $gimptool_micro_version);
printf("*** of GIMP required is %d.%d.%d. If gimptool-1.3 is correct, then it is\n", major, minor, micro);
printf("*** best to upgrade to the required version.\n");
printf("*** If gimptool-1.3 was wrong, set the environment variable GIMPTOOL\n");
printf("*** to point to the correct copy of gimptool-1.3, and remove the file\n");
printf("*** config.cache before re-running configure\n");
return 1;
}
}
],, no_gimp=yes,[echo $ac_n "cross compiling; assumed OK... $ac_c"])
CFLAGS="$ac_save_CFLAGS"
LIBS="$ac_save_LIBS"
fi
fi
if test "x$no_gimp" = x ; then
AC_MSG_RESULT(yes)
ifelse([$2], , :, [$2])
else
AC_MSG_RESULT(no)
if test "$GIMPTOOL" = "no" ; then
echo "*** The gimptool-1.3 script installed by GIMP could not be found"
echo "*** If GIMP was installed in PREFIX, make sure PREFIX/bin is in"
echo "*** your path, or set the GIMPTOOL environment variable to the"
echo "*** full path to gimptool-1.3."
else
if test -f conf.gimptest ; then
:
else
echo "*** Could not run GIMP test program, checking why..."
CFLAGS="$CFLAGS $GIMP_CFLAGS"
LIBS="$LIBS $GIMP_LIBS"
AC_TRY_LINK([
#include <stdio.h>
#include <libgimp/gimp.h>
GimpPlugInInfo PLUG_IN_INFO =
{
NULL, /* init_proc */
NULL, /* quit_proc */
NULL, /* query_proc */
NULL /* run_proc */
};
], [ return 0; ],
[ echo "*** The test program compiled, but did not run. This usually means"
echo "*** that the run-time linker is not finding GIMP or finding the wrong"
echo "*** version of GIMP. If it is not finding GIMP, you'll need to set your"
echo "*** LD_LIBRARY_PATH environment variable, or edit /etc/ld.so.conf to point"
echo "*** to the installed location Also, make sure you have run ldconfig if that"
echo "*** is required on your system"
echo "***"
echo "*** If you have an old version installed, it is best to remove it, although"
echo "*** you may also be able to get things to work by modifying LD_LIBRARY_PATH"],
[ echo "*** The test program failed to compile or link. See the file config.log for the"
echo "*** exact error that occured. This usually means GIMP was incorrectly installed"
echo "*** or that you have moved GIMP since it was installed. In the latter case, you"
echo "*** may want to edit the gimptool-1.3 script: $GIMPTOOL" ])
CFLAGS="$ac_save_CFLAGS"
LIBS="$ac_save_LIBS"
fi
fi
GIMP_CFLAGS=""
GIMP_LIBS=""
GIMP_CFLAGS_NOUI=""
GIMP_LIBS_NOUI=""
ifelse([$3], , :, [$3])
fi
AC_SUBST(GIMP_CFLAGS)
AC_SUBST(GIMP_LIBS)
AC_SUBST(GIMP_CFLAGS_NOUI)
AC_SUBST(GIMP_LIBS_NOUI)
AC_SUBST(GIMP_DATA_DIR)
AC_SUBST(GIMP_PLUGIN_DIR)
rm -f conf.gimptest
])
# ******************************************************************** # ********************************************************************
# Configure paths for SANE # Configure paths for SANE
# Oliver Rauch 2000-10-30 # Oliver Rauch 2000-10-30
@ -787,7 +601,17 @@ main ()
# ******************************************************************** # ********************************************************************
#serial 1
# isc-posix.m4 serial 2 (gettext-0.11.2)
dnl Copyright (C) 1995-2002 Free Software Foundation, Inc.
dnl This file is free software, distributed under the terms of the GNU
dnl General Public License. As a special exception to the GNU General
dnl Public License, this file may be distributed as part of a program
dnl that contains a configuration script generated by Autoconf, under
dnl the same distribution terms as the rest of that program.
# This file is not needed with autoconf-2.53 and newer. Remove it in 2005.
# This test replaces the one in autoconf. # This test replaces the one in autoconf.
# Currently this macro should have the same name as the autoconf macro # Currently this macro should have the same name as the autoconf macro
# because gettext's gettext.m4 (distributed in the automake package) # because gettext's gettext.m4 (distributed in the automake package)
@ -806,7 +630,24 @@ AC_DEFUN([AC_ISC_POSIX],
) )
# serial 1 # Copyright 1996, 1997, 1999, 2000, 2001, 2002 Free Software Foundation, Inc.
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2, or (at your option)
# any later version.
# 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 the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
# 02111-1307, USA.
# serial 2
# @defmac AC_PROG_CC_STDC # @defmac AC_PROG_CC_STDC
# @maindex PROG_CC_STDC # @maindex PROG_CC_STDC
@ -833,7 +674,7 @@ dnl like #elif.
dnl FIXME: can't do this because then AC_AIX won't work due to a dnl FIXME: can't do this because then AC_AIX won't work due to a
dnl circular dependency. dnl circular dependency.
dnl AC_BEFORE([$0], [AC_PROG_CPP]) dnl AC_BEFORE([$0], [AC_PROG_CPP])
AC_MSG_CHECKING(for ${CC-cc} option to accept ANSI C) AC_MSG_CHECKING([for ${CC-cc} option to accept ANSI C])
AC_CACHE_VAL(am_cv_prog_cc_stdc, AC_CACHE_VAL(am_cv_prog_cc_stdc,
[am_cv_prog_cc_stdc=no [am_cv_prog_cc_stdc=no
ac_save_CC="$CC" ac_save_CC="$CC"
@ -841,9 +682,10 @@ ac_save_CC="$CC"
# breaks some systems' header files. # breaks some systems' header files.
# AIX -qlanglvl=ansi # AIX -qlanglvl=ansi
# Ultrix and OSF/1 -std1 # Ultrix and OSF/1 -std1
# HP-UX -Aa -D_HPUX_SOURCE # HP-UX 10.20 and later -Ae
# HP-UX older versions -Aa -D_HPUX_SOURCE
# SVR4 -Xc -D__EXTENSIONS__ # SVR4 -Xc -D__EXTENSIONS__
for ac_arg in "" -qlanglvl=ansi -std1 "-Aa -D_HPUX_SOURCE" "-Xc -D__EXTENSIONS__" for ac_arg in "" -qlanglvl=ansi -std1 -Ae "-Aa -D_HPUX_SOURCE" "-Xc -D__EXTENSIONS__"
do do
CC="$ac_save_CC $ac_arg" CC="$ac_save_CC $ac_arg"
AC_TRY_COMPILE( AC_TRY_COMPILE(
@ -885,7 +727,7 @@ CC="$ac_save_CC"
if test -z "$am_cv_prog_cc_stdc"; then if test -z "$am_cv_prog_cc_stdc"; then
AC_MSG_RESULT([none needed]) AC_MSG_RESULT([none needed])
else else
AC_MSG_RESULT($am_cv_prog_cc_stdc) AC_MSG_RESULT([$am_cv_prog_cc_stdc])
fi fi
case "x$am_cv_prog_cc_stdc" in case "x$am_cv_prog_cc_stdc" in
x|xno) ;; x|xno) ;;
@ -893,6 +735,8 @@ case "x$am_cv_prog_cc_stdc" in
esac esac
]) ])
AU_DEFUN([fp_PROG_CC_STDC], [AM_PROG_CC_STDC])
# Configure paths for GTK+ # Configure paths for GTK+
# Owen Taylor 1997-2001 # Owen Taylor 1997-2001
@ -1090,3 +934,184 @@ main ()
rm -f conf.gtktest rm -f conf.gtktest
]) ])
# Configure paths for GIMP-2.0
# Manish Singh, Sven Neumann
# Large parts shamelessly stolen from Owen Taylor
dnl AM_PATH_GIMP_2_0([MINIMUM-VERSION, [ACTION-IF-FOUND [, ACTION-IF-NOT-FOUND]]])
dnl Test for GIMP, and define GIMP_CFLAGS and GIMP_LIBS
dnl
AC_DEFUN(AM_PATH_GIMP_2_0,
[dnl
dnl Get the cflags and libraries from pkg-config
dnl
AC_ARG_ENABLE(gimptest, [ --disable-gimptest do not try to compile and run a test GIMP program],, enable_gimptest=yes)
pkg_name=gimp-2.0
pkg_config_args="$pkg_name gimpui-2.0"
no_gimp=""
AC_PATH_PROG(PKG_CONFIG, pkg-config, no)
if test x$PKG_CONFIG != xno ; then
if pkg-config --atleast-pkgconfig-version 0.7 ; then
:
else
echo *** pkg-config too old; version 0.7 or better required.
no_gimp=yes
PKG_CONFIG=no
fi
else
no_gimp=yes
fi
min_gimp_version=ifelse([$1], ,1.3.24,$1)
AC_MSG_CHECKING(for GIMP - version >= $min_gimp_version)
if test x$PKG_CONFIG != xno ; then
## don't try to run the test against uninstalled libtool libs
if $PKG_CONFIG --uninstalled $pkg_config_args; then
echo "Will use uninstalled version of GIMP found in PKG_CONFIG_PATH"
enable_gimptest=no
fi
if $PKG_CONFIG --atleast-version $min_gimp_version $pkg_config_args; then
:
else
no_gimp=yes
fi
fi
if test x"$no_gimp" = x ; then
GIMP_CFLAGS=`$PKG_CONFIG $pkg_config_args --cflags`
GIMP_LIBS=`$PKG_CONFIG $pkg_config_args --libs`
GIMP_CFLAGS_NOUI=`$PKG_CONFIG $pkg_name --cflags`
GIMP_LIBS_NOUI=`$PKG_CONFIG $pkg_name --libs`
GIMP_DATA_DIR=`$PKG_CONFIG $pkg_name --variable=gimpdatadir`
GIMP_PLUGIN_DIR=`$PKG_CONFIG $pkg_name --variable=gimplibdir`
gimp_pkg_major_version=`$PKG_CONFIG --modversion $pkg_name | \
sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\1/'`
gimp_pkg_minor_version=`$PKG_CONFIG --modversion $pkg_name | \
sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\2/'`
gimp_pkg_micro_version=`$PKG_CONFIG --modversion $pkg_name | \
sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\3/'`
if test "x$enable_gimptest" = "xyes" ; then
ac_save_CFLAGS="$CFLAGS"
ac_save_LIBS="$LIBS"
CFLAGS="$CFLAGS $GIMP_CFLAGS"
LIBS="$GIMP_LIBS $LIBS"
dnl
dnl Now check if the installed GIMP is sufficiently new. (Also sanity
dnl checks the results of pkg-config to some extent
dnl
rm -f conf.gimptest
AC_TRY_RUN([
#include <stdio.h>
#include <stdlib.h>
#include <libgimp/gimp.h>
GimpPlugInInfo PLUG_IN_INFO =
{
NULL, /* init_proc */
NULL, /* quit_proc */
NULL, /* query_proc */
NULL /* run_proc */
};
int main ()
{
int major, minor, micro;
char *tmp_version;
system ("touch conf.gimptest");
/* HP/UX 9 (%@#!) writes to sscanf strings */
tmp_version = g_strdup("$min_gimp_version");
if (sscanf(tmp_version, "%d.%d.%d", &major, &minor, &micro) != 3) {
printf("%s, bad version string\n", "$min_gimp_version");
exit(1);
}
if (($gimp_pkg_major_version > major) ||
(($gimp_pkg_major_version == major) && ($gimp_pkg_minor_version > minor)) ||
(($gimp_pkg_major_version == major) && ($gimp_pkg_minor_version == minor) && ($gimp_pkg_micro_version >= micro)))
{
return 0;
}
else
{
printf("\n*** 'pkg-config --modversion %s' returned %d.%d.%d, but the minimum version\n", "$pkg_name", $gimp_pkg_major_version, $gimp_pkg_minor_version, $gimp_pkg_micro_version);
printf("*** of GIMP required is %d.%d.%d. If pkg-config is correct, then it is\n", major, minor, micro);
printf("*** best to upgrade to the required version.\n");
printf("*** If pkg-config was wrong, set the environment variable PKG_CONFIG_PATH\n");
printf("*** to point to the correct the correct configuration files\n");
return 1;
}
}
],, no_gimp=yes,[echo $ac_n "cross compiling; assumed OK... $ac_c"])
CFLAGS="$ac_save_CFLAGS"
LIBS="$ac_save_LIBS"
fi
fi
if test "x$no_gimp" = x ; then
AC_MSG_RESULT(yes (version $gimp_pkg_major_version.$gimp_pkg_minor_version.$gimp_pkg_micro_version))
ifelse([$2], , :, [$2])
else
if test "$PKG_CONFIG" = "no" ; then
echo "*** A new enough version of pkg-config was not found."
echo "*** See http://www.freedesktop.org/software/pkgconfig/"
else
if test -f conf.gimptest ; then
:
else
echo "*** Could not run GIMP test program, checking why..."
CFLAGS="$CFLAGS $GIMP_CFLAGS"
LIBS="$LIBS $GIMP_LIBS"
AC_TRY_LINK([
#include <stdio.h>
#include <libgimp/gimp.h>
GimpPlugInInfo PLUG_IN_INFO =
{
NULL, /* init_proc */
NULL, /* quit_proc */
NULL, /* query_proc */
NULL /* run_proc */
};
], [ return 0; ],
[ echo "*** The test program compiled, but did not run. This usually means"
echo "*** that the run-time linker is not finding GIMP or finding the wrong"
echo "*** version of GIMP. If it is not finding GIMP, you'll need to set your"
echo "*** LD_LIBRARY_PATH environment variable, or edit /etc/ld.so.conf to point"
echo "*** to the installed location Also, make sure you have run ldconfig if that"
echo "*** is required on your system"
echo "***"
echo "*** If you have an old version installed, it is best to remove it, although"
echo "*** you may also be able to get things to work by modifying LD_LIBRARY_PATH"],
[ echo "*** The test program failed to compile or link. See the file config.log for the"
echo "*** exact error that occured. This usually means GIMP is incorrectly installed."])
CFLAGS="$ac_save_CFLAGS"
LIBS="$ac_save_LIBS"
fi
fi
GIMP_CFLAGS=""
GIMP_LIBS=""
GIMP_CFLAGS_NOUI=""
GIMP_LIBS_NOUI=""
ifelse([$3], , :, [$3])
fi
AC_SUBST(GIMP_CFLAGS)
AC_SUBST(GIMP_LIBS)
AC_SUBST(GIMP_CFLAGS_NOUI)
AC_SUBST(GIMP_LIBS_NOUI)
AC_SUBST(GIMP_DATA_DIR)
AC_SUBST(GIMP_PLUGIN_DIR)
rm -f conf.gimptest
])

1735
configure vendored

Plik diff jest za duży Load Diff

Wyświetl plik

@ -33,23 +33,19 @@ dnl Check if GUIs shall be compiled
AC_ARG_ENABLE(guis, [ --disable-guis do not compile graphical user interfaces (GUIs)], USE_GUI=$enableval, USE_GUI=yes) AC_ARG_ENABLE(guis, [ --disable-guis do not compile graphical user interfaces (GUIs)], USE_GUI=$enableval, USE_GUI=yes)
dnl Check if GTK2 support is wanted dnl Check if GTK2 support is wanted
AC_ARG_ENABLE(gtk2, [ --disable-gtk2 do not use GTK2 (GIMP plugin must be disabled to use GTK2)], USE_GTK2=$enableval, USE_GTK2=yes) AC_ARG_ENABLE(gtk2, [ --disable-gtk2 do not use GTK2], USE_GTK2=$enableval, USE_GTK2=yes)
dnl Check for gimp plugin support dnl Check for gimp plugin support
AC_MSG_CHECKING([whether GIMP plugin is requested]) AC_MSG_CHECKING([whether GIMP plugin is requested])
dnl Default is enabled GIMP plugin dnl Default is enabled GIMP plugin
AC_ARG_ENABLE(gimp, [ --disable-gimp do not include GIMP plugin mode], USE_GIMP=$enableval, USE_GIMP=yes) AC_ARG_ENABLE(gimp, [ --disable-gimp do not include GIMP plugin mode], USE_GIMP=$enableval, USE_GIMP=yes)
AC_ARG_ENABLE(gimp13, [ --enable-gimp13 include GIMP 1.3 plugin mode (this disables GIMP =< 1.2 plugin)], USE_GIMP13=$enableval, USE_GIMP13="no") AC_ARG_ENABLE(gimp12, [ --enable-gimp12 include GIMP 1.2 plugin mode (this enables GIMP =< 1.2 plugin, defaults to GIMP 2.0)], USE_GIMP12=$enableval, USE_GIMP12="no")
if test "${USE_GIMP13}" = "yes"; then if test "${USE_GIMP12}" = "yes"; then
AC_MSG_RESULT([yes, GIMP 1.3]) AC_MSG_RESULT([yes, GIMP 1.2])
USE_GIMP="no" USE_GIMP="no"
else
AC_MSG_RESULT($USE_GIMP)
fi
# we cannot use GTK2 with GIMP < 1.3
if test "${USE_GIMP}" = "yes"; then
USE_GTK2="no" USE_GTK2="no"
else
AC_MSG_RESULT([$USE_GIMP, GIMP 2.0])
fi fi
dnl Checks for programs. dnl Checks for programs.
@ -137,10 +133,10 @@ fi
# check for GTK2 or GTK >= 0.99.13 # check for GTK2 or GTK >= 0.99.13
if test "${USE_GUI}" = "yes"; then if test "${USE_GUI}" = "yes"; then
if test "${USE_GTK2}" = "yes" || test "${USE_GIMP13}" = "yes"; then if test "${USE_GTK2}" = "yes" || test "${USE_GIMP}" = "yes"; then
AM_PATH_GTK_2_0(2.0.0, HAVE_GTK=yes, [ AM_PATH_GTK_2_0(2.0.0, HAVE_GTK=yes, [
if test "${USE_GIMP13}" = "yes"; then if test "${USE_GIMP}" = "yes"; then
AC_MSG_ERROR([*** GIMP 1.3 plugin requested, but GTK+ 2.0 not found ***]) AC_MSG_ERROR([*** GIMP 2.0 plugin requested, but GTK+ 2.0 not found ***])
else else
AC_MSG_WARN([*** GTK+ 2.0 not found, falling back to GTK+ < 2.0 if possible ***]) AC_MSG_WARN([*** GTK+ 2.0 not found, falling back to GTK+ < 2.0 if possible ***])
fi]) fi])
@ -151,14 +147,16 @@ if test "${USE_GUI}" = "yes"; then
AM_PATH_GTK(0.99.13, HAVE_GTK=yes, ) AM_PATH_GTK(0.99.13, HAVE_GTK=yes, )
fi fi
if test "${USE_GIMP}" = "yes"; then if test "${USE_GIMP12}" = "yes"; then
AM_PATH_GIMP(1.0.0, HAVE_GIMP=yes) AM_PATH_GIMP(1.0.0, HAVE_GIMP=yes)
if test "${HAVE_GIMP}" = "yes"; then
AC_DEFINE([ENABLE_GIMP_1_2], 1, [Define to 1 if GIMP 1.2 support wanted])
fi
fi fi
if test "${USE_GIMP13}" = "yes"; then if test "${USE_GIMP}" = "yes"; then
AM_PATH_GIMP_1_4(1.3.17, HAVE_GIMP13=yes) AM_PATH_GIMP_2_0(1.3.23, HAVE_GIMP=yes)
if test "${HAVE_GIMP13}" = "yes"; then if test "${HAVE_GIMP}" = "yes"; then
AC_DEFINE([ENABLE_GIMP_1_3], 1, [Define to 1 if GIMP 1.3 support wanted])
AC_DEFINE([HAVE_LIBGIMP_GIMP_H], 1, [Define to 1 if you have the <libgimp/gimp.h> header file.]) AC_DEFINE([HAVE_LIBGIMP_GIMP_H], 1, [Define to 1 if you have the <libgimp/gimp.h> header file.])
fi fi
fi fi

Wyświetl plik

@ -8,8 +8,8 @@
/* Define to 1 if using `alloca.c'. */ /* Define to 1 if using `alloca.c'. */
#undef C_ALLOCA #undef C_ALLOCA
/* Define to 1 if GIMP 1.3 support wanted */ /* Define to 1 if GIMP 1.2 support wanted */
#undef ENABLE_GIMP_1_3 #undef ENABLE_GIMP_1_2
/* Define to 1 if you have `alloca', as a function or macro. */ /* Define to 1 if you have `alloca', as a function or macro. */
#undef HAVE_ALLOCA #undef HAVE_ALLOCA

Wyświetl plik

@ -65,13 +65,13 @@
# ifdef HAVE_LIBGIMP_GIMPFEATURES_H # ifdef HAVE_LIBGIMP_GIMPFEATURES_H
# include <libgimp/gimpfeatures.h> # include <libgimp/gimpfeatures.h>
# elif !defined(ENABLE_GIMP_1_3) # elif defined(ENABLE_GIMP_1_2)
# define GIMP_CHECK_VERSION(major, minor, micro) 0 # define GIMP_CHECK_VERSION(major, minor, micro) 0
# endif /* HAVE_LIBGIMP_GIMPFEATURES_H */ # endif /* HAVE_LIBGIMP_GIMPFEATURES_H */
#ifdef ENABLE_GIMP_1_3 #ifndef ENABLE_GIMP_1_2
# define GIMP_HAVE_RESOLUTION_INFO # define GIMP_HAVE_RESOLUTION_INFO
#endif /* ENABLE_GIMP_1_3 */ #endif /* !ENABLE_GIMP_1_2 */
# ifdef GIMP_CHECK_VERSION # ifdef GIMP_CHECK_VERSION
# if GIMP_CHECK_VERSION(1,1,25) # if GIMP_CHECK_VERSION(1,1,25)
@ -81,21 +81,20 @@
# include "xscanimage-gimp-1_0-compat.h" # include "xscanimage-gimp-1_0-compat.h"
# endif # endif
# else # else
# ifndef ENABLE_GIMP_1_3 # ifdef ENABLE_GIMP_1_2
/* we have the old gimp interface and need the compatibility header file */ /* we have the old gimp interface and need the compatibility header file */
# include "xscanimage-gimp-1_0-compat.h" # include "xscanimage-gimp-1_0-compat.h"
# endif /* !ENABLE_GIMP_1_3 */ # endif /* ENABLE_GIMP_1_2 */
# endif # endif
static void query (void); static void query (void);
#ifdef ENABLE_GIMP_1_3 #ifndef ENABLE_GIMP_1_2
static void run (const gchar *name, gint nparams, const GimpParam * param, static void run (const gchar *name, gint nparams, const GimpParam * param,
gint *nreturn_vals, GimpParam ** return_vals); gint *nreturn_vals, GimpParam ** return_vals);
#else #else
static void run (char *name, int nparams, GimpParam * param, static void run (char *name, int nparams, GimpParam * param,
int *nreturn_vals, GimpParam ** return_vals); int *nreturn_vals, GimpParam ** return_vals);
#endif /* ENABLE_GIMP_1_3 */ #endif /* !ENABLE_GIMP_1_2 */
GimpPlugInInfo PLUG_IN_INFO = GimpPlugInInfo PLUG_IN_INFO =
{ {
@ -370,7 +369,7 @@ query (void)
DBG(DBG_debug, "query: finished\n"); DBG(DBG_debug, "query: finished\n");
} }
#ifdef ENABLE_GIMP_1_3 #ifndef ENABLE_GIMP_1_2
static void static void
run (const gchar *name, gint nparams, const GimpParam * param, run (const gchar *name, gint nparams, const GimpParam * param,
gint *nreturn_vals, GimpParam ** return_vals) gint *nreturn_vals, GimpParam ** return_vals)
@ -378,14 +377,14 @@ run (const gchar *name, gint nparams, const GimpParam * param,
static void static void
run (char *name, int nparams, GimpParam * param, run (char *name, int nparams, GimpParam * param,
int *nreturn_vals, GimpParam ** return_vals) int *nreturn_vals, GimpParam ** return_vals)
#endif /* ENABLE_GIMP_1_3 */ #endif /* !ENABLE_GIMP_1_2 */
{ {
static GimpParam values[2]; static GimpParam values[2];
#ifdef ENABLE_GIMP_1_3 #ifndef ENABLE_GIMP_1_2
GimpRunMode run_mode; GimpRunMode run_mode;
#else #else
GimpRunModeType run_mode; GimpRunModeType run_mode;
#endif /* ENABLE_GIMP_1_3 */ #endif /* !ENABLE_GIMP_1_2 */
char devname[1024]; char devname[1024];
char *args[2]; char *args[2];
int nargs; int nargs;
@ -1974,13 +1973,13 @@ init (int argc, char **argv)
#ifdef HAVE_LIBGIMP_GIMP_H #ifdef HAVE_LIBGIMP_GIMP_H
gtk_rc_parse (gimp_gtkrc ()); gtk_rc_parse (gimp_gtkrc ());
# ifdef ENABLE_GIMP_1_3 # ifndef ENABLE_GIMP_1_2
/* GIMP 1.3 defines gimp_use_xshm() as a macro always returning TRUE /* GIMP 2.0 defines gimp_use_xshm() as a macro always returning TRUE
* (in the compat header) */ * (in the compat header) */
gdk_set_use_xshm (TRUE); gdk_set_use_xshm (TRUE);
# else # else
gdk_set_use_xshm (gimp_use_xshm ()); gdk_set_use_xshm (gimp_use_xshm ());
# endif /* ENABLE_GIMP_1_3 */ # endif /* !ENABLE_GIMP_1_2 */
#endif #endif
gsg_make_path (sizeof (filename), filename, 0, "sane-style", 0, ".rc"); gsg_make_path (sizeof (filename), filename, 0, "sane-style", 0, ".rc");
@ -2158,11 +2157,11 @@ main (int argc, char **argv)
# ifdef HAVE_OS2_H # ifdef HAVE_OS2_H
set_gimp_PLUG_IN_INFO(&PLUG_IN_INFO); set_gimp_PLUG_IN_INFO(&PLUG_IN_INFO);
# endif # endif
# ifdef ENABLE_GIMP_1_3 # ifndef ENABLE_GIMP_1_2
result = gimp_main (&PLUG_IN_INFO, argc, argv); result = gimp_main (&PLUG_IN_INFO, argc, argv);
# else # else
result = gimp_main (argc, argv); result = gimp_main (argc, argv);
# endif /* ENABLE_GIMP_1_3 */ # endif /* !ENABLE_GIMP_1_2 */
g_set_print_handler (old_print_func); g_set_print_handler (old_print_func);
g_set_printerr_handler (old_printerr_func); g_set_printerr_handler (old_printerr_func);
if (result) if (result)