Commit Diff


commit - dd038bc6ec835ad3fd3c0b5303b8af9ad506c8cc
commit + acf52a76031e15e6a2bbe327bc4291a2867ae143
blob - 4a32b53176f07eed16b613bb85a0eaa5ff2bfb65
blob + 58e9cd224042487a39106bc8aedac7af423fa274
--- configure.ac
+++ configure.ac
@@ -313,62 +313,46 @@ AC_LINK_IFELSE([AC_LANG_SOURCE(
 	AC_MSG_RESULT(no)
 )
 
-# Look for ncurses.
 PKG_CHECK_MODULES(
-	LIBTINFO,
-	tinfo,
+	LIBPANELW,
+	panelw,
+	found_panel=yes,
+	AC_MSG_ERROR("*** couldn't find -lpanel from ncurses")
+)
+
+PKG_CHECK_MODULES(
+	LIBNCURSES,
+	ncursesw,
 	found_ncurses=yes,
 	found_ncurses=no
 )
-if test "x$found_ncurses" = xno; then
-	PKG_CHECK_MODULES(
-		LIBNCURSES,
-		ncurses,
-		found_ncurses=yes,
-		found_ncurses=no
-	)
-fi
-if test "x$found_ncurses" = xno; then
-	PKG_CHECK_MODULES(
-		LIBNCURSES,
-		ncursesw,
-		found_ncurses=yes,
-		found_ncurses=no
-	)
-fi
-if test "x$found_ncurses" = xyes; then
-	AM_CFLAGS="$LIBNCURSES_CFLAGS $LIBTINFO_CFLAGS $AM_CFLAGS"
-	CFLAGS="$LIBNCURSES_CFLAGS $LIBTINFO_CFLAGS $CFLAGS"
-	LIBS="$LIBNCURSES_LIBS $LIBTINFO_LIBS $LIBS"
+if test "x$found_ncurses" = xyes; then
+	AM_CFLAGS="$LIBNCURSES_CFLAGS $LIBTINFO_CFLAGS $LIBPANELW_CFLAGS $AM_CFLAGS"
+	CFLAGS="$LIBNCURSES_CFLAGS $LIBTINFO_CFLAGS $LIBPANELW_CFLAGS $CFLAGS"
+	LIBS="$LIBNCURSES_LIBS $LIBTINFO_LIBS $LIBPANELW_LIBS $LIBS"
 else
-	# pkg-config didn't work, try ncurses.
 	AC_CHECK_LIB(
-		tinfo,
+		ncursesw,
 		setupterm,
 		found_ncurses=yes,
 		found_ncurses=no
 	)
-	if test "x$found_ncurses" = xno; then
-		AC_CHECK_LIB(
-			ncurses,
-			setupterm,
-			found_ncurses=yes,
-			found_ncurses=no
-		)
-	fi
 	if test "x$found_ncurses" = xyes; then
 		AC_CHECK_HEADER(
 			ncurses.h,
-			LIBS="$LIBS -lncurses",
-			found_ncurses=no)
-	fi
+			AM_CFLAGS="$LIBPANELW_CFLAGS $AM_CFLAGS"
+			CFLAGS="$LIBPANEL_CFLAGS $CFLAGS"
+			LIBS="$LIBS -lncursesw $LIBPANELW_LIBS",
+			found_ncurses=no
+		)
+		fi
 fi
 if test "x$found_ncurses" = xyes; then
 	AC_DEFINE(HAVE_NCURSES_H)
 else
 	# No ncurses, try curses.
 	AC_CHECK_LIB(
-		curses,
+		cursesw,
 		setupterm,
 		found_curses=yes,
 		found_curses=no
@@ -378,7 +362,9 @@ else
 		,
 		found_curses=no)
 	if test "x$found_curses" = xyes; then
-		LIBS="$LIBS -lcurses"
+		AM_CFLAGS="$LIBPANELW_CFLAGS $AM_CFLAGS"
+		CFLAGS="$LIBPANEL_CFLAGS $CFLAGS"
+		LIBS="$LIBS -lcursesw $LIBPANELW_LIBS"
 		AC_DEFINE(HAVE_CURSES_H)
 	else
 		AC_MSG_ERROR("curses not found")
blob - 3f3825f3ab509f53cf1886193cccec03dfb99724
blob + 22be8f445205b2b01aced81e6ed5000cb6e90ac4
--- tog/Makefile.am
+++ tog/Makefile.am
@@ -54,4 +54,4 @@ AM_CPPFLAGS += -DGOT_VERSION='"@VERSION@"' \
 	-I$(top_srcdir)/include \
 	-I.
 
-LDADD = -L$(top_builddir)/compat -lopenbsd-compat -lutil -lpanel -lncursesw -lpthread
+LDADD = -L$(top_builddir)/compat -lopenbsd-compat -lpthread
blob - 9368c448d5fc066021785fa4c63cfc10e92e46ae
blob + af76bcbb1f3e4fea2aa79213207241abf1d2c04d
--- tog/tog.c
+++ tog/tog.c
@@ -66,7 +66,9 @@
 #define	MAX(_a,_b) ((_a) > (_b) ? (_a) : (_b))
 #endif
 
+#ifndef CTRL
 #define CTRL(x)		((x) & 0x1f)
+#endif
 
 #ifndef nitems
 #define nitems(_a)	(sizeof((_a)) / sizeof((_a)[0]))