From 31cd499e87188ec57621f12335d4db910facdc1b Mon Sep 17 00:00:00 2001
From: dos-reis <gdr@axiomatics.org>
Date: Sat, 27 Nov 2010 21:28:37 +0000
Subject: 	* etc/Makefile.in: Compile and link with a C++ compiler. 
 * etc/asq.c.pamphlet: Fix bogus declarations of standard 	functions. 
 Fix const-correctness for string literals.

---
 src/ChangeLog                   |  6 ++++++
 src/etc/Makefile.in             |  4 ++--
 src/etc/asq.c.pamphlet          | 15 ++++++---------
 src/graph/Gdraws/Makefile.in    |  2 +-
 src/graph/view2D/Makefile.in    |  4 ++--
 src/graph/view3D/Makefile.in    |  4 ++--
 src/graph/viewAlone/Makefile.in |  4 ++--
 src/graph/viewman/Makefile.in   |  4 ++--
 8 files changed, 23 insertions(+), 20 deletions(-)

(limited to 'src')

diff --git a/src/ChangeLog b/src/ChangeLog
index ffbceec5..acb4b103 100644
--- a/src/ChangeLog
+++ b/src/ChangeLog
@@ -1,3 +1,9 @@
+2010-11-27  Gabriel Dos Reis  <gdr@cs.tamu.edu>
+
+	* etc/Makefile.in: Compile and link with a C++ compiler.
+	* etc/asq.c.pamphlet: Fix bogus declarations of standard
+	functions.  Fix const-correctness for string literals.
+
 2010-11-27  Gabriel Dos Reis  <gdr@cs.tamu.edu>
 
 	* lisp/Makefile.in (GCL_LTCC): Specify the tag.
diff --git a/src/etc/Makefile.in b/src/etc/Makefile.in
index c06c0437..6052ffb7 100644
--- a/src/etc/Makefile.in
+++ b/src/etc/Makefile.in
@@ -102,10 +102,10 @@ $(axiom_target_bindir)/asq$(EXEEXT): asq$(EXEEXT)
 	cp -p $< $(axiom_target_bindir)
 
 asq$(EXEEXT): $(asq_objects)
-	$(LINK) -o $@ $(asq_objects) $(asq_LDADD)
+	$(CXXLINK) -o $@ $(asq_objects) $(asq_LDADD)
 
 %.$(OBJEXT) %.lo: %.c $(axiom_c_macros_h)
-	$(COMPILE) $(CFLAGS) $(axiom_includes) -o $@ $<
+	$(CXXCOMPILE) $(CXXCFLAGS) $(axiom_includes) -o $@ $<
 
 
 asq.c: $(srcdir)/asq.c.pamphlet
diff --git a/src/etc/asq.c.pamphlet b/src/etc/asq.c.pamphlet
index 034c35d3..a5f37be0 100644
--- a/src/etc/asq.c.pamphlet
+++ b/src/etc/asq.c.pamphlet
@@ -524,12 +524,14 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
 /* printhelp    -- print the help info                                      */
 /* main                                                                     */
 
+#include "openaxiom-c-macros.h"
+
+#include <ctype.h>
 #include <unistd.h>
 #include <stdlib.h>
 #include <stdio.h>
 #include <string.h>
 
-#include "openaxiom-c-macros.h"
 #include "cfuns.h"
 
 /* we need to predeclare some functions so their signatures are known */
@@ -538,11 +540,6 @@ int printlist(char *list);
 int pprintobject(char *list);
 int pprintcond(int seekpt,char *path);
 
-/* this bogucity is apparently due to the introduction of unicode */
-/* since we don't use unicode we default to the K&R C signatures  */
-int isdigit(int c);
-int isspace(int c);
-
 /*defvar*/  char *AXIOM;         /* the AXIOM shell variable    */
 
 /*defvar*/ char interppath[256]; /* where the file is           */
@@ -603,7 +600,7 @@ int isspace(int c);
   return 1;
 }
 
-/*defun*/ char* N2S(int n)
+/*defun*/ const char* N2S(int n)
 {
   return ((n<=0 && n>-Nct) ? ct[-n] : "the unknown thing");
 }
