summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: f87fea3)
raw | patch | inline | side by side (parent: f87fea3)
author | Max Kellermann <max@duempel.org> | |
Thu, 25 Sep 2008 18:00:03 +0000 (20:00 +0200) | ||
committer | Max Kellermann <max@duempel.org> | |
Thu, 25 Sep 2008 18:00:03 +0000 (20:00 +0200) |
Instead of evaluating macros from config.h in the disabled source,
don't start the compiler on it at all.
don't start the compiler on it at all.
diff --git a/Makefile.am b/Makefile.am
index 25a7b6376b0daff0cb71cb5c6ffbedd911565b20..77720dd1a6a7c9b6d1b64ca2741b7afdf1af1a7b 100644 (file)
--- a/Makefile.am
+++ b/Makefile.am
# lyrics plugins
#
-if LYRICS
+if ENABLE_LYRICS_SCREEN
lyrics_plugin_dir = @lyrics_plugin_dir@
lyrics_plugins = hd.sh leoslyrics.py lyricswiki.rb
diff --git a/configure.ac b/configure.ac
index ef9a617cdb2c88955167e5e086b31a4933c77a4c..4637c2555f87ad0f3a93dec7bc7a15ab3849004a 100644 (file)
--- a/configure.ac
+++ b/configure.ac
AC_DEFINE(DISABLE_ARTIST_SCREEN, 1, [Disable artist screen])
fi
+AM_CONDITIONAL(ENABLE_ARTIST_SCREEN, test x$artist_screen = xyes)
+
dnl Optional screen - search
AC_MSG_CHECKING([whether to include the search screen])
AC_ARG_ENABLE([search-screen],
if test "x$search_screen" != "xyes" ; then
AC_DEFINE(DISABLE_SEARCH_SCREEN, 1, [Disable search screen])
fi
+
+AM_CONDITIONAL(ENABLE_SEARCH_SCREEN, test x$search_screen = xyes)
dnl Optional screen - key editor
AC_MSG_CHECKING([whether to include the key editor screen])
AC_DEFINE(DISABLE_KEYDEF_SCREEN, 1, [Disable key editor screen])
fi
+AM_CONDITIONAL(ENABLE_KEYDEF_SCREEN, test x$keydef_screen = xyes)
+
dnl Optional screen - lyrics
AC_MSG_CHECKING([whether to include the lyrics screen])
AC_ARG_ENABLE([lyrics-screen],
lyrics_screen=no
fi
-AM_CONDITIONAL(LYRICS, test x$lyrics_screen = xyes)
+AM_CONDITIONAL(ENABLE_LYRICS_SCREEN, test x$lyrics_screen = xyes)
AC_MSG_RESULT([$lyrics_screen])
diff --git a/src/Makefile.am b/src/Makefile.am
index 9a2d5c02263330f6a8c585669cffd1ba7af2a8d7..f91c2cff5ef04d493b89d0e9de4697021c978c20 100644 (file)
--- a/src/Makefile.am
+++ b/src/Makefile.am
screen_play.c\
screen_browser.c\
screen_file.c\
- screen_artist.c\
- screen_search.c\
screen_help.c\
- screen_lyrics.c\
- screen_keydef.c\
list_window.c\
colors.c\
support.c\
wreadln.c\
strfsong.c\
utils.c\
- lyrics.c \
str_pool.c
+if ENABLE_ARTIST_SCREEN
+ncmpc_SOURCES += screen_artist.c
+endif
+
+if ENABLE_SEARCH_SCREEN
+ncmpc_SOURCES += screen_search.c
+endif
+
+if ENABLE_KEYDEF_SCREEN
+ncmpc_SOURCES += screen_keydef.c
+endif
+
+if ENABLE_LYRICS_SCREEN
+ncmpc_SOURCES += screen_lyrics.c lyrics.c
+endif
+
ncmpc_SOURCES+=${ncmpc_headers}
diff --git a/src/screen.c b/src/screen.c
index e391a9d6295968f39f6e51c3ddbf1125c970134a..71631db6e48d61fa1aa64d85ec836996b1e812a5 100644 (file)
--- a/src/screen.c
+++ b/src/screen.c
#ifdef ENABLE_KEYDEF_SCREEN
extern const struct screen_functions screen_keydef;
#endif
+#ifdef ENABLE_LYRICS_SCREEN
extern const struct screen_functions screen_lyrics;
+#endif
typedef struct screen_functions * (*screen_get_mode_functions_fn_t) (void);
diff --git a/src/screen_artist.c b/src/screen_artist.c
index be7049b4d00db013d0498d614d6376517c5de92b..23a56d5b418b6d11edc6f2107ee49c67fbb9e493 100644 (file)
--- a/src/screen_artist.c
+++ b/src/screen_artist.c
*
*/
-#include "config.h"
-
-#ifndef DISABLE_ARTIST_SCREEN
#include "ncmpc.h"
#include "options.h"
#include "support.h"
.cmd = artist_cmd,
.get_title = get_title,
};
-
-#endif /* ENABLE_ARTIST_SCREEN */
diff --git a/src/screen_keydef.c b/src/screen_keydef.c
index ad547147600168feb4614759d20a2581578039ca..a37d27d2a0dfb2eda684beef648c30782823e1b5 100644 (file)
--- a/src/screen_keydef.c
+++ b/src/screen_keydef.c
*
*/
-#include "config.h"
-
-#ifndef DISABLE_KEYDEF_SCREEN
#include "ncmpc.h"
#include "mpdclient.h"
#include "options.h"
.cmd = keydef_cmd,
.get_title = keydef_title,
};
-
-#endif
diff --git a/src/screen_lyrics.c b/src/screen_lyrics.c
index d83bf5b36b993d9acfdca8cd8d2356aa8f3873d5..3c0393488fde736866ae6a669f20a8fbab42f23d 100644 (file)
--- a/src/screen_lyrics.c
+++ b/src/screen_lyrics.c
*
*/
-#include "config.h"
-#ifndef DISABLE_LYRICS_SCREEN
#include <sys/stat.h>
#include "ncmpc.h"
#include "options.h"
.cmd = lyrics_cmd,
.get_title = lyrics_title,
};
-
-#endif /* ENABLE_LYRICS_SCREEN */
diff --git a/src/screen_search.c b/src/screen_search.c
index 5135b6cf027309fbea390791426d524655d01ad4..245eb5243c9c9bc9000895fb54dea15967585af7 100644 (file)
--- a/src/screen_search.c
+++ b/src/screen_search.c
*
*/
-#include "config.h"
-
-#ifndef DISABLE_SEARCH_SCREEN
#include "ncmpc.h"
#include "options.h"
#include "support.h"
.cmd = search_cmd,
.get_title = get_title,
};
-
-#endif /* ENABLE_SEARCH_SCREEN */