diff options
author | Max Kellermann <max@duempel.org> | 2008-09-25 20:00:03 +0200 |
---|---|---|
committer | Max Kellermann <max@duempel.org> | 2008-09-25 20:00:03 +0200 |
commit | cee4c0450e477e6b683fb3db883227c2a7fa423f (patch) | |
tree | 6d38e37ce065a8db8e7444fae5ab317cf97108f7 | |
parent | f87fea3cd0792de52c0620c329b67db096a7a687 (diff) | |
download | mpd-cee4c0450e477e6b683fb3db883227c2a7fa423f.tar.gz mpd-cee4c0450e477e6b683fb3db883227c2a7fa423f.tar.xz mpd-cee4c0450e477e6b683fb3db883227c2a7fa423f.zip |
screen: don't compile disabled sources
Instead of evaluating macros from config.h in the disabled source,
don't start the compiler on it at all.
-rw-r--r-- | Makefile.am | 2 | ||||
-rw-r--r-- | configure.ac | 8 | ||||
-rw-r--r-- | src/Makefile.am | 21 | ||||
-rw-r--r-- | src/screen.c | 2 | ||||
-rw-r--r-- | src/screen_artist.c | 5 | ||||
-rw-r--r-- | src/screen_keydef.c | 5 | ||||
-rw-r--r-- | src/screen_lyrics.c | 4 | ||||
-rw-r--r-- | src/screen_search.c | 5 |
8 files changed, 26 insertions, 26 deletions
diff --git a/Makefile.am b/Makefile.am index 25a7b6376..77720dd1a 100644 --- a/Makefile.am +++ b/Makefile.am @@ -23,7 +23,7 @@ EXTRA_DIST = \ # 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 ef9a617cd..4637c2555 100644 --- a/configure.ac +++ b/configure.ac @@ -218,6 +218,8 @@ if test "x$artist_screen" != "xyes" ; then 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], @@ -229,6 +231,8 @@ AC_MSG_RESULT([$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]) @@ -242,6 +246,8 @@ if test "x$keydef_screen" != "xyes" ; then 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], @@ -254,7 +260,7 @@ if test "x$lyrics_screen" != "xyes" ; then 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 9a2d5c022..f91c2cff5 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -58,20 +58,31 @@ ncmpc_SOURCES = \ 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 e391a9d62..71631db6e 100644 --- a/src/screen.c +++ b/src/screen.c @@ -61,7 +61,9 @@ extern const struct screen_functions screen_search; #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 be7049b4d..23a56d5b4 100644 --- a/src/screen_artist.c +++ b/src/screen_artist.c @@ -16,9 +16,6 @@ * */ -#include "config.h" - -#ifndef DISABLE_ARTIST_SCREEN #include "ncmpc.h" #include "options.h" #include "support.h" @@ -486,5 +483,3 @@ const struct screen_functions screen_artist = { .cmd = artist_cmd, .get_title = get_title, }; - -#endif /* ENABLE_ARTIST_SCREEN */ diff --git a/src/screen_keydef.c b/src/screen_keydef.c index ad5471476..a37d27d2a 100644 --- a/src/screen_keydef.c +++ b/src/screen_keydef.c @@ -16,9 +16,6 @@ * */ -#include "config.h" - -#ifndef DISABLE_KEYDEF_SCREEN #include "ncmpc.h" #include "mpdclient.h" #include "options.h" @@ -375,5 +372,3 @@ const struct screen_functions screen_keydef = { .cmd = keydef_cmd, .get_title = keydef_title, }; - -#endif diff --git a/src/screen_lyrics.c b/src/screen_lyrics.c index d83bf5b36..3c0393488 100644 --- a/src/screen_lyrics.c +++ b/src/screen_lyrics.c @@ -17,8 +17,6 @@ * */ -#include "config.h" -#ifndef DISABLE_LYRICS_SCREEN #include <sys/stat.h> #include "ncmpc.h" #include "options.h" @@ -336,5 +334,3 @@ const struct screen_functions screen_lyrics = { .cmd = lyrics_cmd, .get_title = lyrics_title, }; - -#endif /* ENABLE_LYRICS_SCREEN */ diff --git a/src/screen_search.c b/src/screen_search.c index 5135b6cf0..245eb5243 100644 --- a/src/screen_search.c +++ b/src/screen_search.c @@ -16,9 +16,6 @@ * */ -#include "config.h" - -#ifndef DISABLE_SEARCH_SCREEN #include "ncmpc.h" #include "options.h" #include "support.h" @@ -525,5 +522,3 @@ const struct screen_functions screen_search = { .cmd = search_cmd, .get_title = get_title, }; - -#endif /* ENABLE_SEARCH_SCREEN */ |