Description: <short summary of the patch>
 TODO: Put a short summary on the line above and replace this paragraph
 with a longer explanation of this change. Complete the meta-information
 with other relevant fields (see below for details). To make it easier, the
 information below has been extracted from the changelog. Adjust it or drop
 it.
 .
 ivtools (1.2.8a1-8) unstable; urgency=low
 .
   * merge automake >= 1.11.3 autotools fix (closes: #660485)
Author: Barak A. Pearlmutter <bap@debian.org>
Bug-Debian: http://bugs.debian.org/660485

---
The information above should follow the Patch Tagging Guidelines, please
checkout http://dep.debian.net/deps/dep3/ to learn about the format. Here
are templates for supplementary fields that you might want to add:

Origin: <vendor|upstream|other>, <url of original patch>
Bug: <url in upstream bugtracker>
Bug-Debian: http://bugs.debian.org/<bugnumber>
Bug-Ubuntu: https://launchpad.net/bugs/<bugnumber>
Forwarded: <no|not-needed|url proving that it has been forwarded>
Reviewed-By: <name and email of someone who approved the patch>
Last-Update: <YYYY-MM-DD>

--- ivtools-1.2.8a1.orig/configure.ac
+++ ivtools-1.2.8a1/configure.ac
@@ -6,7 +6,8 @@ AC_PREREQ([2.67])
 
 AC_INIT([InterViews Application Framework and Drawing Tools],[1.2.8],[johnston@vectaport.com],[ivtools],[http://www.ivtools.org])
 
-AM_INIT_AUTOMAKE([subdir-objects])
+dnl The foreign option allows the follow files to not exist: NEWS AUTHORS ChangeLog
+AM_INIT_AUTOMAKE([subdir-objects foreign])
 
 AC_CONFIG_SRCDIR([src/Unidraw/path.cc])
 
@@ -25,18 +26,22 @@ ACLTX_PROG_PS2PDF(AC_MSG_WARN([Cannot fi
 AM_CONDITIONAL([PS2PDF], [test x$ps2pdf != xno])
 
 # Checks for libraries.
+AC_CHECK_LIB([m], [pow], [MATH_LD=-lm], AC_MSG_WARN([Cannot find math library]))
 AC_CHECK_LIB([X11], [XOpenDisplay], [X11_LD=-lX11], AC_MSG_ERROR([Cannot find X11 library]))
 AC_CHECK_LIB([Xext], [XextFindDisplay], [XEXT_LD=-lXext], AC_MSG_ERROR([Cannot find Xext library]))
 AC_CHECK_LIB([ACE], [ace_cleanup_destroyer], [ACE_LD=-lACE], AC_MSG_WARN([Cannot find ACE library]))
 AC_CHECK_LIB([tiff], [TIFFOpen], [TIFF_LD=-ltiff],
  AC_CHECK_LIB([TIFF], [TIFFOpen], [TIFF_LD=-lTIFF], AC_MSG_WARN([Cannot find tiff or TIFF library])))
+AC_CHECK_LIB([clippoly], [clippoly_version], [CLIPPOLY_LD=-lclippoly], AC_MSG_WARN([Cannot find clippoly library]))
 AM_CONDITIONAL([HAVE_LIBACE], [test x${ACE_LD} != x])
 AM_CONDITIONAL([HAVE_LIBTIFF], [test x${TIFF_LD} != x])
+AM_CONDITIONAL([HAVE_LIBCLIPPOLY], [test x${CLIPPOLY_LD} != x])
 
 AC_SUBST(X11_LD)
 AC_SUBST(XEXT_LD)
 AC_SUBST(ACE_LD)
 AC_SUBST(TIFF_LD)
+AC_SUBST(CLIPPOLY_LD)
 
 LT_INIT
 
@@ -68,6 +73,11 @@ AC_TYPE_PID_T
 AC_TYPE_SIZE_T
 AC_TYPE_UID_T
 
+AH_TEMPLATE([sig_atomic_t], [Define to int if <signal.h> does not define.])
+AC_CHECK_TYPES([sig_atomic_t], [], [AC_DEFINE([sig_atomic_t], [int])], [
+#include <signal.h>
+])
+
 # Checks for library functions.
 AC_FUNC_ERROR_AT_LINE
 AC_FUNC_FORK
@@ -79,7 +89,7 @@ AC_FUNC_STRTOD
 AC_CHECK_FUNCS([bzero floor getcwd gethostbyname gethostname \
 gettimeofday isascii memchr memmove memset munmap pow realpath \
 regcomp select socket sqrt strcasecmp strchr strcspn strdup strerror \
-strncasecmp strrchr strstr strtol uname])
+strncasecmp strrchr strstr strtol uname hypot hypotf])
 
 # Checks for locations
 AC_CHECK_FILE([/usr/share/fonts/type1/gsfonts/a010015l.afm],
--- ivtools-1.2.8a1.orig/Makefile.am
+++ ivtools-1.2.8a1/Makefile.am
@@ -36,6 +36,9 @@
 
 ACLOCAL_AMFLAGS = -I m4
 
+### Support file location
+programfilesdir = $(pkglibdir)
+
 EXTRA_LTLIBRARIES =
 
 lib_LTLIBRARIES =
@@ -103,25 +106,25 @@ else
 ACEDISPATCH_LA =
 endif
 
-libAceDispatch_la_LIBADD	= libIV.la $(ACE_LD) -lstdc++
-libAttrGlyph_la_LIBADD		= libAttribute.la libIVGlyph.la libUnidraw.la libIV.la -lstdc++
-libAttribute_la_LIBADD		= libUnidraw.la libIV.la libComUtil.la -lstdc++
-libComGlyph_la_LIBADD		= libAttribute.la libComTerp.la libIVGlyph.la libIV.la libComUtil.la -lstdc++
-libComTerp_la_LIBADD		= libAttribute.la libUnidraw.la libIV.la $(ACE_LD) -lstdc++ libComUtil.la -lm
-libComUnidraw_la_LIBADD		= libAttribute.la libComGlyph.la libComTerp.la libIVGlyph.la libOverlayUnidraw.la libUniIdraw.la libUnidraw.la libIV.la $(ACE_LD) -lstdc++ libComUtil.la $(X11_LD)
+libAceDispatch_la_LIBADD	= libIV.la $(ACE_LD)
+libAttrGlyph_la_LIBADD		= libAttribute.la libIVGlyph.la libUnidraw.la libIV.la
+libAttribute_la_LIBADD		= libUnidraw.la libIV.la libComUtil.la
+libComGlyph_la_LIBADD		= libAttribute.la libComTerp.la libIVGlyph.la libIV.la libComUtil.la
+libComTerp_la_LIBADD		= libAttribute.la libUnidraw.la libIV.la $(ACE_LD) libComUtil.la $(MATH_LD)
+libComUnidraw_la_LIBADD		= libAttribute.la libComGlyph.la libComTerp.la libIVGlyph.la libOverlayUnidraw.la libUniIdraw.la libUnidraw.la libIV.la $(ACE_LD) libComUtil.la $(X11_LD)
 libComUtil_la_LIBADD		= 
-libDrawServ_la_LIBADD		= libAttribute.la libComTerp.la libComUnidraw.la libFrameUnidraw.la libGraphUnidraw.la libIVGlyph.la libOverlayUnidraw.la libTopoFace.la libUniIdraw.la libUnidraw.la libIV.la -lstdc++ libComUtil.la $(ACE_LD)
-libFrameUnidraw_la_LIBADD	= libAttribute.la libComGlyph.la libComTerp.la libComUnidraw.la libIVGlyph.la libOverlayUnidraw.la libUniIdraw.la libUnidraw.la libIV.la -lstdc++ libComUtil.la
-libGraphUnidraw_la_LIBADD	= libAttribute.la libComTerp.la libComUnidraw.la libIVGlyph.la libOverlayUnidraw.la libTopoFace.la libUniIdraw.la libUnidraw.la libIV.la -lstdc++ libComUtil.la
-libIVGlyph_la_LIBADD		= libIV.la -lstdc++ $(X11_LD)
-libIV_common_la_LIBADD		= -lstdc++
-libIV_la_LIBADD			= -lstdc++ $(TIFF_LD) $(XEXT_LD) $(X11_LD) -lm
-libOverlayUnidraw_la_LIBADD	= libAttrGlyph.la libAttribute.la libComGlyph.la libComTerp.la libIVGlyph.la libTopoFace.la libUniIdraw.la libUnidraw.la libIV.la $(ACE_LD) -lstdc++ libComUtil.la $(X11_LD) -lm
-libTime_la_LIBADD		= libIVGlyph.la libIV.la -lstdc++
-libTopoFace_la_LIBADD		= libUnidraw.la libIV.la -lstdc++
-libUniIdraw_la_LIBADD		= libUnidraw.la libIV.la -lstdc++
-libUnidraw_common_la_LIBADD	= libIV.la -lstdc++
-libUnidraw_la_LIBADD		= libIV.la -lstdc++ $(X11_LD)
+libDrawServ_la_LIBADD		= libAttribute.la libComTerp.la libComUnidraw.la libFrameUnidraw.la libGraphUnidraw.la libIVGlyph.la libOverlayUnidraw.la libTopoFace.la libUniIdraw.la libUnidraw.la libIV.la libComUtil.la $(ACE_LD)
+libFrameUnidraw_la_LIBADD	= libAttribute.la libComGlyph.la libComTerp.la libComUnidraw.la libIVGlyph.la libOverlayUnidraw.la libUniIdraw.la libUnidraw.la libIV.la libComUtil.la
+libGraphUnidraw_la_LIBADD	= libAttribute.la libComTerp.la libComUnidraw.la libIVGlyph.la libOverlayUnidraw.la libTopoFace.la libUniIdraw.la libUnidraw.la libIV.la libComUtil.la
+libIVGlyph_la_LIBADD		= libIV.la $(X11_LD)
+libIV_common_la_LIBADD		=
+libIV_la_LIBADD			= $(TIFF_LD) $(XEXT_LD) $(X11_LD) $(MATH_LD)
+libOverlayUnidraw_la_LIBADD	= libAttrGlyph.la libAttribute.la libComGlyph.la libComTerp.la libIVGlyph.la libTopoFace.la libUniIdraw.la libUnidraw.la libIV.la $(ACE_LD) libComUtil.la $(CLIPPOLY_LD) $(X11_LD) $(MATH_LD)
+libTime_la_LIBADD		= libIVGlyph.la libIV.la
+libTopoFace_la_LIBADD		= libUnidraw.la libIV.la
+libUniIdraw_la_LIBADD		= libUnidraw.la libIV.la
+libUnidraw_common_la_LIBADD	= libIV.la
+libUnidraw_la_LIBADD		= libIV.la $(X11_LD)
 
 IVSTD_INCLUDES = -Isrc -Isrc/include -Isrc/include/ivstd
 IV2_6_INCLUDES = -Div2_6_compatible -Isrc -Isrc/include/IV-2_6 -Isrc/include -Isrc/include/ivstd
@@ -282,7 +285,7 @@ libIV_la_SOURCES = src/InterViews/sessio
 
 libIV_la_CPPFLAGS = \
  -Dcplusplus_2_1 \
- -DABSLIBALLDIR='"$(pkglibdir)"' \
+ -DABSLIBALLDIR='"$(programfilesdir)"' \
  -DRELLIBALLDIR='"lib/$(PACKAGE)"' \
  -DX_LIBDIR='"$(libdir)"' \
  -Isrc/IV $(IVSTD_INCLUDES)
@@ -437,7 +440,7 @@ libComUtilPART1_la_SOURCES = src/ComUtil
 #  -DRELLIBALLDIR=\"lib/ivtools/\"
 
 libComUtilPART1_la_CPPFLAGS = \
- -DABSLIBALLDIR=\"$(pkglibdir)/\" \
+ -DABSLIBALLDIR=\"$(programfilesdir)/\" \
  -DRELLIBALLDIR=\"lib/$(PACKAGE)/\" \
  -D_POSIX_C_SOURCE $(IVSTD_INCLUDES)
 
@@ -511,11 +514,6 @@ libFrameUnidrawPART1_la_CPPFLAGS = \
 
 ### libOverlayUnidraw
 
-# in directory but not included in build:
-#  src/OverlayUnidraw/cliplinepoly.cc
-#  src/OverlayUnidraw/clippoly.cc
-#  src/OverlayUnidraw/ovclip.cc
-
 libOverlayUnidraw_parts = libOverlayUnidrawPART1.la libOverlayUnidrawPART2.la
 libOverlayUnidraw_la_LIBADD += $(libOverlayUnidraw_parts)
 EXTRA_LTLIBRARIES += $(libOverlayUnidraw_parts)
@@ -544,6 +542,11 @@ src/OverlayUnidraw/ovviews.cc src/Overla
 src/OverlayUnidraw/rastercmds.cc src/OverlayUnidraw/scriptview.cc	\
 src/OverlayUnidraw/textfile.cc src/OverlayUnidraw/annotate.cc
 
+if HAVE_LIBCLIPPOLY
+libOverlayUnidraw_la_SOURCES += src/OverlayUnidraw/cliplinepoly.cc	\
+src/OverlayUnidraw/clippoly.cc src/OverlayUnidraw/ovclip.cc
+endif
+
 libOverlayUnidraw_la_CPPFLAGS = \
  -Dcplusplus_2_1 $(ACE_CPPFLAGS) $(IV2_6_INCLUDES)
 
@@ -567,6 +570,12 @@ libOverlayUnidrawPART2_la_CPPFLAGS = \
  -Dcplusplus_2_1 -Div2_6_incompatible -Isrc/include \
  $(ACE_INLINE_CPPFLAGS) $(IV2_6_INCLUDES)
 
+if HAVE_LIBCLIPPOLY
+libOverlayUnidraw_la_CPPFLAGS += -DCLIPPOLY -I/usr/include/clippoly
+libOverlayUnidrawPART1_la_CPPFLAGS += -DCLIPPOLY -I/usr/include/clippoly
+libOverlayUnidrawPART2_la_CPPFLAGS += -DCLIPPOLY -I/usr/include/clippoly
+endif
+
 ### libAceDispatch
 
 libAceDispatch_la_SOURCES = src/AceDispatch/ace_dispatcher.cc	\
@@ -635,7 +644,7 @@ endif
 
 ### Support files
 
-pkglib_DATA = src/ComUtil/comterp.err Idemo InterViews
+programfiles_DATA = src/ComUtil/comterp.err Idemo InterViews
 
 Idemo: src/idemo/Idemo.defaults
 	cp $< $@
--- ivtools-1.2.8a1.orig/autogen.sh
+++ ivtools-1.2.8a1/autogen.sh
@@ -2,13 +2,14 @@
 
 set -e
 
-for f in NEWS AUTHORS ChangeLog; do
-    test -e "$f" || cp --verbose /dev/null "$f"
-done
+## option --foreign engaged so these files are no longer mandatory
+# for f in NEWS AUTHORS ChangeLog; do
+#     test -e "$f" || cp --verbose /dev/null "$f"
+# done
 
-test -e m4 || mkdir --verbose m4
+mkdir --parent --verbose m4
 
-autoreconf --install --symlink --make
+autoreconf --install --symlink
 
-# Use --force to recreate things that don't seem to require recreation:
+## Use --force to recreate things that don't seem to require recreation:
 # autoreconf --install --symlink --make --force
