Code

configure.ac: added --disable-locale option
[ncmpc.git] / src / main.c
index 11f16acb842f57174986ffca34e4e7ddcd1c2769..a0f7c0c99c7aedd42b204af2cfcb2d64233ebd8c 100644 (file)
 #include <signal.h>
 #include <string.h>
 
+#ifdef ENABLE_LOCALE
+#include <locale.h>
+#endif
+
 /* time between mpd updates [s] */
 static const guint update_interval = 500;
 
@@ -359,7 +363,7 @@ int
 main(int argc, const char *argv[])
 {
        struct sigaction act;
-#if defined(HAVE_LOCALE_H) && !defined(NCMPC_MINI)
+#ifdef ENABLE_LOCALE
        const char *charset = NULL;
 #endif
        GIOChannel *keyboard_channel;
@@ -368,7 +372,7 @@ main(int argc, const char *argv[])
        GIOChannel *lirc_channel = NULL;
 #endif
 
-#if defined(HAVE_LOCALE_H) && !defined(NCMPC_MINI)
+#ifdef ENABLE_LOCALE
        /* time and date formatting */
        setlocale(LC_TIME,"");
        /* care about sorting order etc */
@@ -393,13 +397,13 @@ main(int argc, const char *argv[])
        /* parse command line options - 1 pass get configuration files */
        options_parse(argc, argv);
 
-       /* read configuration */
 #ifndef NCMPC_MINI
+       /* read configuration */
        read_configuration();
-#endif
 
        /* check key bindings */
        check_key_bindings(NULL, NULL, 0);
+#endif
 
        /* parse command line options - 2 pass */
        options_parse(argc, argv);
@@ -510,6 +514,11 @@ main(int argc, const char *argv[])
 #endif
 
        exit_and_cleanup();
+
+#ifdef ENABLE_LYRICS_SCREEN
+       lyrics_deinit();
+#endif
+
        ncu_deinit();
 
        return 0;