diff options
author | Mattia Rizzolo <mattia@mapreri.org> | 2014-10-03 14:05:03 +0000 |
---|---|---|
committer | Mattia Rizzolo <mattia@mapreri.org> | 2014-10-03 14:05:03 +0000 |
commit | 817e6294b42b3e4435f1b99728afc1dca84a6445 (patch) | |
tree | 75bc563b5fe4149fe7e5cbf7a5c2cbcee5ea0fb3 /m4 | |
parent | e7e90b72fd3161c5d55fed49e100781dfa3e9408 (diff) |
Imported Upstream version 0.97upstream/0.97
Diffstat (limited to 'm4')
-rw-r--r-- | m4/gettext.m4 | 368 | ||||
-rw-r--r-- | m4/gimp-2.0.m4 | 183 | ||||
-rw-r--r-- | m4/gimp-orauch.m4 | 251 | ||||
-rw-r--r-- | m4/gtk-2.0.m4 | 196 | ||||
-rw-r--r-- | m4/gtk.m4 | 194 | ||||
-rw-r--r-- | m4/msnative-struct.m4 | 48 | ||||
-rw-r--r-- | m4/old/aclocal.m4-0.92 | 1086 | ||||
-rw-r--r-- | m4/old/aclocal.m4.bak | 1086 | ||||
-rw-r--r-- | m4/old/configure.in-0.92 | 248 | ||||
-rw-r--r-- | m4/old/gimp.m4 | 211 | ||||
-rw-r--r-- | m4/old/gtk2.m4 | 39 | ||||
-rw-r--r-- | m4/sane.m4 | 149 |
12 files changed, 4059 insertions, 0 deletions
diff --git a/m4/gettext.m4 b/m4/gettext.m4 new file mode 100644 index 0000000..0dca591 --- /dev/null +++ b/m4/gettext.m4 @@ -0,0 +1,368 @@ +# progtest.m4 from gettext 0.32 +# Search path for a program which passes the given test. +# Ulrich Drepper <drepper@cygnus.com>, 1996. +# +# This file file be copied and used freely without restrictions. It can +# be used in projects which are not available under the GNU Public License +# but which still want to provide support for the GNU gettext functionality. +# Please note that the actual code is *not* freely available. + +# serial 1 + +dnl AM_PATH_PROG_WITH_TEST(VARIABLE, PROG-TO-CHECK-FOR, +dnl TEST-PERFORMED-ON-FOUND_PROGRAM [, VALUE-IF-NOT-FOUND [, PATH]]) +AC_DEFUN(AM_PATH_PROG_WITH_TEST, +[# Extract the first word of "$2", so it can be a program name with args. +set dummy $2; ac_word=[$]2 +AC_MSG_CHECKING([for $ac_word]) +AC_CACHE_VAL(ac_cv_path_$1, +[case "[$]$1" in + /*) + ac_cv_path_$1="[$]$1" # Let the user override the test with a path. + ;; + *) + IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}:" + for ac_dir in ifelse([$5], , $PATH, [$5]); do + test -z "$ac_dir" && ac_dir=. + if test -f $ac_dir/$ac_word; then + if [$3]; then + ac_cv_path_$1="$ac_dir/$ac_word" + break + fi + fi + done + IFS="$ac_save_ifs" +dnl If no 4th arg is given, leave the cache variable unset, +dnl so AC_PATH_PROGS will keep looking. +ifelse([$4], , , [ test -z "[$]ac_cv_path_$1" && ac_cv_path_$1="$4" +])dnl + ;; +esac])dnl +$1="$ac_cv_path_$1" +if test -n "[$]$1"; then + AC_MSG_RESULT([$]$1) +else + AC_MSG_RESULT(no) +fi +AC_SUBST($1)dnl +]) + +# ******************************************************************** +# lcmessage.m4 from gettext 0.32 +# Check whether LC_MESSAGES is available in <locale.h>. +# Ulrich Drepper <drepper@cygnus.com>, 1995. +# +# This file file be copied and used freely without restrictions. It can +# be used in projects which are not available under the GNU Public License +# but which still want to provide support for the GNU gettext functionality. +# Please note that the actual code is *not* freely available. + +# serial 1 + +AC_DEFUN(AM_LC_MESSAGES, + [if test $ac_cv_header_locale_h = yes; then + AC_CACHE_CHECK([for LC_MESSAGES], am_cv_val_LC_MESSAGES, + [AC_TRY_LINK([#include <locale.h>], [return LC_MESSAGES], + am_cv_val_LC_MESSAGES=yes, am_cv_val_LC_MESSAGES=no)]) + if test $am_cv_val_LC_MESSAGES = yes; then + AC_DEFINE(HAVE_LC_MESSAGES) + fi + fi]) + + +# ******************************************************************** +# gettext.m4 from gettext 0.32 +# Macro to add for using GNU gettext. +# Ulrich Drepper <drepper@cygnus.com>, 1995. +# +# This file file be copied and used freely without restrictions. It can +# be used in projects which are not available under the GNU Public License +# but which still want to provide support for the GNU gettext functionality. +# Please note that the actual code is *not* freely available. + +# serial 3 + +AC_DEFUN(AM_WITH_NLS, + [AC_MSG_CHECKING([whether NLS is requested]) + dnl Default is enabled NLS + AC_ARG_ENABLE(nls, + [ --disable-nls do not use Native Language Support], + USE_NLS=$enableval, USE_NLS=yes) + AC_MSG_RESULT($USE_NLS) + AC_SUBST(USE_NLS) + + USE_INCLUDED_LIBINTL=no + + dnl If we use NLS figure out what method + if test "$USE_NLS" = "yes"; then + AC_DEFINE(ENABLE_NLS) + AC_MSG_CHECKING([whether included gettext is requested]) + AC_ARG_WITH(included-gettext, + [ --with-included-gettext use the GNU gettext library included here], + nls_cv_force_use_gnu_gettext=$withval, + nls_cv_force_use_gnu_gettext=no) + AC_MSG_RESULT($nls_cv_force_use_gnu_gettext) + + nls_cv_use_gnu_gettext="$nls_cv_force_use_gnu_gettext" + if test "$nls_cv_force_use_gnu_gettext" != "yes"; then + dnl User does not insist on using GNU NLS library. Figure out what + dnl to use. If gettext or catgets are available (in this order) we + dnl use this. Else we have to fall back to GNU NLS library. + dnl catgets is only used if permitted by option --with-catgets. + nls_cv_header_intl= + nls_cv_header_libgt= + CATOBJEXT=NONE + + AC_CHECK_HEADER(libintl.h, + [AC_CACHE_CHECK([for gettext in libc], gt_cv_func_gettext_libc, + [AC_TRY_LINK([#include <libintl.h>], [return (int) gettext ("")], + gt_cv_func_gettext_libc=yes, gt_cv_func_gettext_libc=no)]) + + if test "$gt_cv_func_gettext_libc" != "yes"; then + AC_CHECK_LIB(intl, bindtextdomain, + [AC_CACHE_CHECK([for gettext in libintl], + gt_cv_func_gettext_libintl, + [AC_TRY_LINK([], [return (int) gettext ("")], + gt_cv_func_gettext_libintl=yes, + gt_cv_func_gettext_libintl=no)])]) + fi + + if test "$gt_cv_func_gettext_libintl" = "yes"; then + LIBS="-lintl $LIBS" + fi + + if test "$gt_cv_func_gettext_libc" = "yes" \ + || test "$gt_cv_func_gettext_libintl" = "yes"; then + AC_DEFINE(HAVE_GETTEXT) + AM_PATH_PROG_WITH_TEST(MSGFMT, msgfmt, + [test -z "`$ac_dir/$ac_word -h 2>&1 | grep 'dv '`"], no)dnl + if test "$MSGFMT" != "no"; then + AC_CHECK_FUNCS(dcgettext) + AC_PATH_PROG(GMSGFMT, gmsgfmt, $MSGFMT) + AM_PATH_PROG_WITH_TEST(XGETTEXT, xgettext, + [test -z "`$ac_dir/$ac_word -h 2>&1 | grep '(HELP)'`"], :) + AC_TRY_LINK(, [extern int _nl_msg_cat_cntr; + return _nl_msg_cat_cntr], + [CATOBJEXT=.gmo + DATADIRNAME=share], + [CATOBJEXT=.mo + DATADIRNAME=lib]) + INSTOBJEXT=.mo + fi + fi + ]) + + if test "$CATOBJEXT" = "NONE"; then + AC_MSG_CHECKING([whether catgets can be used]) + AC_ARG_WITH(catgets, + [ --with-catgets use catgets functions if available], + nls_cv_use_catgets=$withval, nls_cv_use_catgets=no) + AC_MSG_RESULT($nls_cv_use_catgets) + + if test "$nls_cv_use_catgets" = "yes"; then + dnl No gettext in C library. Try catgets next. + AC_CHECK_LIB(i, main) + AC_CHECK_FUNC(catgets, + [AC_DEFINE(HAVE_CATGETS) + INTLOBJS="\$(CATOBJS)" + AC_PATH_PROG(GENCAT, gencat, no)dnl + if test "$GENCAT" != "no"; then + AC_PATH_PROG(GMSGFMT, gmsgfmt, no) + if test "$GMSGFMT" = "no"; then + AM_PATH_PROG_WITH_TEST(GMSGFMT, msgfmt, + [test -z "`$ac_dir/$ac_word -h 2>&1 | grep 'dv '`"], no) + fi + AM_PATH_PROG_WITH_TEST(XGETTEXT, xgettext, + [test -z "`$ac_dir/$ac_word -h 2>&1 | grep '(HELP)'`"], :) + USE_INCLUDED_LIBINTL=yes + CATOBJEXT=.cat + INSTOBJEXT=.cat + DATADIRNAME=lib + INTLDEPS='$(top_builddir)/intl/libintl.a' + INTLLIBS=$INTLDEPS + LIBS=`echo $LIBS | sed -e 's/-lintl//'` + nls_cv_header_intl=intl/libintl.h + nls_cv_header_libgt=intl/libgettext.h + fi]) + fi + fi + + if test "$CATOBJEXT" = "NONE"; then + dnl Neither gettext nor catgets in included in the C library. + dnl Fall back on GNU gettext library. + nls_cv_use_gnu_gettext=yes + fi + fi + + if test "$nls_cv_use_gnu_gettext" = "yes"; then + dnl Mark actions used to generate GNU NLS library. + INTLOBJS="\$(GETTOBJS)" + AM_PATH_PROG_WITH_TEST(MSGFMT, msgfmt, + [test -z "`$ac_dir/$ac_word -h 2>&1 | grep 'dv '`"], msgfmt) + AC_PATH_PROG(GMSGFMT, gmsgfmt, $MSGFMT) + AM_PATH_PROG_WITH_TEST(XGETTEXT, xgettext, + [test -z "`$ac_dir/$ac_word -h 2>&1 | grep '(HELP)'`"], :) + AC_SUBST(MSGFMT) + USE_INCLUDED_LIBINTL=yes + CATOBJEXT=.gmo + INSTOBJEXT=.mo + DATADIRNAME=share + INTLDEPS='$(top_builddir)/intl/libintl.a' + INTLLIBS=$INTLDEPS + LIBS=`echo $LIBS | sed -e 's/-lintl//'` + nls_cv_header_intl=intl/libintl.h + nls_cv_header_libgt=intl/libgettext.h + fi + + dnl Test whether we really found GNU xgettext. + if test "$XGETTEXT" != ":"; then + dnl If it is no GNU xgettext we define it as : so that the + dnl Makefiles still can work. + if $XGETTEXT --omit-header /dev/null 2> /dev/null; then + : ; + else + AC_MSG_RESULT( + [found xgettext programs is not GNU xgettext; ignore it]) + XGETTEXT=":" + fi + fi + + # We need to process the po/ directory. + POSUB=po + else + DATADIRNAME=share + nls_cv_header_intl=intl/libintl.h + nls_cv_header_libgt=intl/libgettext.h + fi + + # If this is used in GNU gettext we have to set USE_NLS to `yes' + # because some of the sources are only built for this goal. + if test "$PACKAGE" = gettext; then + USE_NLS=yes + USE_INCLUDED_LIBINTL=yes + fi + + dnl These rules are solely for the distribution goal. While doing this + dnl we only have to keep exactly one list of the available catalogs + dnl in configure.in. + for lang in $ALL_LINGUAS; do + GMOFILES="$GMOFILES $lang.gmo" + POFILES="$POFILES $lang.po" + done + + dnl Make all variables we use known to autoconf. + AC_SUBST(USE_INCLUDED_LIBINTL) + AC_SUBST(CATALOGS) + AC_SUBST(CATOBJEXT) + AC_SUBST(DATADIRNAME) + AC_SUBST(GMOFILES) + AC_SUBST(INSTOBJEXT) + AC_SUBST(INTLDEPS) + AC_SUBST(INTLLIBS) + AC_SUBST(INTLOBJS) + AC_SUBST(POFILES) + AC_SUBST(POSUB) + ]) + +AC_DEFUN(AM_GNU_GETTEXT, + [AC_REQUIRE([AC_PROG_MAKE_SET])dnl + AC_REQUIRE([AC_PROG_CC])dnl + AC_REQUIRE([AC_PROG_RANLIB])dnl + AC_REQUIRE([AC_ISC_POSIX])dnl + AC_REQUIRE([AC_HEADER_STDC])dnl + AC_REQUIRE([AC_C_CONST])dnl + AC_REQUIRE([AC_C_INLINE])dnl + AC_REQUIRE([AC_TYPE_OFF_T])dnl + AC_REQUIRE([AC_TYPE_SIZE_T])dnl + AC_REQUIRE([AC_FUNC_ALLOCA])dnl + AC_REQUIRE([AC_FUNC_MMAP])dnl + + AC_CHECK_HEADERS([argz.h limits.h locale.h nl_types.h malloc.h string.h \ +unistd.h values.h sys/param.h]) + AC_CHECK_FUNCS([getcwd munmap putenv setenv setlocale strchr strcasecmp \ +__argz_count __argz_stringify __argz_next]) + + if test "${ac_cv_func_stpcpy+set}" != "set"; then + AC_CHECK_FUNCS(stpcpy) + fi + if test "${ac_cv_func_stpcpy}" = "yes"; then + AC_DEFINE(HAVE_STPCPY) + fi + + AM_LC_MESSAGES + AM_WITH_NLS + + if test "x$CATOBJEXT" != "x"; then + if test "x$ALL_LINGUAS" = "x"; then + LINGUAS= + else + AC_MSG_CHECKING(for catalogs to be installed) + NEW_LINGUAS= + for lang in ${LINGUAS=$ALL_LINGUAS}; do + case "$ALL_LINGUAS" in + *$lang*) NEW_LINGUAS="$NEW_LINGUAS $lang" ;; + esac + done + LINGUAS=$NEW_LINGUAS + AC_MSG_RESULT($LINGUAS) + fi + + dnl Construct list of names of catalog files to be constructed. + if test -n "$LINGUAS"; then + for lang in $LINGUAS; do CATALOGS="$CATALOGS $lang$CATOBJEXT"; done + fi + fi + + dnl The reference to <locale.h> in the installed <libintl.h> file + dnl must be resolved because we cannot expect the users of this + dnl to define HAVE_LOCALE_H. + if test $ac_cv_header_locale_h = yes; then + INCLUDE_LOCALE_H="#include <locale.h>" + else + INCLUDE_LOCALE_H="\ +/* The system does not provide the header <locale.h>. Take care yourself. */" + fi + AC_SUBST(INCLUDE_LOCALE_H) + + dnl Determine which catalog format we have (if any is needed) + dnl For now we know about two different formats: + dnl Linux libc-5 and the normal X/Open format + test -d intl || mkdir intl + if test "$CATOBJEXT" = ".cat"; then + AC_CHECK_HEADER(linux/version.h, msgformat=linux, msgformat=xopen) + + dnl Transform the SED scripts while copying because some dumb SEDs + dnl cannot handle comments. + sed -e '/^#/d' $srcdir/intl/$msgformat-msg.sed > intl/po2msg.sed + fi + dnl po2tbl.sed is always needed. + sed -e '/^#.*[^\\]$/d' -e '/^#$/d' \ + $srcdir/intl/po2tbl.sed.in > intl/po2tbl.sed + + dnl In the intl/Makefile.in we have a special dependency which makes + dnl only sense for gettext. We comment this out for non-gettext + dnl packages. + if test "$PACKAGE" = "gettext"; then + GT_NO="#NO#" + GT_YES= + else + GT_NO= + GT_YES="#YES#" + fi + AC_SUBST(GT_NO) + AC_SUBST(GT_YES) + + dnl If the AC_CONFIG_AUX_DIR macro for autoconf is used we possibly + dnl find the mkinstalldirs script in another subdir but ($top_srcdir). + dnl Try to locate is. + MKINSTALLDIRS= + if test -z "$MKINSTALLDIRS"; then + MKINSTALLDIRS="\$(top_srcdir)/mkinstalldirs" + fi + AC_SUBST(MKINSTALLDIRS) + + dnl *** For now the libtool support in intl/Makefile is not for real. + l= + AC_SUBST(l) + ]) + diff --git a/m4/gimp-2.0.m4 b/m4/gimp-2.0.m4 new file mode 100644 index 0000000..587b85e --- /dev/null +++ b/m4/gimp-2.0.m4 @@ -0,0 +1,183 @@ +# 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], ,2.0.0,$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, µ) != 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 "" + 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." + echo "*** When gimp-2.0 is not installed but gimp-1.x is installed then you can" + echo "*** ignore this error message."]) + 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 +]) diff --git a/m4/gimp-orauch.m4 b/m4/gimp-orauch.m4 new file mode 100644 index 0000000..ad15c0b --- /dev/null +++ b/m4/gimp-orauch.m4 @@ -0,0 +1,251 @@ +###################################################################### +# Configure paths for The GIMP +# Oliver Rauch 2000-12-28, Changes 2004-04-20 +# Parts from the original gimp.m4 +# with extensions that this version can handle gimp-1.0.x + +dnl AM_PATH_GIMP_ORAUCH([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_ORAUCH, +[dnl +dnl Get the cflags and libraries from the gimp-config script +dnl + AC_ARG_WITH(gimp-prefix,[ --with-gimp-prefix=PFX Prefix where GIMP is installed (optional)], + gimp_config_prefix="$withval", gimp_config_prefix="") + AC_ARG_WITH(gimp-exec-prefix,[ --with-gimp-exec-prefix=PFX Exec prefix where GIMP is installed (optional)], + gimp_config_exec_prefix="$withval", gimp_config_exec_prefix="") + AC_ARG_ENABLE(gimptest, [ --disable-gimptest do not try to compile and run a test GIMP program], , enable_gimptest=yes) + + ac_save_CFLAGS="$CFLAGS" + ac_save_LIBS="$LIBS" + ac_save_GTK_CFLAGS="$GTK_CFLAGS" + ac_save_GTK_LIBS="$GTK_LIBS" + + if test x$gimp_config_exec_prefix != x ; then + gimp_config_args="$gimp_config_args --exec-prefix=$gimp_config_exec_prefix" + if test x${GIMP_CONFIG+set} != xset ; then + GIMP_CONFIG=$gimp_config_exec_prefix/bin/gimp-config + fi + fi + + if test x$gimp_config_prefix != x ; then + gimp_config_args="$gimp_config_args --prefix=$gimp_config_prefix" + if test x${GIMP_CONFIG+set} != xset ; then + GIMP_CONFIG=$gimp_config_prefix/bin/gimp-config + fi + fi + + AC_PATH_PROG(GIMP_CONFIG, gimp-config, no) + if test "$GIMP_CONFIG" = "no" ; then + if test x$gimp_config_exec_prefix != x ; then + gimp_config_args="$gimp_config_args --exec-prefix=$gimp_config_exec_prefix" + if test x${GIMP_TOOL+set} != xset ; then + GIMP_TOOL=$gimp_config_exec_prefix/bin/gimptool + fi + fi + if test x$gimp_config_prefix != x ; then + gimp_config_args="$gimp_config_args --prefix=$gimp_config_prefix" + if test x${GIMP_TOOL+set} != xset ; then + GIMP_TOOL=$gimp_config_prefix/bin/gimptool + fi + fi + AC_PATH_PROG(GIMP_TOOL, gimptool, no) + GIMP_CONFIG=$GIMP_TOOL + fi + + min_gimp_version=ifelse([$1], ,1.0.0,$1) + no_gimp="" + + if test "$GIMP_CONFIG" = "no" ; then +dnl we do not have gimp-config (gimp-1.0.x does not have gimp-config) +dnl so we have to use the GTK_* things for testing for gimp.h and gimpfeatures.h + ac_save_CPPFLAGS="$CPPFLAGS" + CPPFLAGS="${CPPFLAGS} ${GTK_CFLAGS}" + AC_CHECK_HEADERS(libgimp/gimp.h, GIMP_LIBS="-lgimp", no_gimp=yes) + AC_CHECK_HEADERS(libgimp/gimpfeatures.h) + CPPFLAGS="$ac_save_CPPFLAGS" + CFLAGS="${CFLAGS} ${GTK_CFLAGS}" + LIBS="${LIBS} ${GTK_LIBS} ${GIMP_LIBS}" + + if test "x$no_gimp" = x ; then + dnl *** we have found libgimp/gimp.h *** + AC_MSG_CHECKING(GIMP compilation) + gimp_config_major_version=-1 + gimp_config_minor_version=0 + gimp_config_micro_version=0 + fi + else +dnl Ok, we have gimp-config and so we do not need the GTK_* things because they are +dnl included in the output of gimp-config + GTK_CFLAGS="" + GTK_LIBS="" + GIMP_CFLAGS=`$GIMP_CONFIG $gimp_config_args --cflags` + GIMP_LIBS=`$GIMP_CONFIG $gimp_config_args --libs`" -lgimp" + gimp_config_major_version=`$GIMP_CONFIG $gimp_config_args --version | \ + sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\1/'` + gimp_config_minor_version=`$GIMP_CONFIG $gimp_config_args --version | \ + sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\2/'` + gimp_config_micro_version=`$GIMP_CONFIG $gimp_config_args --version | \ + sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\3/'` + CFLAGS="${CFLAGS} ${GIMP_CFLAGS}" + LIBS="${LIBS} ${GIMP_LIBS}" + AC_MSG_CHECKING(for GIMP - version >= $min_gimp_version) + fi + +dnl +dnl Now check if the installed GIMP is sufficiently new. (Also sanity +dnl checks the results of gimp-config to some extent +dnl + if test "x$no_gimp" = x ; then + if test "$enable_gimptest" = "yes" ; then + rm -f conf.gimptest + AC_TRY_RUN([ +#include <libgimp/gimp.h> +#include <stdio.h> + +#define GIMP_TEST_CHECK_VERSION(major, minor, micro) \ + ($gimp_config_major_version > (major) || \ + ($gimp_config_major_version == (major) && $gimp_config_minor_version > (minor)) || \ + ($gimp_config_major_version == (major) && $gimp_config_minor_version == (minor) && \ + $gimp_config_micro_version >= (micro))) + +#if !GIMP_TEST_CHECK_VERSION(1,1,25) +# define GimpPlugInInfo GPlugInInfo /* do test with gimp interface version 1.0 */ +#endif + +GimpPlugInInfo PLUG_IN_INFO = +{ + NULL, NULL, NULL, NULL +}; + + +int +main () +{ + int major, minor, micro; + + system ("touch conf.gimptest"); + + if (sscanf("$min_gimp_version", "%d.%d.%d", &major, &minor, µ) != 3) { + printf("%s, bad version string\n", "$min_gimp_version"); + exit(1); + } + + if ( ($gimp_config_major_version != -1) && + ((gimp_major_version != $gimp_config_major_version) || + (gimp_minor_version != $gimp_config_minor_version) || + (gimp_micro_version != $gimp_config_micro_version)) ) + { + printf("\n*** 'gimp-config --version' returned %d.%d.%d, but GIMP (%d.%d.%d)\n", + $gimp_config_major_version, $gimp_config_minor_version, $gimp_config_micro_version, + gimp_major_version, gimp_minor_version, gimp_micro_version); + printf ("*** was found! If gimp-config was correct, then it is best\n"); + printf ("*** to remove the old version of GIMP. You may also be able to fix the error\n"); + printf("*** by modifying your LD_LIBRARY_PATH enviroment variable, or by editing\n"); + printf("*** /etc/ld.so.conf. Make sure you have run ldconfig if that is\n"); + printf("*** required on your system.\n"); + printf("*** If gimp-config was wrong, set the environment variable GIMP_CONFIG\n"); + printf("*** to point to the correct copy of gimp-config, and remove the file config.cache\n"); + printf("*** before re-running configure\n"); + } + else + { + if ((gimp_major_version > major) || + ((gimp_major_version == major) && (gimp_minor_version > minor)) || + ((gimp_major_version == major) && (gimp_minor_version == minor) && (gimp_micro_version >= micro))) + { + return 0; + } + else + { + printf("\n*** An old version of GIMP (%d.%d.%d) was found.\n", + gimp_major_version, gimp_minor_version, gimp_micro_version); + printf("*** You need a version of GIMP newer than %d.%d.%d. The latest version of\n", + major, minor, micro); + printf("*** GIMP is always available from ftp://ftp.gimp.org.\n"); + printf("***\n"); + printf("*** If you have already installed a sufficiently new version, this error\n"); + printf("*** probably means that the wrong copy of the gimp-config shell script is\n"); + printf("*** being found. The easiest way to fix this is to remove the old version\n"); + printf("*** of GIMP, but you can also set the GIMP_CONFIG environment to point to the\n"); + printf("*** correct copy of gimp-config. (In this case, you will have to\n"); + printf("*** modify your LD_LIBRARY_PATH enviroment variable, or edit /etc/ld.so.conf\n"); + printf("*** so that the correct libraries are found at run-time))\n"); + } + } + return 1; +} +], , no_gimp=yes,[echo $ac_n "cross compiling; assumed OK... $ac_c"]) + fi + fi + + if test "x$no_gimp" = x ; then + dnl *** gimp test succeeded or not tested *** + if test "$enable_gimptest" = "yes" ; then + AC_MSG_RESULT(yes) + else + AC_MSG_RESULT(not tested) + fi + if test "$GIMP_CONFIG" != "no" ; then + ac_save_CPPFLAGS="$CPPFLAGS" + CPPFLAGS="${CPPFLAGS} ${GIMP_CFLAGS}" + AC_CHECK_HEADERS(libgimp/gimp.h) + AC_CHECK_HEADERS(libgimp/gimpfeatures.h) + CPPFLAGS="$ac_save_CPPFLAGS" + fi + CFLAGS="$ac_save_CFLAGS" + LIBS="$ac_save_LIBS" + ifelse([$2], , :, [$2]) + else + AC_MSG_RESULT(no) + if test -f conf.gimptest ; then + : + else + echo "" + echo "*** Could not run GIMP test program, checking why..." + CFLAGS="$CFLAGS $GIMP_CFLAGS" + LIBS="$LIBS $GIMP_LIBS" + AC_TRY_LINK([ +#include <libgimp/gimp.h> +#include <stdio.h> +#define GIMP_TEST_CHECK_VERSION(major, minor, micro) \ + ($gimp_config_major_version > (major) || \ + ($gimp_config_major_version == (major) && $gimp_config_minor_version > (minor)) || \ + ($gimp_config_major_version == (major) && $gimp_config_minor_version == (minor) && \ + $gimp_config_micro_version >= (micro))) + +#if !GIMP_TEST_CHECK_VERSION(1,1,25) +# define GimpPlugInInfo GPlugInInfo /* do test with gimp interface version 1.0 */ +#endif +GimpPlugInInfo PLUG_IN_INFO = { NULL, NULL, NULL, NULL }; +], [ return ((gimp_major_version) || (gimp_minor_version) || (gimp_micro_version)); ], + [ 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 "***" + echo "***" ]) + CFLAGS="$ac_save_CFLAGS" + LIBS="$ac_save_LIBS" + fi + + dnl *** ok, gimp does not work, so we have to use the gtk_* things again *** + GIMP_CFLAGS="" + GIMP_LIBS="" + GTK_CFLAGS="$ac_save_GTK_CFLAGS" + GTK_LIBS="$ac_save_GTK_LIBS" + CFLAGS="${CFLAGS} ${GTK_CFLAGS}" + LIBS="${LIBS} ${GTK_LIBS}" + ifelse([$3], , :, [$3]) + fi + AC_SUBST(GIMP_CFLAGS) + AC_SUBST(GIMP_LIBS) + rm -f conf.gimptest +]) + diff --git a/m4/gtk-2.0.m4 b/m4/gtk-2.0.m4 new file mode 100644 index 0000000..a0c53ac --- /dev/null +++ b/m4/gtk-2.0.m4 @@ -0,0 +1,196 @@ +# Configure paths for GTK+ +# Owen Taylor 1997-2001 + +dnl AM_PATH_GTK_2_0([MINIMUM-VERSION, [ACTION-IF-FOUND [, ACTION-IF-NOT-FOUND [, MODULES]]]]) +dnl Test for GTK+, and define GTK_CFLAGS and GTK_LIBS, if gthread is specified in MODULES, +dnl pass to pkg-config +dnl +AC_DEFUN(AM_PATH_GTK_2_0, +[dnl +dnl Get the cflags and libraries from pkg-config +dnl +AC_ARG_ENABLE(gtktest, [ --disable-gtktest do not try to compile and run a test GTK+ program], + , enable_gtktest=yes) + + pkg_config_args=gtk+-2.0 + for module in . $4 + do + case "$module" in + gthread) + pkg_config_args="$pkg_config_args gthread-2.0" + ;; + esac + done + + no_gtk="" + + 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_gtk=yes + PKG_CONFIG=no + fi + else + no_gtk=yes + fi + + min_gtk_version=ifelse([$1], ,2.0.0,$1) + AC_MSG_CHECKING(for GTK+ - version >= $min_gtk_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 GTK+ found in PKG_CONFIG_PATH" + enable_gtktest=no + fi + + if $PKG_CONFIG --atleast-version $min_gtk_version $pkg_config_args; then + : + else + no_gtk=yes + fi + fi + + if test x"$no_gtk" = x ; then + GTK_CFLAGS=`$PKG_CONFIG $pkg_config_args --cflags` + GTK_LIBS=`$PKG_CONFIG $pkg_config_args --libs` + gtk_config_major_version=`$PKG_CONFIG --modversion gtk+-2.0 | \ + sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\1/'` + gtk_config_minor_version=`$PKG_CONFIG --modversion gtk+-2.0 | \ + sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\2/'` + gtk_config_micro_version=`$PKG_CONFIG --modversion gtk+-2.0 | \ + sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\3/'` + if test "x$enable_gtktest" = "xyes" ; then + ac_save_CFLAGS="$CFLAGS" + ac_save_LIBS="$LIBS" + CFLAGS="$CFLAGS $GTK_CFLAGS" + LIBS="$GTK_LIBS $LIBS" +dnl +dnl Now check if the installed GTK+ is sufficiently new. (Also sanity +dnl checks the results of pkg-config to some extent) +dnl + rm -f conf.gtktest + AC_TRY_RUN([ +#include <gtk/gtk.h> +#include <stdio.h> +#include <stdlib.h> + +int +main () +{ + int major, minor, micro; + char *tmp_version; + + system ("touch conf.gtktest"); + + /* HP/UX 9 (%@#!) writes to sscanf strings */ + tmp_version = g_strdup("$min_gtk_version"); + if (sscanf(tmp_version, "%d.%d.%d", &major, &minor, µ) != 3) { + printf("%s, bad version string\n", "$min_gtk_version"); + exit(1); + } + + if ((gtk_major_version != $gtk_config_major_version) || + (gtk_minor_version != $gtk_config_minor_version) || + (gtk_micro_version != $gtk_config_micro_version)) + { + printf("\n*** 'pkg-config --modversion gtk+-2.0' returned %d.%d.%d, but GTK+ (%d.%d.%d)\n", + $gtk_config_major_version, $gtk_config_minor_version, $gtk_config_micro_version, + gtk_major_version, gtk_minor_version, gtk_micro_version); + printf ("*** was found! If pkg-config was correct, then it is best\n"); + printf ("*** to remove the old version of GTK+. You may also be able to fix the error\n"); + printf("*** by modifying your LD_LIBRARY_PATH enviroment variable, or by editing\n"); + printf("*** /etc/ld.so.conf. Make sure you have run ldconfig if that is\n"); + printf("*** required on your system.\n"); + printf("*** If pkg-config was wrong, set the environment variable PKG_CONFIG_PATH\n"); + printf("*** to point to the correct configuration files\n"); + } + else if ((gtk_major_version != GTK_MAJOR_VERSION) || + (gtk_minor_version != GTK_MINOR_VERSION) || + (gtk_micro_version != GTK_MICRO_VERSION)) + { + printf("*** GTK+ header files (version %d.%d.%d) do not match\n", + GTK_MAJOR_VERSION, GTK_MINOR_VERSION, GTK_MICRO_VERSION); + printf("*** library (version %d.%d.%d)\n", + gtk_major_version, gtk_minor_version, gtk_micro_version); + } + else + { + if ((gtk_major_version > major) || + ((gtk_major_version == major) && (gtk_minor_version > minor)) || + ((gtk_major_version == major) && (gtk_minor_version == minor) && (gtk_micro_version >= micro))) + { + return 0; + } + else + { + printf("\n*** An old version of GTK+ (%d.%d.%d) was found.\n", + gtk_major_version, gtk_minor_version, gtk_micro_version); + printf("*** You need a version of GTK+ newer than %d.%d.%d. The latest version of\n", + major, minor, micro); + printf("*** GTK+ is always available from ftp://ftp.gtk.org.\n"); + printf("***\n"); + printf("*** If you have already installed a sufficiently new version, this error\n"); + printf("*** probably means that the wrong copy of the pkg-config shell script is\n"); + printf("*** being found. The easiest way to fix this is to remove the old version\n"); + printf("*** of GTK+, but you can also set the PKG_CONFIG environment to point to the\n"); + printf("*** correct copy of pkg-config. (In this case, you will have to\n"); + printf("*** modify your LD_LIBRARY_PATH enviroment variable, or edit /etc/ld.so.conf\n"); + printf("*** so that the correct libraries are found at run-time))\n"); + } + } + return 1; +} +],, no_gtk=yes,[echo $ac_n "cross compiling; assumed OK... $ac_c"]) + CFLAGS="$ac_save_CFLAGS" + LIBS="$ac_save_LIBS" + fi + fi + if test "x$no_gtk" = x ; then + AC_MSG_RESULT(yes (version $gtk_config_major_version.$gtk_config_minor_version.$gtk_config_micro_version)) + ifelse([$2], , :, [$2]) + else + AC_MSG_RESULT(no) + if test "$PKG_CONFIG" = "no" ; then + echo "*** A new enough version of pkg-config was not found." + echo "*** See http://pkgconfig.sourceforge.net" + else + if test -f conf.gtktest ; then + : + else + echo "*** Could not run GTK+ test program, checking why..." + ac_save_CFLAGS="$CFLAGS" + ac_save_LIBS="$LIBS" + CFLAGS="$CFLAGS $GTK_CFLAGS" + LIBS="$LIBS $GTK_LIBS" + AC_TRY_LINK([ +#include <gtk/gtk.h> +#include <stdio.h> +], [ return ((gtk_major_version) || (gtk_minor_version) || (gtk_micro_version)); ], + [ echo "*** The test program compiled, but did not run. This usually means" + echo "*** that the run-time linker is not finding GTK+ or finding the wrong" + echo "*** version of GTK+. If it is not finding GTK+, 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 GTK+ is incorrectly installed."]) + CFLAGS="$ac_save_CFLAGS" + LIBS="$ac_save_LIBS" + fi + fi + GTK_CFLAGS="" + GTK_LIBS="" + ifelse([$3], , :, [$3]) + fi + AC_SUBST(GTK_CFLAGS) + AC_SUBST(GTK_LIBS) + rm -f conf.gtktest +]) diff --git a/m4/gtk.m4 b/m4/gtk.m4 new file mode 100644 index 0000000..d01e03a --- /dev/null +++ b/m4/gtk.m4 @@ -0,0 +1,194 @@ +# Configure paths for GTK+ +# Owen Taylor 97-11-3 + +dnl AM_PATH_GTK([MINIMUM-VERSION, [ACTION-IF-FOUND [, ACTION-IF-NOT-FOUND [, MODULES]]]]) +dnl Test for GTK, and define GTK_CFLAGS and GTK_LIBS +dnl +AC_DEFUN(AM_PATH_GTK, +[dnl +dnl Get the cflags and libraries from the gtk-config script +dnl +AC_ARG_WITH(gtk-prefix,[ --with-gtk-prefix=PFX Prefix where GTK is installed (optional)], + gtk_config_prefix="$withval", gtk_config_prefix="") +AC_ARG_WITH(gtk-exec-prefix,[ --with-gtk-exec-prefix=PFX Exec prefix where GTK is installed (optional)], + gtk_config_exec_prefix="$withval", gtk_config_exec_prefix="") +AC_ARG_ENABLE(gtktest, [ --disable-gtktest do not try to compile and run a test GTK+ program], + , enable_gtktest=yes) + + for module in . $4 + do + case "$module" in + gthread) + gtk_config_args="$gtk_config_args gthread" + ;; + esac + done + + if test x$gtk_config_exec_prefix != x ; then + gtk_config_args="$gtk_config_args --exec-prefix=$gtk_config_exec_prefix" + if test x${GTK_CONFIG+set} != xset ; then + GTK_CONFIG=$gtk_config_exec_prefix/bin/gtk-config + fi + fi + if test x$gtk_config_prefix != x ; then + gtk_config_args="$gtk_config_args --prefix=$gtk_config_prefix" + if test x${GTK_CONFIG+set} != xset ; then + GTK_CONFIG=$gtk_config_prefix/bin/gtk-config + fi + fi + + AC_PATH_PROG(GTK_CONFIG, gtk-config, no) + min_gtk_version=ifelse([$1], ,0.99.7,$1) + AC_MSG_CHECKING(for GTK - version >= $min_gtk_version) + no_gtk="" + if test "$GTK_CONFIG" = "no" ; then + no_gtk=yes + else + GTK_CFLAGS=`$GTK_CONFIG $gtk_config_args --cflags` + GTK_LIBS=`$GTK_CONFIG $gtk_config_args --libs` + gtk_config_major_version=`$GTK_CONFIG $gtk_config_args --version | \ + sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\1/'` + gtk_config_minor_version=`$GTK_CONFIG $gtk_config_args --version | \ + sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\2/'` + gtk_config_micro_version=`$GTK_CONFIG $gtk_config_args --version | \ + sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\3/'` + if test "x$enable_gtktest" = "xyes" ; then + ac_save_CFLAGS="$CFLAGS" + ac_save_LIBS="$LIBS" + CFLAGS="$CFLAGS $GTK_CFLAGS" + LIBS="$GTK_LIBS $LIBS" +dnl +dnl Now check if the installed GTK is sufficiently new. (Also sanity +dnl checks the results of gtk-config to some extent +dnl + rm -f conf.gtktest + AC_TRY_RUN([ +#include <gtk/gtk.h> +#include <stdio.h> +#include <stdlib.h> + +int +main () +{ + int major, minor, micro; + char *tmp_version; + + system ("touch conf.gtktest"); + + /* HP/UX 9 (%@#!) writes to sscanf strings */ + tmp_version = g_strdup("$min_gtk_version"); + if (sscanf(tmp_version, "%d.%d.%d", &major, &minor, µ) != 3) { + printf("%s, bad version string\n", "$min_gtk_version"); + exit(1); + } + + if ((gtk_major_version != $gtk_config_major_version) || + (gtk_minor_version != $gtk_config_minor_version) || + (gtk_micro_version != $gtk_config_micro_version)) + { + printf("\n*** 'gtk-config --version' returned %d.%d.%d, but GTK+ (%d.%d.%d)\n", + $gtk_config_major_version, $gtk_config_minor_version, $gtk_config_micro_version, + gtk_major_version, gtk_minor_version, gtk_micro_version); + printf ("*** was found! If gtk-config was correct, then it is best\n"); + printf ("*** to remove the old version of GTK+. You may also be able to fix the error\n"); + printf("*** by modifying your LD_LIBRARY_PATH enviroment variable, or by editing\n"); + printf("*** /etc/ld.so.conf. Make sure you have run ldconfig if that is\n"); + printf("*** required on your system.\n"); + printf("*** If gtk-config was wrong, set the environment variable GTK_CONFIG\n"); + printf("*** to point to the correct copy of gtk-config, and remove the file config.cache\n"); + printf("*** before re-running configure\n"); + } +#if defined (GTK_MAJOR_VERSION) && defined (GTK_MINOR_VERSION) && defined (GTK_MICRO_VERSION) + else if ((gtk_major_version != GTK_MAJOR_VERSION) || + (gtk_minor_version != GTK_MINOR_VERSION) || + (gtk_micro_version != GTK_MICRO_VERSION)) + { + printf("*** GTK+ header files (version %d.%d.%d) do not match\n", + GTK_MAJOR_VERSION, GTK_MINOR_VERSION, GTK_MICRO_VERSION); + printf("*** library (version %d.%d.%d)\n", + gtk_major_version, gtk_minor_version, gtk_micro_version); + } +#endif /* defined (GTK_MAJOR_VERSION) ... */ + else + { + if ((gtk_major_version > major) || + ((gtk_major_version == major) && (gtk_minor_version > minor)) || + ((gtk_major_version == major) && (gtk_minor_version == minor) && (gtk_micro_version >= micro))) + { + return 0; + } + else + { + printf("\n*** An old version of GTK+ (%d.%d.%d) was found.\n", + gtk_major_version, gtk_minor_version, gtk_micro_version); + printf("*** You need a version of GTK+ newer than %d.%d.%d. The latest version of\n", + major, minor, micro); + printf("*** GTK+ is always available from ftp://ftp.gtk.org.\n"); + printf("***\n"); + printf("*** If you have already installed a sufficiently new version, this error\n"); + printf("*** probably means that the wrong copy of the gtk-config shell script is\n"); + printf("*** being found. The easiest way to fix this is to remove the old version\n"); + printf("*** of GTK+, but you can also set the GTK_CONFIG environment to point to the\n"); + printf("*** correct copy of gtk-config. (In this case, you will have to\n"); + printf("*** modify your LD_LIBRARY_PATH enviroment variable, or edit /etc/ld.so.conf\n"); + printf("*** so that the correct libraries are found at run-time))\n"); + } + } + return 1; +} +],, no_gtk=yes,[echo $ac_n "cross compiling; assumed OK... $ac_c"]) + CFLAGS="$ac_save_CFLAGS" + LIBS="$ac_save_LIBS" + fi + fi + if test "x$no_gtk" = x ; then + AC_MSG_RESULT(yes) + ifelse([$2], , :, [$2]) + else + AC_MSG_RESULT(no) + if test "$GTK_CONFIG" = "no" ; then + echo "*** The gtk-config script installed by GTK could not be found" + echo "*** If GTK was installed in PREFIX, make sure PREFIX/bin is in" + echo "*** your path, or set the GTK_CONFIG environment variable to the" + echo "*** full path to gtk-config." + else + if test -f conf.gtktest ; then + : + else + echo "*** Could not run GTK test program, checking why..." + CFLAGS="$CFLAGS $GTK_CFLAGS" + LIBS="$LIBS $GTK_LIBS" + AC_TRY_LINK([ +#include <gtk/gtk.h> +#include <stdio.h> +], [ return ((gtk_major_version) || (gtk_minor_version) || (gtk_micro_version)); ], + [ echo "*** The test program compiled, but did not run. This usually means" + echo "*** that the run-time linker is not finding GTK or finding the wrong" + echo "*** version of GTK. If it is not finding GTK, 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 "***" + echo "*** If you have a RedHat 5.0 system, you should remove the GTK package that" + echo "*** came with the system with the command" + echo "***" + echo "*** rpm --erase --nodeps gtk gtk-devel" ], + [ echo "*** The test program failed to compile or link. See the file config.log for the" + echo "*** exact error that occured. This usually means GTK was incorrectly installed" + echo "*** or that you have moved GTK since it was installed. In the latter case, you" + echo "*** may want to edit the gtk-config script: $GTK_CONFIG" ]) + CFLAGS="$ac_save_CFLAGS" + LIBS="$ac_save_LIBS" + fi + fi + GTK_CFLAGS="" + GTK_LIBS="" + ifelse([$3], , :, [$3]) + fi + AC_SUBST(GTK_CFLAGS) + AC_SUBST(GTK_LIBS) + rm -f conf.gtktest +]) diff --git a/m4/msnative-struct.m4 b/m4/msnative-struct.m4 new file mode 100644 index 0000000..84d773e --- /dev/null +++ b/m4/msnative-struct.m4 @@ -0,0 +1,48 @@ +############################################################# +# when compiling on Win32 we have to add the option +# -fnative-struct for gcc2 or +# --mms-bitfields for gcc3 +# parts from glib configure.in + +dnl AC_GCC_MSNATIVE_STRUCT +dnl test if gcc supports option for MSnative struct +dnl +AC_DEFUN(AC_GCC_MSNATIVE_STRUCT, +[dnl +dnl Add ms native struct gcc option to CFLAGS if available +dnl +dnl if test x"$glib_native_win32" = xyes; then + AC_CHECK_HEADERS(windows.h, + [ + if test x"$GCC" = xyes; then + msnative_struct='' + AC_MSG_CHECKING([how to get MSVC-compatible struct packing]) + if test -z "$ac_cv_prog_CC"; then + our_gcc="$CC" + else + our_gcc="$ac_cv_prog_CC" + fi + case `$our_gcc --version | sed -e 's,\..*,.,' -e q` in + 2.) + if $our_gcc -v --help 2>/dev/null | grep fnative-struct >/dev/null; then + msnative_struct='-fnative-struct' + fi + ;; + *) + if $our_gcc -v --help 2>/dev/null | grep ms-bitfields >/dev/null; then + msnative_struct='-mms-bitfields' + fi + ;; + esac + if test x"$msnative_struct" = x ; then + AC_MSG_RESULT([no way]) + AC_MSG_WARN([produced libraries might be incompatible with MSVC-compiled code]) + else + CFLAGS="$CFLAGS $msnative_struct" + AC_MSG_RESULT([${msnative_struct}]) + fi + fi +dnl fi + ]) +]) + diff --git a/m4/old/aclocal.m4-0.92 b/m4/old/aclocal.m4-0.92 new file mode 100644 index 0000000..d9d0216 --- /dev/null +++ b/m4/old/aclocal.m4-0.92 @@ -0,0 +1,1086 @@ +###################################################################### +# Configure paths for GTK+2 +# Oliver Rauch 2002-06-17 + +dnl AM_PATH_GTK2([MINIMUM-VERSION, [ACTION-IF-FOUND [, ACTION-IF-NOT-FOUND]]]) +dnl Test for GTK+-2.0.x, and define GTK_CFLAGS and GTK_LIBS +dnl +AC_DEFUN(AM_PATH_GTK2, +[ + AC_ARG_ENABLE(gtk2, [ --disable-gtk2 Do not use gtk+-2.0.x], USE_GTK2=$enableval, USE_GTK2=yes) + + if test $USE_GTK2 != no ; then + min_gtk_version=ifelse([$1], ,2.0.0,$1) + if `pkg-config --atleast-pkgconfig-version=0` ; then + AC_MSG_CHECKING(for GTK - version >= $min_gtk_version) + if `pkg-config gtk+-2.0 --atleast-version=$min_gtk_version` ; then + GTK_CFLAGS=`pkg-config gtk+-2.0 --cflags` + GTK_LIBS=`pkg-config gtk+-2.0 --libs` + AC_MSG_RESULT(yes) + ifelse([$2], , :, [$2]) + else + AC_MSG_RESULT(no) + ifelse([$3], , :, [$3]) + fi + else + AC_MSG_WARN(***************************************************************) + AC_MSG_WARN(*** pgk-config is not avilable: test for gtk2 not possible ****) + AC_MSG_WARN(***************************************************************) + ifelse([$3], , :, [$3]) + fi + else + ifelse([$3], , :, [$3]) + fi + + + AC_SUBST(GTK_CFLAGS) + AC_SUBST(GTK_LIBS) +] +) + +# Configure paths for GTK+ +# Owen Taylor 97-11-3 +dnl AM_PATH_GTK([MINIMUM-VERSION, [ACTION-IF-FOUND [, ACTION-IF-NOT-FOUND]]]) +dnl Test for GTK, and define GTK_CFLAGS and GTK_LIBS +dnl +AC_DEFUN(AM_PATH_GTK, +[dnl +dnl Get the cflags and libraries from the gtk-config script +dnl + AC_ARG_WITH(gtk-prefix,[ --with-gtk-prefix=PFX Prefix where GTK is installed (optional)], + gtk_config_prefix="$withval", gtk_config_prefix="") + AC_ARG_WITH(gtk-exec-prefix,[ --with-gtk-exec-prefix=PFX Exec prefix where GTK is installed (optional)], + gtk_config_exec_prefix="$withval", gtk_config_exec_prefix="") + AC_ARG_ENABLE(gtktest, [ --disable-gtktest Do not try to compile and run a test GTK program], , enable_gtktest=yes) + + if test x$gtk_config_exec_prefix != x ; then + gtk_config_args="$gtk_config_args --exec-prefix=$gtk_config_exec_prefix" + if test x${GTK_CONFIG+set} != xset ; then + GTK_CONFIG=$gtk_config_exec_prefix/bin/gtk-config + fi + fi + if test x$gtk_config_prefix != x ; then + gtk_config_args="$gtk_config_args --prefix=$gtk_config_prefix" + if test x${GTK_CONFIG+set} != xset ; then + GTK_CONFIG=$gtk_config_prefix/bin/gtk-config + fi + fi + + AC_PATH_PROG(GTK_CONFIG, gtk-config, no) + min_gtk_version=ifelse([$1], ,0.99.7,$1) + AC_MSG_CHECKING(for GTK - version >= $min_gtk_version) + no_gtk="" + if test "$GTK_CONFIG" = "no" ; then + no_gtk=yes + else + GTK_CFLAGS=`$GTK_CONFIG $gtk_config_args --cflags` + GTK_LIBS=`$GTK_CONFIG $gtk_config_args --libs` + gtk_config_major_version=`$GTK_CONFIG $gtk_config_args --version | \ + sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\1/'` + gtk_config_minor_version=`$GTK_CONFIG $gtk_config_args --version | \ + sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\2/'` + gtk_config_micro_version=`$GTK_CONFIG $gtk_config_args --version | \ + sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\3/'` + if test "x$enable_gtktest" = "xyes" ; then + ac_save_CFLAGS="$CFLAGS" + ac_save_LIBS="$LIBS" + CFLAGS="$CFLAGS $GTK_CFLAGS" + LIBS="$LIBS $GTK_LIBS" +dnl +dnl Now check if the installed GTK is sufficiently new. (Also sanity +dnl checks the results of gtk-config to some extent) +dnl + rm -f conf.gtktest + AC_TRY_RUN([ +#include <gtk/gtk.h> +#include <stdio.h> + +int +main () +{ + int major, minor, micro; + + system ("touch conf.gtktest"); + + if (sscanf("$min_gtk_version", "%d.%d.%d", &major, &minor, µ) != 3) { + printf("%s, bad version string\n", "$min_gtk_version"); + exit(1); + } + + if ((gtk_major_version != $gtk_config_major_version) || + (gtk_minor_version != $gtk_config_minor_version) || + (gtk_micro_version != $gtk_config_micro_version)) + { + printf("\n*** 'gtk-config --version' returned %d.%d.%d, but GTK+ (%d.%d.%d)\n", + $gtk_config_major_version, $gtk_config_minor_version, $gtk_config_micro_version, + gtk_major_version, gtk_minor_version, gtk_micro_version); + printf ("*** was found! If gtk-config was correct, then it is best\n"); + printf ("*** to remove the old version of GTK+. You may also be able to fix the error\n"); + printf("*** by modifying your LD_LIBRARY_PATH enviroment variable, or by editing\n"); + printf("*** /etc/ld.so.conf. Make sure you have run ldconfig if that is\n"); + printf("*** required on your system.\n"); + printf("*** If gtk-config was wrong, set the environment variable GTK_CONFIG\n"); + printf("*** to point to the correct copy of gtk-config, and remove the file config.cache\n"); + printf("*** before re-running configure\n"); + } + else + { + if ((gtk_major_version > major) || + ((gtk_major_version == major) && (gtk_minor_version > minor)) || + ((gtk_major_version == major) && (gtk_minor_version == minor) && (gtk_micro_version >= micro))) + { + return 0; + } + else + { + printf("\n*** An old version of GTK+ (%d.%d.%d) was found.\n", + gtk_major_version, gtk_minor_version, gtk_micro_version); + printf("*** You need a version of GTK+ newer than %d.%d.%d. The latest version of\n", + major, minor, micro); + printf("*** GTK+ is always available from ftp://ftp.gtk.org.\n"); + printf("***\n"); + printf("*** If you have already installed a sufficiently new version, this error\n"); + printf("*** probably means that the wrong copy of the gtk-config shell script is\n"); + printf("*** being found. The easiest way to fix this is to remove the old version\n"); + printf("*** of GTK+, but you can also set the GTK_CONFIG environment to point to the\n"); + printf("*** correct copy of gtk-config. (In this case, you will have to\n"); + printf("*** modify your LD_LIBRARY_PATH enviroment variable, or edit /etc/ld.so.conf\n"); + printf("*** so that the correct libraries are found at run-time))\n"); + } + } + return 1; +} +],, no_gtk=yes,[echo $ac_n "cross compiling; assumed OK... $ac_c"]) + CFLAGS="$ac_save_CFLAGS" + LIBS="$ac_save_LIBS" + fi + fi + if test "x$no_gtk" = x ; then + AC_MSG_RESULT(yes) + ifelse([$2], , :, [$2]) + else + AC_MSG_RESULT(no) + if test "$GTK_CONFIG" = "no" ; then + echo "*** The gtk-config script installed by GTK could not be found" + echo "*** If GTK was installed in PREFIX, make sure PREFIX/bin is in" + echo "*** your path, or set the GTK_CONFIG environment variable to the" + echo "*** full path to gtk-config." + else + if test -f conf.gtktest ; then + : + else + echo "*** Could not run GTK test program, checking why..." + CFLAGS="$CFLAGS $GTK_CFLAGS" + LIBS="$LIBS $GTK_LIBS" + AC_TRY_LINK([ +#include <gtk/gtk.h> +#include <stdio.h> +], [ return ((gtk_major_version) || (gtk_minor_version) || (gtk_micro_version)); ], + [ echo "*** The test program compiled, but did not run. This usually means" + echo "*** that the run-time linker is not finding GTK or finding the wrong" + echo "*** version of GTK. If it is not finding GTK, 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 "***" + echo "*** If you have a RedHat 5.0 system, you should remove the GTK package that" + echo "*** came with the system with the command" + echo "***" + echo "*** rpm --erase --nodeps gtk gtk-devel" ], + [ echo "*** The test program failed to compile or link. See the file config.log for the" + echo "*** exact error that occured. This usually means GTK was incorrectly installed" + echo "*** or that you have moved GTK since it was installed. In the latter case, you" + echo "*** may want to edit the gtk-config script: $GTK_CONFIG" ]) + CFLAGS="$ac_save_CFLAGS" + LIBS="$ac_save_LIBS" + fi + fi + GTK_CFLAGS="" + GTK_LIBS="" + ifelse([$3], , :, [$3]) + fi + AC_SUBST(GTK_CFLAGS) + AC_SUBST(GTK_LIBS) + rm -f conf.gtktest +]) + + +###################################################################### +# Configure paths for The GIMP +# Oliver Rauch 2000-12-28 + +dnl AM_PATH_GIMP([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, +[dnl +dnl Get the cflags and libraries from the gimp-config script +dnl + AC_ARG_WITH(gimp-prefix,[ --with-gimp-prefix=PFX Prefix where GIMP is installed (optional)], + gimp_config_prefix="$withval", gimp_config_prefix="") + AC_ARG_WITH(gimp-exec-prefix,[ --with-gimp-exec-prefix=PFX Exec prefix where GIMP is installed (optional)], + gimp_config_exec_prefix="$withval", gimp_config_exec_prefix="") + AC_ARG_ENABLE(gimptest, [ --disable-gimptest Do not try to compile and run a test GIMP program], , enable_gimptest=yes) + + ac_save_CFLAGS="$CFLAGS" + ac_save_LIBS="$LIBS" + ac_save_GTK_CFLAGS="$GTK_CFLAGS" + ac_save_GTK_LIBS="$GTK_LIBS" + + if test x$gimp_config_exec_prefix != x ; then + gimp_config_args="$gimp_config_args --exec-prefix=$gimp_config_exec_prefix" + if test x${GIMP_CONFIG+set} != xset ; then + GIMP_CONFIG=$gimp_config_exec_prefix/bin/gimp-config + fi + fi + + if test x$gimp_config_prefix != x ; then + gimp_config_args="$gimp_config_args --prefix=$gimp_config_prefix" + if test x${GIMP_CONFIG+set} != xset ; then + GIMP_CONFIG=$gimp_config_prefix/bin/gimp-config + fi + fi + + AC_PATH_PROG(GIMP_CONFIG, gimp-config, no) + if test "$GIMP_CONFIG" = "no" ; then + if test x$gimp_config_exec_prefix != x ; then + gimp_config_args="$gimp_config_args --exec-prefix=$gimp_config_exec_prefix" + if test x${GIMP_TOOL+set} != xset ; then + GIMP_TOOL=$gimp_config_exec_prefix/bin/gimptool + fi + fi + if test x$gimp_config_prefix != x ; then + gimp_config_args="$gimp_config_args --prefix=$gimp_config_prefix" + if test x${GIMP_TOOL+set} != xset ; then + GIMP_TOOL=$gimp_config_prefix/bin/gimptool + fi + fi + AC_PATH_PROG(GIMP_TOOL, gimptool, no) + GIMP_CONFIG=$GIMP_TOOL + fi + + min_gimp_version=ifelse([$1], ,1.0.0,$1) + no_gimp="" + + if test "$GIMP_CONFIG" = "no" ; then +dnl we do not have gimp-config (gimp-1.0.x does not have gimp-config) +dnl so we have to use the GTK_* things for testing for gimp.h and gimpfeatures.h + ac_save_CPPFLAGS="$CPPFLAGS" + CPPFLAGS="${CPPFLAGS} ${GTK_CFLAGS}" + AC_CHECK_HEADERS(libgimp/gimp.h, GIMP_LIBS="-lgimp", no_gimp=yes) + AC_CHECK_HEADERS(libgimp/gimpfeatures.h) + CPPFLAGS="$ac_save_CPPFLAGS" + CFLAGS="${CFLAGS} ${GTK_CFLAGS}" + LIBS="${LIBS} ${GTK_LIBS} ${GIMP_LIBS}" + if test "x$no_gimp" = x ; then + AC_MSG_CHECKING(GIMP compilation) + gimp_config_major_version=-1 + gimp_config_minor_version=0 + gimp_config_micro_version=0 + fi + else +dnl Ok, we have gimp-config and so we do not need the GTK_* things because they are +dnl included in the output of gimp-config + GTK_CFLAGS="" + GTK_LIBS="" + GIMP_CFLAGS=`$GIMP_CONFIG $gimp_config_args --cflags` + GIMP_LIBS=`$GIMP_CONFIG $gimp_config_args --libs`" -lgimp" + gimp_config_major_version=`$GIMP_CONFIG $gimp_config_args --version | \ + sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\1/'` + gimp_config_minor_version=`$GIMP_CONFIG $gimp_config_args --version | \ + sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\2/'` + gimp_config_micro_version=`$GIMP_CONFIG $gimp_config_args --version | \ + sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\3/'` + CFLAGS="${CFLAGS} ${GIMP_CFLAGS}" + LIBS="${LIBS} ${GIMP_LIBS}" + AC_MSG_CHECKING(for GIMP - version >= $min_gimp_version) + fi + +dnl +dnl Now check if the installed GIMP is sufficiently new. (Also sanity +dnl checks the results of gimp-config to some extent +dnl + if test "x$no_gimp" = x ; then + if test "x$enable_gimptest" = "xyes" ; then + rm -f conf.gimptest + AC_TRY_RUN([ +#include <libgimp/gimp.h> +#include <stdio.h> + +#define GIMP_TEST_CHECK_VERSION(major, minor, micro) \ + ($gimp_config_major_version > (major) || \ + ($gimp_config_major_version == (major) && $gimp_config_minor_version > (minor)) || \ + ($gimp_config_major_version == (major) && $gimp_config_minor_version == (minor) && \ + $gimp_config_micro_version >= (micro))) + +#if !GIMP_TEST_CHECK_VERSION(1,1,25) +# define GimpPlugInInfo GPlugInInfo /* do test with gimp interface version 1.0 */ +#endif + +GimpPlugInInfo PLUG_IN_INFO = +{ + NULL, NULL, NULL, NULL +}; + + +int +main () +{ + int major, minor, micro; + + system ("touch conf.gimptest"); + + if (sscanf("$min_gimp_version", "%d.%d.%d", &major, &minor, µ) != 3) { + printf("%s, bad version string\n", "$min_gimp_version"); + exit(1); + } + + if ( ($gimp_config_major_version != -1) && + ((gimp_major_version != $gimp_config_major_version) || + (gimp_minor_version != $gimp_config_minor_version) || + (gimp_micro_version != $gimp_config_micro_version)) ) + { + printf("\n*** 'gimp-config --version' returned %d.%d.%d, but GIMP (%d.%d.%d)\n", + $gimp_config_major_version, $gimp_config_minor_version, $gimp_config_micro_version, + gimp_major_version, gimp_minor_version, gimp_micro_version); + printf ("*** was found! If gimp-config was correct, then it is best\n"); + printf ("*** to remove the old version of GIMP. You may also be able to fix the error\n"); + printf("*** by modifying your LD_LIBRARY_PATH enviroment variable, or by editing\n"); + printf("*** /etc/ld.so.conf. Make sure you have run ldconfig if that is\n"); + printf("*** required on your system.\n"); + printf("*** If gimp-config was wrong, set the environment variable GIMP_CONFIG\n"); + printf("*** to point to the correct copy of gimp-config, and remove the file config.cache\n"); + printf("*** before re-running configure\n"); + } + else + { + if ((gimp_major_version > major) || + ((gimp_major_version == major) && (gimp_minor_version > minor)) || + ((gimp_major_version == major) && (gimp_minor_version == minor) && (gimp_micro_version >= micro))) + { + return 0; + } + else + { + printf("\n*** An old version of GIMP (%d.%d.%d) was found.\n", + gimp_major_version, gimp_minor_version, gimp_micro_version); + printf("*** You need a version of GIMP newer than %d.%d.%d. The latest version of\n", + major, minor, micro); + printf("*** GIMP is always available from ftp://ftp.gimp.org.\n"); + printf("***\n"); + printf("*** If you have already installed a sufficiently new version, this error\n"); + printf("*** probably means that the wrong copy of the gimp-config shell script is\n"); + printf("*** being found. The easiest way to fix this is to remove the old version\n"); + printf("*** of GIMP, but you can also set the GIMP_CONFIG environment to point to the\n"); + printf("*** correct copy of gimp-config. (In this case, you will have to\n"); + printf("*** modify your LD_LIBRARY_PATH enviroment variable, or edit /etc/ld.so.conf\n"); + printf("*** so that the correct libraries are found at run-time))\n"); + } + } + return 1; +} +], , no_gimp=yes,[echo $ac_n "cross compiling; assumed OK... $ac_c"]) + fi + fi + + if test "x$no_gimp" = x ; then +dnl gimp test succeeded or not tested + if test "x$enable_gimptest" = "xyes" ; then + AC_MSG_RESULT(yes) + else + AC_MSG_RESULT(not tested) + fi + if test "$GIMP_CONFIG" != "no" ; then + ac_save_CPPFLAGS="$CPPFLAGS" + CPPFLAGS="${CPPFLAGS} ${GIMP_CFLAGS}" + AC_CHECK_HEADERS(libgimp/gimp.h) + AC_CHECK_HEADERS(libgimp/gimpfeatures.h) + CPPFLAGS="$ac_save_CPPFLAGS" + fi + CFLAGS="$ac_save_CFLAGS" + LIBS="$ac_save_LIBS" + ifelse([$2], , :, [$2]) + else + AC_MSG_RESULT(no) + 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 <libgimp/gimp.h> +#include <stdio.h> +#define GIMP_TEST_CHECK_VERSION(major, minor, micro) \ + ($gimp_config_major_version > (major) || \ + ($gimp_config_major_version == (major) && $gimp_config_minor_version > (minor)) || \ + ($gimp_config_major_version == (major) && $gimp_config_minor_version == (minor) && \ + $gimp_config_micro_version >= (micro))) + +#if !GIMP_TEST_CHECK_VERSION(1,1,25) +# define GimpPlugInInfo GPlugInInfo /* do test with gimp interface version 1.0 */ +#endif +GimpPlugInInfo PLUG_IN_INFO = { NULL, NULL, NULL, NULL }; +], [ return ((gimp_major_version) || (gimp_minor_version) || (gimp_micro_version)); ], + [ 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 "***" + echo "***" ]) + CFLAGS="$ac_save_CFLAGS" + LIBS="$ac_save_LIBS" + fi +dnl ok, gimp does not work, so we have to use the gtk_* things again + GIMP_CFLAGS="" + GIMP_LIBS="" + GTK_CFLAGS="$ac_save_GTK_CFLAGS" + GTK_LIBS="$ac_save_GTK_LIBS" + CFLAGS="${CFLAGS} ${GTK_CFLAGS}" + LIBS="${LIBS} ${GTK_LIBS} ${GIMP_LIBS}" + ifelse([$3], , :, [$3]) + fi + AC_SUBST(GIMP_CFLAGS) + AC_SUBST(GIMP_LIBS) + rm -f conf.gimptest +]) + + +# ******************************************************************** +# Configure paths for SANE +# Oliver Rauch 2000-10-30 + +dnl AM_PATH_SANE([MINIMUM-VERSION, [ACTION-IF-FOUND [, ACTION-IF-NOT-FOUND]]]) +dnl Test for SANE, and define SANE_CFLAGS and SANE_LIBS +dnl +AC_DEFUN(AM_PATH_SANE, +[dnl +dnl Get the cflags and libraries from the sane-config script +dnl + AC_ARG_ENABLE(sanetest, [ --disable-sanetest Do not try to compile and run a test SANE program], , enable_sanetest=yes) + + AC_PATH_PROG(SANE_CONFIG, sane-config, no) + min_sane_version=ifelse([$1], ,1.0.0,$1) + AC_MSG_CHECKING(for SANE - version >= $min_sane_version) + no_sane="" + if test "$SANE_CONFIG" = "no" ; then + no_sane=yes + else + SANE_CFLAGS=`$SANE_CONFIG $sane_config_args --cflags` + SANE_LDFLAGS=`$SANE_CONFIG $sane_config_args --ldflags` +# SANE_LIBS=`$SANE_CONFIG $sane_config_args --libs` + SANE_LIBS=`$SANE_CONFIG $sane_config_args --libs | sed -e 's/-lintl//g'` + SANE_PREFIX=`$SANE_CONFIG $sane_config_args --prefix` + sane_config_major_version=`$SANE_CONFIG $sane_config_args --version | \ + sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\1/'` + sane_config_minor_version=`$SANE_CONFIG $sane_config_args --version | \ + sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\2/'` + sane_config_micro_version=`$SANE_CONFIG $sane_config_args --version | \ + sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\3/'` + if test "x$enable_sanetest" = "xyes" ; then + ac_save_CFLAGS="$CFLAGS" + ac_save_LDFLAGS="$LDFLAGS" + ac_save_LIBS="$LIBS" + CFLAGS="$CFLAGS $SANE_CFLAGS" + LDFLAGS="$LDFLAGS $SANE_LDFLAGS" + LIBS="$LIBS $SANE_LIBS" +dnl +dnl Now check if the installed SANE is sufficiently new. (Also sanity +dnl checks the results of sane-config to some extent +dnl + rm -f conf.sanetest + AC_TRY_RUN([ +#include <sane/sane.h> +#include <stdio.h> + +int +main () +{ + int major, minor, micro; + + system ("touch conf.sanetest"); + + if (sscanf("$min_sane_version", "%d.%d.%d", &major, &minor, µ) != 3) { + printf("%s, bad version string\n", "$min_sane_version"); + exit(1); + } + + if ( ($sane_config_major_version == major) && + ( ($sane_config_minor_version > minor) || + ( ($sane_config_minor_version == minor) && ($sane_config_micro_version >= micro)))) + { + return 0; + } + else if ($sane_config_major_version > major) + { + printf("\n*** A too new version of SANE (%d.%d.%d) was found.\n", + $sane_config_major_version, $sane_config_minor_version, $sane_config_micro_version); + printf("*** You need a version of SANE with the major version number %d.\n", major); + } + else + { + printf("\n*** An old version of SANE (%d.%d.%d) was found.\n", + $sane_config_major_version, $sane_config_minor_version, $sane_config_micro_version); + printf("*** You need a version of SANE newer than %d.%d.%d. The latest version of\n", + major, minor, micro); + } + + printf("*** SANE is always available from ftp://ftp.mostang.com\n"); + printf("***\n"); + printf("*** If you have already installed a sufficient version, this error\n"); + printf("*** probably means that the wrong copy of the sane-config shell script is\n"); + printf("*** being found. The easiest way to fix this is to remove the old version\n"); + printf("*** of SANE, but you can also set the SANE_CONFIG environment to point to the\n"); + printf("*** correct copy of sane-config. (In this case, you will have to\n"); + printf("*** modify your LD_LIBRARY_PATH enviroment variable, or edit /etc/ld.so.conf\n"); + printf("*** so that the correct libraries are found at run-time))\n"); + + return 1; +} +],, no_sane=yes,[echo $ac_n "cross compiling; assumed OK... $ac_c"]) + CFLAGS="$ac_save_CFLAGS" + LDFLAGS="$ac_save_LDFLAGS" + LIBS="$ac_save_LIBS" + fi + fi + if test "x$no_sane" = x ; then + AC_MSG_RESULT(yes) + ifelse([$2], , :, [$2]) + else + AC_MSG_RESULT(no) + if test "$SANE_CONFIG" = "no" ; then + echo "*** The sane-config script installed by SANE could not be found" + echo "*** If SANE was installed in PREFIX, make sure PREFIX/bin is in" + echo "*** your path, or set the SANE_CONFIG environment variable to the" + echo "*** full path to sane-config." + else + if test -f conf.sanetest ; then + : + else + echo "*** Could not run SANE test program, checking why..." + CFLAGS="$CFLAGS $SANE_CFLAGS" + LIBS="$LIBS $SANE_LIBS" + LDFLAGS="$LDFLAGS $SANE_LDFLAGS" + AC_TRY_LINK([ +#include <sane/sane.h> +#include <stdio.h> +], [ return (SANE_CURRENT_MAJOR); ], + [ echo "*** The test program compiled, but did not run. This usually means" + echo "*** that the run-time linker is not finding SANE or finding the wrong" + echo "*** version of SANE. If it is not finding SANE, 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 "***" ] + [ echo "*** The test program failed to compile or link. See the file config.log for the" + echo "*** exact error that occured. This usually means SANE was incorrectly installed" + echo "*** or that you have moved SANE since it was installed. In the latter case, you" + echo "*** may want to edit the sane-config script: $SANE_CONFIG" ]) + CFLAGS="$ac_save_CFLAGS" + LDFLAGS="$ac_save_LDFLAGS" + LIBS="$ac_save_LIBS" + fi + fi + SANE_CFLAGS="" + SANE_LDFLAGS="" + SANE_LIBS="" + ifelse([$3], , :, [$3]) + fi + AC_SUBST(SANE_LDFLAGS) + AC_SUBST(SANE_CFLAGS) + AC_SUBST(SANE_LIBS) + AC_SUBST(SANE_PREFIX) + rm -f conf.sanetest +]) + +# ******************************************************************** + + +dnl AM_FUNC_ALLOCA +AC_DEFUN(AM_FUNC_ALLOCA, +[AC_REQUIRE([AC_FUNC_ALLOCA])dnl +test $ac_cv_func_alloca_works = no && LTALLOCA=alloca.lo +AC_SUBST(LTALLOCA)dnl +]) + +# @defmac AC_PROG_CC_STDC +# @maindex PROG_CC_STDC +# @ovindex CC +# If the C compiler in not in ANSI C mode by default, try to add an option +# to output variable @code{CC} to make it so. This macro tries various +# options that select ANSI C on some system or another. It considers the +# compiler to be in ANSI C mode if it handles function prototypes correctly. +# +# If you use this macro, you should check after calling it whether the C +# compiler has been set to accept ANSI C; if not, the shell variable +# @code{am_cv_prog_cc_stdc} is set to @samp{no}. If you wrote your source +# code in ANSI C, you can make an un-ANSIfied copy of it by using the +# program @code{ansi2knr}, which comes with Ghostscript. +# @end defmac + +AC_DEFUN(AM_PROG_CC_STDC, +[AC_REQUIRE([AC_PROG_CC]) +AC_BEFORE([$0], [AC_C_INLINE]) +AC_BEFORE([$0], [AC_C_CONST]) +dnl Force this before AC_PROG_CPP. Some cpp's, eg on HPUX, require +dnl a magic option to avoid problems with ANSI preprocessor commands +dnl like #elif. +dnl FIXME: can't do this because then AC_AIX won't work due to a +dnl circular dependency. +dnl AC_BEFORE([$0], [AC_PROG_CPP]) +AC_MSG_CHECKING(for ${CC-cc} option to accept ANSI C) +AC_CACHE_VAL(am_cv_prog_cc_stdc, +[am_cv_prog_cc_stdc=no +ac_save_CC="$CC" +# Don't try gcc -ansi; that turns off useful extensions and +# breaks some systems' header files. +# AIX -qlanglvl=ansi # Ultrix and OSF/1 -std1 +# HP-UX -Aa -D_HPUX_SOURCE +# SVR4 -Xc -D__EXTENSIONS__ +for ac_arg in "" -qlanglvl=ansi -std1 "-Aa -D_HPUX_SOURCE" "-Xc -D__EXTENSIONS__ +" +do + CC="$ac_save_CC $ac_arg" + AC_TRY_COMPILE( +[#include <stdarg.h> +#include <stdio.h> +#include <sys/types.h> +#include <sys/stat.h> +/* Most of the following tests are stolen from RCS 5.7's src/conf.sh. */ +struct buf { int x; }; +FILE * (*rcsopen) (struct buf *, struct stat *, int); +static char *e (p, i) + char **p; + int i; +{ + return p[i]; +} +static char *f (char * (*g) (char **, int), char **p, ...) +{ + char *s; + va_list v; + va_start (v,p); + s = g (p, va_arg (v,int)); + va_end (v); + return s; +} int test (int i, double x); +struct s1 {int (*f) (int a);}; +struct s2 {int (*f) (double a);}; +int pairnames (int, char **, FILE *(*)(struct buf *, struct stat *, int), int, + int); +int argc; +char **argv; +], [ +return f (e, argv, 0) != argv[0] || f (e, argv, 1) != argv[1]; +], +[am_cv_prog_cc_stdc="$ac_arg"; break]) +done +CC="$ac_save_CC" +]) +if test -z "$am_cv_prog_cc_stdc"; then + AC_MSG_RESULT([none needed]) +else + AC_MSG_RESULT($am_cv_prog_cc_stdc) +fi +case "x$am_cv_prog_cc_stdc" in + x|xno) ;; + *) CC="$CC $am_cv_prog_cc_stdc" ;; +esac +]) + + + + +# ******************************************************************** +dnl aclocal.m4 generated automatically by aclocal 1.2f + +dnl Copyright (C) 1994, 1995, 1996, 1997, 1998 Free Software Foundation, Inc. +dnl This Makefile.in is free software; the Free Software Foundation +dnl gives unlimited permission to copy and/or distribute it, +dnl with or without modifications, as long as this notice is preserved. + +dnl This program is distributed in the hope that it will be useful, +dnl but WITHOUT ANY WARRANTY, to the extent permitted by law; without +dnl even the implied warranty of MERCHANTABILITY or FITNESS FOR A +dnl PARTICULAR PURPOSE. + + +# progtest.m4 from gettext 0.32 +# Search path for a program which passes the given test. +# Ulrich Drepper <drepper@cygnus.com>, 1996. +# +# This file file be copied and used freely without restrictions. It can +# be used in projects which are not available under the GNU Public License +# but which still want to provide support for the GNU gettext functionality. +# Please note that the actual code is *not* freely available. + +# serial 1 + +dnl AM_PATH_PROG_WITH_TEST(VARIABLE, PROG-TO-CHECK-FOR, +dnl TEST-PERFORMED-ON-FOUND_PROGRAM [, VALUE-IF-NOT-FOUND [, PATH]]) +AC_DEFUN(AM_PATH_PROG_WITH_TEST, +[# Extract the first word of "$2", so it can be a program name with args. +set dummy $2; ac_word=[$]2 +AC_MSG_CHECKING([for $ac_word]) +AC_CACHE_VAL(ac_cv_path_$1, +[case "[$]$1" in + /*) + ac_cv_path_$1="[$]$1" # Let the user override the test with a path. + ;; + *) + IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}:" + for ac_dir in ifelse([$5], , $PATH, [$5]); do + test -z "$ac_dir" && ac_dir=. + if test -f $ac_dir/$ac_word; then + if [$3]; then + ac_cv_path_$1="$ac_dir/$ac_word" + break + fi + fi + done + IFS="$ac_save_ifs" +dnl If no 4th arg is given, leave the cache variable unset, +dnl so AC_PATH_PROGS will keep looking. +ifelse([$4], , , [ test -z "[$]ac_cv_path_$1" && ac_cv_path_$1="$4" +])dnl + ;; +esac])dnl +$1="$ac_cv_path_$1" +if test -n "[$]$1"; then + AC_MSG_RESULT([$]$1) +else + AC_MSG_RESULT(no) +fi +AC_SUBST($1)dnl +]) + +# ******************************************************************** +# lcmessage.m4 from gettext 0.32 +# Check whether LC_MESSAGES is available in <locale.h>. +# Ulrich Drepper <drepper@cygnus.com>, 1995. +# +# This file file be copied and used freely without restrictions. It can +# be used in projects which are not available under the GNU Public License +# but which still want to provide support for the GNU gettext functionality. +# Please note that the actual code is *not* freely available. + +# serial 1 + +AC_DEFUN(AM_LC_MESSAGES, + [if test $ac_cv_header_locale_h = yes; then + AC_CACHE_CHECK([for LC_MESSAGES], am_cv_val_LC_MESSAGES, + [AC_TRY_LINK([#include <locale.h>], [return LC_MESSAGES], + am_cv_val_LC_MESSAGES=yes, am_cv_val_LC_MESSAGES=no)]) + if test $am_cv_val_LC_MESSAGES = yes; then + AC_DEFINE(HAVE_LC_MESSAGES) + fi + fi]) + + +# ******************************************************************** +# gettext.m4 from gettext 0.32 +# Macro to add for using GNU gettext. +# Ulrich Drepper <drepper@cygnus.com>, 1995. +# +# This file file be copied and used freely without restrictions. It can +# be used in projects which are not available under the GNU Public License +# but which still want to provide support for the GNU gettext functionality. +# Please note that the actual code is *not* freely available. + +# serial 3 + +AC_DEFUN(AM_WITH_NLS, + [AC_MSG_CHECKING([whether NLS is requested]) + dnl Default is enabled NLS + AC_ARG_ENABLE(nls, + [ --disable-nls do not use Native Language Support], + USE_NLS=$enableval, USE_NLS=yes) + AC_MSG_RESULT($USE_NLS) + AC_SUBST(USE_NLS) + + USE_INCLUDED_LIBINTL=no + + dnl If we use NLS figure out what method + if test "$USE_NLS" = "yes"; then + AC_DEFINE(ENABLE_NLS) + AC_MSG_CHECKING([whether included gettext is requested]) + AC_ARG_WITH(included-gettext, + [ --with-included-gettext use the GNU gettext library included here], + nls_cv_force_use_gnu_gettext=$withval, + nls_cv_force_use_gnu_gettext=no) + AC_MSG_RESULT($nls_cv_force_use_gnu_gettext) + + nls_cv_use_gnu_gettext="$nls_cv_force_use_gnu_gettext" + if test "$nls_cv_force_use_gnu_gettext" != "yes"; then + dnl User does not insist on using GNU NLS library. Figure out what + dnl to use. If gettext or catgets are available (in this order) we + dnl use this. Else we have to fall back to GNU NLS library. + dnl catgets is only used if permitted by option --with-catgets. + nls_cv_header_intl= + nls_cv_header_libgt= + CATOBJEXT=NONE + + AC_CHECK_HEADER(libintl.h, + [AC_CACHE_CHECK([for gettext in libc], gt_cv_func_gettext_libc, + [AC_TRY_LINK([#include <libintl.h>], [return (int) gettext ("")], + gt_cv_func_gettext_libc=yes, gt_cv_func_gettext_libc=no)]) + + if test "$gt_cv_func_gettext_libc" != "yes"; then + AC_CHECK_LIB(intl, bindtextdomain, + [AC_CACHE_CHECK([for gettext in libintl], + gt_cv_func_gettext_libintl, + [AC_TRY_LINK([], [return (int) gettext ("")], + gt_cv_func_gettext_libintl=yes, + gt_cv_func_gettext_libintl=no)])]) + fi + + if test "$gt_cv_func_gettext_libintl" = "yes"; then + LIBS="-lintl $LIBS" + fi + + if test "$gt_cv_func_gettext_libc" = "yes" \ + || test "$gt_cv_func_gettext_libintl" = "yes"; then + AC_DEFINE(HAVE_GETTEXT) + AM_PATH_PROG_WITH_TEST(MSGFMT, msgfmt, + [test -z "`$ac_dir/$ac_word -h 2>&1 | grep 'dv '`"], no)dnl + if test "$MSGFMT" != "no"; then + AC_CHECK_FUNCS(dcgettext) + AC_PATH_PROG(GMSGFMT, gmsgfmt, $MSGFMT) + AM_PATH_PROG_WITH_TEST(XGETTEXT, xgettext, + [test -z "`$ac_dir/$ac_word -h 2>&1 | grep '(HELP)'`"], :) + AC_TRY_LINK(, [extern int _nl_msg_cat_cntr; + return _nl_msg_cat_cntr], + [CATOBJEXT=.gmo + DATADIRNAME=share], + [CATOBJEXT=.mo + DATADIRNAME=lib]) + INSTOBJEXT=.mo + fi + fi + ]) + + if test "$CATOBJEXT" = "NONE"; then + AC_MSG_CHECKING([whether catgets can be used]) + AC_ARG_WITH(catgets, + [ --with-catgets use catgets functions if available], + nls_cv_use_catgets=$withval, nls_cv_use_catgets=no) + AC_MSG_RESULT($nls_cv_use_catgets) + + if test "$nls_cv_use_catgets" = "yes"; then + dnl No gettext in C library. Try catgets next. + AC_CHECK_LIB(i, main) + AC_CHECK_FUNC(catgets, + [AC_DEFINE(HAVE_CATGETS) + INTLOBJS="\$(CATOBJS)" + AC_PATH_PROG(GENCAT, gencat, no)dnl + if test "$GENCAT" != "no"; then + AC_PATH_PROG(GMSGFMT, gmsgfmt, no) + if test "$GMSGFMT" = "no"; then + AM_PATH_PROG_WITH_TEST(GMSGFMT, msgfmt, + [test -z "`$ac_dir/$ac_word -h 2>&1 | grep 'dv '`"], no) + fi + AM_PATH_PROG_WITH_TEST(XGETTEXT, xgettext, + [test -z "`$ac_dir/$ac_word -h 2>&1 | grep '(HELP)'`"], :) + USE_INCLUDED_LIBINTL=yes + CATOBJEXT=.cat + INSTOBJEXT=.cat + DATADIRNAME=lib + INTLDEPS='$(top_builddir)/intl/libintl.a' + INTLLIBS=$INTLDEPS + LIBS=`echo $LIBS | sed -e 's/-lintl//'` + nls_cv_header_intl=intl/libintl.h + nls_cv_header_libgt=intl/libgettext.h + fi]) + fi + fi + + if test "$CATOBJEXT" = "NONE"; then + dnl Neither gettext nor catgets in included in the C library. + dnl Fall back on GNU gettext library. + nls_cv_use_gnu_gettext=yes + fi + fi + + if test "$nls_cv_use_gnu_gettext" = "yes"; then + dnl Mark actions used to generate GNU NLS library. + INTLOBJS="\$(GETTOBJS)" + AM_PATH_PROG_WITH_TEST(MSGFMT, msgfmt, + [test -z "`$ac_dir/$ac_word -h 2>&1 | grep 'dv '`"], msgfmt) + AC_PATH_PROG(GMSGFMT, gmsgfmt, $MSGFMT) + AM_PATH_PROG_WITH_TEST(XGETTEXT, xgettext, + [test -z "`$ac_dir/$ac_word -h 2>&1 | grep '(HELP)'`"], :) + AC_SUBST(MSGFMT) + USE_INCLUDED_LIBINTL=yes + CATOBJEXT=.gmo + INSTOBJEXT=.mo + DATADIRNAME=share + INTLDEPS='$(top_builddir)/intl/libintl.a' + INTLLIBS=$INTLDEPS + LIBS=`echo $LIBS | sed -e 's/-lintl//'` + nls_cv_header_intl=intl/libintl.h + nls_cv_header_libgt=intl/libgettext.h + fi + + dnl Test whether we really found GNU xgettext. + if test "$XGETTEXT" != ":"; then + dnl If it is no GNU xgettext we define it as : so that the + dnl Makefiles still can work. + if $XGETTEXT --omit-header /dev/null 2> /dev/null; then + : ; + else + AC_MSG_RESULT( + [found xgettext programs is not GNU xgettext; ignore it]) + XGETTEXT=":" + fi + fi + + # We need to process the po/ directory. + POSUB=po + else + DATADIRNAME=share + nls_cv_header_intl=intl/libintl.h + nls_cv_header_libgt=intl/libgettext.h + fi + + # If this is used in GNU gettext we have to set USE_NLS to `yes' + # because some of the sources are only built for this goal. + if test "$PACKAGE" = gettext; then + USE_NLS=yes + USE_INCLUDED_LIBINTL=yes + fi + + dnl These rules are solely for the distribution goal. While doing this + dnl we only have to keep exactly one list of the available catalogs + dnl in configure.in. + for lang in $ALL_LINGUAS; do + GMOFILES="$GMOFILES $lang.gmo" + POFILES="$POFILES $lang.po" + done + + dnl Make all variables we use known to autoconf. + AC_SUBST(USE_INCLUDED_LIBINTL) + AC_SUBST(CATALOGS) + AC_SUBST(CATOBJEXT) + AC_SUBST(DATADIRNAME) + AC_SUBST(GMOFILES) + AC_SUBST(INSTOBJEXT) + AC_SUBST(INTLDEPS) + AC_SUBST(INTLLIBS) + AC_SUBST(INTLOBJS) + AC_SUBST(POFILES) + AC_SUBST(POSUB) + ]) + +AC_DEFUN(AM_GNU_GETTEXT, + [AC_REQUIRE([AC_PROG_MAKE_SET])dnl + AC_REQUIRE([AC_PROG_CC])dnl + AC_REQUIRE([AC_PROG_RANLIB])dnl + AC_REQUIRE([AC_ISC_POSIX])dnl + AC_REQUIRE([AC_HEADER_STDC])dnl + AC_REQUIRE([AC_C_CONST])dnl + AC_REQUIRE([AC_C_INLINE])dnl + AC_REQUIRE([AC_TYPE_OFF_T])dnl + AC_REQUIRE([AC_TYPE_SIZE_T])dnl + AC_REQUIRE([AC_FUNC_ALLOCA])dnl + AC_REQUIRE([AC_FUNC_MMAP])dnl + + AC_CHECK_HEADERS([argz.h limits.h locale.h nl_types.h malloc.h string.h \ +unistd.h values.h sys/param.h]) + AC_CHECK_FUNCS([getcwd munmap putenv setenv setlocale strchr strcasecmp \ +__argz_count __argz_stringify __argz_next]) + + if test "${ac_cv_func_stpcpy+set}" != "set"; then + AC_CHECK_FUNCS(stpcpy) + fi + if test "${ac_cv_func_stpcpy}" = "yes"; then + AC_DEFINE(HAVE_STPCPY) + fi + + AM_LC_MESSAGES + AM_WITH_NLS + + if test "x$CATOBJEXT" != "x"; then + if test "x$ALL_LINGUAS" = "x"; then + LINGUAS= + else + AC_MSG_CHECKING(for catalogs to be installed) + NEW_LINGUAS= + for lang in ${LINGUAS=$ALL_LINGUAS}; do + case "$ALL_LINGUAS" in + *$lang*) NEW_LINGUAS="$NEW_LINGUAS $lang" ;; + esac + done + LINGUAS=$NEW_LINGUAS + AC_MSG_RESULT($LINGUAS) + fi + + dnl Construct list of names of catalog files to be constructed. + if test -n "$LINGUAS"; then + for lang in $LINGUAS; do CATALOGS="$CATALOGS $lang$CATOBJEXT"; done + fi + fi + + dnl The reference to <locale.h> in the installed <libintl.h> file + dnl must be resolved because we cannot expect the users of this + dnl to define HAVE_LOCALE_H. + if test $ac_cv_header_locale_h = yes; then + INCLUDE_LOCALE_H="#include <locale.h>" + else + INCLUDE_LOCALE_H="\ +/* The system does not provide the header <locale.h>. Take care yourself. */" + fi + AC_SUBST(INCLUDE_LOCALE_H) + + dnl Determine which catalog format we have (if any is needed) + dnl For now we know about two different formats: + dnl Linux libc-5 and the normal X/Open format + test -d intl || mkdir intl + if test "$CATOBJEXT" = ".cat"; then + AC_CHECK_HEADER(linux/version.h, msgformat=linux, msgformat=xopen) + + dnl Transform the SED scripts while copying because some dumb SEDs + dnl cannot handle comments. + sed -e '/^#/d' $srcdir/intl/$msgformat-msg.sed > intl/po2msg.sed + fi + dnl po2tbl.sed is always needed. + sed -e '/^#.*[^\\]$/d' -e '/^#$/d' \ + $srcdir/intl/po2tbl.sed.in > intl/po2tbl.sed + + dnl In the intl/Makefile.in we have a special dependency which makes + dnl only sense for gettext. We comment this out for non-gettext + dnl packages. + if test "$PACKAGE" = "gettext"; then + GT_NO="#NO#" + GT_YES= + else + GT_NO= + GT_YES="#YES#" + fi + AC_SUBST(GT_NO) + AC_SUBST(GT_YES) + + dnl If the AC_CONFIG_AUX_DIR macro for autoconf is used we possibly + dnl find the mkinstalldirs script in another subdir but ($top_srcdir). + dnl Try to locate is. + MKINSTALLDIRS= + if test -z "$MKINSTALLDIRS"; then + MKINSTALLDIRS="\$(top_srcdir)/mkinstalldirs" + fi + AC_SUBST(MKINSTALLDIRS) + + dnl *** For now the libtool support in intl/Makefile is not for real. + l= + AC_SUBST(l) + ]) + diff --git a/m4/old/aclocal.m4.bak b/m4/old/aclocal.m4.bak new file mode 100644 index 0000000..d9d0216 --- /dev/null +++ b/m4/old/aclocal.m4.bak @@ -0,0 +1,1086 @@ +###################################################################### +# Configure paths for GTK+2 +# Oliver Rauch 2002-06-17 + +dnl AM_PATH_GTK2([MINIMUM-VERSION, [ACTION-IF-FOUND [, ACTION-IF-NOT-FOUND]]]) +dnl Test for GTK+-2.0.x, and define GTK_CFLAGS and GTK_LIBS +dnl +AC_DEFUN(AM_PATH_GTK2, +[ + AC_ARG_ENABLE(gtk2, [ --disable-gtk2 Do not use gtk+-2.0.x], USE_GTK2=$enableval, USE_GTK2=yes) + + if test $USE_GTK2 != no ; then + min_gtk_version=ifelse([$1], ,2.0.0,$1) + if `pkg-config --atleast-pkgconfig-version=0` ; then + AC_MSG_CHECKING(for GTK - version >= $min_gtk_version) + if `pkg-config gtk+-2.0 --atleast-version=$min_gtk_version` ; then + GTK_CFLAGS=`pkg-config gtk+-2.0 --cflags` + GTK_LIBS=`pkg-config gtk+-2.0 --libs` + AC_MSG_RESULT(yes) + ifelse([$2], , :, [$2]) + else + AC_MSG_RESULT(no) + ifelse([$3], , :, [$3]) + fi + else + AC_MSG_WARN(***************************************************************) + AC_MSG_WARN(*** pgk-config is not avilable: test for gtk2 not possible ****) + AC_MSG_WARN(***************************************************************) + ifelse([$3], , :, [$3]) + fi + else + ifelse([$3], , :, [$3]) + fi + + + AC_SUBST(GTK_CFLAGS) + AC_SUBST(GTK_LIBS) +] +) + +# Configure paths for GTK+ +# Owen Taylor 97-11-3 +dnl AM_PATH_GTK([MINIMUM-VERSION, [ACTION-IF-FOUND [, ACTION-IF-NOT-FOUND]]]) +dnl Test for GTK, and define GTK_CFLAGS and GTK_LIBS +dnl +AC_DEFUN(AM_PATH_GTK, +[dnl +dnl Get the cflags and libraries from the gtk-config script +dnl + AC_ARG_WITH(gtk-prefix,[ --with-gtk-prefix=PFX Prefix where GTK is installed (optional)], + gtk_config_prefix="$withval", gtk_config_prefix="") + AC_ARG_WITH(gtk-exec-prefix,[ --with-gtk-exec-prefix=PFX Exec prefix where GTK is installed (optional)], + gtk_config_exec_prefix="$withval", gtk_config_exec_prefix="") + AC_ARG_ENABLE(gtktest, [ --disable-gtktest Do not try to compile and run a test GTK program], , enable_gtktest=yes) + + if test x$gtk_config_exec_prefix != x ; then + gtk_config_args="$gtk_config_args --exec-prefix=$gtk_config_exec_prefix" + if test x${GTK_CONFIG+set} != xset ; then + GTK_CONFIG=$gtk_config_exec_prefix/bin/gtk-config + fi + fi + if test x$gtk_config_prefix != x ; then + gtk_config_args="$gtk_config_args --prefix=$gtk_config_prefix" + if test x${GTK_CONFIG+set} != xset ; then + GTK_CONFIG=$gtk_config_prefix/bin/gtk-config + fi + fi + + AC_PATH_PROG(GTK_CONFIG, gtk-config, no) + min_gtk_version=ifelse([$1], ,0.99.7,$1) + AC_MSG_CHECKING(for GTK - version >= $min_gtk_version) + no_gtk="" + if test "$GTK_CONFIG" = "no" ; then + no_gtk=yes + else + GTK_CFLAGS=`$GTK_CONFIG $gtk_config_args --cflags` + GTK_LIBS=`$GTK_CONFIG $gtk_config_args --libs` + gtk_config_major_version=`$GTK_CONFIG $gtk_config_args --version | \ + sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\1/'` + gtk_config_minor_version=`$GTK_CONFIG $gtk_config_args --version | \ + sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\2/'` + gtk_config_micro_version=`$GTK_CONFIG $gtk_config_args --version | \ + sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\3/'` + if test "x$enable_gtktest" = "xyes" ; then + ac_save_CFLAGS="$CFLAGS" + ac_save_LIBS="$LIBS" + CFLAGS="$CFLAGS $GTK_CFLAGS" + LIBS="$LIBS $GTK_LIBS" +dnl +dnl Now check if the installed GTK is sufficiently new. (Also sanity +dnl checks the results of gtk-config to some extent) +dnl + rm -f conf.gtktest + AC_TRY_RUN([ +#include <gtk/gtk.h> +#include <stdio.h> + +int +main () +{ + int major, minor, micro; + + system ("touch conf.gtktest"); + + if (sscanf("$min_gtk_version", "%d.%d.%d", &major, &minor, µ) != 3) { + printf("%s, bad version string\n", "$min_gtk_version"); + exit(1); + } + + if ((gtk_major_version != $gtk_config_major_version) || + (gtk_minor_version != $gtk_config_minor_version) || + (gtk_micro_version != $gtk_config_micro_version)) + { + printf("\n*** 'gtk-config --version' returned %d.%d.%d, but GTK+ (%d.%d.%d)\n", + $gtk_config_major_version, $gtk_config_minor_version, $gtk_config_micro_version, + gtk_major_version, gtk_minor_version, gtk_micro_version); + printf ("*** was found! If gtk-config was correct, then it is best\n"); + printf ("*** to remove the old version of GTK+. You may also be able to fix the error\n"); + printf("*** by modifying your LD_LIBRARY_PATH enviroment variable, or by editing\n"); + printf("*** /etc/ld.so.conf. Make sure you have run ldconfig if that is\n"); + printf("*** required on your system.\n"); + printf("*** If gtk-config was wrong, set the environment variable GTK_CONFIG\n"); + printf("*** to point to the correct copy of gtk-config, and remove the file config.cache\n"); + printf("*** before re-running configure\n"); + } + else + { + if ((gtk_major_version > major) || + ((gtk_major_version == major) && (gtk_minor_version > minor)) || + ((gtk_major_version == major) && (gtk_minor_version == minor) && (gtk_micro_version >= micro))) + { + return 0; + } + else + { + printf("\n*** An old version of GTK+ (%d.%d.%d) was found.\n", + gtk_major_version, gtk_minor_version, gtk_micro_version); + printf("*** You need a version of GTK+ newer than %d.%d.%d. The latest version of\n", + major, minor, micro); + printf("*** GTK+ is always available from ftp://ftp.gtk.org.\n"); + printf("***\n"); + printf("*** If you have already installed a sufficiently new version, this error\n"); + printf("*** probably means that the wrong copy of the gtk-config shell script is\n"); + printf("*** being found. The easiest way to fix this is to remove the old version\n"); + printf("*** of GTK+, but you can also set the GTK_CONFIG environment to point to the\n"); + printf("*** correct copy of gtk-config. (In this case, you will have to\n"); + printf("*** modify your LD_LIBRARY_PATH enviroment variable, or edit /etc/ld.so.conf\n"); + printf("*** so that the correct libraries are found at run-time))\n"); + } + } + return 1; +} +],, no_gtk=yes,[echo $ac_n "cross compiling; assumed OK... $ac_c"]) + CFLAGS="$ac_save_CFLAGS" + LIBS="$ac_save_LIBS" + fi + fi + if test "x$no_gtk" = x ; then + AC_MSG_RESULT(yes) + ifelse([$2], , :, [$2]) + else + AC_MSG_RESULT(no) + if test "$GTK_CONFIG" = "no" ; then + echo "*** The gtk-config script installed by GTK could not be found" + echo "*** If GTK was installed in PREFIX, make sure PREFIX/bin is in" + echo "*** your path, or set the GTK_CONFIG environment variable to the" + echo "*** full path to gtk-config." + else + if test -f conf.gtktest ; then + : + else + echo "*** Could not run GTK test program, checking why..." + CFLAGS="$CFLAGS $GTK_CFLAGS" + LIBS="$LIBS $GTK_LIBS" + AC_TRY_LINK([ +#include <gtk/gtk.h> +#include <stdio.h> +], [ return ((gtk_major_version) || (gtk_minor_version) || (gtk_micro_version)); ], + [ echo "*** The test program compiled, but did not run. This usually means" + echo "*** that the run-time linker is not finding GTK or finding the wrong" + echo "*** version of GTK. If it is not finding GTK, 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 "***" + echo "*** If you have a RedHat 5.0 system, you should remove the GTK package that" + echo "*** came with the system with the command" + echo "***" + echo "*** rpm --erase --nodeps gtk gtk-devel" ], + [ echo "*** The test program failed to compile or link. See the file config.log for the" + echo "*** exact error that occured. This usually means GTK was incorrectly installed" + echo "*** or that you have moved GTK since it was installed. In the latter case, you" + echo "*** may want to edit the gtk-config script: $GTK_CONFIG" ]) + CFLAGS="$ac_save_CFLAGS" + LIBS="$ac_save_LIBS" + fi + fi + GTK_CFLAGS="" + GTK_LIBS="" + ifelse([$3], , :, [$3]) + fi + AC_SUBST(GTK_CFLAGS) + AC_SUBST(GTK_LIBS) + rm -f conf.gtktest +]) + + +###################################################################### +# Configure paths for The GIMP +# Oliver Rauch 2000-12-28 + +dnl AM_PATH_GIMP([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, +[dnl +dnl Get the cflags and libraries from the gimp-config script +dnl + AC_ARG_WITH(gimp-prefix,[ --with-gimp-prefix=PFX Prefix where GIMP is installed (optional)], + gimp_config_prefix="$withval", gimp_config_prefix="") + AC_ARG_WITH(gimp-exec-prefix,[ --with-gimp-exec-prefix=PFX Exec prefix where GIMP is installed (optional)], + gimp_config_exec_prefix="$withval", gimp_config_exec_prefix="") + AC_ARG_ENABLE(gimptest, [ --disable-gimptest Do not try to compile and run a test GIMP program], , enable_gimptest=yes) + + ac_save_CFLAGS="$CFLAGS" + ac_save_LIBS="$LIBS" + ac_save_GTK_CFLAGS="$GTK_CFLAGS" + ac_save_GTK_LIBS="$GTK_LIBS" + + if test x$gimp_config_exec_prefix != x ; then + gimp_config_args="$gimp_config_args --exec-prefix=$gimp_config_exec_prefix" + if test x${GIMP_CONFIG+set} != xset ; then + GIMP_CONFIG=$gimp_config_exec_prefix/bin/gimp-config + fi + fi + + if test x$gimp_config_prefix != x ; then + gimp_config_args="$gimp_config_args --prefix=$gimp_config_prefix" + if test x${GIMP_CONFIG+set} != xset ; then + GIMP_CONFIG=$gimp_config_prefix/bin/gimp-config + fi + fi + + AC_PATH_PROG(GIMP_CONFIG, gimp-config, no) + if test "$GIMP_CONFIG" = "no" ; then + if test x$gimp_config_exec_prefix != x ; then + gimp_config_args="$gimp_config_args --exec-prefix=$gimp_config_exec_prefix" + if test x${GIMP_TOOL+set} != xset ; then + GIMP_TOOL=$gimp_config_exec_prefix/bin/gimptool + fi + fi + if test x$gimp_config_prefix != x ; then + gimp_config_args="$gimp_config_args --prefix=$gimp_config_prefix" + if test x${GIMP_TOOL+set} != xset ; then + GIMP_TOOL=$gimp_config_prefix/bin/gimptool + fi + fi + AC_PATH_PROG(GIMP_TOOL, gimptool, no) + GIMP_CONFIG=$GIMP_TOOL + fi + + min_gimp_version=ifelse([$1], ,1.0.0,$1) + no_gimp="" + + if test "$GIMP_CONFIG" = "no" ; then +dnl we do not have gimp-config (gimp-1.0.x does not have gimp-config) +dnl so we have to use the GTK_* things for testing for gimp.h and gimpfeatures.h + ac_save_CPPFLAGS="$CPPFLAGS" + CPPFLAGS="${CPPFLAGS} ${GTK_CFLAGS}" + AC_CHECK_HEADERS(libgimp/gimp.h, GIMP_LIBS="-lgimp", no_gimp=yes) + AC_CHECK_HEADERS(libgimp/gimpfeatures.h) + CPPFLAGS="$ac_save_CPPFLAGS" + CFLAGS="${CFLAGS} ${GTK_CFLAGS}" + LIBS="${LIBS} ${GTK_LIBS} ${GIMP_LIBS}" + if test "x$no_gimp" = x ; then + AC_MSG_CHECKING(GIMP compilation) + gimp_config_major_version=-1 + gimp_config_minor_version=0 + gimp_config_micro_version=0 + fi + else +dnl Ok, we have gimp-config and so we do not need the GTK_* things because they are +dnl included in the output of gimp-config + GTK_CFLAGS="" + GTK_LIBS="" + GIMP_CFLAGS=`$GIMP_CONFIG $gimp_config_args --cflags` + GIMP_LIBS=`$GIMP_CONFIG $gimp_config_args --libs`" -lgimp" + gimp_config_major_version=`$GIMP_CONFIG $gimp_config_args --version | \ + sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\1/'` + gimp_config_minor_version=`$GIMP_CONFIG $gimp_config_args --version | \ + sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\2/'` + gimp_config_micro_version=`$GIMP_CONFIG $gimp_config_args --version | \ + sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\3/'` + CFLAGS="${CFLAGS} ${GIMP_CFLAGS}" + LIBS="${LIBS} ${GIMP_LIBS}" + AC_MSG_CHECKING(for GIMP - version >= $min_gimp_version) + fi + +dnl +dnl Now check if the installed GIMP is sufficiently new. (Also sanity +dnl checks the results of gimp-config to some extent +dnl + if test "x$no_gimp" = x ; then + if test "x$enable_gimptest" = "xyes" ; then + rm -f conf.gimptest + AC_TRY_RUN([ +#include <libgimp/gimp.h> +#include <stdio.h> + +#define GIMP_TEST_CHECK_VERSION(major, minor, micro) \ + ($gimp_config_major_version > (major) || \ + ($gimp_config_major_version == (major) && $gimp_config_minor_version > (minor)) || \ + ($gimp_config_major_version == (major) && $gimp_config_minor_version == (minor) && \ + $gimp_config_micro_version >= (micro))) + +#if !GIMP_TEST_CHECK_VERSION(1,1,25) +# define GimpPlugInInfo GPlugInInfo /* do test with gimp interface version 1.0 */ +#endif + +GimpPlugInInfo PLUG_IN_INFO = +{ + NULL, NULL, NULL, NULL +}; + + +int +main () +{ + int major, minor, micro; + + system ("touch conf.gimptest"); + + if (sscanf("$min_gimp_version", "%d.%d.%d", &major, &minor, µ) != 3) { + printf("%s, bad version string\n", "$min_gimp_version"); + exit(1); + } + + if ( ($gimp_config_major_version != -1) && + ((gimp_major_version != $gimp_config_major_version) || + (gimp_minor_version != $gimp_config_minor_version) || + (gimp_micro_version != $gimp_config_micro_version)) ) + { + printf("\n*** 'gimp-config --version' returned %d.%d.%d, but GIMP (%d.%d.%d)\n", + $gimp_config_major_version, $gimp_config_minor_version, $gimp_config_micro_version, + gimp_major_version, gimp_minor_version, gimp_micro_version); + printf ("*** was found! If gimp-config was correct, then it is best\n"); + printf ("*** to remove the old version of GIMP. You may also be able to fix the error\n"); + printf("*** by modifying your LD_LIBRARY_PATH enviroment variable, or by editing\n"); + printf("*** /etc/ld.so.conf. Make sure you have run ldconfig if that is\n"); + printf("*** required on your system.\n"); + printf("*** If gimp-config was wrong, set the environment variable GIMP_CONFIG\n"); + printf("*** to point to the correct copy of gimp-config, and remove the file config.cache\n"); + printf("*** before re-running configure\n"); + } + else + { + if ((gimp_major_version > major) || + ((gimp_major_version == major) && (gimp_minor_version > minor)) || + ((gimp_major_version == major) && (gimp_minor_version == minor) && (gimp_micro_version >= micro))) + { + return 0; + } + else + { + printf("\n*** An old version of GIMP (%d.%d.%d) was found.\n", + gimp_major_version, gimp_minor_version, gimp_micro_version); + printf("*** You need a version of GIMP newer than %d.%d.%d. The latest version of\n", + major, minor, micro); + printf("*** GIMP is always available from ftp://ftp.gimp.org.\n"); + printf("***\n"); + printf("*** If you have already installed a sufficiently new version, this error\n"); + printf("*** probably means that the wrong copy of the gimp-config shell script is\n"); + printf("*** being found. The easiest way to fix this is to remove the old version\n"); + printf("*** of GIMP, but you can also set the GIMP_CONFIG environment to point to the\n"); + printf("*** correct copy of gimp-config. (In this case, you will have to\n"); + printf("*** modify your LD_LIBRARY_PATH enviroment variable, or edit /etc/ld.so.conf\n"); + printf("*** so that the correct libraries are found at run-time))\n"); + } + } + return 1; +} +], , no_gimp=yes,[echo $ac_n "cross compiling; assumed OK... $ac_c"]) + fi + fi + + if test "x$no_gimp" = x ; then +dnl gimp test succeeded or not tested + if test "x$enable_gimptest" = "xyes" ; then + AC_MSG_RESULT(yes) + else + AC_MSG_RESULT(not tested) + fi + if test "$GIMP_CONFIG" != "no" ; then + ac_save_CPPFLAGS="$CPPFLAGS" + CPPFLAGS="${CPPFLAGS} ${GIMP_CFLAGS}" + AC_CHECK_HEADERS(libgimp/gimp.h) + AC_CHECK_HEADERS(libgimp/gimpfeatures.h) + CPPFLAGS="$ac_save_CPPFLAGS" + fi + CFLAGS="$ac_save_CFLAGS" + LIBS="$ac_save_LIBS" + ifelse([$2], , :, [$2]) + else + AC_MSG_RESULT(no) + 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 <libgimp/gimp.h> +#include <stdio.h> +#define GIMP_TEST_CHECK_VERSION(major, minor, micro) \ + ($gimp_config_major_version > (major) || \ + ($gimp_config_major_version == (major) && $gimp_config_minor_version > (minor)) || \ + ($gimp_config_major_version == (major) && $gimp_config_minor_version == (minor) && \ + $gimp_config_micro_version >= (micro))) + +#if !GIMP_TEST_CHECK_VERSION(1,1,25) +# define GimpPlugInInfo GPlugInInfo /* do test with gimp interface version 1.0 */ +#endif +GimpPlugInInfo PLUG_IN_INFO = { NULL, NULL, NULL, NULL }; +], [ return ((gimp_major_version) || (gimp_minor_version) || (gimp_micro_version)); ], + [ 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 "***" + echo "***" ]) + CFLAGS="$ac_save_CFLAGS" + LIBS="$ac_save_LIBS" + fi +dnl ok, gimp does not work, so we have to use the gtk_* things again + GIMP_CFLAGS="" + GIMP_LIBS="" + GTK_CFLAGS="$ac_save_GTK_CFLAGS" + GTK_LIBS="$ac_save_GTK_LIBS" + CFLAGS="${CFLAGS} ${GTK_CFLAGS}" + LIBS="${LIBS} ${GTK_LIBS} ${GIMP_LIBS}" + ifelse([$3], , :, [$3]) + fi + AC_SUBST(GIMP_CFLAGS) + AC_SUBST(GIMP_LIBS) + rm -f conf.gimptest +]) + + +# ******************************************************************** +# Configure paths for SANE +# Oliver Rauch 2000-10-30 + +dnl AM_PATH_SANE([MINIMUM-VERSION, [ACTION-IF-FOUND [, ACTION-IF-NOT-FOUND]]]) +dnl Test for SANE, and define SANE_CFLAGS and SANE_LIBS +dnl +AC_DEFUN(AM_PATH_SANE, +[dnl +dnl Get the cflags and libraries from the sane-config script +dnl + AC_ARG_ENABLE(sanetest, [ --disable-sanetest Do not try to compile and run a test SANE program], , enable_sanetest=yes) + + AC_PATH_PROG(SANE_CONFIG, sane-config, no) + min_sane_version=ifelse([$1], ,1.0.0,$1) + AC_MSG_CHECKING(for SANE - version >= $min_sane_version) + no_sane="" + if test "$SANE_CONFIG" = "no" ; then + no_sane=yes + else + SANE_CFLAGS=`$SANE_CONFIG $sane_config_args --cflags` + SANE_LDFLAGS=`$SANE_CONFIG $sane_config_args --ldflags` +# SANE_LIBS=`$SANE_CONFIG $sane_config_args --libs` + SANE_LIBS=`$SANE_CONFIG $sane_config_args --libs | sed -e 's/-lintl//g'` + SANE_PREFIX=`$SANE_CONFIG $sane_config_args --prefix` + sane_config_major_version=`$SANE_CONFIG $sane_config_args --version | \ + sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\1/'` + sane_config_minor_version=`$SANE_CONFIG $sane_config_args --version | \ + sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\2/'` + sane_config_micro_version=`$SANE_CONFIG $sane_config_args --version | \ + sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\3/'` + if test "x$enable_sanetest" = "xyes" ; then + ac_save_CFLAGS="$CFLAGS" + ac_save_LDFLAGS="$LDFLAGS" + ac_save_LIBS="$LIBS" + CFLAGS="$CFLAGS $SANE_CFLAGS" + LDFLAGS="$LDFLAGS $SANE_LDFLAGS" + LIBS="$LIBS $SANE_LIBS" +dnl +dnl Now check if the installed SANE is sufficiently new. (Also sanity +dnl checks the results of sane-config to some extent +dnl + rm -f conf.sanetest + AC_TRY_RUN([ +#include <sane/sane.h> +#include <stdio.h> + +int +main () +{ + int major, minor, micro; + + system ("touch conf.sanetest"); + + if (sscanf("$min_sane_version", "%d.%d.%d", &major, &minor, µ) != 3) { + printf("%s, bad version string\n", "$min_sane_version"); + exit(1); + } + + if ( ($sane_config_major_version == major) && + ( ($sane_config_minor_version > minor) || + ( ($sane_config_minor_version == minor) && ($sane_config_micro_version >= micro)))) + { + return 0; + } + else if ($sane_config_major_version > major) + { + printf("\n*** A too new version of SANE (%d.%d.%d) was found.\n", + $sane_config_major_version, $sane_config_minor_version, $sane_config_micro_version); + printf("*** You need a version of SANE with the major version number %d.\n", major); + } + else + { + printf("\n*** An old version of SANE (%d.%d.%d) was found.\n", + $sane_config_major_version, $sane_config_minor_version, $sane_config_micro_version); + printf("*** You need a version of SANE newer than %d.%d.%d. The latest version of\n", + major, minor, micro); + } + + printf("*** SANE is always available from ftp://ftp.mostang.com\n"); + printf("***\n"); + printf("*** If you have already installed a sufficient version, this error\n"); + printf("*** probably means that the wrong copy of the sane-config shell script is\n"); + printf("*** being found. The easiest way to fix this is to remove the old version\n"); + printf("*** of SANE, but you can also set the SANE_CONFIG environment to point to the\n"); + printf("*** correct copy of sane-config. (In this case, you will have to\n"); + printf("*** modify your LD_LIBRARY_PATH enviroment variable, or edit /etc/ld.so.conf\n"); + printf("*** so that the correct libraries are found at run-time))\n"); + + return 1; +} +],, no_sane=yes,[echo $ac_n "cross compiling; assumed OK... $ac_c"]) + CFLAGS="$ac_save_CFLAGS" + LDFLAGS="$ac_save_LDFLAGS" + LIBS="$ac_save_LIBS" + fi + fi + if test "x$no_sane" = x ; then + AC_MSG_RESULT(yes) + ifelse([$2], , :, [$2]) + else + AC_MSG_RESULT(no) + if test "$SANE_CONFIG" = "no" ; then + echo "*** The sane-config script installed by SANE could not be found" + echo "*** If SANE was installed in PREFIX, make sure PREFIX/bin is in" + echo "*** your path, or set the SANE_CONFIG environment variable to the" + echo "*** full path to sane-config." + else + if test -f conf.sanetest ; then + : + else + echo "*** Could not run SANE test program, checking why..." + CFLAGS="$CFLAGS $SANE_CFLAGS" + LIBS="$LIBS $SANE_LIBS" + LDFLAGS="$LDFLAGS $SANE_LDFLAGS" + AC_TRY_LINK([ +#include <sane/sane.h> +#include <stdio.h> +], [ return (SANE_CURRENT_MAJOR); ], + [ echo "*** The test program compiled, but did not run. This usually means" + echo "*** that the run-time linker is not finding SANE or finding the wrong" + echo "*** version of SANE. If it is not finding SANE, 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 "***" ] + [ echo "*** The test program failed to compile or link. See the file config.log for the" + echo "*** exact error that occured. This usually means SANE was incorrectly installed" + echo "*** or that you have moved SANE since it was installed. In the latter case, you" + echo "*** may want to edit the sane-config script: $SANE_CONFIG" ]) + CFLAGS="$ac_save_CFLAGS" + LDFLAGS="$ac_save_LDFLAGS" + LIBS="$ac_save_LIBS" + fi + fi + SANE_CFLAGS="" + SANE_LDFLAGS="" + SANE_LIBS="" + ifelse([$3], , :, [$3]) + fi + AC_SUBST(SANE_LDFLAGS) + AC_SUBST(SANE_CFLAGS) + AC_SUBST(SANE_LIBS) + AC_SUBST(SANE_PREFIX) + rm -f conf.sanetest +]) + +# ******************************************************************** + + +dnl AM_FUNC_ALLOCA +AC_DEFUN(AM_FUNC_ALLOCA, +[AC_REQUIRE([AC_FUNC_ALLOCA])dnl +test $ac_cv_func_alloca_works = no && LTALLOCA=alloca.lo +AC_SUBST(LTALLOCA)dnl +]) + +# @defmac AC_PROG_CC_STDC +# @maindex PROG_CC_STDC +# @ovindex CC +# If the C compiler in not in ANSI C mode by default, try to add an option +# to output variable @code{CC} to make it so. This macro tries various +# options that select ANSI C on some system or another. It considers the +# compiler to be in ANSI C mode if it handles function prototypes correctly. +# +# If you use this macro, you should check after calling it whether the C +# compiler has been set to accept ANSI C; if not, the shell variable +# @code{am_cv_prog_cc_stdc} is set to @samp{no}. If you wrote your source +# code in ANSI C, you can make an un-ANSIfied copy of it by using the +# program @code{ansi2knr}, which comes with Ghostscript. +# @end defmac + +AC_DEFUN(AM_PROG_CC_STDC, +[AC_REQUIRE([AC_PROG_CC]) +AC_BEFORE([$0], [AC_C_INLINE]) +AC_BEFORE([$0], [AC_C_CONST]) +dnl Force this before AC_PROG_CPP. Some cpp's, eg on HPUX, require +dnl a magic option to avoid problems with ANSI preprocessor commands +dnl like #elif. +dnl FIXME: can't do this because then AC_AIX won't work due to a +dnl circular dependency. +dnl AC_BEFORE([$0], [AC_PROG_CPP]) +AC_MSG_CHECKING(for ${CC-cc} option to accept ANSI C) +AC_CACHE_VAL(am_cv_prog_cc_stdc, +[am_cv_prog_cc_stdc=no +ac_save_CC="$CC" +# Don't try gcc -ansi; that turns off useful extensions and +# breaks some systems' header files. +# AIX -qlanglvl=ansi # Ultrix and OSF/1 -std1 +# HP-UX -Aa -D_HPUX_SOURCE +# SVR4 -Xc -D__EXTENSIONS__ +for ac_arg in "" -qlanglvl=ansi -std1 "-Aa -D_HPUX_SOURCE" "-Xc -D__EXTENSIONS__ +" +do + CC="$ac_save_CC $ac_arg" + AC_TRY_COMPILE( +[#include <stdarg.h> +#include <stdio.h> +#include <sys/types.h> +#include <sys/stat.h> +/* Most of the following tests are stolen from RCS 5.7's src/conf.sh. */ +struct buf { int x; }; +FILE * (*rcsopen) (struct buf *, struct stat *, int); +static char *e (p, i) + char **p; + int i; +{ + return p[i]; +} +static char *f (char * (*g) (char **, int), char **p, ...) +{ + char *s; + va_list v; + va_start (v,p); + s = g (p, va_arg (v,int)); + va_end (v); + return s; +} int test (int i, double x); +struct s1 {int (*f) (int a);}; +struct s2 {int (*f) (double a);}; +int pairnames (int, char **, FILE *(*)(struct buf *, struct stat *, int), int, + int); +int argc; +char **argv; +], [ +return f (e, argv, 0) != argv[0] || f (e, argv, 1) != argv[1]; +], +[am_cv_prog_cc_stdc="$ac_arg"; break]) +done +CC="$ac_save_CC" +]) +if test -z "$am_cv_prog_cc_stdc"; then + AC_MSG_RESULT([none needed]) +else + AC_MSG_RESULT($am_cv_prog_cc_stdc) +fi +case "x$am_cv_prog_cc_stdc" in + x|xno) ;; + *) CC="$CC $am_cv_prog_cc_stdc" ;; +esac +]) + + + + +# ******************************************************************** +dnl aclocal.m4 generated automatically by aclocal 1.2f + +dnl Copyright (C) 1994, 1995, 1996, 1997, 1998 Free Software Foundation, Inc. +dnl This Makefile.in is free software; the Free Software Foundation +dnl gives unlimited permission to copy and/or distribute it, +dnl with or without modifications, as long as this notice is preserved. + +dnl This program is distributed in the hope that it will be useful, +dnl but WITHOUT ANY WARRANTY, to the extent permitted by law; without +dnl even the implied warranty of MERCHANTABILITY or FITNESS FOR A +dnl PARTICULAR PURPOSE. + + +# progtest.m4 from gettext 0.32 +# Search path for a program which passes the given test. +# Ulrich Drepper <drepper@cygnus.com>, 1996. +# +# This file file be copied and used freely without restrictions. It can +# be used in projects which are not available under the GNU Public License +# but which still want to provide support for the GNU gettext functionality. +# Please note that the actual code is *not* freely available. + +# serial 1 + +dnl AM_PATH_PROG_WITH_TEST(VARIABLE, PROG-TO-CHECK-FOR, +dnl TEST-PERFORMED-ON-FOUND_PROGRAM [, VALUE-IF-NOT-FOUND [, PATH]]) +AC_DEFUN(AM_PATH_PROG_WITH_TEST, +[# Extract the first word of "$2", so it can be a program name with args. +set dummy $2; ac_word=[$]2 +AC_MSG_CHECKING([for $ac_word]) +AC_CACHE_VAL(ac_cv_path_$1, +[case "[$]$1" in + /*) + ac_cv_path_$1="[$]$1" # Let the user override the test with a path. + ;; + *) + IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}:" + for ac_dir in ifelse([$5], , $PATH, [$5]); do + test -z "$ac_dir" && ac_dir=. + if test -f $ac_dir/$ac_word; then + if [$3]; then + ac_cv_path_$1="$ac_dir/$ac_word" + break + fi + fi + done + IFS="$ac_save_ifs" +dnl If no 4th arg is given, leave the cache variable unset, +dnl so AC_PATH_PROGS will keep looking. +ifelse([$4], , , [ test -z "[$]ac_cv_path_$1" && ac_cv_path_$1="$4" +])dnl + ;; +esac])dnl +$1="$ac_cv_path_$1" +if test -n "[$]$1"; then + AC_MSG_RESULT([$]$1) +else + AC_MSG_RESULT(no) +fi +AC_SUBST($1)dnl +]) + +# ******************************************************************** +# lcmessage.m4 from gettext 0.32 +# Check whether LC_MESSAGES is available in <locale.h>. +# Ulrich Drepper <drepper@cygnus.com>, 1995. +# +# This file file be copied and used freely without restrictions. It can +# be used in projects which are not available under the GNU Public License +# but which still want to provide support for the GNU gettext functionality. +# Please note that the actual code is *not* freely available. + +# serial 1 + +AC_DEFUN(AM_LC_MESSAGES, + [if test $ac_cv_header_locale_h = yes; then + AC_CACHE_CHECK([for LC_MESSAGES], am_cv_val_LC_MESSAGES, + [AC_TRY_LINK([#include <locale.h>], [return LC_MESSAGES], + am_cv_val_LC_MESSAGES=yes, am_cv_val_LC_MESSAGES=no)]) + if test $am_cv_val_LC_MESSAGES = yes; then + AC_DEFINE(HAVE_LC_MESSAGES) + fi + fi]) + + +# ******************************************************************** +# gettext.m4 from gettext 0.32 +# Macro to add for using GNU gettext. +# Ulrich Drepper <drepper@cygnus.com>, 1995. +# +# This file file be copied and used freely without restrictions. It can +# be used in projects which are not available under the GNU Public License +# but which still want to provide support for the GNU gettext functionality. +# Please note that the actual code is *not* freely available. + +# serial 3 + +AC_DEFUN(AM_WITH_NLS, + [AC_MSG_CHECKING([whether NLS is requested]) + dnl Default is enabled NLS + AC_ARG_ENABLE(nls, + [ --disable-nls do not use Native Language Support], + USE_NLS=$enableval, USE_NLS=yes) + AC_MSG_RESULT($USE_NLS) + AC_SUBST(USE_NLS) + + USE_INCLUDED_LIBINTL=no + + dnl If we use NLS figure out what method + if test "$USE_NLS" = "yes"; then + AC_DEFINE(ENABLE_NLS) + AC_MSG_CHECKING([whether included gettext is requested]) + AC_ARG_WITH(included-gettext, + [ --with-included-gettext use the GNU gettext library included here], + nls_cv_force_use_gnu_gettext=$withval, + nls_cv_force_use_gnu_gettext=no) + AC_MSG_RESULT($nls_cv_force_use_gnu_gettext) + + nls_cv_use_gnu_gettext="$nls_cv_force_use_gnu_gettext" + if test "$nls_cv_force_use_gnu_gettext" != "yes"; then + dnl User does not insist on using GNU NLS library. Figure out what + dnl to use. If gettext or catgets are available (in this order) we + dnl use this. Else we have to fall back to GNU NLS library. + dnl catgets is only used if permitted by option --with-catgets. + nls_cv_header_intl= + nls_cv_header_libgt= + CATOBJEXT=NONE + + AC_CHECK_HEADER(libintl.h, + [AC_CACHE_CHECK([for gettext in libc], gt_cv_func_gettext_libc, + [AC_TRY_LINK([#include <libintl.h>], [return (int) gettext ("")], + gt_cv_func_gettext_libc=yes, gt_cv_func_gettext_libc=no)]) + + if test "$gt_cv_func_gettext_libc" != "yes"; then + AC_CHECK_LIB(intl, bindtextdomain, + [AC_CACHE_CHECK([for gettext in libintl], + gt_cv_func_gettext_libintl, + [AC_TRY_LINK([], [return (int) gettext ("")], + gt_cv_func_gettext_libintl=yes, + gt_cv_func_gettext_libintl=no)])]) + fi + + if test "$gt_cv_func_gettext_libintl" = "yes"; then + LIBS="-lintl $LIBS" + fi + + if test "$gt_cv_func_gettext_libc" = "yes" \ + || test "$gt_cv_func_gettext_libintl" = "yes"; then + AC_DEFINE(HAVE_GETTEXT) + AM_PATH_PROG_WITH_TEST(MSGFMT, msgfmt, + [test -z "`$ac_dir/$ac_word -h 2>&1 | grep 'dv '`"], no)dnl + if test "$MSGFMT" != "no"; then + AC_CHECK_FUNCS(dcgettext) + AC_PATH_PROG(GMSGFMT, gmsgfmt, $MSGFMT) + AM_PATH_PROG_WITH_TEST(XGETTEXT, xgettext, + [test -z "`$ac_dir/$ac_word -h 2>&1 | grep '(HELP)'`"], :) + AC_TRY_LINK(, [extern int _nl_msg_cat_cntr; + return _nl_msg_cat_cntr], + [CATOBJEXT=.gmo + DATADIRNAME=share], + [CATOBJEXT=.mo + DATADIRNAME=lib]) + INSTOBJEXT=.mo + fi + fi + ]) + + if test "$CATOBJEXT" = "NONE"; then + AC_MSG_CHECKING([whether catgets can be used]) + AC_ARG_WITH(catgets, + [ --with-catgets use catgets functions if available], + nls_cv_use_catgets=$withval, nls_cv_use_catgets=no) + AC_MSG_RESULT($nls_cv_use_catgets) + + if test "$nls_cv_use_catgets" = "yes"; then + dnl No gettext in C library. Try catgets next. + AC_CHECK_LIB(i, main) + AC_CHECK_FUNC(catgets, + [AC_DEFINE(HAVE_CATGETS) + INTLOBJS="\$(CATOBJS)" + AC_PATH_PROG(GENCAT, gencat, no)dnl + if test "$GENCAT" != "no"; then + AC_PATH_PROG(GMSGFMT, gmsgfmt, no) + if test "$GMSGFMT" = "no"; then + AM_PATH_PROG_WITH_TEST(GMSGFMT, msgfmt, + [test -z "`$ac_dir/$ac_word -h 2>&1 | grep 'dv '`"], no) + fi + AM_PATH_PROG_WITH_TEST(XGETTEXT, xgettext, + [test -z "`$ac_dir/$ac_word -h 2>&1 | grep '(HELP)'`"], :) + USE_INCLUDED_LIBINTL=yes + CATOBJEXT=.cat + INSTOBJEXT=.cat + DATADIRNAME=lib + INTLDEPS='$(top_builddir)/intl/libintl.a' + INTLLIBS=$INTLDEPS + LIBS=`echo $LIBS | sed -e 's/-lintl//'` + nls_cv_header_intl=intl/libintl.h + nls_cv_header_libgt=intl/libgettext.h + fi]) + fi + fi + + if test "$CATOBJEXT" = "NONE"; then + dnl Neither gettext nor catgets in included in the C library. + dnl Fall back on GNU gettext library. + nls_cv_use_gnu_gettext=yes + fi + fi + + if test "$nls_cv_use_gnu_gettext" = "yes"; then + dnl Mark actions used to generate GNU NLS library. + INTLOBJS="\$(GETTOBJS)" + AM_PATH_PROG_WITH_TEST(MSGFMT, msgfmt, + [test -z "`$ac_dir/$ac_word -h 2>&1 | grep 'dv '`"], msgfmt) + AC_PATH_PROG(GMSGFMT, gmsgfmt, $MSGFMT) + AM_PATH_PROG_WITH_TEST(XGETTEXT, xgettext, + [test -z "`$ac_dir/$ac_word -h 2>&1 | grep '(HELP)'`"], :) + AC_SUBST(MSGFMT) + USE_INCLUDED_LIBINTL=yes + CATOBJEXT=.gmo + INSTOBJEXT=.mo + DATADIRNAME=share + INTLDEPS='$(top_builddir)/intl/libintl.a' + INTLLIBS=$INTLDEPS + LIBS=`echo $LIBS | sed -e 's/-lintl//'` + nls_cv_header_intl=intl/libintl.h + nls_cv_header_libgt=intl/libgettext.h + fi + + dnl Test whether we really found GNU xgettext. + if test "$XGETTEXT" != ":"; then + dnl If it is no GNU xgettext we define it as : so that the + dnl Makefiles still can work. + if $XGETTEXT --omit-header /dev/null 2> /dev/null; then + : ; + else + AC_MSG_RESULT( + [found xgettext programs is not GNU xgettext; ignore it]) + XGETTEXT=":" + fi + fi + + # We need to process the po/ directory. + POSUB=po + else + DATADIRNAME=share + nls_cv_header_intl=intl/libintl.h + nls_cv_header_libgt=intl/libgettext.h + fi + + # If this is used in GNU gettext we have to set USE_NLS to `yes' + # because some of the sources are only built for this goal. + if test "$PACKAGE" = gettext; then + USE_NLS=yes + USE_INCLUDED_LIBINTL=yes + fi + + dnl These rules are solely for the distribution goal. While doing this + dnl we only have to keep exactly one list of the available catalogs + dnl in configure.in. + for lang in $ALL_LINGUAS; do + GMOFILES="$GMOFILES $lang.gmo" + POFILES="$POFILES $lang.po" + done + + dnl Make all variables we use known to autoconf. + AC_SUBST(USE_INCLUDED_LIBINTL) + AC_SUBST(CATALOGS) + AC_SUBST(CATOBJEXT) + AC_SUBST(DATADIRNAME) + AC_SUBST(GMOFILES) + AC_SUBST(INSTOBJEXT) + AC_SUBST(INTLDEPS) + AC_SUBST(INTLLIBS) + AC_SUBST(INTLOBJS) + AC_SUBST(POFILES) + AC_SUBST(POSUB) + ]) + +AC_DEFUN(AM_GNU_GETTEXT, + [AC_REQUIRE([AC_PROG_MAKE_SET])dnl + AC_REQUIRE([AC_PROG_CC])dnl + AC_REQUIRE([AC_PROG_RANLIB])dnl + AC_REQUIRE([AC_ISC_POSIX])dnl + AC_REQUIRE([AC_HEADER_STDC])dnl + AC_REQUIRE([AC_C_CONST])dnl + AC_REQUIRE([AC_C_INLINE])dnl + AC_REQUIRE([AC_TYPE_OFF_T])dnl + AC_REQUIRE([AC_TYPE_SIZE_T])dnl + AC_REQUIRE([AC_FUNC_ALLOCA])dnl + AC_REQUIRE([AC_FUNC_MMAP])dnl + + AC_CHECK_HEADERS([argz.h limits.h locale.h nl_types.h malloc.h string.h \ +unistd.h values.h sys/param.h]) + AC_CHECK_FUNCS([getcwd munmap putenv setenv setlocale strchr strcasecmp \ +__argz_count __argz_stringify __argz_next]) + + if test "${ac_cv_func_stpcpy+set}" != "set"; then + AC_CHECK_FUNCS(stpcpy) + fi + if test "${ac_cv_func_stpcpy}" = "yes"; then + AC_DEFINE(HAVE_STPCPY) + fi + + AM_LC_MESSAGES + AM_WITH_NLS + + if test "x$CATOBJEXT" != "x"; then + if test "x$ALL_LINGUAS" = "x"; then + LINGUAS= + else + AC_MSG_CHECKING(for catalogs to be installed) + NEW_LINGUAS= + for lang in ${LINGUAS=$ALL_LINGUAS}; do + case "$ALL_LINGUAS" in + *$lang*) NEW_LINGUAS="$NEW_LINGUAS $lang" ;; + esac + done + LINGUAS=$NEW_LINGUAS + AC_MSG_RESULT($LINGUAS) + fi + + dnl Construct list of names of catalog files to be constructed. + if test -n "$LINGUAS"; then + for lang in $LINGUAS; do CATALOGS="$CATALOGS $lang$CATOBJEXT"; done + fi + fi + + dnl The reference to <locale.h> in the installed <libintl.h> file + dnl must be resolved because we cannot expect the users of this + dnl to define HAVE_LOCALE_H. + if test $ac_cv_header_locale_h = yes; then + INCLUDE_LOCALE_H="#include <locale.h>" + else + INCLUDE_LOCALE_H="\ +/* The system does not provide the header <locale.h>. Take care yourself. */" + fi + AC_SUBST(INCLUDE_LOCALE_H) + + dnl Determine which catalog format we have (if any is needed) + dnl For now we know about two different formats: + dnl Linux libc-5 and the normal X/Open format + test -d intl || mkdir intl + if test "$CATOBJEXT" = ".cat"; then + AC_CHECK_HEADER(linux/version.h, msgformat=linux, msgformat=xopen) + + dnl Transform the SED scripts while copying because some dumb SEDs + dnl cannot handle comments. + sed -e '/^#/d' $srcdir/intl/$msgformat-msg.sed > intl/po2msg.sed + fi + dnl po2tbl.sed is always needed. + sed -e '/^#.*[^\\]$/d' -e '/^#$/d' \ + $srcdir/intl/po2tbl.sed.in > intl/po2tbl.sed + + dnl In the intl/Makefile.in we have a special dependency which makes + dnl only sense for gettext. We comment this out for non-gettext + dnl packages. + if test "$PACKAGE" = "gettext"; then + GT_NO="#NO#" + GT_YES= + else + GT_NO= + GT_YES="#YES#" + fi + AC_SUBST(GT_NO) + AC_SUBST(GT_YES) + + dnl If the AC_CONFIG_AUX_DIR macro for autoconf is used we possibly + dnl find the mkinstalldirs script in another subdir but ($top_srcdir). + dnl Try to locate is. + MKINSTALLDIRS= + if test -z "$MKINSTALLDIRS"; then + MKINSTALLDIRS="\$(top_srcdir)/mkinstalldirs" + fi + AC_SUBST(MKINSTALLDIRS) + + dnl *** For now the libtool support in intl/Makefile is not for real. + l= + AC_SUBST(l) + ]) + diff --git a/m4/old/configure.in-0.92 b/m4/old/configure.in-0.92 new file mode 100644 index 0000000..6449024 --- /dev/null +++ b/m4/old/configure.in-0.92 @@ -0,0 +1,248 @@ +dnl Process this file with autoconf to produce a configure script. -*-sh-*- +AC_INIT(include/config.h.in) +AC_CONFIG_HEADER(include/config.h) +# AC_PREREQ(2.10)dnl dnl Minimum Autoconf version required. +# AC_ARG_PROGRAM + +# version code: +V_MAJOR=0 +V_MINOR=93 + +PACKAGE=xsane + +BINPROGS="xsane" + +# languages +ALL_LINGUAS="cs da de es fr it ja nl pt pt_BR ro ru sk sl sr sv vi tr zh" + +SANE_V_MAJOR=1 +VERSION=${V_MAJOR}.${V_MINOR} +PACKAGE_VERSION="$PACKAGE-$VERSION" +AC_DEFINE_UNQUOTED(PACKAGE, "$PACKAGE") +AC_DEFINE_UNQUOTED(VERSION, "$VERSION") +AC_DEFINE_UNQUOTED(PACKAGE_VERSION, "$PACKAGE_VERSION") +AC_SUBST(PACKAGE) +AC_SUBST(VERSION) +AC_SUBST(PACKAGE_VERSION) +AC_SUBST(SANE_MAJOR) + + +dnl Check args + +dnl Check for gimp plugin support +AC_MSG_CHECKING([whether GIMP plugin is requested]) +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_MSG_RESULT($USE_GIMP) + +dnl Check for jpeg support +AC_MSG_CHECKING([whether JPEG support is requested]) +dnl Default is enabled JPEG +AC_ARG_ENABLE(jpeg, [ --disable-jpeg do not include JPEG support], USE_JPEG=$enableval, USE_JPEG=yes) +AC_MSG_RESULT($USE_JPEG) + +dnl Check for png support +AC_MSG_CHECKING([whether PNG support is requested]) +dnl Default is enabled PNG +AC_ARG_ENABLE(png, [ --disable-png do not include PNG support], USE_PNG=$enableval, USE_PNG=yes) +AC_MSG_RESULT($USE_PNG) + +dnl Check for tiff support +AC_MSG_CHECKING([whether TIFF support is requested]) +dnl Default is enabled TIFF +AC_ARG_ENABLE(tiff, [ --disable-tiff do not include TIFF support], USE_TIFF=$enableval, USE_TIFF=yes) +AC_MSG_RESULT($USE_TIFF) + + +dnl Checks for programs. +AC_PROG_CC +AC_AIX +AC_MINIX +AC_ISC_POSIX +AM_PROG_CC_STDC +AC_PROG_INSTALL +AC_PROG_MAKE_SET +AC_PROG_CPP +AC_PROG_GCC_TRADITIONAL + +INCLUDES="${INCLUDES} -I/usr/local/include" +CPPFLAGS="${CPPFLAGS} -D_GNU_SOURCE" +if test "${ac_cv_prog_gcc}" = "yes"; then + CFLAGS="${CFLAGS} -Wall" +fi + +dnl Checks for header files. +AC_HEADER_STDC +AC_CHECK_HEADERS(os2.h fcntl.h unistd.h libc.h sys/time.h sys/types.h zlib.h) + +dnl Checks for typedefs, structures, and compiler characteristics. +AC_C_CONST +AC_C_INLINE +AC_TYPE_SIGNAL +AC_TYPE_SIZE_T +AC_TYPE_PID_T +AC_CHECK_TYPE(ssize_t, long) +AC_CHECK_TYPE(u_char, unsigned char) +AC_CHECK_TYPE(u_int, unsigned int) +AC_CHECK_TYPE(u_long, unsigned long) + +dnl Checks for libraries. +AC_CHECK_LIB(m, sqrt) +AC_CHECK_LIB(z, deflateInit_) + +if test "${USE_JPEG}" = "yes"; then + AC_CHECK_LIB(jpeg, jpeg_start_decompress) +fi + +# tiff test must stand after test for zlib +if test "${USE_TIFF}" = "yes"; then + AC_CHECK_LIB(tiff, TIFFOpen) +fi + +dnl Checks for library functions. +AM_FUNC_ALLOCA +AC_FUNC_MMAP +AC_CHECK_FUNCS(atexit mkdir sigprocmask strdup strndup strftime strstr strsep strtod snprintf usleep strcasecmp strncasecmp lstat) + +dnl Check for NLS/gettext +AM_GNU_GETTEXT +AC_LINK_FILES($nls_cv_header_libgt, $nls_cv_header_intl) + +if test "$USE_NLS" = yes; then + if test "$USE_INCLUDED_LIBINTL" = yes; then + CPPFLAGS="$CPPFLAGS -I\$(top_builddir)/intl" + INTLSUB=intl + fi +fi + +AC_SUBST(INTLSUB) + +AM_PATH_SANE(1.0.0, HAVE_SANE=yes, ) + +dnl *** if xsane is compiled as gimp plugin it is possible that we do not +dnl *** need the test for gtk, but when we have gimp-1.0.x installed +dnl *** (gimp-1.0.x does not have gimp-config) or we compile xsane without +dnl *** gimp support we need the test for gtk +AM_PATH_GTK2(2.0.0, HAVE_GTK=yes, ) +if test "x${HAVE_GTK}" = "x"; then + AM_PATH_GTK(1.2.0, HAVE_GTK=yes, ) +fi + +if test "${USE_GIMP}" = "yes"; then + AM_PATH_GIMP(1.0.0, HAVE_GIMP=yes) +fi + + +# png test must stand after test for zlib +# png test must stand behind GTK-check (X-Window-check) +# because png.h is located in the X11 directory on some systems +# so we have to use GTK_CFLAGS and GTK_LIBS to test for png +if test "${USE_PNG}" = "yes"; then + saved_CPPFLAGS="${CPPFLAGS}" + + if test "x${HAVE_GTK}" != "x"; then + CPPFLAGS="${CPPFLAGS} ${GTK_CFLAGS}" + fi + + AC_CHECK_HEADERS(png.h, [AC_CHECK_LIB(png, png_create_info_struct,,, ${GTK_LIBS})]) + CPPFLAGS="${saved_CPPFLAGS}" +fi + + +AC_SUBST(INCLUDES) +AC_SUBST(BINPROGS) +AC_SUBST(GTK_CFLAGS) +AC_SUBST(GTK_LIBS) +AC_SUBST(GIMP_LIBS) +CPPFLAGS="${CPPFLAGS} \ + -DV_MAJOR=${V_MAJOR} -DV_MINOR=${V_MINOR} -DSANE_V_MAJOR=${SANE_V_MAJOR}" + +dnl Print error message if sane or gtk is missing +if test "x${HAVE_SANE}" = "x"; then + echo "****************************************************************" + echo "ERROR: SANE-1.0.0 or newer is needed for compiling xsane" + echo " - if you installed SANE as rpm make sure you also included" + echo " sane-devel" + echo "****************************************************************" + echo "" + exit +fi + +if test "x${HAVE_GTK}" = "x"; then + echo "****************************************************************" + echo "ERROR: GTK-1.2.0 or newer is needed for compiling xsane" + echo " if you installed gtk as rpm make sure you also included" + echo " gtk-devel" + echo "****************************************************************" + echo "" + exit +fi + + +AC_SUBST(V_MAJOR) +AC_SUBST(V_MINOR) +AC_SUBST(DLL_PRELOAD) + +AC_ARG_ENABLE(foo1, [ +Used environment variables that can be set by user: + CFLAGS, CPPFLAGS, LDFLAGS, LIBS]) + +AC_ARG_ENABLE(foo2, [ +To add include or library paths call: + [env] CPPFLAGS=\"-I/path/to/foo/include\" LDFLAGS=\"-L/path/to/foo/libs\" ./configure]) + +AC_OUTPUT([Makefile intl/Makefile po/Makefile lib/Makefile + src/Makefile include/Makefile doc/Makefile xsane.spec],) + +echo "****************************************************************" +echo "* *" +echo "* XSANE configure status: *" +echo "* ----------------------- *" + +if test "${USE_NLS}" = "yes"; then + if test "$USE_INCLUDED_LIBINTL" = yes; then + echo "* - NLS activated (package internal) *" + else + echo "* - NLS activated (external) *" + fi +else + echo "* - NLS deactivated *" +fi + +if test "${GIMP_LIBS}set" != "set"; then + echo "* - GIMP plugin activated *" +else + echo "* - GIMP plugin deactivated *" +fi + +if test "${ac_cv_lib_jpeg_jpeg_start_decompress}" = "yes"; then + echo "* - JPEG support activated *" +else + echo "* - JPEG support deactivated *" +fi + +if test "${ac_cv_lib_tiff_TIFFOpen}" = "yes"; then + echo "* - TIFF support activated *" +else + echo "* - TIFF support deactivated *" +fi + +if test "${ac_cv_lib_png_png_create_info_struct}" = "yes"; then + echo "* - PNG support activated *" +else + echo "* - PNG support deactivated *" +fi + +echo "* *" +echo "****************************************************************" +echo "* *" +echo "* To compile XSANE: *" +echo "* ----------------- *" +echo "* make *" +echo "* make install *" +echo "* *" +echo "* ------------------------------------------------------------ *" +echo "* ... PLEASE READ SANE DOCUMENTATION BEFORE STARTING XSANE ... *" +echo "* ------------------------------------------------------------ *" +echo "****************************************************************" +cat xsane.NEWS diff --git a/m4/old/gimp.m4 b/m4/old/gimp.m4 new file mode 100644 index 0000000..313f180 --- /dev/null +++ b/m4/old/gimp.m4 @@ -0,0 +1,211 @@ +# Configure paths for GIMP +# Manish Singh 98-6-11 +# Shamelessly stolen from Owen Taylor + +dnl AM_PATH_GIMP([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, +[dnl +dnl Get the cflags and libraries from the gimptool 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 + 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 + fi + fi + + AC_PATH_PROG(GIMPTOOL, gimptool, no) + min_gimp_version=ifelse([$1], ,1.0.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 to some extent +dnl + rm -f conf.gimptest + AC_TRY_RUN([ +#include <stdio.h> +#include <stdlib.h> + +#include <libgimp/gimp.h> + +#ifndef GIMP_CHECK_VERSION +#define GIMP_CHECK_VERSION(major, minor, micro) \ + (GIMP_MAJOR_VERSION > (major) || \ + (GIMP_MAJOR_VERSION == (major) && GIMP_MINOR_VERSION > (minor)) || \ + (GIMP_MAJOR_VERSION == (major) && GIMP_MINOR_VERSION == (minor) && \ + GIMP_MICRO_VERSION >= (micro))) +#endif + +#if GIMP_CHECK_VERSION(1,1,24) +GimpPlugInInfo +#else +GPlugInInfo +#endif +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, µ) != 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 --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 is correct, then it is\n", major, minor, micro); + printf("*** best to upgrade to the required version.\n"); + printf("*** If gimptool was wrong, set the environment variable GIMPTOOL\n"); + printf("*** to point to the correct copy of gimptool, 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 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." + 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> + +#ifndef GIMP_CHECK_VERSION +#define GIMP_CHECK_VERSION(major, minor, micro) \ + (GIMP_MAJOR_VERSION > (major) || \ + (GIMP_MAJOR_VERSION == (major) && GIMP_MINOR_VERSION > (minor)) || \ + (GIMP_MAJOR_VERSION == (major) && GIMP_MINOR_VERSION == (minor) && \ + GIMP_MICRO_VERSION >= (micro))) +#endif + +#if GIMP_CHECK_VERSION(1,1,24) +GimpPlugInInfo +#else +GPlugInInfo +#endif +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 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 +]) diff --git a/m4/old/gtk2.m4 b/m4/old/gtk2.m4 new file mode 100644 index 0000000..5d43f02 --- /dev/null +++ b/m4/old/gtk2.m4 @@ -0,0 +1,39 @@ +###################################################################### +# Configure paths for GTK+2 +# Oliver Rauch 2002-06-17 + +dnl AM_PATH_GTK2_EXTENDED([MINIMUM-VERSION, [ACTION-IF-FOUND [, ACTION-IF-NOT-FOUND]]]) +dnl Test for GTK+-2.0.x, and define GTK_CFLAGS and GTK_LIBS +dnl +AC_DEFUN(AM_PATH_GTK2_EXTENDED, +[ + AC_ARG_ENABLE(gtk2, [ --disable-gtk2 Do not use gtk+-2.0.x], USE_GTK2=$enableval, USE_GTK2=yes) + + if test $USE_GTK2 != no ; then + min_gtk_version=ifelse([$1], ,2.0.0,$1) + if `pkg-config --atleast-pkgconfig-version=0` ; then + AC_MSG_CHECKING(for GTK - version >= $min_gtk_version) + if `pkg-config gtk+-2.0 --atleast-version=$min_gtk_version` ; then + GTK_CFLAGS=`pkg-config gtk+-2.0 --cflags` + GTK_LIBS=`pkg-config gtk+-2.0 --libs` + AC_MSG_RESULT(yes) + ifelse([$2], , :, [$2]) + else + AC_MSG_RESULT(no) + ifelse([$3], , :, [$3]) + fi + else + AC_MSG_WARN(***************************************************************) + AC_MSG_WARN(*** pgk-config is not avilable: test for gtk2 not possible ****) + AC_MSG_WARN(***************************************************************) + ifelse([$3], , :, [$3]) + fi + else + ifelse([$3], , :, [$3]) + fi + + + AC_SUBST(GTK_CFLAGS) + AC_SUBST(GTK_LIBS) +] +) diff --git a/m4/sane.m4 b/m4/sane.m4 new file mode 100644 index 0000000..d0dc89c --- /dev/null +++ b/m4/sane.m4 @@ -0,0 +1,149 @@ +# ******************************************************************** +# Configure paths for SANE +# Oliver Rauch 2000-10-30 + +dnl AM_PATH_SANE([MINIMUM-VERSION, [ACTION-IF-FOUND [, ACTION-IF-NOT-FOUND]]]) +dnl Test for SANE, and define SANE_CFLAGS and SANE_LIBS +dnl +AC_DEFUN(AM_PATH_SANE, +[dnl +dnl Get the cflags and libraries from the sane-config script +dnl + AC_ARG_ENABLE(sanetest, [ --disable-sanetest Do not try to compile and run a test SANE program], , enable_sanetest=yes) + + AC_PATH_PROG(SANE_CONFIG, sane-config, no) + min_sane_version=ifelse([$1], ,1.0.0,$1) + AC_MSG_CHECKING(for SANE - version >= $min_sane_version) + no_sane="" + if test "$SANE_CONFIG" = "no" ; then + no_sane=yes + else + SANE_CFLAGS=`$SANE_CONFIG $sane_config_args --cflags` + SANE_LDFLAGS=`$SANE_CONFIG $sane_config_args --ldflags` +# SANE_LIBS=`$SANE_CONFIG $sane_config_args --libs` + SANE_LIBS=`$SANE_CONFIG $sane_config_args --libs | sed -e 's/-lintl//g'` + SANE_PREFIX=`$SANE_CONFIG $sane_config_args --prefix` + sane_config_major_version=`$SANE_CONFIG $sane_config_args --version | \ + sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\1/'` + sane_config_minor_version=`$SANE_CONFIG $sane_config_args --version | \ + sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\2/'` + sane_config_micro_version=`$SANE_CONFIG $sane_config_args --version | \ + sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\3/'` + if test "x$enable_sanetest" = "xyes" ; then + ac_save_CFLAGS="$CFLAGS" + ac_save_LDFLAGS="$LDFLAGS" + ac_save_LIBS="$LIBS" + CFLAGS="$CFLAGS $SANE_CFLAGS" + LDFLAGS="$LDFLAGS $SANE_LDFLAGS" + LIBS="$LIBS $SANE_LIBS" +dnl +dnl Now check if the installed SANE is sufficiently new. (Also sanity +dnl checks the results of sane-config to some extent +dnl + rm -f conf.sanetest + AC_TRY_RUN([ +#include <sane/sane.h> +#include <stdio.h> + +int +main () +{ + int major, minor, micro; + + system ("touch conf.sanetest"); + + if (sscanf("$min_sane_version", "%d.%d.%d", &major, &minor, µ) != 3) { + printf("%s, bad version string\n", "$min_sane_version"); + exit(1); + } + + if ( ($sane_config_major_version == major) && + ( ($sane_config_minor_version > minor) || + ( ($sane_config_minor_version == minor) && ($sane_config_micro_version >= micro)))) + { + return 0; + } + else if ($sane_config_major_version > major) + { + printf("\n*** A too new version of SANE (%d.%d.%d) was found.\n", + $sane_config_major_version, $sane_config_minor_version, $sane_config_micro_version); + printf("*** You need a version of SANE with the major version number %d.\n", major); + } + else + { + printf("\n*** An old version of SANE (%d.%d.%d) was found.\n", + $sane_config_major_version, $sane_config_minor_version, $sane_config_micro_version); + printf("*** You need a version of SANE newer than %d.%d.%d. The latest version of\n", + major, minor, micro); + } + + printf("*** SANE is always available from ftp://ftp.mostang.com\n"); + printf("***\n"); + printf("*** If you have already installed a sufficient version, this error\n"); + printf("*** probably means that the wrong copy of the sane-config shell script is\n"); + printf("*** being found. The easiest way to fix this is to remove the old version\n"); + printf("*** of SANE, but you can also set the SANE_CONFIG environment to point to the\n"); + printf("*** correct copy of sane-config. (In this case, you will have to\n"); + printf("*** modify your LD_LIBRARY_PATH enviroment variable, or edit /etc/ld.so.conf\n"); + printf("*** so that the correct libraries are found at run-time))\n"); + + return 1; +} +],, no_sane=yes,[echo $ac_n "cross compiling; assumed OK... $ac_c"]) + CFLAGS="$ac_save_CFLAGS" + LDFLAGS="$ac_save_LDFLAGS" + LIBS="$ac_save_LIBS" + fi + fi + if test "x$no_sane" = x ; then + AC_MSG_RESULT(yes) + ifelse([$2], , :, [$2]) + else + AC_MSG_RESULT(no) + if test "$SANE_CONFIG" = "no" ; then + echo "*** The sane-config script installed by SANE could not be found" + echo "*** If SANE was installed in PREFIX, make sure PREFIX/bin is in" + echo "*** your path, or set the SANE_CONFIG environment variable to the" + echo "*** full path to sane-config." + else + if test -f conf.sanetest ; then + : + else + echo "*** Could not run SANE test program, checking why..." + CFLAGS="$CFLAGS $SANE_CFLAGS" + LIBS="$LIBS $SANE_LIBS" + LDFLAGS="$LDFLAGS $SANE_LDFLAGS" + AC_TRY_LINK([ +#include <sane/sane.h> +#include <stdio.h> +], [ return (SANE_CURRENT_MAJOR); ], + [ echo "*** The test program compiled, but did not run. This usually means" + echo "*** that the run-time linker is not finding SANE or finding the wrong" + echo "*** version of SANE. If it is not finding SANE, 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 "***" ] + [ echo "*** The test program failed to compile or link. See the file config.log for the" + echo "*** exact error that occured. This usually means SANE was incorrectly installed" + echo "*** or that you have moved SANE since it was installed. In the latter case, you" + echo "*** may want to edit the sane-config script: $SANE_CONFIG" ]) + CFLAGS="$ac_save_CFLAGS" + LDFLAGS="$ac_save_LDFLAGS" + LIBS="$ac_save_LIBS" + fi + fi + SANE_CFLAGS="" + SANE_LDFLAGS="" + SANE_LIBS="" + ifelse([$3], , :, [$3]) + fi + AC_SUBST(SANE_LDFLAGS) + AC_SUBST(SANE_CFLAGS) + AC_SUBST(SANE_LIBS) + AC_SUBST(SANE_PREFIX) + rm -f conf.sanetest +]) |