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.
 .
 axiom (20140801-1) unstable; urgency=medium
 .
   * New upstream release
Author: Camm Maguire <camm@debian.org>

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

Index: axiom-20170401/lsp/Makefile.pamphlet
===================================================================
--- axiom-20170401.orig/lsp/Makefile.pamphlet
+++ axiom-20170401/lsp/Makefile.pamphlet
@@ -2020,13 +2020,30 @@ OUT=${OBJ}/${SYS}/bin
 all:
 	@echo 1 building ${LSP} ${GCLVERSION}
 
-gcldir: 
+${BOOKS}/tangle1.lisp: ${BOOKS}/tangle.lisp
+	cp $< $@		       
+
+GCL?=$(GCLVERSION)/bin/gcl
+
+$(GCLVERSION)/bin/gcl:
 	@echo 2 building ${GCLVERSION}
 	@tar -zxf ${ZIPS}/${GCLVERSION}.tgz
-	(cd ${GCLVERSION} ; \
-	./configure ${GCLOPTS} ; \
-	${ENV} ${MAKE} ; \
-	echo '(compiler::link (list (compile-file "${BOOKS}/tangle.lisp")) "${OUT}/lisp" (format nil "(progn (let ((*load-path* (cons ~S *load-path*)) (si::*load-types* ~S)) (compiler::emit-fn t)) (makunbound (quote *system-banner*)) (when (fboundp (quote si::sgc-on)) (si::sgc-on t)) #-native-reloc (setq compiler::*default-system-p* t))" si::*system-directory* (quote (list #+native-reloc".o" ".lsp"))) "${OBJ}/${SYS}/lib/cfuns-c.o ${OBJ}/${SYS}/lib/sockio-c.o ${OBJ}/${SYS}/lib/libspad.a")' | bin/gcl )
+	cd ${GCLVERSION} && ./configure ${GCLOPTS} && ${ENV} DESTDIR= ${MAKE}
+
+${OUT}/lisp: ${GCL} ${BOOKS}/tangle1.lisp
+	echo "(progn \
+		     (load (compile-file \"${BOOKS}/tangle1.lisp\"))\
+		     (compiler::emit-fn t)(setq si::*code-block-reserve* (make-array 40000000 :element-type 'character :static t))\
+		     (when (fboundp 'si::sgc-on)(si::sgc-on nil))\
+		     (si::save-system \"${OUT}/lisp\"))" | ${GCL}
+
+gcldir: ${OUT}/lisp
+#	@echo 2 building ${GCLVERSION}
+#	@tar -zxf ${ZIPS}/${GCLVERSION}.tgz
+#	(cd ${GCLVERSION} ; \
+#	./configure ${GCLOPTS} ; \
+#	${ENV} ${MAKE} ; \
+#	echo '(compiler::link (list (compile-file "${BOOKS}/tangle.lisp")) "${OUT}/lisp" (format nil "(progn (let ((*load-path* (cons ~S *load-path*)) (si::*load-types* ~S)) (compiler::emit-fn t)) (makunbound (quote *system-banner*)) (when (fboundp (quote si::sgc-on)) (si::sgc-on nil)) #-native-reloc (setq compiler::*default-system-p* t))" si::*system-directory* (quote (list #+native-reloc".o" ".lsp"))) "${OBJ}/${SYS}/lib/cfuns-c.o ${OBJ}/${SYS}/lib/sockio-c.o ${OBJ}/${SYS}/lib/libspad.a")' | bin/gcl )
 	@echo 13 finished system build on `date` | tee >gcldir
 
 ccldir: ${LSP}/ccl/Makefile
Index: axiom-20170401/src/interp/cfuns.lisp.pamphlet
===================================================================
--- axiom-20170401.orig/src/interp/cfuns.lisp.pamphlet
+++ axiom-20170401/src/interp/cfuns.lisp.pamphlet
@@ -45,6 +45,10 @@
 \end{verbatim}
 \begin{chunk}{*}
 
+(clines "
+#define GCL_SOURCE
+#include \"../lib/cfuns-c.c\"
+")
 
 (in-package "BOOT")
 
Index: axiom-20170401/src/interp/sockio.lisp.pamphlet
===================================================================
--- axiom-20170401.orig/src/interp/sockio.lisp.pamphlet
+++ axiom-20170401/src/interp/sockio.lisp.pamphlet
@@ -48,6 +48,12 @@
 
 ;; load C socket functions
 
+(clines "
+#define GCL_SOURCE
+#include \"../lib/sockio-c.c\"
+#include \"../lib/bsdsignal.c\"
+")
+
 (in-package "BOOT")
 
 #+(and :Lucid (not :ibm/370))
@@ -90,24 +96,24 @@ string with data read from connection, t
 actual string buffer. We use [[sock_get_string_buf_wrapper]] to
 resolve the problem
 \begin{chunk}{*}
-  (clines "int sock_get_string_buf_wrapper(int i, object x, int j)"
+  (clines "fixnum sock_get_string_buf_wrapper(int i, object x, int j)"
           "{ if (type_of(x)!=t_string) FEwrong_type_argument(sLstring,x);"
           "  if (x->st.st_fillp<j)"
           "    FEerror(\"string too small in sock_get_string_buf_wrapper\",0);"
-          "  return sock_get_string_buf(i, x->st.st_self, j); }")
+          "  return (fixnum)sock_get_string_buf(i, x->st.st_self, j); }")
   (defentry open_server (string) (int "open_server"))
   (defentry sock_get_int (int) (int "sock_get_int"))
   (defentry sock_send_int (int int) (int "sock_send_int"))
   (defentry sock_get_string_buf (int object int) 
-     (int "sock_get_string_buf_wrapper"))
+     (fixnum "sock_get_string_buf_wrapper"))
   (defentry sock_send_string_len (int string int) (int "sock_send_string_len"))
   (defentry sock_get_float (int) (double "sock_get_float"))
   (defentry sock_send_float (int double) (int "sock_send_float"))
-  (defentry sock_send_wakeup (int int) (int "sock_send_wakeup"))
+  (defentry sock_send_wakeup (int) (int "sock_send_wakeup"))
   (defentry server_switch () (int "server_switch"))
-  (defentry flush_stdout () (int "flush_stdout"))
+  (defentry flush_stdout () (void "flush_stdout"))
   (defentry sock_send_signal (int int) (int "sock_send_signal"))
-  (defentry print_line (string) (int "print_line"))
+  (defentry print_line (string) (void "print_line"))
   (defentry plus_infinity () (double "plus_infinity"))
   (defentry minus_infinity () (double "minus_infinity"))
   (defentry NANQ () (double "NANQ"))
