Don't bail out if configure (without --with-curses) does not find libcurses.
[gnushogi.git] / configure.ac
index 6a710a0..c2be5bb 100644 (file)
@@ -6,7 +6,7 @@ dnl Process this file with autoconf to produce a configure script.
 
 AC_PREREQ(2.57)
 AC_INIT([gnushogi],[1.4.0+],[https://savannah.gnu.org/bugs/?group=gnushogi])
-AC_CONFIG_SRCDIR([version.h])
+AC_CONFIG_SRCDIR([gnushogi/gnushogi.h])
 AC_CONFIG_HEADER(config.h)
 
 ##########
@@ -29,19 +29,21 @@ AC_MSG_NOTICE([libs])
 # curses
 AC_ARG_WITH([curses],
   [AS_HELP_STRING([--with-curses],
-    [enable curses UI])],
+    [enable curses UI (default: yes if available)])],
   [],
   [with_curses=check])
 
 LIBCURSES=
 AS_IF([test "x$with_curses" != xno],
   [AC_CHECK_LIB([curses], [clrtoeol],
-    [AC_SUBST([LIBCURSES], ["-lcurses"])
+    [AC_SUBST([LIBCURSES], [-lcurses])
+     AC_SUBST([CURSESDSP], [cursesdsp.o])
      AC_DEFINE([HAVE_LIBCURSES], [1],
                [Define if you have lib])
     ],
-    [AC_MSG_ERROR(
-       [--with-curses was given, but test for curses failed])],
+    [AS_IF([test "x$with_curses" = xyes],
+      [AC_MSG_ERROR(
+        [--with-curses was given, but test for curses failed])])],
     [-ltermcap])])
 
 # other libraries.