Revision: 6747
Author: nogu.dev
Date: Thu Sep  9 04:50:34 2010
Log: * configure.ac
  - (LIBEDIT_LIBS): Take ncurses into account and check if curses or ncurses
    is installed.
http://code.google.com/p/uim/source/detail?r=6747

Modified:
 /trunk/configure.ac

=======================================
--- /trunk/configure.ac Fri Aug 13 02:21:49 2010
+++ /trunk/configure.ac Thu Sep  9 04:50:34 2010
@@ -1121,21 +1121,24 @@
   ],
   [use_libedit="yes"])

- if test "x$use_libedit" != "xno"; then
-     saved_CPPFLAGS=$CPPFLAGS
-     saved_LDFLAGS=$LDFLAGS
-     CPPFLAGS="${CPPFLAGS} -I$libedit_path/include"
-     LDFLAGS="${LDFLAGS} -L$libedit_path/lib"
-     AC_CHECK_LIB(edit, el_init,
-               [
-                  LIBEDIT_LIBS="-ledit -lcurses -L$libedit_path/lib"
-                  AC_SUBST(LIBEDIT_LIBS)
-               ], [
-                   AC_MSG_WARN("libedit not found. Disabled...")
-                   use_libedit="no"
-                ])
-     CPPFLAGS=$saved_CPPFLAGS
-     LDFLAGS=$saved_LDFLAGS
+if test "x$use_libedit" != "xno"; then
+    saved_CPPFLAGS=$CPPFLAGS
+    saved_LDFLAGS=$LDFLAGS
+    CPPFLAGS="${CPPFLAGS} -I$libedit_path/include"
+    LDFLAGS="${LDFLAGS} -L$libedit_path/lib"
+    AC_CHECK_LIB(curses, tgetent, LIBEDIT_LIBS="-lcurses",
+        [AC_CHECK_LIB(ncurses, tgetent, LIBEDIT_LIBS="-lncurses",
+ AC_MSG_WARN("libedit needs libcurses or libncurses. disabled...")
+            use_libedit="no")])
+    if test "x$use_libedit" != "xno"; then
+        AC_CHECK_LIB(edit, el_init,
+            [LIBEDIT_LIBS="-ledit $LIBEDIT_LIBS -L$libedit_path/lib"
+                AC_SUBST(LIBEDIT_LIBS)],
+            [AC_MSG_WARN("libedit not found. Disabled...")
+                use_libedit="no"])
+    fi
+    CPPFLAGS=$saved_CPPFLAGS
+    LDFLAGS=$saved_LDFLAGS
 fi

 dnl for uim-dict.xml.in

Reply via email to