This commit was manufactured by cvs2svn to create branch 'gtk2'.

Cherrypick from master 2004-02-17 08:53:12 UTC twb 'enable building with automake 1.8.x':
    m4/Makefile.am
    m4/README
    m4/aclocal-include.m4
    m4/aspell.m4
    m4/check-type.m4
    m4/gnupg-check-typedef.m4
    m4/missing/gdk-pixbuf.m4
    m4/missing/gettext.m4
    m4/missing/gpgme.m4
    m4/missing/imlib.m4
    m4/openssl.m4
    m4/spamassassin.m4
    src/folderutils.c
    src/folderutils.h
    src/pixmaps/linewrapcurrent.xpm
    src/prefs_ext_prog.c
    src/prefs_themes.c
    tools/textviewer.sh
This commit is contained in:
Claws Mail Team 2004-02-17 08:53:13 +00:00
parent ec88eb9383
commit fe2dc15e4f
18 changed files with 3092 additions and 0 deletions

13
m4/Makefile.am Normal file
View file

@ -0,0 +1,13 @@
MACROS = \
aclocal-include.m4 \
check-type.m4 \
gnupg-check-typedef.m4 \
aspell.m4 \
openssl.m4 \
spamassassin.m4
EXTRA_DIST = $(MACROS) \
missing/gdk-pixbuf.m4 \
missing/gettext.m4 \
missing/gpgme.m4 \
missing/imlib.m4

6
m4/README Normal file
View file

@ -0,0 +1,6 @@
If you encountered errors like:
aclocal: configure.in: ??: macro `AM_SOMETHING' not found in library
when executing autogen.sh, copy the corresponding m4 files in the missing/
directory into here (or install the development packages).

12
m4/aclocal-include.m4 Normal file
View file

@ -0,0 +1,12 @@
# aclocal-include.m4
#
# This macro adds the name macrodir to the set of directories
# that `aclocal' searches for macros.
dnl SYLPHEED_ACLOCAL_INCLUDE(macrodir)
AC_DEFUN([SYLPHEED_ACLOCAL_INCLUDE],
[
test -n "$ACLOCAL_FLAGS" && ACLOCAL="$ACLOCAL $ACLOCAL_FLAGS"
for k in $1 ; do ACLOCAL="$ACLOCAL -I $k" ; done
])

149
m4/aspell.m4 Normal file
View file

