mailarchive of the ptxdist mailing list
 help / color / mirror / Atom feed
* [ptxdist] [PATCH] configure.ac: Improve curses searching
@ 2012-03-08 10:07 Ladislav Michl
  2012-03-12  8:59 ` Michael Olbrich
  0 siblings, 1 reply; 3+ messages in thread
From: Ladislav Michl @ 2012-03-08 10:07 UTC (permalink / raw)
  To: ptxdist

This is a resend of an older patch: http://www.mail-archive.com/ptxdist@pengutronix.de/msg03400.html

Cygwin-1.7 places curses headers into /usr/include/ncurses.
Tested on Debian, MinGW with pdcurses and Cygwin.

Signed-off-by: Ladislav Michl <ladis@linux-mips.org>
---
 configure.ac |   23 +++++++----------------
 1 file changed, 7 insertions(+), 16 deletions(-)

diff --git a/configure.ac b/configure.ac
old mode 100644
new mode 100755
index 00c2521..ec50a44
--- a/configure.ac
+++ b/configure.ac
@@ -36,25 +36,16 @@ AC_SEARCH_LIBS(regcomp, [regex gnuregex],,
 CONF_LIBS=${LIBS}
 AC_SUBST(CONF_LIBS)
 
-AC_SEARCH_LIBS(mvaddch, [ncurses curses pdcurses], [CURSES_LIB=$ac_lib],
-	[AC_MSG_ERROR([ncurses development library not found, please install libncurses-dev])])
+AC_SEARCH_LIBS(mvaddch, [curses ncurses pdcurses], [CURSES_LIB=$ac_lib],
+	[AC_MSG_ERROR([curses development library not found, please install libncurses-dev])])
 MCONF_LIBS=${LIBS}
 AC_SUBST(MCONF_LIBS)
 
-if test "$CURSES_LIB" = "ncurses"
-then
-	AC_CHECK_HEADER(
-		[ncurses.h],
-		[CURSES_LOC='<ncurses.h>'],
-		AC_MSG_ERROR([Cannot find ncurses.h.])
-	)
-else
-	AC_CHECK_HEADER(
-		[curses.h],
-		[CURSES_LOC='<curses.h>'],
-		AC_MSG_ERROR([Cannot find curses.h.])
-	)
-fi
+AC_CHECK_HEADERS(
+	[curses.h ncurses.h ncurses/curses.h ncurses/ncurses.h pdcurses.h pdcurses/curses.h pdcurses/pdcurses.h],
+	[CURSES_LOC="<$ac_header>";found_curses_headers=yes; break;])
+AS_IF([test "x$CURSES_LOC" = "x"],
+	[AC_MSG_ERROR([curses headers not found])])
 AC_SUBST(CURSES_LOC)
 
 AC_ARG_WITH(ncurses, AS_HELP_STRING([--with-ncurses],[Include path to the ncurses headers]),

-- 
ptxdist mailing list
ptxdist@pengutronix.de

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [ptxdist] [PATCH] configure.ac: Improve curses searching
  2012-03-08 10:07 [ptxdist] [PATCH] configure.ac: Improve curses searching Ladislav Michl
@ 2012-03-12  8:59 ` Michael Olbrich
  2012-03-14 12:10   ` Ladislav Michl
  0 siblings, 1 reply; 3+ messages in thread
From: Michael Olbrich @ 2012-03-12  8:59 UTC (permalink / raw)
  To: ptxdist

On Thu, Mar 08, 2012 at 11:07:12AM +0100, Ladislav Michl wrote:
> This is a resend of an older patch: http://www.mail-archive.com/ptxdist@pengutronix.de/msg03400.html
> 
> Cygwin-1.7 places curses headers into /usr/include/ncurses.
> Tested on Debian, MinGW with pdcurses and Cygwin.

any reason, why you changed the search order to look for curses first?

Michael

> Signed-off-by: Ladislav Michl <ladis@linux-mips.org>
> ---
>  configure.ac |   23 +++++++----------------
>  1 file changed, 7 insertions(+), 16 deletions(-)
> 
> diff --git a/configure.ac b/configure.ac
> old mode 100644
> new mode 100755
> index 00c2521..ec50a44
> --- a/configure.ac
> +++ b/configure.ac
> @@ -36,25 +36,16 @@ AC_SEARCH_LIBS(regcomp, [regex gnuregex],,
>  CONF_LIBS=${LIBS}
>  AC_SUBST(CONF_LIBS)
>  
> -AC_SEARCH_LIBS(mvaddch, [ncurses curses pdcurses], [CURSES_LIB=$ac_lib],
> -	[AC_MSG_ERROR([ncurses development library not found, please install libncurses-dev])])
> +AC_SEARCH_LIBS(mvaddch, [curses ncurses pdcurses], [CURSES_LIB=$ac_lib],
> +	[AC_MSG_ERROR([curses development library not found, please install libncurses-dev])])
>  MCONF_LIBS=${LIBS}
>  AC_SUBST(MCONF_LIBS)
>  
> -if test "$CURSES_LIB" = "ncurses"
> -then
> -	AC_CHECK_HEADER(
> -		[ncurses.h],
> -		[CURSES_LOC='<ncurses.h>'],
> -		AC_MSG_ERROR([Cannot find ncurses.h.])
> -	)
> -else
> -	AC_CHECK_HEADER(
> -		[curses.h],
> -		[CURSES_LOC='<curses.h>'],
> -		AC_MSG_ERROR([Cannot find curses.h.])
> -	)
> -fi
> +AC_CHECK_HEADERS(
> +	[curses.h ncurses.h ncurses/curses.h ncurses/ncurses.h pdcurses.h pdcurses/curses.h pdcurses/pdcurses.h],
> +	[CURSES_LOC="<$ac_header>";found_curses_headers=yes; break;])
> +AS_IF([test "x$CURSES_LOC" = "x"],
> +	[AC_MSG_ERROR([curses headers not found])])
>  AC_SUBST(CURSES_LOC)
>  
>  AC_ARG_WITH(ncurses, AS_HELP_STRING([--with-ncurses],[Include path to the ncurses headers]),
> 
> -- 
> ptxdist mailing list
> ptxdist@pengutronix.de
> 

-- 
Pengutronix e.K.                           |                             |
Industrial Linux Solutions                 | http://www.pengutronix.de/  |
Peiner Str. 6-8, 31137 Hildesheim, Germany | Phone: +49-5121-206917-0    |
Amtsgericht Hildesheim, HRA 2686           | Fax:   +49-5121-206917-5555 |

-- 
ptxdist mailing list
ptxdist@pengutronix.de

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [ptxdist] [PATCH] configure.ac: Improve curses searching
  2012-03-12  8:59 ` Michael Olbrich
