From 82035cb9d3375b8c65b4a5a5d3bd89febdc7e201 Mon Sep 17 00:00:00 2001
From: "Thomas E. Dickey" <dickey@invisible-island.net>
Date: Sun, 28 Nov 2010 18:37:37 +0000
Subject: [PATCH] ncurses 5.7 - patch 20101128

+ modify test/configure and test/Makefile.in to handle this special
  case of building within a build-tree (Debian #34182):
	mkdir -p build && cd build && ../test/configure && make
---
 NEWS              | 7 ++++++-
 dist.mk           | 4 ++--
 test/Makefile.in  | 4 ++--
 test/configure    | 6 +++---
 test/configure.in | 8 ++++----
 5 files changed, 17 insertions(+), 12 deletions(-)

diff --git a/NEWS b/NEWS
index 311ed8bb..6a919665 100644
--- a/NEWS
+++ b/NEWS
@@ -25,7 +25,7 @@
 -- sale, use or other dealings in this Software without prior written        --
 -- authorization.                                                            --
 -------------------------------------------------------------------------------
--- $Id: NEWS,v 1.1614 2010/11/28 00:32:32 tom Exp $
+-- $Id: NEWS,v 1.1615 2010/11/28 16:43:28 tom Exp $
 -------------------------------------------------------------------------------
 
 This is a log of changes that ncurses has gone through since Zeyd started
@@ -45,6 +45,11 @@ See the AUTHORS file for the corresponding full names.
 Changes through 1.9.9e did not credit all contributions;
 it is not possible to add this information.
 
+20101128
+	+ modify test/configure and test/Makefile.in to handle this special
+	  case of building within a build-tree (Debian #34182):
+		mkdir -p build && cd build && ../test/configure && make
+
 20101127
 	+ miscellaneous build-fixes for Ada95 and test-directories when built
 	  out-of-tree.
diff --git a/dist.mk b/dist.mk
index c8993ffe..8948d22a 100644
--- a/dist.mk
+++ b/dist.mk
@@ -25,7 +25,7 @@
 # use or other dealings in this Software without prior written               #
 # authorization.                                                             #
 ##############################################################################
-# $Id: dist.mk,v 1.782 2010/11/27 16:17:05 tom Exp $
+# $Id: dist.mk,v 1.783 2010/11/28 16:43:43 tom Exp $
 # Makefile for creating ncurses distributions.
 #
 # This only needs to be used directly as a makefile by developers, but
@@ -37,7 +37,7 @@ SHELL = /bin/sh
 # These define the major/minor/patch versions of ncurses.
 NCURSES_MAJOR = 5
 NCURSES_MINOR = 7
-NCURSES_PATCH = 20101127
+NCURSES_PATCH = 20101128
 
 # We don't append the patch to the version, since this only applies to releases
 VERSION = $(NCURSES_MAJOR).$(NCURSES_MINOR)
diff --git a/test/Makefile.in b/test/Makefile.in
index c9d56180..9fde0adb 100644
--- a/test/Makefile.in
+++ b/test/Makefile.in
@@ -1,4 +1,4 @@
-# $Id: Makefile.in,v 1.107 2010/11/27 21:47:17 tom Exp $
+# $Id: Makefile.in,v 1.108 2010/11/28 16:39:40 tom Exp $
 ##############################################################################
 # Copyright (c) 1998-2008,2010 Free Software Foundation, Inc.                #
 #                                                                            #
@@ -72,7 +72,7 @@ CC		= @CC@
 CPP		= @CPP@
 
 CFLAGS		= @CFLAGS@ @EXTRA_CFLAGS@
-CPPFLAGS	=  -I../test -I$(srcdir) -DHAVE_CONFIG_H @CPPFLAGS@
+CPPFLAGS	= -I. -I$(srcdir) -I../test -DHAVE_CONFIG_H @CPPFLAGS@
 
 CCFLAGS		= $(CPPFLAGS) $(CFLAGS)
 
diff --git a/test/configure b/test/configure
index 41395d2a..07fd3489 100755
--- a/test/configure
+++ b/test/configure
@@ -15477,10 +15477,10 @@ for N in $LIST
 do
 	cat >>Makefile <<TEST_EOF
 
-\$(MODEL)/$N.o : $N.c \\
-	test.priv.h \\
+\$(MODEL)/$N.o : \$(srcdir)/$N.c \\
+	\$(srcdir)/test.priv.h \\
 	ncurses_cfg.h
-	@echo compiling $N; \$(CC) -c \$(CFLAGS_DEFAULT) $N.c
+	@echo compiling $N; \$(CC) -c \$(CFLAGS_DEFAULT) \$(srcdir)/$N.c
 TEST_EOF
 done
 
diff --git a/test/configure.in b/test/configure.in
index 28eddbca..697ad550 100644
--- a/test/configure.in
+++ b/test/configure.in
@@ -28,7 +28,7 @@ dnl***************************************************************************
 dnl
 dnl Author: Thomas E. Dickey 1996, etc.
 dnl
-dnl $Id: configure.in,v 1.84 2010/11/28 00:16:57 tom Exp $
+dnl $Id: configure.in,v 1.85 2010/11/28 16:38:04 tom Exp $
 dnl This is a simple configuration-script for the ncurses test programs that
 dnl allows the test-directory to be separately configured against a reference
 dnl system (i.e., sysvr4 curses)
@@ -293,10 +293,10 @@ for N in $LIST
 do
 	cat >>Makefile <<TEST_EOF
 
-\$(MODEL)/$N.o : $N.c \\
-	test.priv.h \\
+\$(MODEL)/$N.o : \$(srcdir)/$N.c \\
+	\$(srcdir)/test.priv.h \\
 	ncurses_cfg.h
-	@echo compiling $N; \$(CC) -c \$(CFLAGS_DEFAULT) $N.c
+	@echo compiling $N; \$(CC) -c \$(CFLAGS_DEFAULT) \$(srcdir)/$N.c
 TEST_EOF
 done