@ -0,0 +1,149 @@
dnl Autoconf macros for libaspell
dnl $Id$
# Configure paths for ASPELL
# Shamelessly stolen from the one of GPGME by Werner Koch
# Melvin Hadasht 2001-09-17, 2002
dnl AM_PATH_ASPELL([MINIMUM-VERSION,
dnl [ACTION-IF-FOUND [, ACTION-IF-NOT-FOUND ]]])
dnl Test for aspell, and define ASPELL_CFLAGS, ASPELL_LIBS and ASPELL_PATH
dnl
AC_DEFUN([AM_PATH_ASPELL],
[dnl
dnl Get the cflags and libraries from the aspell-config script
dnl
AC_ARG_WITH(aspell-prefix,
[ --with-aspell-prefix=PFX Prefix where aspell is installed (optional)],
aspell_prefix="$withval", aspell_prefix="")
AC_ARG_ENABLE(aspell-test,
[ --disable-aspell-test Do not try to compile and run a test GNU/aspell program],
, enable_aspelltest=yes)
AC_ARG_WITH(aspell-libs,
[ --with-aspell-libs=LIBS Where GNU/aspell library reside (/usr/local/lib)],
aspell_libs="$withval", aspell_libs="")
AC_ARG_WITH(aspell-includes,
[ --with-aspell-includes=INCLUDES Where GNU/aspell headers reside (/usr/local/include)],
aspell_includes="$withval", aspell_includes="")
if test x$aspell_prefix != x ; then
if test x${ASPELL+set} != xset ; then
ASPELL=$aspell_prefix/bin/aspell
fi
if test x$aspell_includes = x ; then
aspell_includes=$aspell_prefix/include
fi
if test x$aspell_libs = x ; then
aspell_libs=$aspell_prefix/lib
fi
aspell_path=$aspell_prefix/lib/aspell
fi
if test x$aspell_includes = x ; then
aspell_includes=/usr/local/include
fi
if test x$aspell_libs = x ; then
aspell_libs=/usr/local/lib
fi
if test x$aspell_path = x ; then
aspell_path=/usr/local/lib/aspell
fi
if test "x$enable_aspelltest" != "xyes" ; then
echo "*** Disabling GNU/aspell tests upon user request"
ASPELL_CFLAGS="-I$aspell_includes"
ASPELL_LIBS="-L$aspell_libs -laspell"
AC_DEFINE_UNQUOTED(ASPELL_PATH, "${aspell_path}/", Define ASPELL's default directory)
ifelse([$2], , :, [$2])
else
AC_PATH_PROG(ASPELL, aspell, no)
min_aspell_version=ifelse([$1], ,.50,$1)
AC_MSG_CHECKING(for GNU/aspell - version >= $min_aspell_version)
no_aspell=""
if test "$ASPELL" = "no" ; then
echo "*** The aspell executable could not be found"
echo "*** If aspell was installed in PREFIX, make sure PREFIX/bin is in"
echo "*** your path, or set the ASPELL environment variable to the"
echo "*** full path to aspell or configure with --with-aspell-prefix=PREFIX."
ASPELL_CFLAGS=""
ASPELL_LIBS=""
ASPELL_PATH=""
no_aspell=yes
ifelse([$3], , :, [$3])
else
ASPELL_CFLAGS="-I$aspell_includes"
ASPELL_LIBS="-L$aspell_libs -laspell"
aspell_version=`$ASPELL version|sed -e "s/\(@(#) International Ispell Version 3.1.20 (but really Aspell \)\(.*\))/\2/"`
rm -f conf.aspelltest
AC_TRY_RUN([
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
int
main ()
{
system ("touch conf.aspelltest");
if(strcmp("$aspell_version","$min_aspell_version")<0){
return 1;
}
return 0;
}
],, no_aspell=yes,[echo $ac_n "cross compiling; assumed OK... $ac_c"])
rm -f conf.aspelltest
if test "x$no_aspell" = x ; then
AC_MSG_RESULT(yes)
AC_MSG_CHECKING(for GNU/aspell dictionaries location)
aspell_path="`$ASPELL config dict-dir`"
AC_DEFINE_UNQUOTED(ASPELL_PATH, "${aspell_path}/", Define ASPELL's default directory)
AC_MSG_RESULT($aspell_path)
AC_MSG_CHECKING(if GNU/aspell is correctly installed)
ac_save_CFLAGS="$CFLAGS"
ac_save_LIBS="$LIBS"
CFLAGS="$CFLAGS $ASPELL_CFLAGS"
LIBS="$LIBS $ASPELL_LIBS"
AC_TRY_RUN([
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <aspell.h>
int
main()
{
AspellConfig * aspellconfig = new_aspell_config();
return 0;
}
],, aspell_failure=yes,)
rm -f conftest.c
CFLAGS="$ac_save_CFLAGS"
LIBS="$ac_save_LIBS"
if test "x$aspell_failure" = x ; then
AC_MSG_RESULT(yes)
ifelse([$2], , :, [$2])
else
AC_MSG_RESULT(no)
echo "*** The GNU/aspell test program did not succeed. This usually means that "
echo "*** the headers and the libraries could not be found. Check config.log"
echo "*** for detailed error message and add the relevant options"
echo "*** --with-aspell-prefix, --with-aspell-includes or --with-aspell-libs"
echo "*** to the configure command."
echo "*** This can also mean that the library was not found at runtime. In that case"
echo "*** add its path to LD_LIBRARY_PATH environment variable or in /etc/ld.so.conf"
ASPELL_CFLAGS=""
ASPELL_LIBS=""
ASPELL_PATH=""
ifelse([$3], , :, [$3])
fi
else
AC_MSG_RESULT(no)
ASPELL_CFLAGS=""
ASPELL_LIBS=""
ASPELL_PATH=""
ifelse([$3], , :, [$3])
fi
fi
fi
AC_SUBST(ASPELL_CFLAGS)
AC_SUBST(ASPELL_LIBS)
AC_SUBST(ASPELL_PATH)
])

27
m4/check-type.m4 Normal file
View file

@ -0,0 +1,27 @@
dnl SYLPHEED_CHECK_TYPE(TYPE, DEFAULT [, INCLUDES, COMMENT])
dnl
dnl Like AC_CHECK_TYPE, but in addition to `sys/types.h', `stdlib.h' and
dnl `stddef.h' checks files included by INCLUDES, which should be a
dnl series of #include statements. If TYPE is not defined, define it
dnl to DEFAULT.
dnl
AC_DEFUN([SYLPHEED_CHECK_TYPE],
[AC_REQUIRE([AC_HEADER_STDC])dnl
AC_MSG_CHECKING(for $1)
AC_CACHE_VAL(sylpheed_cv_type_$1,
[AC_TRY_COMPILE([
#include <sys/types.h>
#if STDC_HEADERS
#include <stdlib.h>
#include <stddef.h>
#endif
$3
], [
#undef $1
int a = sizeof($1);
], sylpheed_cv_type_$1=yes, sylpheed_cv_type_$1=no)])dnl
AC_MSG_RESULT($sylpheed_cv_type_$1)
if test $sylpheed_cv_type_$1 = no; then
AC_DEFINE($1, $2, $4)
fi
])

17
m4/gnupg-check-typedef.m4 Normal file
View file

@ -0,0 +1,17 @@
dnl GNUPG_CHECK_TYPEDEF(TYPE, HAVE_NAME [, COMMENT])
dnl Check whether a typedef exists and create a #define $2 if it exists
dnl
AC_DEFUN([GNUPG_CHECK_TYPEDEF],
[ AC_MSG_CHECKING(for $1 typedef)
AC_CACHE_VAL(gnupg_cv_typedef_$1,
[AC_TRY_COMPILE([#include <stdlib.h>
#include <sys/types.h>], [
#undef $1
int a = sizeof($1);
], gnupg_cv_typedef_$1=yes, gnupg_cv_typedef_$1=no )])
AC_MSG_RESULT($gnupg_cv_typedef_$1)
if test "$gnupg_cv_typedef_$1" = yes; then
AC_DEFINE($2, 1, $3)
fi
])

166
m4/missing/gdk-pixbuf.m4 Normal file
View file

@ -0,0 +1,166 @@
# Configure paths for gdk-pixbuf
# Elliot Lee 2000-01-10
# stolen from Raph Levien 98-11-18
# stolen from Manish Singh 98-9-30
# stolen back from Frank Belew
# stolen from Manish Singh
# Shamelessly stolen from Owen Taylor
dnl AM_PATH_GDK_PIXBUF([MINIMUM-VERSION, [ACTION-IF-FOUND [, ACTION-IF-NOT-FOUND]]])
dnl Test for GDK_PIXBUF, and define GDK_PIXBUF_CFLAGS and GDK_PIXBUF_LIBS
dnl
AC_DEFUN([AM_PATH_GDK_PIXBUF],
[dnl
dnl Get the cflags and libraries from the gdk-pixbuf-config script
dnl
AC_ARG_WITH(gdk-pixbuf-prefix,[ --with-gdk-pixbuf-prefix=PFX Prefix where GDK_PIXBUF is installed (optional)],
gdk_pixbuf_prefix="$withval", gdk_pixbuf_prefix="")
AC_ARG_WITH(gdk-pixbuf-exec-prefix,[ --with-gdk-pixbuf-exec-prefix=PFX Exec prefix where GDK_PIXBUF is installed (optional)],
gdk_pixbuf_exec_prefix="$withval", gdk_pixbuf_exec_prefix="")
AC_ARG_ENABLE(gdk_pixbuftest, [ --disable-gdk_pixbuftest Do not try to compile and run a test GDK_PIXBUF program],
, enable_gdk_pixbuftest=yes)
if test x$gdk_pixbuf_exec_prefix != x ; then
gdk_pixbuf_args="$gdk_pixbuf_args --exec-prefix=$gdk_pixbuf_exec_prefix"
if test x${GDK_PIXBUF_CONFIG+set} = xset ; then
GDK_PIXBUF_CONFIG=$gdk_pixbuf_exec_prefix/gdk-pixbuf-config
fi
fi
if test x$gdk_pixbuf_prefix != x ; then
gdk_pixbuf_args="$gdk_pixbuf_args --prefix=$gdk_pixbuf_prefix"
if test x${GDK_PIXBUF_CONFIG+set} = xset ; then
GDK_PIXBUF_CONFIG=$gdk_pixbuf_prefix/bin/gdk-pixbuf-config
fi
fi
AC_PATH_PROG(GDK_PIXBUF_CONFIG, gdk-pixbuf-config, no)
min_gdk_pixbuf_version=ifelse([$1], ,0.2.5,$1)
AC_MSG_CHECKING(for GDK_PIXBUF - version >= $min_gdk_pixbuf_version)
no_gdk_pixbuf=""
if test "$GDK_PIXBUF_CONFIG" = "no" ; then
no_gdk_pixbuf=yes
else
GDK_PIXBUF_CFLAGS=`$GDK_PIXBUF_CONFIG $gdk_pixbufconf_args --cflags`
GDK_PIXBUF_LIBS=`$GDK_PIXBUF_CONFIG $gdk_pixbufconf_args --libs`
gdk_pixbuf_major_version=`$GDK_PIXBUF_CONFIG $gdk_pixbuf_args --version | \
sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\1/'`
gdk_pixbuf_minor_version=`$GDK_PIXBUF_CONFIG $gdk_pixbuf_args --version | \
sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\2/'`
gdk_pixbuf_micro_version=`$GDK_PIXBUF_CONFIG $gdk_pixbuf_config_args --version | \
sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\3/'`
if test "x$enable_gdk_pixbuftest" = "xyes" ; then
ac_save_CFLAGS="$CFLAGS"
ac_save_LIBS="$LIBS"
CFLAGS="$CFLAGS $GDK_PIXBUF_CFLAGS"
LIBS="$LIBS $GDK_PIXBUF_LIBS"
dnl
dnl Now check if the installed GDK_PIXBUF is sufficiently new. (Also sanity
dnl checks the results of gdk-pixbuf-config to some extent
dnl
rm -f conf.gdk_pixbuftest
AC_TRY_RUN([
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <gdk-pixbuf/gdk-pixbuf.h>
char*
my_strdup (char *str)
{
char *new_str;
if (str)
{
new_str = malloc ((strlen (str) + 1) * sizeof(char));
strcpy (new_str, str);
}
else
new_str = NULL;
return new_str;
}
int main ()
{
int major, minor, micro;
char *tmp_version;
system ("touch conf.gdk_pixbuftest");
/* HP/UX 9 (%@#!) writes to sscanf strings */
tmp_version = my_strdup("$min_gdk_pixbuf_version");
if (sscanf(tmp_version, "%d.%d.%d", &major, &minor, &micro) != 3) {
printf("%s, bad version string\n", "$min_gdk_pixbuf_version");
exit(1);
}
if (($gdk_pixbuf_major_version > major) ||
(($gdk_pixbuf_major_version == major) && ($gdk_pixbuf_minor_version > minor)) ||
(($gdk_pixbuf_major_version == major) && ($gdk_pixbuf_minor_version == minor) && ($gdk_pixbuf_micro_version >= micro)))
{
return 0;
}
else
{
printf("\n*** 'gdk-pixbuf-config --version' returned %d.%d.%d, but the minimum version\n", $gdk_pixbuf_major_version, $gdk_pixbuf_minor_version, $gdk_pixbuf_micro_version);
printf("*** of GDK_PIXBUF required is %d.%d.%d. If gdk-pixbuf-config is correct, then it is\n", major, minor, micro);
printf("*** best to upgrade to the required version.\n");
printf("*** If gdk-pixbuf-config was wrong, set the environment variable GDK_PIXBUF_CONFIG\n");
printf("*** to point to the correct copy of gdk-pixbuf-config, and remove the file\n");
printf("*** config.cache before re-running configure\n");
return 1;
}
}
],, no_gdk_pixbuf=yes,[echo $ac_n "cross compiling; assumed OK... $ac_c"])
CFLAGS="$ac_save_CFLAGS"
LIBS="$ac_save_LIBS"
fi
fi
if test "x$no_gdk_pixbuf" = x ; then
AC_MSG_RESULT(yes)
ifelse([$2], , :, [$2])
else
AC_MSG_RESULT(no)
if test "$GDK_PIXBUF_CONFIG" = "no" ; then
echo "*** The gdk-pixbuf-config script installed by GDK_PIXBUF could not be found"
echo "*** If GDK_PIXBUF was installed in PREFIX, make sure PREFIX/bin is in"
echo "*** your path, or set the GDK_PIXBUF_CONFIG environment variable to the"
echo "*** full path to gdk-pixbuf-config."
else
if test -f conf.gdk_pixbuftest ; then
:
else
echo "*** Could not run GDK_PIXBUF test program, checking why..."
CFLAGS="$CFLAGS $GDK_PIXBUF_CFLAGS"
LIBS="$LIBS $GDK_PIXBUF_LIBS"
AC_TRY_LINK([
#include <stdio.h>
#include <gdk-pixbuf/gdk-pixbuf.h>
], [ return 0; ],
[ echo "*** The test program compiled, but did not run. This usually means"
echo "*** that the run-time linker is not finding GDK_PIXBUF or finding the wrong"
echo "*** version of GDK_PIXBUF. If it is not finding GDK_PIXBUF, 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 GDK_PIXBUF was incorrectly installed"
echo "*** or that you have moved GDK_PIXBUF since it was installed. In the latter case, you"
echo "*** may want to edit the gdk-pixbuf-config script: $GDK_PIXBUF_CONFIG" ])
CFLAGS="$ac_save_CFLAGS"
LIBS="$ac_save_LIBS"
fi
fi
GDK_PIXBUF_CFLAGS=""
GDK_PIXBUF_LIBS=""
ifelse([$3], , :, [$3])
fi
AC_SUBST(GDK_PIXBUF_CFLAGS)
AC_SUBST(GDK_PIXBUF_LIBS)
rm -f conf.gdk_pixbuftest
])

415
m4/missing/gettext.m4 Normal file
View file

@ -0,0 +1,415 @@
# gettext.m4 serial 20 (gettext-0.12)
dnl Copyright (C) 1995-2003 Free Software Foundation, Inc.
dnl This file is free software, distributed under the terms of the GNU
dnl General Public License. As a special exception to the GNU General
dnl Public License, this file may be distributed as part of a program
dnl that contains a configuration script generated by Autoconf, under
dnl the same distribution terms as the rest of that program.
dnl
dnl This file can can be used in projects which are not available under
dnl the GNU General Public License or the GNU Library General Public
dnl License but which still want to provide support for the GNU gettext
dnl functionality.
dnl Please note that the actual code of the GNU gettext library is covered
dnl by the GNU Library General Public License, and the rest of the GNU
dnl gettext package package is covered by the GNU General Public License.
dnl They are *not* in the public domain.
dnl Authors:
dnl Ulrich Drepper <drepper@cygnus.com>, 1995-2000.
dnl Bruno Haible <haible@clisp.cons.org>, 2000-2003.
dnl Macro to add for using GNU gettext.
dnl Usage: AM_GNU_GETTEXT([INTLSYMBOL], [NEEDSYMBOL], [INTLDIR]).
dnl INTLSYMBOL can be one of 'external', 'no-libtool', 'use-libtool'. The
dnl default (if it is not specified or empty) is 'no-libtool'.
dnl INTLSYMBOL should be 'external' for packages with no intl directory,
dnl and 'no-libtool' or 'use-libtool' for packages with an intl directory.
dnl If INTLSYMBOL is 'use-libtool', then a libtool library
dnl $(top_builddir)/intl/libintl.la will be created (shared and/or static,
dnl depending on --{enable,disable}-{shared,static} and on the presence of
dnl AM-DISABLE-SHARED). If INTLSYMBOL is 'no-libtool', a static library
dnl $(top_builddir)/intl/libintl.a will be created.
dnl If NEEDSYMBOL is specified and is 'need-ngettext', then GNU gettext
dnl implementations (in libc or libintl) without the ngettext() function
dnl will be ignored. If NEEDSYMBOL is specified and is
dnl 'need-formatstring-macros', then GNU gettext implementations that don't
dnl support the ISO C 99 <inttypes.h> formatstring macros will be ignored.
dnl INTLDIR is used to find the intl libraries. If empty,
dnl the value `$(top_builddir)/intl/' is used.
dnl
dnl The result of the configuration is one of three cases:
dnl 1) GNU gettext, as included in the intl subdirectory, will be compiled
dnl and used.
dnl Catalog format: GNU --> install in $(datadir)
dnl Catalog extension: .mo after installation, .gmo in source tree
dnl 2) GNU gettext has been found in the system's C library.
dnl Catalog format: GNU --> install in $(datadir)
dnl Catalog extension: .mo after installation, .gmo in source tree
dnl 3) No internationalization, always use English msgid.
dnl Catalog format: none
dnl Catalog extension: none
dnl If INTLSYMBOL is 'external', only cases 2 and 3 can occur.
dnl The use of .gmo is historical (it was needed to avoid overwriting the
dnl GNU format catalogs when building on a platform with an X/Open gettext),
dnl but we keep it in order not to force irrelevant filename changes on the
dnl maintainers.
dnl
AC_DEFUN([AM_GNU_GETTEXT],
[
dnl Argument checking.
ifelse([$1], [], , [ifelse([$1], [external], , [ifelse([$1], [no-libtool], , [ifelse([$1], [use-libtool], ,
[errprint([ERROR: invalid first argument to AM_GNU_GETTEXT
])])])])])
ifelse([$2], [], , [ifelse([$2], [need-ngettext], , [ifelse([$2], [need-formatstring-macros], ,
[errprint([ERROR: invalid second argument to AM_GNU_GETTEXT
])])])])
define(gt_included_intl, ifelse([$1], [external], [no], [yes]))
define(gt_libtool_suffix_prefix, ifelse([$1], [use-libtool], [l], []))
AC_REQUIRE([AM_PO_SUBDIRS])dnl
ifelse(gt_included_intl, yes, [
AC_REQUIRE([AM_INTL_SUBDIR])dnl
])
dnl Prerequisites of AC_LIB_LINKFLAGS_BODY.
AC_REQUIRE([AC_LIB_PREPARE_PREFIX])
AC_REQUIRE([AC_LIB_RPATH])
dnl Sometimes libintl requires libiconv, so first search for libiconv.
dnl Ideally we would do this search only after the
dnl if test "$USE_NLS" = "yes"; then
dnl if test "$gt_cv_func_gnugettext_libc" != "yes"; then
dnl tests. But if configure.in invokes AM_ICONV after AM_GNU_GETTEXT
dnl the configure script would need to contain the same shell code
dnl again, outside any 'if'. There are two solutions:
dnl - Invoke AM_ICONV_LINKFLAGS_BODY here, outside any 'if'.
dnl - Control the expansions in more detail using AC_PROVIDE_IFELSE.
dnl Since AC_PROVIDE_IFELSE is only in autoconf >= 2.52 and not
dnl documented, we avoid it.
ifelse(gt_included_intl, yes, , [
AC_REQUIRE([AM_ICONV_LINKFLAGS_BODY])
])
dnl Set USE_NLS.
AM_NLS
ifelse(gt_included_intl, yes, [
BUILD_INCLUDED_LIBINTL=no
USE_INCLUDED_LIBINTL=no
])
LIBINTL=
LTLIBINTL=
POSUB=
dnl If we use NLS figure out what method
if test "$USE_NLS" = "yes"; then
gt_use_preinstalled_gnugettext=no
ifelse(gt_included_intl, yes, [
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 GNU gettext is available we use this. Else we have
dnl to fall back to GNU NLS library.
dnl Add a version number to the cache macros.
define([gt_api_version], ifelse([$2], [need-formatstring-macros], 3, ifelse([$2], [need-ngettext], 2, 1)))
define([gt_cv_func_gnugettext_libc], [gt_cv_func_gnugettext]gt_api_version[_libc])
define([gt_cv_func_gnugettext_libintl], [gt_cv_func_gnugettext]gt_api_version[_libintl])
AC_CACHE_CHECK([for GNU gettext in libc], gt_cv_func_gnugettext_libc,
[AC_TRY_LINK([#include <libintl.h>
]ifelse([$2], [need-formatstring-macros],
[#ifndef __GNU_GETTEXT_SUPPORTED_REVISION
#define __GNU_GETTEXT_SUPPORTED_REVISION(major) ((major) == 0 ? 0 : -1)
#endif
changequote(,)dnl
typedef int array [2 * (__GNU_GETTEXT_SUPPORTED_REVISION(0) >= 1) - 1];
changequote([,])dnl
], [])[extern int _nl_msg_cat_cntr;
extern int *_nl_domain_bindings;],
[bindtextdomain ("", "");
return (int) gettext ("")]ifelse([$2], [need-ngettext], [ + (int) ngettext ("", "", 0)], [])[ + _nl_msg_cat_cntr + *_nl_domain_bindings],
gt_cv_func_gnugettext_libc=yes,
gt_cv_func_gnugettext_libc=no)])
if test "$gt_cv_func_gnugettext_libc" != "yes"; then
dnl Sometimes libintl requires libiconv, so first search for libiconv.
ifelse(gt_included_intl, yes, , [
AM_ICONV_LINK
])
dnl Search for libintl and define LIBINTL, LTLIBINTL and INCINTL
dnl accordingly. Don't use AC_LIB_LINKFLAGS_BODY([intl],[iconv])
dnl because that would add "-liconv" to LIBINTL and LTLIBINTL
dnl even if libiconv doesn't exist.
AC_LIB_LINKFLAGS_BODY([intl])
AC_CACHE_CHECK([for GNU gettext in libintl],
gt_cv_func_gnugettext_libintl,
[gt_save_CPPFLAGS="$CPPFLAGS"
CPPFLAGS="$CPPFLAGS $INCINTL"
gt_save_LIBS="$LIBS"
LIBS="$LIBS $LIBINTL"
dnl Now see whether libintl exists and does not depend on libiconv.
AC_TRY_LINK([#include <libintl.h>
]ifelse([$2], [need-formatstring-macros],
[#ifndef __GNU_GETTEXT_SUPPORTED_REVISION
#define __GNU_GETTEXT_SUPPORTED_REVISION(major) ((major) == 0 ? 0 : -1)
#endif
changequote(,)dnl
typedef int array [2 * (__GNU_GETTEXT_SUPPORTED_REVISION(0) >= 1) - 1];
changequote([,])dnl
], [])[extern int _nl_msg_cat_cntr;
extern
#ifdef __cplusplus
"C"
#endif
const char *_nl_expand_alias ();],
[bindtextdomain ("", "");
return (int) gettext ("")]ifelse([$2], [need-ngettext], [ + (int) ngettext ("", "", 0)], [])[ + _nl_msg_cat_cntr + *_nl_expand_alias (0)],
gt_cv_func_gnugettext_libintl=yes,
gt_cv_func_gnugettext_libintl=no)
dnl Now see whether libintl exists and depends on libiconv.
if test "$gt_cv_func_gnugettext_libintl" != yes && test -n "$LIBICONV"; then
LIBS="$LIBS $LIBICONV"
AC_TRY_LINK([#include <libintl.h>
]ifelse([$2], [need-formatstring-macros],
[#ifndef __GNU_GETTEXT_SUPPORTED_REVISION
#define __GNU_GETTEXT_SUPPORTED_REVISION(major) ((major) == 0 ? 0 : -1)
#endif
changequote(,)dnl
typedef int array [2 * (__GNU_GETTEXT_SUPPORTED_REVISION(0) >= 1) - 1];
changequote([,])dnl
], [])[extern int _nl_msg_cat_cntr;
extern
#ifdef __cplusplus
"C"
#endif
const char *_nl_expand_alias ();],
[bindtextdomain ("", "");
return (int) gettext ("")]ifelse([$2], [need-ngettext], [ + (int) ngettext ("", "", 0)], [])[ + _nl_msg_cat_cntr + *_nl_expand_alias (0)],
[LIBINTL="$LIBINTL $LIBICONV"
LTLIBINTL="$LTLIBINTL $LTLIBICONV"
gt_cv_func_gnugettext_libintl=yes
])
fi
CPPFLAGS="$gt_save_CPPFLAGS"
LIBS="$gt_save_LIBS"])
fi
dnl If an already present or preinstalled GNU gettext() is found,
dnl use it. But if this macro is used in GNU gettext, and GNU
dnl gettext is already preinstalled in libintl, we update this
dnl libintl. (Cf. the install rule in intl/Makefile.in.)
if test "$gt_cv_func_gnugettext_libc" = "yes" \
|| { test "$gt_cv_func_gnugettext_libintl" = "yes" \
&& test "$PACKAGE" != gettext-runtime \
&& test "$PACKAGE" != gettext-tools; }; then
gt_use_preinstalled_gnugettext=yes
else
dnl Reset the values set by searching for libintl.
LIBINTL=
LTLIBINTL=
INCINTL=
fi
ifelse(gt_included_intl, yes, [
if test "$gt_use_preinstalled_gnugettext" != "yes"; then
dnl GNU gettext is not found in the C library.
dnl Fall back on included 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.
BUILD_INCLUDED_LIBINTL=yes
USE_INCLUDED_LIBINTL=yes
LIBINTL="ifelse([$3],[],\${top_builddir}/intl,[$3])/libintl.[]gt_libtool_suffix_prefix[]a $LIBICONV"
LTLIBINTL="ifelse([$3],[],\${top_builddir}/intl,[$3])/libintl.[]gt_libtool_suffix_prefix[]a $LTLIBICONV"
LIBS=`echo " $LIBS " | sed -e 's/ -lintl / /' -e 's/^ //' -e 's/ $//'`
fi
if test "$gt_use_preinstalled_gnugettext" = "yes" \
|| test "$nls_cv_use_gnu_gettext" = "yes"; then
dnl Mark actions to use GNU gettext tools.
CATOBJEXT=.gmo
fi
])
if test "$gt_use_preinstalled_gnugettext" = "yes" \
|| test "$nls_cv_use_gnu_gettext" = "yes"; then
AC_DEFINE(ENABLE_NLS, 1,
[Define to 1 if translation of program messages to the user's native language
is requested.])
else
USE_NLS=no
fi
fi
AC_MSG_CHECKING([whether to use NLS])
AC_MSG_RESULT([$USE_NLS])
if test "$USE_NLS" = "yes"; then
AC_MSG_CHECKING([where the gettext function comes from])
if test "$gt_use_preinstalled_gnugettext" = "yes"; then
if test "$gt_cv_func_gnugettext_libintl" = "yes"; then
gt_source="external libintl"
else
gt_source="libc"
fi
else
gt_source="included intl directory"
fi
AC_MSG_RESULT([$gt_source])
fi
if test "$USE_NLS" = "yes"; then
if test "$gt_use_preinstalled_gnugettext" = "yes"; then
if test "$gt_cv_func_gnugettext_libintl" = "yes"; then
AC_MSG_CHECKING([how to link with libintl])
AC_MSG_RESULT([$LIBINTL])
AC_LIB_APPENDTOVAR([CPPFLAGS], [$INCINTL])
fi
dnl For backward compatibility. Some packages may be using this.
AC_DEFINE(HAVE_GETTEXT, 1,
[Define if the GNU gettext() function is already present or preinstalled.])
AC_DEFINE(HAVE_DCGETTEXT, 1,
[Define if the GNU dcgettext() function is already present or preinstalled.])
fi
dnl We need to process the po/ directory.
POSUB=po
fi
ifelse(gt_included_intl, yes, [
dnl If this is used in GNU gettext we have to set BUILD_INCLUDED_LIBINTL
dnl to 'yes' because some of the testsuite requires it.
if test "$PACKAGE" = gettext-runtime || test "$PACKAGE" = gettext-tools; then
BUILD_INCLUDED_LIBINTL=yes
fi
dnl Make all variables we use known to autoconf.
AC_SUBST(BUILD_INCLUDED_LIBINTL)
AC_SUBST(USE_INCLUDED_LIBINTL)
AC_SUBST(CATOBJEXT)
dnl For backward compatibility. Some configure.ins may be using this.
nls_cv_header_intl=
nls_cv_header_libgt=
dnl For backward compatibility. Some Makefiles may be using this.
DATADIRNAME=share
AC_SUBST(DATADIRNAME)
dnl For backward compatibility. Some Makefiles may be using this.
INSTOBJEXT=.mo
AC_SUBST(INSTOBJEXT)
dnl For backward compatibility. Some Makefiles may be using this.
GENCAT=gencat
AC_SUBST(GENCAT)
dnl For backward compatibility. Some Makefiles may be using this.
if test "$USE_INCLUDED_LIBINTL" = yes; then
INTLOBJS="\$(GETTOBJS)"
fi
AC_SUBST(INTLOBJS)
dnl Enable libtool support if the surrounding package wishes it.
INTL_LIBTOOL_SUFFIX_PREFIX=gt_libtool_suffix_prefix
AC_SUBST(INTL_LIBTOOL_SUFFIX_PREFIX)
])
dnl For backward compatibility. Some Makefiles may be using this.
INTLLIBS="$LIBINTL"
AC_SUBST(INTLLIBS)
dnl Make all documented variables known to autoconf.
AC_SUBST(LIBINTL)
AC_SUBST(LTLIBINTL)
AC_SUBST(POSUB)
])
dnl Checks for all prerequisites of the intl subdirectory,
dnl except for INTL_LIBTOOL_SUFFIX_PREFIX (and possibly LIBTOOL), INTLOBJS,
dnl USE_INCLUDED_LIBINTL, BUILD_INCLUDED_LIBINTL.
AC_DEFUN([AM_INTL_SUBDIR],
[
AC_REQUIRE([AC_PROG_INSTALL])dnl
AC_REQUIRE([AM_MKINSTALLDIRS])dnl
AC_REQUIRE([AC_PROG_CC])dnl
AC_REQUIRE([AC_CANONICAL_HOST])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_REQUIRE([jm_GLIBC21])dnl
AC_REQUIRE([gt_INTDIV0])dnl
AC_REQUIRE([jm_AC_TYPE_UINTMAX_T])dnl
AC_REQUIRE([gt_HEADER_INTTYPES_H])dnl
AC_REQUIRE([gt_INTTYPES_PRI])dnl
AC_CHECK_HEADERS([argz.h limits.h locale.h nl_types.h malloc.h stddef.h \
stdlib.h string.h unistd.h sys/param.h])
AC_CHECK_FUNCS([feof_unlocked fgets_unlocked getc_unlocked getcwd getegid \
geteuid getgid getuid mempcpy munmap putenv setenv setlocale stpcpy \
strcasecmp strdup strtoul tsearch __argz_count __argz_stringify __argz_next \
__fsetlocking])
AM_ICONV
AM_LANGINFO_CODESET
if test $ac_cv_header_locale_h = yes; then
AM_LC_MESSAGES
fi
dnl intl/plural.c is generated from intl/plural.y. It requires bison,
dnl because plural.y uses bison specific features. It requires at least
dnl bison-1.26 because earlier versions generate a plural.c that doesn't
dnl compile.
dnl bison is only needed for the maintainer (who touches plural.y). But in
dnl order to avoid separate Makefiles or --enable-maintainer-mode, we put
dnl the rule in general Makefile. Now, some people carelessly touch the
dnl files or have a broken "make" program, hence the plural.c rule will
dnl sometimes fire. To avoid an error, defines BISON to ":" if it is not
dnl present or too old.
AC_CHECK_PROGS([INTLBISON], [bison])
if test -z "$INTLBISON"; then
ac_verc_fail=yes
else
dnl Found it, now check the version.
AC_MSG_CHECKING([version of bison])
changequote(<<,>>)dnl
ac_prog_version=`$INTLBISON --version 2>&1 | sed -n 's/^.*GNU Bison.* \([0-9]*\.[0-9.]*\).*$/\1/p'`
case $ac_prog_version in
'') ac_prog_version="v. ?.??, bad"; ac_verc_fail=yes;;
1.2[6-9]* | 1.[3-9][0-9]* | [2-9].*)
changequote([,])dnl
ac_prog_version="$ac_prog_version, ok"; ac_verc_fail=no;;
*) ac_prog_version="$ac_prog_version, bad"; ac_verc_fail=yes;;
esac
AC_MSG_RESULT([$ac_prog_version])
fi
if test $ac_verc_fail = yes; then
INTLBISON=:
fi
])
dnl Usage: AM_GNU_GETTEXT_VERSION([gettext-version])
AC_DEFUN([AM_GNU_GETTEXT_VERSION], [])

170
m4/missing/gpgme.m4 Normal file
View file

@ -0,0 +1,170 @@
dnl Autoconf macros for libgpgme
dnl $Id$
# Configure paths for GPGME
# Shamelessly stolen from the one of XDELTA by Owen Taylor
# Werner Koch 2000-11-17
dnl AM_PATH_GPGME([MINIMUM-VERSION,
dnl [ACTION-IF-FOUND [, ACTION-IF-NOT-FOUND ]]])
dnl Test for gpgme, and define GPGME_CFLAGS and GPGME_LIBS
dnl
AC_DEFUN([AM_PATH_GPGME],
[dnl
dnl Get the cflags and libraries from the gpgme-config script
dnl
AC_ARG_WITH(gpgme-prefix,
[ --with-gpgme-prefix=PFX Prefix where gpgme is installed (optional)],
gpgme_config_prefix="$withval", gpgme_config_prefix="")
AC_ARG_ENABLE(gpgmetest,
[ --disable-gpgmetest Do not try to compile and run a test gpgme program],
, enable_gpgmetest=yes)
if test x$gpgme_config_prefix != x ; then
gpgme_config_args="$gpgme_config_args --prefix=$gpgme_config_prefix"
if test x${GPGME_CONFIG+set} != xset ; then
GPGME_CONFIG=$gpgme_config_prefix/bin/gpgme-config
fi
fi
AC_PATH_PROG(GPGME_CONFIG, gpgme-config, no)
min_gpgme_version=ifelse([$1], ,1.0.0,$1)
AC_MSG_CHECKING(for GPGME - version >= $min_gpgme_version)
no_gpgme=""
if test "$GPGME_CONFIG" = "no" ; then
no_gpgme=yes
else
GPGME_CFLAGS=`$GPGME_CONFIG $gpgme_config_args --cflags`
GPGME_LIBS=`$GPGME_CONFIG $gpgme_config_args --libs`
gpgme_config_version=`$GPGME_CONFIG $gpgme_config_args --version`
if test "x$enable_gpgmetest" = "xyes" ; then
ac_save_CFLAGS="$CFLAGS"
ac_save_LIBS="$LIBS"
CFLAGS="$CFLAGS $GPGME_CFLAGS"
LIBS="$LIBS $GPGME_LIBS"
dnl
dnl Now check if the installed gpgme is sufficiently new. Also sanity
dnl checks the results of gpgme-config to some extent
dnl
rm -f conf.gpgmetest
AC_TRY_RUN([
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <gpgme.h>
int
main ()
{
system ("touch conf.gpgmetest");
if( strcmp( gpgme_check_version(NULL), "$gpgme_config_version" ) )
{
printf("\n"
"*** 'gpgme-config --version' returned %s, but GPGME (%s) was found!\n",
"$gpgme_config_version", gpgme_check_version(NULL) );
printf(
"*** If gpgme-config was correct, then it is best to remove the old\n"
"*** version of GPGME. You may also be able to fix the error\n"
"*** by modifying your LD_LIBRARY_PATH enviroment variable, or by editing\n"
"*** /etc/ld.so.conf. Make sure you have run ldconfig if that is\n"
"*** required on your system.\n"
"*** If gpgme-config was wrong, set the environment variable GPGME_CONFIG\n"
"*** to point to the correct copy of gpgme-config, \n"
"*** and remove the file config.cache before re-running configure\n"
);
}
else if ( strcmp(gpgme_check_version(NULL), GPGME_VERSION ) )
{
printf("\n*** GPGME header file (version %s) does not match\n",
GPGME_VERSION);
printf("*** library (version %s)\n", gpgme_check_version(NULL) );
}
else
{
if ( gpgme_check_version( "$min_gpgme_version" ) )
return 0;
printf("no\n"
"*** An old version of GPGME (%s) was found.\n", gpgme_check_version(NULL) );
printf(
"*** You need a version of GPGME newer than %s.\n", "$min_gpgme_version" );
printf(
"*** The latest version of GPGME is always available at\n"
"*** ftp://ftp.gnupg.org/pub/gcrypt/alpha/gpgme/\n"
"*** \n"
"*** If you have already installed a sufficiently new version, this error\n"
"*** probably means that the wrong copy of the gpgme-config shell script is\n"
"*** being found. The easiest way to fix this is to remove the old version\n"
"*** of GPGME, but you can also set the GPGME_CONFIG environment to point to\n"
"*** the correct copy of gpgme-config. (In this case, you will have to\n"
"*** modify your LD_LIBRARY_PATH enviroment variable, or edit /etc/ld.so.conf\n"
"*** so that the correct libraries are found at run-time).\n"
);
}
return 1;
}
],, no_gpgme=yes,[echo $ac_n "cross compiling; assumed OK... $ac_c"])
CFLAGS="$ac_save_CFLAGS"
LIBS="$ac_save_LIBS"
fi
fi
if test "x$no_gpgme" = x ; then
AC_MSG_RESULT(yes)
ifelse([$2], , :, [$2])
else
if test -f conf.gpgmetest ; then
:
else
AC_MSG_RESULT(no)
fi
if test "$GPGME_CONFIG" = "no" ; then
echo "*** The gpgme-config script installed by GPGME could not be found"
echo "*** If GPGME was installed in PREFIX, make sure PREFIX/bin is in"
echo "*** your path, or set the GPGME_CONFIG environment variable to the"
echo "*** full path to gpgme-config."
else
if test -f conf.gpgmetest ; then
:
else
echo "*** Could not run gpgme test program, checking why..."
CFLAGS="$CFLAGS $GPGME_CFLAGS"
LIBS="$LIBS $GPGME_LIBS"
AC_TRY_LINK([
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <gpgme.h>
], [ gpgme_check_version(NULL); return 0 ],
[
echo "*** The test program compiled, but did not run. This usually means"
echo "*** that the run-time linker is not finding GPGME or finding the wrong"
echo "*** version of GPGME. If it is not finding GPGME, 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"
echo "*** that is required on your system"
echo "***"
echo "*** If you have an old version installed, it is best to remove it,"
echo "*** although you may also be able to get things to work by"
echo "*** modifying LD_LIBRARY_PATH"
echo "***"
],
[
echo "*** The test program failed to compile or link. See the file config.log"
echo "*** for the exact error that occured. This usually means GPGME was"
echo "*** incorrectly installed or that you have moved GPGME since it was"
echo "*** installed. In the latter case, you may want to edit the"
echo "*** gpgme-config script: $GPGME_CONFIG"
])
CFLAGS="$ac_save_CFLAGS"
LIBS="$ac_save_LIBS"
fi
fi
GPGME_CFLAGS=""
GPGME_LIBS=""
ifelse([$3], , :, [$3])
fi
AC_SUBST(GPGME_CFLAGS)
AC_SUBST(GPGME_LIBS)
rm -f conf.gpgmetest
])

301
m4/missing/imlib.m4 Normal file
View file

@ -0,0 +1,301 @@
# Configure paths for IMLIB
# Frank Belew 98-8-31
# stolen from Manish Singh
# Shamelessly stolen from Owen Taylor
dnl AM_PATH_IMLIB([MINIMUM-VERSION, [ACTION-IF-FOUND [, ACTION-IF-NOT-FOUND]]])
dnl Test for IMLIB, and define IMLIB_CFLAGS and IMLIB_LIBS
dnl
AC_DEFUN([AM_PATH_IMLIB],
[dnl
dnl Get the cflags and libraries from the imlib-config script
dnl
AC_ARG_WITH(imlib-prefix,[ --with-imlib-prefix=PFX Prefix where IMLIB is installed (optional)],
imlib_prefix="$withval", imlib_prefix="")
AC_ARG_WITH(imlib-exec-prefix,[ --with-imlib-exec-prefix=PFX Exec prefix where IMLIB is installed (optional)],
imlib_exec_prefix="$withval", imlib_exec_prefix="")
AC_ARG_ENABLE(imlibtest, [ --disable-imlibtest Do not try to compile and run a test IMLIB program],
, enable_imlibtest=yes)
if test x$imlib_exec_prefix != x ; then
imlib_args="$imlib_args --exec-prefix=$imlib_exec_prefix"
if test x${IMLIB_CONFIG+set} != xset ; then
IMLIB_CONFIG=$imlib_exec_prefix/bin/imlib-config
fi
fi
if test x$imlib_prefix != x ; then
imlib_args="$imlib_args --prefix=$imlib_prefix"
if test x${IMLIB_CONFIG+set} != xset ; then
IMLIB_CONFIG=$imlib_prefix/bin/imlib-config
fi
fi
AC_PATH_PROG(IMLIB_CONFIG, imlib-config, no)
min_imlib_version=ifelse([$1], ,1.8.2,$1)
AC_MSG_CHECKING(for IMLIB - version >= $min_imlib_version)
no_imlib=""
if test "$IMLIB_CONFIG" = "no" ; then
no_imlib=yes
else
IMLIB_CFLAGS=`$IMLIB_CONFIG $imlibconf_args --cflags`
IMLIB_LIBS=`$IMLIB_CONFIG $imlibconf_args --libs`
imlib_major_version=`$IMLIB_CONFIG $imlib_args --version | \
sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\1/'`
imlib_minor_version=`$IMLIB_CONFIG $imlib_args --version | \
sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\2/'`
imlib_micro_version=`$IMLIB_CONFIG $imlib_args --version | \
sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\3/'`
if test "x$enable_imlibtest" = "xyes" ; then
ac_save_CFLAGS="$CFLAGS"
ac_save_LIBS="$LIBS"
CFLAGS="$CFLAGS $IMLIB_CFLAGS"
LIBS="$LIBS $IMLIB_LIBS"
dnl
dnl Now check if the installed IMLIB is sufficiently new. (Also sanity
dnl checks the results of imlib-config to some extent
dnl
rm -f conf.imlibtest
AC_TRY_RUN([
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <Imlib.h>
char*
my_strdup (char *str)
{
char *new_str;
if (str)
{
new_str = malloc ((strlen (str) + 1) * sizeof(char));
strcpy (new_str, str);
}
else
new_str = NULL;
return new_str;
}
int main ()
{
int major, minor, micro;
char *tmp_version;
system ("touch conf.imlibtest");
/* HP/UX 9 (%@#!) writes to sscanf strings */
tmp_version = my_strdup("$min_imlib_version");
if (sscanf(tmp_version, "%d.%d.%d", &major, &minor, &micro) != 3) {
printf("%s, bad version string\n", "$min_imlib_version");
exit(1);
}
if (($imlib_major_version > major) ||
(($imlib_major_version == major) && ($imlib_minor_version > minor)) ||
(($imlib_major_version == major) && ($imlib_minor_version == minor) &&
($imlib_micro_version >= micro)))
{
return 0;
}
else
{
printf("\n*** 'imlib-config --version' returned %d.%d, but the minimum version\n", $imlib_major_version, $imlib_minor_version);
printf("*** of IMLIB required is %d.%d. If imlib-config is correct, then it is\n", major, minor);
printf("*** best to upgrade to the required version.\n");
printf("*** If imlib-config was wrong, set the environment variable IMLIB_CONFIG\n");
printf("*** to point to the correct copy of imlib-config, and remove the file\n");
printf("*** config.cache before re-running configure\n");
return 1;
}
}
],, no_imlib=yes,[echo $ac_n "cross compiling; assumed OK... $ac_c"])
CFLAGS="$ac_save_CFLAGS"
LIBS="$ac_save_LIBS"
fi
fi
if test "x$no_imlib" = x ; then
AC_MSG_RESULT(yes)
ifelse([$2], , :, [$2])
else
AC_MSG_RESULT(no)
if test "$IMLIB_CONFIG" = "no" ; then
echo "*** The imlib-config script installed by IMLIB could not be found"
echo "*** If IMLIB was installed in PREFIX, make sure PREFIX/bin is in"
echo "*** your path, or set the IMLIB_CONFIG environment variable to the"
echo "*** full path to imlib-config."
else
if test -f conf.imlibtest ; then
:
else
echo "*** Could not run IMLIB test program, checking why..."
CFLAGS="$CFLAGS $IMLIB_CFLAGS"
LIBS="$LIBS $IMLIB_LIBS"
AC_TRY_LINK([
#include <stdio.h>
#include <Imlib.h>
], [ return 0; ],
[ echo "*** The test program compiled, but did not run. This usually means"
echo "*** that the run-time linker is not finding IMLIB or finding the wrong"
echo "*** version of IMLIB. If it is not finding IMLIB, 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 IMLIB was incorrectly installed"
echo "*** or that you have moved IMLIB since it was installed. In the latter case, you"
echo "*** may want to edit the imlib-config script: $IMLIB_CONFIG" ])
CFLAGS="$ac_save_CFLAGS"
LIBS="$ac_save_LIBS"
fi
fi
IMLIB_CFLAGS=""
IMLIB_LIBS=""
ifelse([$3], , :, [$3])
fi
AC_SUBST(IMLIB_CFLAGS)
AC_SUBST(IMLIB_LIBS)
rm -f conf.imlibtest
])
# Check for gdk-imlib
AC_DEFUN(AM_PATH_GDK_IMLIB,
[dnl
dnl Get the cflags and libraries from the imlib-config script
dnl
AC_ARG_WITH(imlib-prefix,[ --with-imlib-prefix=PFX Prefix where IMLIB is installed (optional)],
imlib_prefix="$withval", imlib_prefix="")
AC_ARG_WITH(imlib-exec-prefix,[ --with-imlib-exec-prefix=PFX Exec prefix where IMLIB is installed (optional)],
imlib_exec_prefix="$withval", imlib_exec_prefix="")
AC_ARG_ENABLE(imlibtest, [ --disable-imlibtest Do not try to compile and run a test IMLIB program],
, enable_imlibtest=yes)
if test x$imlib_exec_prefix != x ; then
imlib_args="$imlib_args --exec-prefix=$imlib_exec_prefix"
if test x${IMLIB_CONFIG+set} != xset ; then
IMLIB_CONFIG=$imlib_exec_prefix/bin/imlib-config
fi
fi
if test x$imlib_prefix != x ; then
imlib_args="$imlib_args --prefix=$imlib_prefix"
if test x${IMLIB_CONFIG+set} != xset ; then
IMLIB_CONFIG=$imlib_prefix/bin/imlib-config
fi
fi
AC_PATH_PROG(IMLIB_CONFIG, imlib-config, no)
min_imlib_version=ifelse([$1], ,1.8.2,$1)
AC_MSG_CHECKING(for IMLIB - version >= $min_imlib_version)
no_imlib=""
if test "$IMLIB_CONFIG" = "no" ; then
no_imlib=yes
else
GDK_IMLIB_CFLAGS=`$IMLIB_CONFIG $imlibconf_args --cflags-gdk`
GDK_IMLIB_LIBS=`$IMLIB_CONFIG $imlibconf_args --libs-gdk`
imlib_major_version=`$IMLIB_CONFIG $imlib_args --version | \
sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\1/'`
imlib_minor_version=`$IMLIB_CONFIG $imlib_args --version | \
sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\2/'`
if test "x$enable_imlibtest" = "xyes" ; then
ac_save_CFLAGS="$CFLAGS"
ac_save_LIBS="$LIBS"
CFLAGS="$CFLAGS $GDK_IMLIB_CFLAGS"
LIBS="$LIBS $GDK_IMLIB_LIBS"
dnl
dnl Now check if the installed IMLIB is sufficiently new. (Also sanity
dnl checks the results of imlib-config to some extent
dnl
rm -f conf.imlibtest
AC_TRY_RUN([
#include <stdio.h>
#include <stdlib.h>
#include <gdk_imlib.h>
int main ()
{
int major, minor;
char *tmp_version;
system ("touch conf.gdkimlibtest");
/* HP/UX 9 (%@#!) writes to sscanf strings */
tmp_version = g_strdup("$min_imlib_version");
if (sscanf(tmp_version, "%d.%d", &major, &minor) != 2) {
printf("%s, bad version string\n", "$min_imlib_version");
exit(1);
}
if (($imlib_major_version > major) ||
(($imlib_major_version == major) && ($imlib_minor_version >= minor)))
{
return 0;
}
else
{
printf("\n*** 'imlib-config --version' returned %d.%d, but the minimum version\n", $imlib_major_version, $imlib_minor_version);
printf("*** of IMLIB required is %d.%d. If imlib-config is correct, then it is\n", major, minor);
printf("*** best to upgrade to the required version.\n");
printf("*** If imlib-config was wrong, set the environment variable IMLIB_CONFIG\n");
printf("*** to point to the correct copy of imlib-config, and remove the file\n");
printf("*** config.cache before re-running configure\n");
return 1;
}
}
],, no_imlib=yes,[echo $ac_n "cross compiling; assumed OK... $ac_c"])
CFLAGS="$ac_save_CFLAGS"
LIBS="$ac_save_LIBS"
fi
fi
if test "x$no_imlib" = x ; then
AC_MSG_RESULT(yes)
ifelse([$2], , :, [$2])
else
AC_MSG_RESULT(no)
if test "$IMLIB_CONFIG" = "no" ; then
echo "*** The imlib-config script installed by IMLIB could not be found"
echo "*** If IMLIB was installed in PREFIX, make sure PREFIX/bin is in"
echo "*** your path, or set the IMLIB_CONFIG environment variable to the"
echo "*** full path to imlib-config."
else
if test -f conf.gdkimlibtest ; then
:
else
echo "*** Could not run IMLIB test program, checking why..."
CFLAGS="$CFLAGS $GDK_IMLIB_CFLAGS"
LIBS="$LIBS $GDK_IMLIB_LIBS"
AC_TRY_LINK([
#include <stdio.h>
#include <gdk_imlib.h>
], [ return 0; ],
[ echo "*** The test program compiled, but did not run. This usually means"
echo "*** that the run-time linker is not finding IMLIB or finding the wrong"
echo "*** version of IMLIB. If it is not finding IMLIB, 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 IMLIB was incorrectly installed"
echo "*** or that you have moved IMLIB since it was installed. In the latter case, you"
echo "*** may want to edit the imlib-config script: $IMLIB_CONFIG" ])
CFLAGS="$ac_save_CFLAGS"
LIBS="$ac_save_LIBS"
fi
fi
IMLIB_CFLAGS=""
IMLIB_LIBS=""
ifelse([$3], , :, [$3])
fi
AC_SUBST(GDK_IMLIB_CFLAGS)
AC_SUBST(GDK_IMLIB_LIBS)
rm -f conf.gdkimlibtest
])

75
m4/openssl.m4 Normal file
View file

@ -0,0 +1,75 @@
dnl ******************************
dnl OpenSSL
dnl ******************************
AC_DEFUN([AM_PATH_OPENSSL],
[dnl
USE_OPENSSL=0
AC_ARG_ENABLE(openssl, [ --enable-openssl Attempt to use OpenSSL for SSL support.],
[ac_cv_enable_openssl=$enableval], [ac_cv_enable_openssl=no])
dnl detect OpenSSL
if test "x${ac_cv_enable_openssl}" != "xno"; then
AC_ARG_WITH(openssl-includes, [ --with-openssl-includes=PREFIX Location of OpenSSL includes.],
with_openssl_includes="$withval", with_openssl_includes="/usr/include")
have_openssl_includes="no"
if test "x${with_openssl_includes}" != "xno"; then
CPPFLAGS_save="$CPPFLAGS"
AC_MSG_CHECKING(for OpenSSL includes)
AC_MSG_RESULT("")
CPPFLAGS="$CPPFLAGS -I$with_openssl_includes"
AC_CHECK_HEADERS(openssl/ssl.h openssl/x509.h, [ openssl_includes="yes" ])
CPPFLAGS="$CPPFLAGS_save"
if test "x{$openssl_includes}" != "xno" -a "x{$openssl_includes}" != "x"; then
have_openssl_includes="yes"
OPENSSL_CFLAGS="-I$with_openssl_includes"
else
OPENSSL_CFLAGS=""
fi
else
AC_MSG_CHECKING(for OpenSSL includes)
AC_MSG_RESULT(no)
fi
AC_ARG_WITH(openssl-libs, [ --with-openssl-libs=PREFIX Location of OpenSSL libs.],
with_openssl_libs="$withval")
if test "x${with_openssl_libs}" != "xno" -a "x${have_openssl_includes}" != "xno"; then
case $with_openssl_libs in
""|-L*) ;;
*) with_openssl_libs="-L$with_openssl_libs" ;;
esac
AC_CHECK_LIB(dl, dlopen, DL_LIBS="-ldl", DL_LIBS="")
AC_CACHE_CHECK([for OpenSSL libraries], openssl_libs,
[
LIBS_save="$LIBS"
LIBS="$LIBS $with_openssl_libs -lssl -lcrypto $DL_LIBS"
AC_TRY_LINK_FUNC(SSL_read, openssl_libs="yes", openssl_libs="no")
LIBS="$LIBS_save"
])
if test "x${openssl_libs}" != "xno"; then
AC_DEFINE(USE_OPENSSL, 1, [Define if you use OpenSSL to support SSL])
USE_OPENSSL=1
msg_ssl="yes (OpenSSL)"
OPENSSL_LIBS="$with_openssl_libs -lssl -lcrypto $DL_LIBS"
else
OPENSSL_CFLAGS=""
OPENSSL_LIBS=""
fi
else
AC_MSG_CHECKING(for OpenSSL libraries)
AC_MSG_RESULT(no)
fi
else
OPENSSL_CFLAGS=""
OPENSSL_LIBS=""
ac_cv_enable_openssl="no"
fi
AC_SUBST(OPENSSL_CFLAGS)
AC_SUBST(OPENSSL_LIBS)
])

