SOURCES: initng-ncurses.patch - updated curses libs detection from...

glen glen at pld-linux.org
Wed Mar 29 17:58:27 CEST 2006


Author: glen                         Date: Wed Mar 29 15:58:27 2006 GMT
Module: SOURCES                       Tag: HEAD
---- Log message:
- updated curses libs detection from less sources

---- Files affected:
SOURCES:
   initng-ncurses.patch (1.1 -> 1.2) 

---- Diffs:

================================================================
Index: SOURCES/initng-ncurses.patch
diff -u SOURCES/initng-ncurses.patch:1.1 SOURCES/initng-ncurses.patch:1.2
--- SOURCES/initng-ncurses.patch:1.1	Sun Feb 26 13:06:59 2006
+++ SOURCES/initng-ncurses.patch	Wed Mar 29 17:58:22 2006
@@ -1,12 +1,134 @@
---- initng-0.5.4/plugins/ngc2/Makefile.am~	2006-02-26 14:05:06.000000000 +0200
-+++ initng-0.5.4/plugins/ngc2/Makefile.am	2006-02-26 14:05:09.000000000 +0200
-@@ -10,7 +10,9 @@
- libngc2_la_LIBADD = ../../src/libinitng.la
+--- initng-0.6.0/m4/ncurses.m4~	2006-03-27 12:02:09.000000000 +0300
++++ initng-0.6.0/m4/ncurses.m4	2006-03-29 18:57:08.000000000 +0300
+@@ -27,15 +27,124 @@
+ 	])
  
