From: Andre Noll Date: Sun, 8 Sep 2013 01:11:16 +0000 (+0000) Subject: build: Separate curses detection from gui configuration. X-Git-Tag: v0.5.1~1^2~53 X-Git-Url: http://git.tuebingen.mpg.de/?p=paraslash.git;a=commitdiff_plain;h=782e47ecd725dd44d4425351e21540a6914b13aa;ds=sidebyside build: Separate curses detection from gui configuration. It's cleaner to separate feature/library detection from the logic that decides whether an executable can be built. This patch creates a separate section for para_gui which contains the list of all objects for para_gui and sets $build_gui to either "yes" or "no", depending on whether a usable curses library was found. --- diff --git a/Makefile.in b/Makefile.in index 6d14029c..c500fb9e 100644 --- a/Makefile.in +++ b/Makefile.in @@ -266,7 +266,7 @@ para_client: $(client_objs) para_gui: $(gui_objs) @[ -z "$(Q)" ] || echo 'LD $@' - $(Q) $(CC) -o $@ $(gui_objs) @gui_ldflags@ $(LDFLAGS) + $(Q) $(CC) -o $@ $(gui_objs) @curses_ldflags@ $(LDFLAGS) para_audiod: $(audiod_objs) @[ -z "$(Q)" ] || echo 'LD $@' diff --git a/configure.ac b/configure.ac index e9d8d848..e18a22e4 100644 --- a/configure.ac +++ b/configure.ac @@ -143,20 +143,6 @@ write_ldflags="" writers=" file" default_writer="FILE_WRITE" -gui_cmdline_objs="gui" -gui_errlist_objs=" - exec - signal - string - stat - ringbuffer - fd - gui - gui_theme - time - version - ggo -" play_errlist_objs="play fd sched ggo buffer_tree time string net afh_recv afh_common wma_afh wma_common mp3_afh @@ -400,27 +386,20 @@ fi AC_CHECK_HEADER(curses.h, [], [ have_curses="no" ]) -gui_ldflags="$curses_libs" +curses_ldflags="$curses_libs" AC_CHECK_LIB([ncursesw], [initscr], - [gui_ldflags="$curses_libs -lncursesw"], [ + [curses_ldflags="$curses_libs -lncursesw"], [ AC_CHECK_LIB([curses], [initscr], - [gui_ldflags="$curses_libs -lcurses"], + [curses_ldflags="$curses_libs -lcurses"], [have_curses="no"] ) ] ) -if test "$have_curses" = "yes"; then - AC_SUBST(curses_cppflags) - build_gui="yes" - executables="$executables gui" -else - build_gui="no" - AC_MSG_WARN([no curses lib, cannot build para_gui]) -fi +AC_SUBST(curses_cppflags) +AC_SUBST(curses_ldflags) CPPFLAGS="$OLD_CPPFLAGS" LDFLAGS="$OLD_LDFLAGS" LIBS="$OLD_LIBS" - ########################################################################### ip_mreqn AC_MSG_CHECKING(for struct ip_mreqn (UDPv4 multicast)) AC_LINK_IFELSE([AC_LANG_PROGRAM([[ @@ -1239,6 +1218,29 @@ else AC_MSG_WARN([no mixer support]) mixer_summary="para_fade: no" fi +########################################################################### gui +if test "$have_curses" = "yes"; then + build_gui="yes" + executables="$executables gui" + gui_cmdline_objs="gui" + gui_errlist_objs=" + exec + signal + string + stat + ringbuffer + fd + gui + gui_theme + time + version + ggo + " + gui_objs="add_cmdline($gui_cmdline_objs) $gui_errlist_objs" +else + build_gui="no" + AC_MSG_WARN([no curses lib, cannot build para_gui]) +fi ############################################################# error2.h AC_MSG_NOTICE(creating error2.h) @@ -1364,7 +1366,6 @@ AC_DEFINE_UNQUOTED(INIT_AUDIOC_ERRLISTS, objlist_to_errlist($audioc_errlist_objs), errors used by para_audioc) AC_SUBST(gui_objs, add_dot_o($gui_objs)) -AC_SUBST(gui_ldflags, $gui_ldflags) AC_DEFINE_UNQUOTED(INIT_GUI_ERRLISTS, objlist_to_errlist($gui_errlist_objs), errors used by para_gui)