From f4b97417db2f20b75b091b5dcd7b579ad2d5c394 Mon Sep 17 00:00:00 2001 From: Andre Noll Date: Fri, 25 Feb 2011 17:13:08 +0100 Subject: [PATCH] Replace ncurses by curses. Ncurses is not available on all platforms, and para_gui should work with any curses implementation. So this patch replaces the --with-ncurses-headers and --with-ncurses-libs configure options by --with-ncurses-headers and --with-ncurses-libs, and makes configure check for libcurses instead of libncurses. Moreover, the para_gui executable is now linked against libcurses rather than libncurses. On linux systems, this should be a no-op. --- Makefile.in | 4 ++-- configure.ac | 34 +++++++++++++++++----------------- 2 files changed, 19 insertions(+), 19 deletions(-) diff --git a/Makefile.in b/Makefile.in index c64b5ae7..8a769607 100644 --- a/Makefile.in +++ b/Makefile.in @@ -54,7 +54,7 @@ CPPFLAGS += -Wbad-function-cast CPPFLAGS += -fno-strict-aliasing CPPFLAGS += -DMAIN_INPUT_FILE_IS_$(*F) CPPFLAGS += @SSL_CPPFLAGS@ -CPPFLAGS += @ncurses_cppflags@ +CPPFLAGS += @curses_cppflags@ CPPFLAGS += @arch_cppflags@ CPPFLAGS += -I/usr/local/include CPPFLAGS += -I$(cmdline_dir) @@ -245,7 +245,7 @@ para_client: $(client_objs) para_gui: $(gui_objs) @[ -z "$(Q)" ] || echo 'LD $@' - $(Q) $(CC) $(LDFLAGS) -o $@ $(gui_objs) -lncurses + $(Q) $(CC) $(LDFLAGS) -o $@ $(gui_objs) -lcurses para_audiod: audiod_command_list.c audiod_command_list.h $(audiod_objs) @[ -z "$(Q)" ] || echo 'LD $@' diff --git a/configure.ac b/configure.ac index 1b2dc114..e5a23438 100644 --- a/configure.ac +++ b/configure.ac @@ -353,31 +353,31 @@ if test ${have_ucred} = yes; then fi ########################################################################### curses -have_ncurses="yes" +have_curses="yes" OLD_CPPFLAGS="$CPPFLAGS" OLD_LD_FLAGS="$LDFLAGS" OLD_LIBS="$LIBS" -AC_ARG_WITH(ncurses_headers, [AC_HELP_STRING(--with-ncurses-headers=dir, - [look for ncurses.h also in dir])]) -if test -n "$with_ncurses_headers"; then - ncurses_cppflags="-I$with_ncurses_headers" - CPPFLAGS="$CPPFLAGS $ncurses_cppflags" +AC_ARG_WITH(curses_headers, [AC_HELP_STRING(--with-curses-headers=dir, + [look for curses.h also in dir])]) +if test -n "$with_curses_headers"; then + curses_cppflags="-I$with_curses_headers" + CPPFLAGS="$CPPFLAGS $curses_cppflags" fi -AC_ARG_WITH(ncurses_libs, [AC_HELP_STRING(--with-ncurses-libs=dir, - [look for libncurses also in dir])]) -if test -n "$with_ncurses_libs"; then - ncurses_libs="-L$with_ncurses_libs" - LDFLAGS="$LDFLAGS $ncurses_libs" +AC_ARG_WITH(curses_libs, [AC_HELP_STRING(--with-curses-libs=dir, + [look for libcurses also in dir])]) +if test -n "$with_curses_libs"; then + curses_libs="-L$with_curses_libs" + LDFLAGS="$LDFLAGS $curses_libs" fi AC_CHECK_HEADER(curses.h, [], [ - have_ncurses="no" + have_curses="no" ]) -AC_CHECK_LIB([ncurses], [initscr], [], [ - have_ncurses="no" +AC_CHECK_LIB([curses], [initscr], [], [ + have_curses="no" ]) -if test "$have_ncurses" = "yes"; then - AC_SUBST(ncurses_cppflags) - AC_DEFINE(HAVE_NCURSES, 1, [define to 1 to turn on ncurses support]) +if test "$have_curses" = "yes"; then + AC_SUBST(curses_cppflags) + AC_DEFINE(HAVE_NCURSES, 1, [define to 1 to turn on curses support]) extras="$extras gui" executables="$executables gui" else -- 2.39.2