summary |
shortlog |
log |
commit | commitdiff |
tree
raw |
patch |
inline | side by side (from parent 1:
f274743)
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 <geoff@infradead.org>
-AC_CHECK_HEADERS([stdarg.h])
-AC_CHECK_HEADERS([varargs.h])
+AX_WITH_CURSES
+AX_WITH_CURSES_MENU
+AX_WITH_CURSES_FORM
+
+AM_CONDITIONAL([WITH_NCURSES], [test "x$ax_cv_curses" = "xyes"])
+
+if test "x$ax_cv_curses" = xyes; then
+ if test "x$ax_cv_menu" != xyes; then
+ AC_MSG_ERROR([--with-ncurses requires the ncurses menu library])
+ fi
+ if test "x$ax_cv_form" != xyes; then
+ AC_MSG_ERROR([--with-ncurses requires the ncurses form library])
+ fi
+fi
AC_CHECK_LIB([udev], [udev_new],
[],
[AC_MSG_FAILURE([The libudev development library is required by petitboot. Try installing the package libudev-dev or libudev-devel.])]
)
AC_CHECK_LIB([udev], [udev_new],
[],
[AC_MSG_FAILURE([The libudev development library is required by petitboot. Try installing the package libudev-dev or libudev-devel.])]
)
+AC_CHECK_HEADERS([stdarg.h])
+AC_CHECK_HEADERS([varargs.h])
+
dnl Checking for va_copy availability
AC_MSG_CHECKING([for va_copy])
AC_TRY_LINK([#include <stdarg.h>
dnl Checking for va_copy availability
AC_MSG_CHECKING([for va_copy])
AC_TRY_LINK([#include <stdarg.h>
-AC_ARG_WITH(
- [ncurses],
- [AS_HELP_STRING([--with-ncurses],
- [build text console UI programs using ncurses [default=yes]]
- )],
- [],
- [with_ncurses=yes]
-)
-AM_CONDITIONAL([WITH_NCURSES], [test "x$with_ncurses" = "xyes"])
-
-AS_IF(
- [test "x$with_ncurses" = "xyes"],
- AC_CHECK_LIB([ncurses], [initscr],
- [],
- [AC_MSG_FAILURE([--with-ncurses was given but the test for libncurses failed. Try installing the package ncurses-dev or ncurses-devel.])]
- )
-)
-
AC_ARG_WITH(
[twin-x11],
[AS_HELP_STRING([--with-twin-x11],
AC_ARG_WITH(
[twin-x11],
[AS_HELP_STRING([--with-twin-x11],
AM_CFLAGS = \
$(DEFAULT_CFLAGS)
AM_CFLAGS = \
$(DEFAULT_CFLAGS)
-AM_LDFLAGS = -lmenu -lform -lncurses
-
common_libs = \
libpbnc.la \
$(top_builddir)/ui/common/libpbui.la \
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
noinst_LTLIBRARIES = libpbnc.la
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
-#if defined(HAVE_CONFIG_H)
#include <errno.h>
#include <getopt.h>
#include <signal.h>
#include <errno.h>
#include <getopt.h>
#include <signal.h>
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
#define _GNU_SOURCE
#include <assert.h>
#define _GNU_SOURCE
#include <assert.h>
#if !defined(_PB_NC_KED_H)
#define _PB_NC_KED_H
#if !defined(_PB_NC_KED_H)
#define _PB_NC_KED_H
#include <linux/input.h> /* This must be included before ncurses.h */
#include <linux/input.h> /* This must be included before ncurses.h */
+#if defined HAVE_NCURSESW_FORM_H
+# include <ncursesw/form.h>
+#elif defined HAVE_NCURSES_FORM_H
+# include <ncurses/form.h>
+#elif defined HAVE_FORM_H
+# include <form.h>
+#else
+# error "Curses form.h not found."
+#endif
#include "types/types.h"
#include "ui/common/ui-system.h"
#include "types/types.h"
#include "ui/common/ui-system.h"
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
#define _GNU_SOURCE
#include <assert.h>
#define _GNU_SOURCE
#include <assert.h>
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
#define _GNU_SOURCE
#include <assert.h>
#define _GNU_SOURCE
#include <assert.h>
#if !defined(_PB_NC_MENU_H)
#define _PB_NC_MENU_H
#if !defined(_PB_NC_MENU_H)
#define _PB_NC_MENU_H
#include <linux/input.h> /* This must be included before ncurses.h */
#include <linux/input.h> /* This must be included before ncurses.h */
+#if defined HAVE_NCURSESW_MENU_H
+# include <ncursesw/menu.h>
+#elif defined HAVE_NCURSES_MENU_H
+# include <ncurses/menu.h>
+#elif defined HAVE_MENU_H
+# include <menu.h>
+#else
+# error "Curses menu.h not found."
+#endif
#include "log/log.h"
#include "types/types.h"
#include "log/log.h"
#include "types/types.h"
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
+#include "config.h"
+
+#define _GNU_SOURCE
+
#include <assert.h>
#include <stdarg.h>
#include <assert.h>
#include <stdarg.h>
#define _PB_NC_SCR_H
#include <linux/input.h> /* This must be included before ncurses.h */
#define _PB_NC_SCR_H
#include <linux/input.h> /* This must be included before ncurses.h */
+#if defined HAVE_NCURSESW_CURSES_H
+# include <ncursesw/curses.h>
+#elif defined HAVE_NCURSESW_H
+# include <ncursesw.h>
+#elif defined HAVE_NCURSES_CURSES_H
+# include <ncurses/curses.h>
+#elif defined HAVE_NCURSES_H
+# include <ncurses.h>
+#elif defined HAVE_CURSES_H
+# include <curses.h>
+#else
+# error "Curses header file not found."
+#endif
#ifdef DEBUG
#define DBG(fmt, args...) pb_log("DBG: " fmt, ## args)
#ifdef DEBUG
#define DBG(fmt, args...) pb_log("DBG: " fmt, ## args)
* ncurses mouse support
*/
* ncurses mouse support
*/
-#if defined(HAVE_CONFIG_H)
#include <errno.h>
#include <getopt.h>
#include <signal.h>
#include <errno.h>
#include <getopt.h>
#include <signal.h>