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.
 .
 gcl (2.6.7-93) unstable; urgency=low
 .
   * remove C_GC_OFFSET for sparc64
   * remove ncurses dependency for readline
   * Bug fix: "FTBFS: dpkg-buildpackage: error: dpkg-source -b gcl-2.6.7
     gave error exit status 2", thanks to Didier Raboud (Closes: #643131).
   * Bug fix: "drops readline support if rebuilt", thanks to Sven Joachim
     (Closes: #646735).
   * lower opts on sparc64 asof gcc 4.6.1
Author: Camm Maguire <camm@debian.org>
Bug-Debian: http://bugs.debian.org/643131
Bug-Debian: http://bugs.debian.org/646735

---
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>

--- gcl-2.6.7.orig/configure
+++ gcl-2.6.7/configure
@@ -4197,6 +4197,9 @@ case $use in
 		ia64*)
 			if test "$enable_debug" != "yes" ; then TO3FLAGS="-O" ; fi #FIXME needed asof gcc 4.6.2
 			;;
+		sparc64*)
+			if test "$enable_debug" != "yes" ; then TO3FLAGS="-O0" ; fi #FIXME needed asof gcc 4.6.1 frame.c/longjmp, possible make/fork
+			;;
 		arm*)
 			TCFLAGS="$TCFLAGS -mlong-calls -fdollars-in-identifiers -g "
 			if test "$enable_debug" != "yes" ; then TO3FLAGS="-O" ; fi #FIXME needed asof gcc 4.6.2
@@ -6870,7 +6873,7 @@ if ${ac_cv_lib_readline_rl_initialize+:}
   $as_echo_n "(cached) " >&6
 else
   ac_check_lib_save_LIBS=$LIBS
-LIBS="-lreadline -lncurses $LIBS"
+LIBS="-lreadline  $LIBS"
 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
 /* end confdefs.h.  */
 
@@ -6903,7 +6906,7 @@ $as_echo "$ac_cv_lib_readline_rl_initial
 if test "x$ac_cv_lib_readline_rl_initialize" = xyes; then :
   $as_echo "#define HAVE_READLINE 1" >>confdefs.h
 
-			TLIBS="$TLIBS -lreadline -lncurses" #some machines don't link this, e.g. Slackware
+			TLIBS="$TLIBS -lreadline" #some machines don't link this, e.g. Slackware
 			RL_OBJS=gcl_readline.o
 # Readline support now initialized automatically when compiled in, this lisp
 # object no longer needed -- 20040102 CM
@@ -6923,7 +6926,7 @@ if ${ac_cv_lib_readline_rl_completion_ma
   $as_echo_n "(cached) " >&6
 else
   ac_check_lib_save_LIBS=$LIBS
-LIBS="-lreadline -lncurses $LIBS"
+LIBS="-lreadline  $LIBS"
 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
 /* end confdefs.h.  */
 
--- gcl-2.6.7.orig/configure.in
+++ gcl-2.6.7/configure.in
@@ -558,6 +558,9 @@ case $use in
 		ia64*)
 			if test "$enable_debug" != "yes" ; then TO3FLAGS="-O" ; fi #FIXME needed asof gcc 4.6.2
 			;;
+		sparc64*)
+			if test "$enable_debug" != "yes" ; then TO3FLAGS="-O0" ; fi #FIXME needed asof gcc 4.6.1 frame.c/longjmp, possible make/fork
+			;;
 		arm*)
 			TCFLAGS="$TCFLAGS -mlong-calls -fdollars-in-identifiers -g "
 			if test "$enable_debug" != "yes" ; then TO3FLAGS="-O" ; fi #FIXME needed asof gcc 4.6.2
@@ -1471,17 +1474,17 @@ if test "$enable_readline" = "yes" ; the
 	AC_CHECK_HEADERS(readline/readline.h,
 		AC_CHECK_LIB(readline,rl_initialize,
 			AC_DEFINE(HAVE_READLINE) 
-			TLIBS="$TLIBS -lreadline -lncurses" #some machines don't link this, e.g. Slackware
+			TLIBS="$TLIBS -lreadline" #some machines don't link this, e.g. Slackware
 			RL_OBJS=gcl_readline.o
 # Readline support now initialized automatically when compiled in, this lisp
 # object no longer needed -- 20040102 CM
 #			RL_LIB=lsp/gcl_readline.o
-			,,-lncurses))
+			))
 
 # These tests discover differences between readline 4.1 and 4.3
 	AC_CHECK_LIB(readline,rl_completion_matches,
 			AC_DEFINE(HAVE_DECL_RL_COMPLETION_MATCHES)
-			AC_DEFINE(HAVE_RL_COMPENTRY_FUNC_T),,-lncurses)
+			AC_DEFINE(HAVE_RL_COMPENTRY_FUNC_T))
 fi
 
 AC_SUBST(RL_OBJS)
--- gcl-2.6.7.orig/h/sparc-linux.h
+++ gcl-2.6.7/h/sparc-linux.h
@@ -25,6 +25,6 @@
 #define SPECIAL_RELOC_H "elf64_sparc_reloc_special.h"
 #endif
 
-#if SIZEOF_LONG == 8
-#define C_GC_OFFSET 4
-#endif
+/* #if SIZEOF_LONG == 8 */
+/* #define C_GC_OFFSET 4 */
+/* #endif */