- ngc_SOURCES = ngc2.c
-+ngc_CFLAGS = -I/usr/include/ncurses
- ngdc_SOURCES = ngc2.c
-+ngdc_CFLAGS = -I/usr/include/ncurses
+ 	if test "x$have_ncurses_h" = "xyes"; then
+-		AC_CHECK_LIB([ncurses], [initscr],
+-		[
+-			AC_DEFINE([HAVE_NCURSES], 1, [define if you have ncurses])
+-			NCURSES_LIBS="$NCURSES_LIBS -lncurses"
+-			have_ncurses="yes"
+-		])
++		# Checks for general libraries.
++		AC_CHECK_LIB(xcurses, tgetent, [have_xcurses=yes], [have_xcurses=no])
++		AC_CHECK_LIB(tinfow, tgetent, [have_tinfow=yes], [have_tinfow=no])
++		AC_CHECK_LIB(ncursesw, tgetent, [have_ncursesw=yes], [have_ncursesw=no])
++		AC_CHECK_LIB(tinfo, tgetent, [have_tinfo=yes], [have_tinfo=no])
++		AC_CHECK_LIB(ncurses, tgetent, [have_ncurses=yes], [have_ncurses=no])
++		AC_CHECK_LIB(curses, tgetent, [have_curses=yes], [have_curses=no])
++
++		# Checks for terminal libraries
++		AC_MSG_CHECKING([for working terminal libraries])
++		TERMLIBS=
++
++		dnl -- Try tinfow.
++		if test "x$TERMLIBS" = x; then
++		  if test $have_tinfow = yes; then
++			TERMLIBS="-ltinfow"
++			SAVE_LIBS=$LIBS
++			LIBS="$LIBS $TERMLIBS"
++			AC_TRY_LINK(, [tgetent(0,0); tgetflag(0); tgetnum(0); tgetstr(0,0);],
++			  [termok=yes], [termok=no])
++			LIBS=$SAVE_LIBS
++			if test $termok = no; then TERMLIBS=""; fi
++		  fi
++		fi
++
++		dnl -- Try ncursesw.
++		if test "x$TERMLIBS" = x; then
++		  if test $have_ncursesw = yes; then
++			TERMLIBS="-lncursesw"
++			SAVE_LIBS=$LIBS
++			LIBS="$LIBS $TERMLIBS"
++			AC_TRY_LINK(, [tgetent(0,0); tgetflag(0); tgetnum(0); tgetstr(0,0);],
++			  [termok=yes], [termok=no])
++			LIBS=$SAVE_LIBS
++			if test $termok = no; then TERMLIBS=""; fi
++		  fi
++		fi
++
++		dnl -- Try tinfo.
++		if test "x$TERMLIBS" = x; then
++		  if test $have_tinfo = yes; then
++			TERMLIBS="-ltinfo"
++			SAVE_LIBS=$LIBS
++			LIBS="$LIBS $TERMLIBS"
++			AC_TRY_LINK(, [tgetent(0,0); tgetflag(0); tgetnum(0); tgetstr(0,0);],
++			  [termok=yes], [termok=no])
++			LIBS=$SAVE_LIBS
++			if test $termok = no; then TERMLIBS=""; fi
++		  fi
++		fi
++
++		# -- Try ncurses.
++		if test "x$TERMLIBS" = x; then
++		  if test $have_ncurses = yes; then
++			TERMLIBS="-lncurses"
++			SAVE_LIBS=$LIBS
++			LIBS="$LIBS $TERMLIBS"
++			AC_TRY_LINK(, [tgetent(0,0); tgetflag(0); tgetnum(0); tgetstr(0,0);],
++			  [termok=yes], [termok=no])
++			LIBS=$SAVE_LIBS
++			if test $termok = no; then TERMLIBS=""; fi
++		  fi
++		fi
++
++		# -- Try xcurses.
++		if test "x$TERMLIBS" = x; then
++		  if test $have_xcurses = yes; then
++			TERMLIBS="-lxcurses"
++			SAVE_LIBS=$LIBS
++			LIBS="$LIBS $TERMLIBS"
++			AC_TRY_LINK(, [tgetent(0,0); tgetflag(0); tgetnum(0); tgetstr(0,0);],
++			  [termok=yes], [termok=no])
++			LIBS=$SAVE_LIBS
++			if test $termok = no; then TERMLIBS=""; fi
++		  fi
++		fi
++
++		# -- Try curses.
++		if test "x$TERMLIBS" = x; then
++		  if test $have_curses = yes; then
++			TERMLIBS="-lcurses"
++			SAVE_LIBS=$LIBS
++			LIBS="$LIBS $TERMLIBS"
++			AC_TRY_LINK(, [tgetent(0,0); tgetflag(0); tgetnum(0); tgetstr(0,0);],
++			  [termok=yes], [termok=no])
++			LIBS=$SAVE_LIBS
++			if test $termok = no; then TERMLIBS=""; fi
++		  fi
++		fi
++
++		# -- Try curses & termcap.
++		if test "x$TERMLIBS" = x; then
++		  if test $have_curses = yes; then
++		  if test $have_termcap = yes; then
++			TERMLIBS="-lcurses -ltermcap"
++			SAVE_LIBS=$LIBS
++			LIBS="$LIBS $TERMLIBS"
++			AC_TRY_LINK(, [tgetent(0,0); tgetflag(0); tgetnum(0); tgetstr(0,0);],
++			  [termok=yes], [termok=no])
++			LIBS=$SAVE_LIBS
++			if test $termok = no; then TERMLIBS=""; fi
++		  fi
++		  fi
++		fi
++
++
++		# summarize
++		if test "x$TERMLIBS" = x; then
++		  AC_MSG_RESULT(Cannot find terminal libraries - configure failed)
++		  exit 1
++		fi
++		AC_MSG_RESULT(using $TERMLIBS)
++		LIBS="$LIBS $TERMLIBS"
++		NCURSES_LIBS="$NCURSES_LIBS $TERMLIBS"
++		have_ncurses="yes"
+ 	fi
  
- install-data-hook:
- 	rm -f $(DESTDIR)$(plugindir)/$(plugin_LTLIBRARIES)
+-	$as_unset have_ncurses_h
++	$as_unset have_ncurses_h termok TERMLIBS
+ 
+ 	CPPFLAGS="$save_CPPFLAGS"
+ 	LDFLAGS="$save_LDFLAGS"
================================================================

---- CVS-web:
    http://cvs.pld-linux.org/SOURCES/initng-ncurses.patch?r1=1.1&r2=1.2&f=u



More information about the pld-cvs-commit mailing list