89
m4/spamassassin.m4 Normal file
View file

@ -0,0 +1,89 @@
dnl check for libspamc required includes
AC_DEFUN([AC_SPAMASSASSIN],
[dnl
AC_CHECK_HEADERS(sys/time.h syslog.h unistd.h errno.h sys/errno.h)
AC_CHECK_HEADERS(time.h sysexits.h sys/socket.h netdb.h netinet/in.h)
AC_CHECK_HEADERS(openssl/crypto.h)
AC_CACHE_CHECK([for SHUT_RD],
shutrd, [
AC_TRY_COMPILE([#include <sys/types.h>
#include <sys/socket.h>],
[printf ("%d", SHUT_RD); return 0;],
[shutrd=yes],
[shutrd=no]),
])
if test $shutrd = yes ; then
AC_DEFINE(HAVE_SHUT_RD, 1, HAVE_SHUT_RD)
fi
dnl ----------------------------------------------------------------------
AC_CHECK_FUNCS(socket strdup strtod strtol snprintf shutdown)
dnl ----------------------------------------------------------------------
AC_CACHE_CHECK([for h_errno],
herrno, [
AC_TRY_COMPILE([#include <netdb.h>],
[printf ("%d", h_errno); return 0;],
[herrno=yes],
[herrno=no]),
])
if test $herrno = yes ; then
AC_DEFINE(HAVE_H_ERRNO, 1, HAVE_H_ERRNO)
fi
dnl ----------------------------------------------------------------------
dnl ----------------------------------------------------------------------
AC_CACHE_CHECK([for in_addr_t],
inaddrt, [
AC_TRY_COMPILE([#include <sys/types.h>
#include <netinet/in.h>],
[in_addr_t foo; return 0;],
[inaddrt=yes],
[inaddrt=no]),
])
if test $inaddrt = no ; then
AC_CHECK_TYPE(in_addr_t, unsigned long)
fi
dnl ----------------------------------------------------------------------
AC_CACHE_CHECK([for INADDR_NONE],
haveinaddrnone, [
AC_TRY_COMPILE([#include <sys/types.h>
#include <netinet/in.h>],
[in_addr_t foo = INADDR_NONE; return 0;],
[haveinaddrnone=yes],
[haveinaddrnone=no]),
])
if test $haveinaddrnone = yes ; then
AC_DEFINE(HAVE_INADDR_NONE, 1, HAVE_INADDR_NONE)
fi
dnl ----------------------------------------------------------------------
AC_CACHE_CHECK([for EX__MAX],
haveexmax, [
AC_TRY_COMPILE([#ifdef HAVE_SYSEXITS_H
#include <sysexits.h>
#endif
#include <errno.h>],
[int foo = EX__MAX; return 0;],
[haveexmax=yes],
[haveexmax=no]),
])
if test $haveexmax = yes ; then
AC_DEFINE(HAVE_EX__MAX, 1, HAVE_EX__MAX)
fi
if test "$USE_OPENSSL" -ne 0; then
AC_DEFINE(SPAMC_SSL, 1, Compile libspamc with OpenSSL support)
fi
])

90
src/folderutils.c Normal file
View file

@ -0,0 +1,90 @@
/*
* Sylpheed -- a GTK+ based, lightweight, and fast e-mail client
* Copyright (C) 2004 Hiroyuki Yamamoto & The Sylpheed-Claws Team
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*/
#include <glib.h>
#include "utils.h"
#include "prefs_common.h"
#include "folderutils.h"
void folderutils_delete_duplicates(FolderItem *item)
{
GHashTable *table;
GSList *msglist, *cur, *duplist = NULL;
debug_print("Deleting duplicated messages...\n");
msglist = folder_item_get_msg_list(item);
if (msglist == NULL)
return;
table = g_hash_table_new(g_str_hash, g_str_equal);
for (cur = msglist; cur != NULL; cur = g_slist_next(cur)) {
MsgInfo *msginfo = (MsgInfo *) cur->data;
MsgInfo *msginfo_dup = NULL;
if (!msginfo || !msginfo->msgid || !*msginfo->msgid)
continue;
msginfo_dup = g_hash_table_lookup(table, msginfo->msgid);
if (msginfo_dup == NULL)
g_hash_table_insert(table, msginfo->msgid, msginfo);
else {
if ((MSG_IS_UNREAD(msginfo->flags) && !MSG_IS_UNREAD(msginfo_dup->flags)) ||
(MSG_IS_UNREAD(msginfo->flags) == MSG_IS_UNREAD(msginfo_dup->flags))) {
duplist = g_slist_append(duplist, msginfo);
} else {
duplist = g_slist_append(duplist, msginfo_dup);
g_hash_table_insert(table, msginfo->msgid, msginfo);
}
}
}
if (duplist) {
if (prefs_common.immediate_exec) {
FolderItem *trash = item->folder->trash;
if (item->stype == F_TRASH || trash == NULL)
folder_item_remove_msgs(item, duplist);
else
folder_item_move_msgs(trash, duplist);
} else {
for (cur = duplist; cur != NULL; cur = g_slist_next(cur)) {
MsgInfo *msginfo = (MsgInfo *) cur->data;
procmsg_msginfo_set_to_folder(msginfo, NULL);
procmsg_msginfo_unset_flags(msginfo, MSG_MARKED, MSG_MOVE | MSG_COPY);
procmsg_msginfo_set_flags(msginfo, MSG_DELETED, 0);
}
}
}
g_slist_free(duplist);
g_hash_table_destroy(table);
for (cur = msglist; cur != NULL; cur = g_slist_next(cur)) {
MsgInfo *msginfo = (MsgInfo *) cur->data;
procmsg_msginfo_free(msginfo);
}
g_slist_free(msglist);
debug_print("done.\n");
}

27
src/folderutils.h Normal file
View file

@ -0,0 +1,27 @@
/*
* Sylpheed -- a GTK+ based, lightweight, and fast e-mail client
* Copyright (C) 2004 Hiroyuki Yamamoto & The Sylpheed-Claws Team
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*/
#ifndef FOLDERUTILS_H
#define FOLDERUTILS_H 1
#include "folder.h"
void folderutils_delete_duplicates(FolderItem *item);
#endif /* FOLDERUTILS_H */

View file

@ -0,0 +1,29 @@
/* XPM */
static char * linewrapcurrent_xpm[] = {
"24 24 2 1",
" c None",
". c #000000",
" ",
" ",
" ",
" ",
" ",
" ",
" ................. ",
" ",
" ................. ",
" ",
" ............. ",
" ",
" ..... ",
" ",
" ............ . ",
" . . ",
" ............ .... ",
" . ",
" ..... ",
" ",
" ",
" ",
" ",
" "};

278
src/prefs_ext_prog.c Normal file
View file

@ -0,0 +1,278 @@
/*
* Sylpheed -- a GTK+ based, lightweight, and fast e-mail client
* Copyright (C) 2004 Hiroyuki Yamamoto & the Sylpheed-Claws team
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*/
#ifdef HAVE_CONFIG_H
# include "config.h"
#endif
#include "defs.h"
#include <stdio.h>
#include <stdlib.h>
#include <glib.h>
#include <gtk/gtk.h>
#include <gdk/gdkkeysyms.h>
#include "intl.h"
#include "utils.h"
#include "prefs_common.h"
#include "prefs_gtk.h"
#include "gtk/gtkutils.h"
#include "gtk/prefswindow.h"
#include "manage_window.h"
typedef struct _ExtProgPage
{
PrefsPage page;
GtkWidget *window; /* do not modify */
GtkWidget *uri_label;
GtkWidget *uri_combo;
GtkWidget *uri_entry;
GtkWidget *printcmd_label;
GtkWidget *printcmd_entry;
GtkWidget *exteditor_label;
GtkWidget *exteditor_combo;
GtkWidget *exteditor_entry;
GtkWidget *image_viewer_label;
GtkWidget *image_viewer_entry;
GtkWidget *audio_player_label;
GtkWidget *audio_player_entry;
} ExtProgPage;
void prefs_ext_prog_create_widget(PrefsPage *_page, GtkWindow *window,
gpointer data)
{
ExtProgPage *prefs_ext_prog = (ExtProgPage *) _page;
GtkWidget *table;
GtkWidget *vbox;
GtkWidget *hint_label;
GtkWidget *table2;
GtkWidget *uri_label;
GtkWidget *uri_combo;
GtkWidget *uri_entry;
GtkWidget *printcmd_label;
GtkWidget *printcmd_entry;
GtkWidget *exteditor_label;
GtkWidget *exteditor_combo;
GtkWidget *exteditor_entry;
GtkWidget *image_viewer_label;
GtkWidget *image_viewer_entry;
GtkWidget *audio_player_label;
GtkWidget *audio_player_entry;
table = gtk_table_new(2, 1, FALSE);
gtk_widget_show(table);
gtk_container_set_border_width(GTK_CONTAINER(table), 8);
gtk_table_set_row_spacings(GTK_TABLE(table), 4);
gtk_table_set_col_spacings(GTK_TABLE(table), 8);
vbox = gtk_vbox_new(TRUE, 0);
gtk_widget_show(vbox);
gtk_table_attach(GTK_TABLE (table), vbox, 0, 1, 0, 1,
(GtkAttachOptions) (GTK_SHRINK),
(GtkAttachOptions) (0), 0, 0);
hint_label = gtk_label_new(_("%s will be replaced with file name / URI"));
gtk_widget_show(hint_label);
gtk_box_pack_start(GTK_BOX (vbox),
hint_label, FALSE, FALSE, 4);
gtk_label_set_justify(GTK_LABEL (hint_label), GTK_JUSTIFY_LEFT);
table2 = gtk_table_new(5, 2, FALSE);
gtk_widget_show(table2);
gtk_container_set_border_width(GTK_CONTAINER(table2), 8);
gtk_table_set_row_spacings(GTK_TABLE(table2), 4);
gtk_table_set_col_spacings(GTK_TABLE(table2), 8);
gtk_table_attach(GTK_TABLE (table), table2, 0, 1, 1, 2,
(GtkAttachOptions) (GTK_EXPAND | GTK_FILL),
(GtkAttachOptions) (0), 0, 0);
uri_label = gtk_label_new (_("Web browser"));
gtk_widget_show(uri_label);
gtk_table_attach(GTK_TABLE (table2), uri_label, 0, 1, 0, 1,
(GtkAttachOptions) (GTK_FILL),
(GtkAttachOptions) (0), 0, 2);
gtk_label_set_justify(GTK_LABEL (hint_label), GTK_JUSTIFY_RIGHT);
gtk_misc_set_alignment(GTK_MISC (hint_label), 1, 0.5);
uri_combo = gtk_combo_new ();
gtk_widget_show (uri_combo);
gtk_table_attach (GTK_TABLE (table2), uri_combo, 1, 2, 0, 1,
GTK_EXPAND | GTK_FILL, 0, 0, 0);
gtkut_combo_set_items (GTK_COMBO (uri_combo),
DEFAULT_BROWSER_CMD,
"galeon --new-tab '%s'",
"galeon '%s'",
"mozilla -remote 'openurl(%s,new-window)'",
"netscape -remote 'openURL(%s, new-window)'",
"netscape '%s'",
"gnome-moz-remote --newwin '%s'",
"kfmclient openURL '%s'",
"opera -newwindow '%s'",
"kterm -e w3m '%s'",
"kterm -e lynx '%s'",
NULL);
uri_entry = GTK_COMBO (uri_combo)->entry;
gtk_entry_set_text(GTK_ENTRY(uri_entry), prefs_common.uri_cmd ? prefs_common.uri_cmd : "");
printcmd_label = gtk_label_new (_("Print command"));
gtk_widget_show(printcmd_label);
gtk_table_attach(GTK_TABLE (table2), printcmd_label, 0, 1, 1, 2,
(GtkAttachOptions) (GTK_FILL),
(GtkAttachOptions) (0), 0, 2);
gtk_label_set_justify(GTK_LABEL (hint_label), GTK_JUSTIFY_RIGHT);
gtk_misc_set_alignment(GTK_MISC (hint_label), 1, 0.5);
printcmd_entry = gtk_entry_new ();
gtk_widget_show (printcmd_entry);
gtk_table_attach(GTK_TABLE (table2), printcmd_entry, 1, 2, 1, 2,
(GtkAttachOptions) (GTK_EXPAND | GTK_FILL),
(GtkAttachOptions) (0), 0, 0);
gtk_entry_set_text(GTK_ENTRY(printcmd_entry), prefs_common.print_cmd ? prefs_common.print_cmd : "");
exteditor_label = gtk_label_new (_("Text editor"));
gtk_widget_show(exteditor_label);
gtk_table_attach(GTK_TABLE (table2), exteditor_label, 0, 1, 2, 3,
(GtkAttachOptions) (GTK_FILL),
(GtkAttachOptions) (0), 0, 2);
gtk_label_set_justify(GTK_LABEL (exteditor_label), GTK_JUSTIFY_RIGHT);
gtk_misc_set_alignment(GTK_MISC (exteditor_label), 1, 0.5);
exteditor_combo = gtk_combo_new ();
gtk_widget_show (exteditor_combo);
gtk_table_attach (GTK_TABLE (table2), exteditor_combo, 1, 2, 2, 3,
GTK_EXPAND | GTK_FILL, 0, 0, 0);
gtkut_combo_set_items (GTK_COMBO (exteditor_combo),
"gedit %s",
"kedit %s",
"nedit %s",
"mgedit --no-fork %s",
"emacs %s",
"xemacs %s",
"kterm -e jed %s",
"kterm -e vi %s",
NULL);
exteditor_entry = GTK_COMBO (exteditor_combo)->entry;
gtk_entry_set_text(GTK_ENTRY(exteditor_entry),
prefs_common.ext_editor_cmd ? prefs_common.ext_editor_cmd : "");
image_viewer_label = gtk_label_new (_("Image viewer"));
gtk_widget_show(image_viewer_label);
gtk_table_attach(GTK_TABLE (table2), image_viewer_label, 0, 1, 3, 4,
(GtkAttachOptions) (GTK_FILL),
(GtkAttachOptions) (0), 0, 2);
gtk_label_set_justify(GTK_LABEL (image_viewer_label), GTK_JUSTIFY_RIGHT);
gtk_misc_set_alignment(GTK_MISC (image_viewer_label), 1, 0.5);
image_viewer_entry = gtk_entry_new ();
gtk_widget_show(image_viewer_entry);
gtk_table_attach(GTK_TABLE (table2), image_viewer_entry, 1, 2, 3, 4,
(GtkAttachOptions) (GTK_EXPAND | GTK_FILL),
(GtkAttachOptions) (0), 0, 0);
gtk_entry_set_text(GTK_ENTRY(image_viewer_entry),
prefs_common.mime_image_viewer ? prefs_common.mime_image_viewer : "");
audio_player_label = gtk_label_new (_("Audio player"));
gtk_widget_show(audio_player_label);
gtk_table_attach(GTK_TABLE (table2), audio_player_label, 0, 1, 4, 5,
(GtkAttachOptions) (GTK_FILL),
(GtkAttachOptions) (0), 0, 2);
gtk_label_set_justify(GTK_LABEL (audio_player_label), GTK_JUSTIFY_RIGHT);
gtk_misc_set_alignment(GTK_MISC (audio_player_label), 1, 0.5);
audio_player_entry = gtk_entry_new ();
gtk_widget_show(audio_player_entry);
gtk_table_attach(GTK_TABLE (table2), audio_player_entry, 1, 2, 4, 5,
(GtkAttachOptions) (GTK_EXPAND | GTK_FILL),
(GtkAttachOptions) (0), 0, 0);
gtk_entry_set_text(GTK_ENTRY(audio_player_entry),
prefs_common.mime_audio_player ? prefs_common.mime_audio_player : "");
prefs_ext_prog->window = GTK_WIDGET(window);
prefs_ext_prog->uri_entry = uri_entry;
prefs_ext_prog->printcmd_entry = printcmd_entry;
prefs_ext_prog->exteditor_entry = exteditor_entry;
prefs_ext_prog->image_viewer_entry = image_viewer_entry;
prefs_ext_prog->audio_player_entry = audio_player_entry;
prefs_ext_prog->page.widget = table;
}
void prefs_ext_prog_save(PrefsPage *_page)
{
ExtProgPage *ext_prog = (ExtProgPage *) _page;
prefs_common.uri_cmd = gtk_editable_get_chars
(GTK_EDITABLE(ext_prog->uri_entry), 0, -1);
prefs_common.print_cmd = gtk_editable_get_chars
(GTK_EDITABLE(ext_prog->printcmd_entry), 0, -1);
prefs_common.ext_editor_cmd = gtk_editable_get_chars
(GTK_EDITABLE(ext_prog->exteditor_entry), 0, -1);
prefs_common.mime_image_viewer = gtk_editable_get_chars
(GTK_EDITABLE(ext_prog->image_viewer_entry), 0, -1);
prefs_common.mime_audio_player = gtk_editable_get_chars
(GTK_EDITABLE(ext_prog->audio_player_entry), 0, -1);
}
static void prefs_ext_prog_destroy_widget(PrefsPage *_page)
{
/* ExtProgPage *ext_prog = (ExtProgPage *) _page; */
}
ExtProgPage *prefs_ext_prog;
void prefs_ext_prog_init(void)
{
ExtProgPage *page;
page = g_new0(ExtProgPage, 1);
page->page.path = _("Message View/External Programs");
page->page.create_widget = prefs_ext_prog_create_widget;
page->page.destroy_widget = prefs_ext_prog_destroy_widget;
page->page.save_page = prefs_ext_prog_save;
page->page.weight = 45.0;
prefs_gtk_register_page((PrefsPage *) page);
prefs_ext_prog = page;
}
void prefs_ext_prog_done(void)
{
prefs_gtk_unregister_page((PrefsPage *) prefs_ext_prog);
g_free(prefs_ext_prog);
}

1034
src/prefs_themes.c Normal file

File diff suppressed because it is too large Load diff

194
tools/textviewer.sh Normal file
View file

@ -0,0 +1,194 @@
#!/bin/bash
# textviewer.sh
# Copyright 2003 Luke Plant <L.Plant.98@cantab.net>
# and Johann Koenig <johann@mental-graffiti.com>
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
# as published by the Free Software Foundation; either version 2
# of the License, or (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
# 02111-1307, USA.
##############################################################################
#
# This script is a text viewer designed to be used with sylpheed-claws actions
# Set up an action with the command line: textviewer.sh %p |
#
# The script will try to detect file type automatically, and then
# invokes a relevant program to print the file in plain text to
# the standard output.
#
# From v 0.9.7claws7, sylpheed-claws sets the temporary file
# of a part to XXXXXX.mimetmp.[filename of attachment]
# This means we can use the extension of the filename for checking.
# Also use the program 'file' if that fails.
#
# To extend the script just follow the patterns that already exist, or
# contact the author if you have problems.
##############################################################################
#
# Change Log
#
# 2004-01-25
# - added brief messages describing whats going on
#
# 2004-01-23
# - added support for 'pdftotext,' from xpdf-utils debian package
#
# 2004-01-05
# - added matcher and action for OpenOffice Writer documents
# (requires ooo2txt)
#
# 2004-01-05
# - changed page width parameter for antiword
# - fixed matcher for 'diffs'
# - added a matcher and action for bzip2 - bzip2 files
# are decompressed and textviewer.sh run on the result
# - similarly decompress gzip files and run textviewer.sh
# on the result, insteading of doing 'gzip -l'
#
# 2003-12-30
# added the script to sylpheed-claws/tools
#
# 2003-12-30
# - use 'fold' after 'unrtf' to wrap to a nice width
# - added basic file sanity checks
#
# 2003-12-29
# Added recognition for "Zip " from 'file' output
#
# 2003-12-19
# Initial public release
#
###############################################################################
if [ $# -eq 0 ]
then
echo "No filename supplied." >&2
echo "Usage: textviewer.sh FILE" >&2
exit 1
fi
[ -f "$1" ] ||
{
echo "File \"$1\" does not exist or is not a regular file." >&2
exit 1
}
[ -r "$1" ] ||
{
echo "Cannot read file \"$1\"." >&2
exit 1
}
FILETYPE=`file --brief "$1"` ||
{
echo "Please install the command 'file' to use this script." >&2
exit 1
};
case "$1" in
*.doc) TYPE=MSWORD ;;
*.zip) TYPE=ZIP ;;
*.tar.gz|*.tgz) TYPE=TARGZ ;;
*.tar.bz2|*.tar.bz) TYPE=TARBZ ;;
*.gz) TYPE=GZIP ;;
*.bz2|*.bz) TYPE=BZIP ;;
*.tar) TYPE=TAR ;;
*.diff) TYPE=TEXT ;;
*.txt) TYPE=TEXT ;;
*.rtf) TYPE=RTF ;;
*.sxw) TYPE=OOWRITER ;;
*.pdf) TYPE=PDF ;;
esac
if [ "$TYPE" == "" ]
then
case $FILETYPE in
"'diff'"*) TYPE=TEXT ;;
gzip*) TYPE=GZIP ;;
bzip2*) TYPE=BZIP ;;
"POSIX tar archive"*) TYPE=TAR ;;
"Zip "*) TYPE=ZIP ;;
ASCII*) TYPE=TEXT ;;
"Rich Text Format"*)
TYPE=RTF ;;
"smtp mail text"* | "RFC 822 mail text"*)
TYPE=TEXT ;;
"Bourne shell script"* | "Bourne-Again shell script"*)
TYPE=TEXT ;;
esac
fi
case $TYPE in
TARGZ) echo -e "Gzip'd tarball contents:\n" ;
tar -tzvf "$1" ;;
TARBZ) echo -e "Bzip'd tarball contents:\n" ;
tar -tjvf "$1" ;;
BZIP) TMP=`mktemp "$1".temp.XXXXXXX` || exit 1;
bunzip2 -c "$1" > "$TMP" || exit 1;
echo -e "Re-running \"$0\" on bunzip'd contents of \"$1\":\n";
"$0" "$TMP";
rm "$TMP" ;;
GZIP) TMP=`mktemp "$1".temp.XXXXXXX` || exit 1;
gunzip -c "$1" > "$TMP" || exit 1;
echo "Re-running \"$0\" on gunzip'd contents of \"$1\":\n";
"$0" "$TMP";
rm "$TMP" ;;
TAR) echo -e "Tar archive contents:\n" ;
tar -tvf "$1" ;;
ZIP) echo -e "Zip file contents:\n" ;
unzip -l "$1" ;;
RTF) which unrtf > /dev/null 2>&1 ||
{
echo "Program 'unrtf' for displaying RTF files not found" >&2
exit 1
};
echo -e "Displaying \"$1\" using \"unrtf\":\n";
unrtf -t text "$1" 2>/dev/null | egrep -v '^### ' | fold -s -w 72 ;;
TEXT) cat "$1" ;;
MSWORD) which antiword > /dev/null 2>&1 ||
{
echo "Program 'antiword' for displaying MS Word files not found" >&2
exit 1
};
echo -e "Displaying \"$1\" using \"antiword\":\n";
antiword -w 72 "$1" ;;
OOWRITER) which ooo2txt > /dev/null 2>&1 ||
{
echo "Program 'ooo2txt' for converting OpenOffice Writer files not files not found" >&2
exit 1
};
echo -e "Displaying \"$1\" using \"ooo2txt\":\n";
ooo2txt "$1" ;;
PDF) which pdftotext > /dev/null 2>&1 ||
{
echo "Program 'pdftotext' for converting Adobe Portable Document Format to text not found" >&2
exit 1
};
echo -e "Displaying \"$1\" using \"pdftotext\":\n";
pdftotext "$1" - ;;
*) echo "Unsupported file type \"$FILETYPE\", cannot display.";;
esac