From: Pierre Habouzit Date: Thu, 17 May 2007 21:56:20 +0000 (+0200) Subject: few tweaks about changed defines. X-Git-Url: http://git.madism.org/?a=commitdiff_plain;h=366c938a78d928880c77bfe31a8715184c918d41;p=apps%2Fmadmutt.git few tweaks about changed defines. Signed-off-by: Pierre Habouzit --- diff --git a/CMakeLists.txt b/CMakeLists.txt index 1fb93bc..2673f3b 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1,10 +1,12 @@ 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) @@ -16,6 +18,7 @@ ADD_DEFINITIONS(-D_GNU_SOURCE) 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") @@ -27,6 +30,7 @@ ADD_DEFINITIONS("-DPKGDATADIR=\\\"${PKGDATADIR}\\\"") 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) @@ -107,6 +111,7 @@ INCLUDE (CheckFunctionExists) 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) @@ -176,6 +181,7 @@ IF(WITH_GPGME) 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) diff --git a/charset.cpkg b/charset.cpkg index b2b4d79..0056160 100644 --- a/charset.cpkg +++ b/charset.cpkg @@ -27,7 +27,7 @@ #include -#ifdef HAVE_LANGINFO_CODESET +#ifdef HAVE_LANGINFO_H # include #endif @@ -47,7 +47,7 @@ static rx_t *iconv_hooks = NULL; 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]; @@ -59,7 +59,7 @@ static char *charset_init(void) res = buff2; } #endif -#ifdef HAVE_BIND_TEXTDOMAIN_CODESET +#ifdef ENABLE_NLS bind_textdomain_codeset(PACKAGE, res); #endif return m_strdup(res); diff --git a/config.h.cmake b/config.h.cmake index 3166c76..a4271c8 100644 --- a/config.h.cmake +++ b/config.h.cmake @@ -1,3 +1,4 @@ +#cmakedefine PACKAGE "${PACKAGE}" #cmakedefine MAILPATH "${MAILPATH}" #cmakedefine SENDMAIL "${SENDMAIL}/sendmail" #cmakedefine MIXMASTER "${MIXMASTER}/mixmaster" @@ -43,6 +44,7 @@ /* functions */ #cmakedefine HAVE_GETSID 1 +#cmakedefine HAVE_SETEGID 1 #cmakedefine HAVE_ISCTYPE 1 #cmakedefine HAVE_GETOPT 1 #cmakedefine HAVE_REGCOMP 1 @@ -67,13 +69,14 @@ #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 - diff --git a/crypt.cpkg b/crypt.cpkg index 50f1eae..f482cdb 100644 --- a/crypt.cpkg +++ b/crypt.cpkg @@ -690,7 +690,7 @@ static void print_time(time_t t, STATE *s) 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)); @@ -2680,7 +2680,7 @@ static void print_key_info (gpgme_key_t key, FILE * fp) 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); @@ -2692,7 +2692,7 @@ static void print_key_info (gpgme_key_t key, FILE * fp) 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); @@ -2803,7 +2803,7 @@ static void print_key_info (gpgme_key_t key, FILE * fp) 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); @@ -2815,7 +2815,7 @@ static void print_key_info (gpgme_key_t key, FILE * fp) 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); diff --git a/lib-lib/lib-lib.h b/lib-lib/lib-lib.h index 6a22306..706a246 100644 --- a/lib-lib/lib-lib.h +++ b/lib-lib/lib-lib.h @@ -78,7 +78,7 @@ # undef _ #endif -#ifdef ENABLE_NLS +#ifdef HAVE_LIBIDN # include #define _(a) (gettext(a)) # ifdef gettext_noop diff --git a/lib-mx/hcache.c b/lib-mx/hcache.c index a985ae3..8748adf 100644 --- a/lib-mx/hcache.c +++ b/lib-mx/hcache.c @@ -55,7 +55,7 @@ static int generate_crc32(void) 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")); diff --git a/lib-sys/mutt_signal.c b/lib-sys/mutt_signal.c index 4823e71..115460d 100644 --- a/lib-sys/mutt_signal.c +++ b/lib-sys/mutt_signal.c @@ -24,19 +24,7 @@ static void exit_handler (int sig) { 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); } diff --git a/main.c b/main.c index 2e1b4d4..35f084e 100644 --- a/main.c +++ b/main.c @@ -216,72 +216,18 @@ static void show_version (void) "-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 ); diff --git a/sendlib.c b/sendlib.c index 80fce14..1926dc6 100644 --- a/sendlib.c +++ b/sendlib.c @@ -534,7 +534,6 @@ static ssize_t convert_file_to (FILE * file, const char *fromcode, 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; @@ -642,9 +641,6 @@ static ssize_t convert_file_to (FILE * file, const char *fromcode, p_delete(&states); return ret; -#else - return -1; -#endif /* !HAVE_ICONV */ } /*