PROJECT(madmutt C)
+SET(PACKAGE madmutt)
SET(CMAKE_MODULE_PATH ${madmutt_SOURCE_DIR}/cmake ${CMAKE_MODULE_PATH})
# TODO {{{
# USE_SETGID
# DOTLOCK_{GROUP,PERMISSION}
-# HAVE_DIRENT_D_INO
+# ENABLE_NLS
+SET(ENABLE_NLS 1)
# }}}
INCLUDE(CMakeDetermineCCompiler)
INCLUDE_DIRECTORIES(${CMAKE_BINARY_DIR} ${madmutt_SOURCE_DIR})
SET(BINDIR "${CMAKE_INSTALL_PREFIX}/bin")
+SET(DATADIR "${CMAKE_INSTALL_PREFIX}/share")
SET(PKGDATADIR "${CMAKE_INSTALL_PREFIX}/share/madmutt")
SET(PKGDOCDIR "${CMAKE_INSTALL_PREFIX}/share/doc/madmutt")
SET(SYSCONFDIR "${CMAKE_INSTALL_PREFIX}/etc")
ADD_DEFINITIONS("-DPKGDOCDIR=\\\"${PKGDOCDIR}\\\"")
ADD_DEFINITIONS("-DSYSCONFDIR=\\\"${SYSCONFDIR}\\\"")
ADD_DEFINITIONS("-DVERSION=\\\"${VERSION}\\\"")
+ADD_DEFINITIONS("-DMUTTLOCALEDIR=\\\"${DATADIR}/locale\\\"")
OPTION(WITH_MAILPATH "Where new mail is spooled")
OPTION(WITH_GPGME "Use GPGME [default: on]" ON)
CHECK_FUNCTION_EXISTS(strlimit HAVE_SETRLIMIT)
CHECK_FUNCTION_EXISTS(getsid HAVE_GETSID)
+CHECK_FUNCTION_EXISTS(setegid HAVE_SETEGID)
CHECK_FUNCTION_EXISTS(isctype HAVE_ISCTYPE)
CHECK_FUNCTION_EXISTS(getopt HAVE_GETOPT)
CHECK_FUNCTION_EXISTS(regcomp HAVE_REGCOMP)
INCLUDE_DIRECTORIES(${gpgme_INCDIR})
ADD_DEFINITIONS(${gpgme_CFLAGS})
SET(MUTTLIBS "${MUTTLIBS} ${gpgme_LDFLAGS}")
+ SET(HAVE_GPGME 1)
ENDIF(WITH_GPGME)
XCONFIG(libgnutls-config gnutls_INCDIR gnutls_LINKDIR gnutls_LDFLAGS gnutls_CFLAGS)
#include <lib-lib/lib-lib.h>
-#ifdef HAVE_LANGINFO_CODESET
+#ifdef HAVE_LANGINFO_H
# include <langinfo.h>
#endif
static char *charset_init(void)
{
const char *res = "iso-8859-1";
-#ifdef HAVE_LANGINFO_CODESET
+#ifdef HAVE_LANGINFO_H
char buff[STRING];
char buff2[STRING];
res = buff2;
}
#endif
-#ifdef HAVE_BIND_TEXTDOMAIN_CODESET
+#ifdef ENABLE_NLS
bind_textdomain_codeset(PACKAGE, res);
#endif
return m_strdup(res);
+#cmakedefine PACKAGE "${PACKAGE}"
#cmakedefine MAILPATH "${MAILPATH}"
#cmakedefine SENDMAIL "${SENDMAIL}/sendmail"
#cmakedefine MIXMASTER "${MIXMASTER}/mixmaster"
/* functions */
#cmakedefine HAVE_GETSID 1
+#cmakedefine HAVE_SETEGID 1
#cmakedefine HAVE_ISCTYPE 1
#cmakedefine HAVE_GETOPT 1
#cmakedefine HAVE_REGCOMP 1
#cmakedefine HAVE_RESIZETERM 1
/* libraries */
+#cmakedefine ENABLE_NLS 1
+#cmakedefine HAVE_GDBM 1
+#cmakedefine HAVE_GPGME 1
#cmakedefine HAVE_LIBIDN 1
#cmakedefine HAVE_QDBM 1
-#cmakedefine HAVE_GDBM 1
-#cmakedefine USE_FLOCK 1
#cmakedefine USE_FCNTL 1
+#cmakedefine USE_FLOCK 1
#cmakedefine USE_HCACHE 1
-#cmakedefine USE_NNTP 1
#cmakedefine USE_LIBESMTP 1
+#cmakedefine USE_NNTP 1
#cmakedefine USE_SLANG_CURSES 1
-
char p[STRING];
setlocale(LC_TIME, "");
-#ifdef HAVE_LANGINFO_D_T_FMT
+#ifdef D_T_FMT
strftime(p, sizeof(p), nl_langinfo(D_T_FMT), localtime(&t));
#else
strftime(p, sizeof(p), "%c", localtime(&t));
tt = key->subkeys->timestamp;
tm = localtime (&tt);
-#ifdef HAVE_LANGINFO_D_T_FMT
+#ifdef D_T_FMT
strftime (shortbuf, sizeof shortbuf, nl_langinfo (D_T_FMT), tm);
#else
strftime (shortbuf, sizeof shortbuf, "%c", tm);
tt = key->subkeys->expires;
tm = localtime (&tt);
-#ifdef HAVE_LANGINFO_D_T_FMT
+#ifdef D_T_FMT
strftime (shortbuf, sizeof shortbuf, nl_langinfo (D_T_FMT), tm);
#else
strftime (shortbuf, sizeof shortbuf, "%c", tm);
tt = subkey->timestamp;
tm = localtime (&tt);
-#ifdef HAVE_LANGINFO_D_T_FMT
+#ifdef D_T_FMT
strftime (shortbuf, sizeof shortbuf, nl_langinfo (D_T_FMT), tm);
#else
strftime (shortbuf, sizeof shortbuf, "%c", tm);
tt = subkey->expires;
tm = localtime (&tt);
-#ifdef HAVE_LANGINFO_D_T_FMT
+#ifdef D_T_FMT
strftime (shortbuf, sizeof shortbuf, nl_langinfo (D_T_FMT), tm);
#else
strftime (shortbuf, sizeof shortbuf, "%c", tm);
# undef _
#endif
-#ifdef ENABLE_NLS
+#ifdef HAVE_LIBIDN
# include <libintl.h>
#define _(a) (gettext(a))
# ifdef gettext_noop
int crc = 0;
crc = crc32(crc, "madmutt.2007.05.13", m_strlen("madmutt.2007.05.13"));
-#ifdef HAVE_LANGINFO_CODESET
+#ifdef HAVE_LANGINFO_H
crc = crc32(crc, MCharset.charset, m_strlen(MCharset.charset));
#endif
crc = crc32(crc, "USE_POP", m_strlen("USE_POP"));
{
curs_set (1);
endwin (); /* just to be safe */
-#ifdef SYS_SIGLIST_DECLARED
- printf (_("%s... Exiting.\n"), sys_siglist[sig]);
-#else
-#if defined(__sun__) && defined(__svr4__)
- printf (_("Caught %s... Exiting.\n"), _sys_siglist[sig]);
-#else
-#if defined(__alpha) && defined(__osf__)
- printf (_("Caught %s... Exiting.\n"), __sys_siglist[sig]);
-#else
- printf (_("Caught signal %d... Exiting.\n"), sig);
-#endif
-#endif
-#endif
+ printf(_("Caught %s... Exiting.\n"), strsignal(sig));
exit (0);
}
"-USE_LIBESMTP "
#endif
"\n "
-#ifdef HAVE_REGCOMP
- "+HAVE_REGCOMP "
-#else
- "-HAVE_REGCOMP "
-#endif
- "\n "
-#ifdef HAVE_TYPEAHEAD
- "+HAVE_TYPEAHEAD "
-#else
- "-HAVE_TYPEAHEAD "
-#endif
-#ifdef HAVE_BKGDSET
- "+HAVE_BKGDSET "
-#else
- "-HAVE_BKGDSET "
-#endif
- "\n "
-#ifdef HAVE_CURS_SET
- "+HAVE_CURS_SET "
-#else
- "-HAVE_CURS_SET "
-#endif
-#ifdef HAVE_META
- "+HAVE_META "
-#else
- "-HAVE_META "
-#endif
-#ifdef HAVE_RESIZETERM
- "+HAVE_RESIZETERM "
-#else
- "-HAVE_RESIZETERM "
-#endif
);
puts (
- "+CRYPT_BACKEND_GPGME "
- "\n "
#ifdef ENABLE_NLS
"+ENABLE_NLS "
#else
"-ENABLE_NLS "
#endif
-#ifdef HAVE_WC_FUNCS
- "+HAVE_WC_FUNCS "
-#else
- "-HAVE_WC_FUNCS "
-#endif
-#ifdef HAVE_LANGINFO_CODESET
- "+HAVE_LANGINFO_CODESET "
-#else
- "-HAVE_LANGINFO_CODESET "
-#endif
-#ifdef HAVE_ICONV
- "+HAVE_ICONV "
-#else
- "-HAVE_ICONV "
-#endif
#ifdef HAVE_LIBIDN
"+HAVE_LIBIDN "
#else
"-HAVE_LIBIDN "
-#endif
-#ifdef HAVE_GETSID
- "+HAVE_GETSID "
-#else
- "-HAVE_GETSID "
#endif
);
int ncodes, const char **tocodes,
int *tocode, CONTENT * info)
{
-#ifdef HAVE_ICONV
iconv_t cd1, *cd;
char bufi[256], bufu[512], bufo[4 * sizeof (bufi)];
const char *ib, *ub;
p_delete(&states);
return ret;
-#else
- return -1;
-#endif /* !HAVE_ICONV */
}
/*