From f1599796efed1eb67759cf42f47fe4bf6a9bf93c Mon Sep 17 00:00:00 2001 From: Geoff Levand Date: Fri, 19 Jul 2013 17:07:31 -0700 Subject: configure: Update to use AX_WITH_CURSES MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit For a more portable build system convert to using the autoconf-archive AX_WITH_CURSES macros. Allows building on openSUSE, which has a different header file layout than other distros, and fixes menu entries with UTF-8 characters; this causes fedora installs (codename "Schrödinger´s cat") to break the UI. Signed-off-by: Geoff Levand --- ui/ncurses/Makefile.am | 5 ++--- ui/ncurses/generic-main.c | 4 ++-- ui/ncurses/nc-boot-editor.c | 2 ++ ui/ncurses/nc-boot-editor.h | 11 +++++++++-- ui/ncurses/nc-cui.c | 2 ++ ui/ncurses/nc-menu.c | 2 ++ ui/ncurses/nc-menu.h | 11 +++++++++-- ui/ncurses/nc-scr.c | 4 ++++ ui/ncurses/nc-scr.h | 14 +++++++++++++- ui/ncurses/ps3-main.c | 4 ++-- 10 files changed, 47 insertions(+), 12 deletions(-) (limited to 'ui') diff --git a/ui/ncurses/Makefile.am b/ui/ncurses/Makefile.am index 6d360d2..64b6eb1 100644 --- a/ui/ncurses/Makefile.am +++ b/ui/ncurses/Makefile.am @@ -20,12 +20,11 @@ AM_CPPFLAGS = \ AM_CFLAGS = \ $(DEFAULT_CFLAGS) -AM_LDFLAGS = -lmenu -lform -lncurses - common_libs = \ libpbnc.la \ $(top_builddir)/ui/common/libpbui.la \ - $(top_builddir)/lib/libpbcore.la + $(top_builddir)/lib/libpbcore.la \ + @MENU_LIB@ @FORM_LIB@ @CURSES_LIB@ noinst_LTLIBRARIES = libpbnc.la diff --git a/ui/ncurses/generic-main.c b/ui/ncurses/generic-main.c index 6280a34..cafd23a 100644 --- a/ui/ncurses/generic-main.c +++ b/ui/ncurses/generic-main.c @@ -18,11 +18,11 @@ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ -#if defined(HAVE_CONFIG_H) #include "config.h" -#endif #define _GNU_SOURCE + +#include #include #include #include diff --git a/ui/ncurses/nc-boot-editor.c b/ui/ncurses/nc-boot-editor.c index 4579b1a..0b658f2 100644 --- a/ui/ncurses/nc-boot-editor.c +++ b/ui/ncurses/nc-boot-editor.c @@ -16,6 +16,8 @@ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ +#include "config.h" + #define _GNU_SOURCE #include diff --git a/ui/ncurses/nc-boot-editor.h b/ui/ncurses/nc-boot-editor.h index bdcc560..a509f75 100644 --- a/ui/ncurses/nc-boot-editor.h +++ b/ui/ncurses/nc-boot-editor.h @@ -19,9 +19,16 @@ #if !defined(_PB_NC_KED_H) #define _PB_NC_KED_H -#include #include /* This must be included before ncurses.h */ -#include +#if defined HAVE_NCURSESW_FORM_H +# include +#elif defined HAVE_NCURSES_FORM_H +# include +#elif defined HAVE_FORM_H +# include +#else +# error "Curses form.h not found." +#endif #include "types/types.h" #include "ui/common/ui-system.h" diff --git a/ui/ncurses/nc-cui.c b/ui/ncurses/nc-cui.c index 3f82f85..4baaec1 100644 --- a/ui/ncurses/nc-cui.c +++ b/ui/ncurses/nc-cui.c @@ -16,6 +16,8 @@ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ +#include "config.h" + #define _GNU_SOURCE #include diff --git a/ui/ncurses/nc-menu.c b/ui/ncurses/nc-menu.c index 0612d8a..e28168e 100644 --- a/ui/ncurses/nc-menu.c +++ b/ui/ncurses/nc-menu.c @@ -16,6 +16,8 @@ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ +#include "config.h" + #define _GNU_SOURCE #include diff --git a/ui/ncurses/nc-menu.h b/ui/ncurses/nc-menu.h index 750bef5..f010835 100644 --- a/ui/ncurses/nc-menu.h +++ b/ui/ncurses/nc-menu.h @@ -19,9 +19,16 @@ #if !defined(_PB_NC_MENU_H) #define _PB_NC_MENU_H -#include #include /* This must be included before ncurses.h */ -#include +#if defined HAVE_NCURSESW_MENU_H +# include +#elif defined HAVE_NCURSES_MENU_H +# include +#elif defined HAVE_MENU_H +# include +#else +# error "Curses menu.h not found." +#endif #include "log/log.h" #include "types/types.h" diff --git a/ui/ncurses/nc-scr.c b/ui/ncurses/nc-scr.c index 062d34a..d2455d4 100644 --- a/ui/ncurses/nc-scr.c +++ b/ui/ncurses/nc-scr.c @@ -16,6 +16,10 @@ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ +#include "config.h" + +#define _GNU_SOURCE + #include #include diff --git a/ui/ncurses/nc-scr.h b/ui/ncurses/nc-scr.h index f18753a..a8aa314 100644 --- a/ui/ncurses/nc-scr.h +++ b/ui/ncurses/nc-scr.h @@ -20,7 +20,19 @@ #define _PB_NC_SCR_H #include /* This must be included before ncurses.h */ -#include +#if defined HAVE_NCURSESW_CURSES_H +# include +#elif defined HAVE_NCURSESW_H +# include +#elif defined HAVE_NCURSES_CURSES_H +# include +#elif defined HAVE_NCURSES_H +# include +#elif defined HAVE_CURSES_H +# include +#else +# error "Curses header file not found." +#endif #ifdef DEBUG #define DBG(fmt, args...) pb_log("DBG: " fmt, ## args) diff --git a/ui/ncurses/ps3-main.c b/ui/ncurses/ps3-main.c index 5735055..5be8c32 100644 --- a/ui/ncurses/ps3-main.c +++ b/ui/ncurses/ps3-main.c @@ -24,11 +24,11 @@ * ncurses mouse support */ -#if defined(HAVE_CONFIG_H) #include "config.h" -#endif #define _GNU_SOURCE + +#include #include #include #include -- cgit v1.2.1