@ 2012-03-14 12:10   ` Ladislav Michl
  0 siblings, 0 replies; 3+ messages in thread
From: Ladislav Michl @ 2012-03-14 12:10 UTC (permalink / raw)
  To: ptxdist

On Mon, Mar 12, 2012 at 09:59:50AM +0100, Michael Olbrich wrote:
> On Thu, Mar 08, 2012 at 11:07:12AM +0100, Ladislav Michl wrote:
> > This is a resend of an older patch: http://www.mail-archive.com/ptxdist@pengutronix.de/msg03400.html
> > 
> > Cygwin-1.7 places curses headers into /usr/include/ncurses.
> > Tested on Debian, MinGW with pdcurses and Cygwin.
> 
> any reason, why you changed the search order to look for curses first?
> 
> Michael

I'm fine with dropping that change. For mconf, curses is fine. On systems with ncurses,
curses just symlinks to them. Changing order just allows mconf to link to default
curses-type library, whereas ncurses explicitely links to ncurses if it is installed.

	ladis

-- 
ptxdist mailing list
ptxdist@pengutronix.de

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2012-03-14 12:10 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-03-08 10:07 [ptxdist] [PATCH] configure.ac: Improve curses searching Ladislav Michl
2012-03-12  8:59 ` Michael Olbrich
2012-03-14 12:10   ` Ladislav Michl

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox