]> git.meshlink.io Git - meshlink/blobdiff - m4/curses.m4
Enable compiler hardening flags by default.
[meshlink] / m4 / curses.m4
index 1001f4970bb6542e52df92e62108811f6e9ce5e2..2e8d151041c9fce008c75a117374421bc2ebebe3 100644 (file)
@@ -6,6 +6,7 @@ AC_DEFUN([tinc_CURSES],
     AS_HELP_STRING([--disable-curses], [disable curses support]))
   AS_IF([test "x$enable_curses" != "xno"], [
   AC_DEFINE(HAVE_CURSES, 1, [have curses support])
+    curses=true
     AC_ARG_WITH(curses,
       AS_HELP_STRING([--with-curses=DIR], [curses base directory, or:]),
       [curses="$withval"
@@ -30,9 +31,14 @@ AC_DEFUN([tinc_CURSES],
       [AC_MSG_ERROR("curses header files not found."); break]
     )
 
-    AC_CHECK_LIB(curses, initscr,
-      [LIBS="$LIBS -lcurses"],
-      [AC_MSG_ERROR("curses libraries not found.")]
+    AC_CHECK_LIB(ncurses, initscr,
+      [CURSES_LIBS="-lncurses"],
+      [AC_CHECK_LIB(curses, initscr,
+        [CURSES_LIBS="-lcurses"],
+        [AC_MSG_ERROR("curses libraries not found.")]
+      )]
     )
   ])
+
+  AC_SUBST(CURSES_LIBS)
 ])