@@ -1457,7 +1454,7 @@ int isspace(int c);
 /*defun*/ int main(int argc, char *argv[])
 {
 /*  FILE *test;         when testing we leave tombstones     */
-  char *ssearch =""; /* the domain or abbreviation           */
+  const char *ssearch =""; /* the domain or abbreviation           */
   char *property=""; /* the property we want (e.g. niladic)  */
   int found=1;       /* did we find the domain? print if yes */
   char c;            /* a temporary                          */
@@ -1491,7 +1488,7 @@ int isspace(int c);
   opencompress();
   fseek(compress,seekcompress,SEEK_SET);
   fscanf(compress,"%d",&Nct);
-  ct = malloc(Nct*sizeof(char *));
+  ct = (char**) malloc(Nct*sizeof(char *));
   /* put entries in ct */
   {
     int foo1,foo2;
diff --git a/src/graph/Gdraws/Makefile.in b/src/graph/Gdraws/Makefile.in
index b3333887..77a01a46 100644
--- a/src/graph/Gdraws/Makefile.in
+++ b/src/graph/Gdraws/Makefile.in
@@ -92,7 +92,7 @@ $(PS)/%.ps: $(srcdir)/psFiles.pamphlet
 Gfun.$(OBJEXT): ${HEADERS}
 
 Gfun.$(OBJEXT): $(builddir)/Gfun.c 
-	${COMPILE} -o $@ $(CFLAGS) $(AXIOM_CFLAGS) $<
+	${CXXCOMPILE} -o $@ $(CFLAGS) $(AXIOM_CFLAGS) $<
 
 
 mostlyclean-local:
diff --git a/src/graph/view2D/Makefile.in b/src/graph/view2D/Makefile.in
index 698f0ca6..c645ceec 100644
--- a/src/graph/view2D/Makefile.in
+++ b/src/graph/view2D/Makefile.in
@@ -74,7 +74,7 @@ stamp: $(axiom_target_libdir)/view2D$(EXEEXT)
 	$(STAMP) stamp
 
 $(axiom_target_libdir)/view2D$(EXEEXT): $(view2D_objects) $(view2D_DEPENDENCIES)
-	$(LINK) -o $@ $(view2D_objects) $(Gfun_objects) \
+	$(CXXLINK) -o $@ $(view2D_objects) $(Gfun_objects) \
 	    $(view2D_LDADD) $(AXIOM_X11_LDFLAGS) -lm 
 
 .PRECIOUS: %.lo
@@ -82,7 +82,7 @@ $(axiom_target_libdir)/view2D$(EXEEXT): $(view2D_objects) $(view2D_DEPENDENCIES)
 %.$(OBJEXT): $(HEADERS)
 
 %.lo: $(builddir)/%.c $(axiom_c_macros.h)
-	$(COMPILE) -o $@ $(CFLAGS) $(AXIOM_CFLAGS) $<
+	$(CXXCOMPILE) -o $@ $(CFLAGS) $(AXIOM_CFLAGS) $<
 
 mostlyclean-local:
 
diff --git a/src/graph/view3D/Makefile.in b/src/graph/view3D/Makefile.in
index 93321339..9111bee7 100644
--- a/src/graph/view3D/Makefile.in
+++ b/src/graph/view3D/Makefile.in
@@ -80,7 +80,7 @@ stamp: $(axiom_target_libdir)/view3D$(EXEEXT)
 	$(STAMP) stamp
 
 $(axiom_target_libdir)/view3D$(EXEEXT): $(view3D_objects) $(view3D_DEPENDENCIES)
-	$(LINK) -o $@ $(view3D_objects) $(Gfun_objects) \
+	$(CXXLINK) -o $@ $(view3D_objects) $(Gfun_objects) \
 		$(view3D_LDADD) $(AXIOM_X11_LDFLAGS) -lm
 
 .PRECIOUS: %.lo
@@ -88,7 +88,7 @@ $(axiom_target_libdir)/view3D$(EXEEXT): $(view3D_objects) $(view3D_DEPENDENCIES)
 %.lo: $(HEADERS)
 
 %.lo: %.c
-	$(COMPILE) -o $@ $(CFLAGS) $(AXIOM_CFLAGS) $<
+	$(CXXCOMPILE) -o $@ $(CFLAGS) $(AXIOM_CFLAGS) $<
 
 mostly-clean:
 
diff --git a/src/graph/viewAlone/Makefile.in b/src/graph/viewAlone/Makefile.in
index dc8a333d..bc4611f5 100644
--- a/src/graph/viewAlone/Makefile.in
+++ b/src/graph/viewAlone/Makefile.in
@@ -68,14 +68,14 @@ stamp: $(axiom_target_bindir)/viewAlone$(EXEEXT)
 
 $(axiom_target_bindir)/viewAlone$(EXEEXT): $(viewAlone_objects) \
 		 $(viewAlone_DEPENDENCIES)
-	$(LINK) -o $@ $(viewAlone_objects) $(viewAlone_LDADD)
+	$(CXXLINK) -o $@ $(viewAlone_objects) $(viewAlone_LDADD)
 
 .PRECIOUS: %.lo
 
 %.lo: $(HEADERS)
 
 %.lo: %.c $(axiom_c_macros_h)
-	$(COMPILE) -o $@ $(CFLAGS) $(AXIOM_CFLAGS) $<
+	$(CXXCOMPILE) -o $@ $(CFLAGS) $(AXIOM_CFLAGS) $<
 
 mostlyclean-local:
 
diff --git a/src/graph/viewman/Makefile.in b/src/graph/viewman/Makefile.in
index 78d74389..f1b4ac21 100644
--- a/src/graph/viewman/Makefile.in
+++ b/src/graph/viewman/Makefile.in
@@ -76,10 +76,10 @@ stamp: $(axiom_target_libdir)/viewman$(EXEEXT)
 %.lo: $(viewman_HEADERS)
 
 %.lo: %.c $(axiom_c_macros_h)
-	$(COMPILE) -o $@ $(CFLAGS) $(AXIOM_CFLAGS) $<
+	$(CXXCOMPILE) -o $@ $(CFLAGS) $(AXIOM_CFLAGS) $<
 
 $(axiom_target_libdir)/viewman$(EXEEXT): $(viewman_objects) $(viewman_DEPENDENCIES)
-	$(LINK) -o $@ $(viewman_objects) $(viewman_LDADD)
+	$(CXXLINK) -o $@ $(viewman_objects) $(viewman_LDADD)
 
 mostlyclean-local:
 
-- 
cgit v1.2.3