--- openjade-1.3.2/spgrove/GroveBuilder.cxx.orig	2013-07-17 10:57:07.000000000 -0400
+++ openjade-1.3.2/spgrove/GroveBuilder.cxx	2013-07-17 11:00:38.000000000 -0400
@@ -2127,7 +2127,7 @@
      chunk = new (grove.allocChunk(CharsChunk::allocSize(dataLen))) DataChunk;
      chunk->size = dataLen;
      chunk->locIndex = event.location().index();
-     memcpy(chunk + 1, event.data(), dataLen * sizeof(Char));
+     memcpy((void*)(chunk + 1), event.data(), dataLen * sizeof(Char));
      grove.appendSibling(chunk);
    }
  }
@@ -3435,7 +3435,7 @@
       chunk = new (mem) PiChunk;
     chunk->size = dataLen;
     chunk->locIndex = event.location().index();
-    memcpy(chunk + 1, event.data(), dataLen * sizeof(Char));
+    memcpy((void*)(chunk + 1), event.data(), dataLen * sizeof(Char));
     grove.appendSibling(chunk);
   }
 }
--- openjade-1.3.2/jade/SgmlFOTBuilder.cxx.orig	2013-07-17 11:04:52.000000000 -0400
+++ openjade-1.3.2/jade/SgmlFOTBuilder.cxx	2013-07-17 11:05:55.000000000 -0400
@@ -393,7 +393,7 @@
 OutputCharStream &operator<<(OutputCharStream &os, Units u)
 {
   char buf[32];
-  sprintf(buf, "%03d", u.n);
+  sprintf(buf, "%03ld", u.n);
   int len = strlen(buf);
   int i = 0;
   for (; i < 3 && buf[len - i - 1] == '0'; i++)
--- openjade-1.3.2/style/DssslSpecEventHandler.cxx.orig	2013-07-17 11:38:53.000000000 -0400
+++ openjade-1.3.2/style/DssslSpecEventHandler.cxx	2013-07-17 11:40:07.000000000 -0400
@@ -365,13 +365,13 @@
        type = DssslSpecEventHandler::DeclarationElement::sgmlGrovePlan;
      currentDecl_ = new DeclarationElement(type);
      const StringC *str; 
-     if (str = attributeString(event, "NAME"))
+     if ((str = attributeString(event, "NAME")))
         currentDecl_->setName(*str);
-     if (str = attributeString(event, "TEXT"))
+     if ((str = attributeString(event, "TEXT")))
         currentDecl_->setText(*str);
-     if (str = attributeString(event, "MODADD"))
+     if ((str = attributeString(event, "MODADD")))
         currentDecl_->setModadd(*str);
-     if (str = attributeString(event, "DESC"))
+     if ((str = attributeString(event, "DESC")))
         currentDecl_->setDesc(*str);
    }
 }
--- openjade-1.3.2/style/primitive.cxx.orig	2013-07-17 11:44:29.000000000 -0400
+++ openjade-1.3.2/style/primitive.cxx	2013-07-17 11:44:56.000000000 -0400
@@ -5304,7 +5304,7 @@
   ELObj *ret;
   InsnPtr insn(func->makeCallInsn(0, interp, loc, InsnPtr()));
   VM vm(context, interp);
-  while (nd = nl->nodeListFirst(context, interp)) {
+  while ((nd = nl->nodeListFirst(context, interp))) {
     nl = nl->nodeListRest(context, interp);
     protect1 = nl;
     EvalContext::CurrentNodeSetter cns(nd, context.processingMode, vm);
--- openjade-1.3.2/jade/MifFOTBuilder.cxx.orig	2013-07-17 11:46:33.000000000 -0400
+++ openjade-1.3.2/jade/MifFOTBuilder.cxx	2013-07-17 11:47:43.000000000 -0400
@@ -3370,7 +3370,7 @@
     }
 
 
-    int numTabs = mifDoc.curFormat().PgfNumTabs + leadingTab ? 2 : 1;
+    int numTabs = (mifDoc.curFormat().PgfNumTabs + leadingTab) ? 2 : 1;
     mifDoc.curFormat().setPgfNumTabs( numTabs );
     mifDoc.curPara()->format().setPgfNumTabs( numTabs );
     mifDoc.curPara()->curFormat().setPgfNumTabs( numTabs );
@@ -5748,7 +5748,7 @@
         char idxStr[32];
         for( size_t i = 0; i < BookComponents.size(); i++ ) {
             fileName.resize( 0 );          
-            sprintf( idxStr, "%u", i+1 );
+            sprintf( idxStr, "%lu", i+1 );
             for( const char *c = idxStr; *c; c++)
                 fileName += CmdLineApp::AppChar(*c);
             fileName += '.'; fileName += fileNameExt;
diff -Nurd -x'*~' openjade-1.3.2.orig/Makefile.comm.in openjade-1.3.2/Makefile.comm.in
--- openjade-1.3.2.orig/Makefile.comm.in	2002-12-01 06:56:47.000000000 -0500
+++ openjade-1.3.2/Makefile.comm.in	2007-04-23 03:55:18.000000000 -0400
@@ -29,7 +29,7 @@
 
 LIBS=@LIBS@
 DEFS=@DEFS@ -DDEFAULT_SCHEME_BUILTINS=\"${datadir}/builtins.dsl\"
-INCS=-I$(srcdir) -I$(srcdir)/../include -I$(spincludedir) -I$(spincludedir)/.. $(INCLUDE)
+INCS=-I$(srcdir) -I$(srcdir)/../include $(INCLUDE) -I$(spincludedir) -I$(spincludedir)/..
 CXXFLAGS=@CXXFLAGS@ $(INCS) $(DEBUG) $(DEFS)
 CFLAGS=@CFLAGS@ $(DEBUG) $(DEFS)
 LDFLAGS=@LDFLAGS@
diff -Nurd -x'*~' openjade-1.3.2.orig/Makefile.lib.in openjade-1.3.2/Makefile.lib.in
--- openjade-1.3.2.orig/Makefile.lib.in	2002-01-22 06:57:53.000000000 -0500
+++ openjade-1.3.2/Makefile.lib.in	2007-04-23 03:40:08.000000000 -0400
@@ -23,7 +23,7 @@
 	echo 'LT_OBJS='`echo $(OBJS)|sed 's/\.o/.lo/g'` >Makefile.lt
 
 lib$(LIB).la: $(LT_OBJS)
-	$(LIBTOOL) --mode=link $(CC) $(LINKFLAGS) -o lib$(LIB).la $(LT_OBJS) \
+	$(LIBTOOL) --mode=link $(CXX) $(LINKFLAGS) -o lib$(LIB).la $(LT_OBJS) \
 	    -rpath $(libdir) -version-info $(LTVERSION) $(DEPLIBS)
 
 install:
diff -Nurd -x'*~' openjade-1.3.2.orig/Makefile.prog.in openjade-1.3.2/Makefile.prog.in
--- openjade-1.3.2.orig/Makefile.prog.in	2002-01-22 06:57:53.000000000 -0500
+++ openjade-1.3.2/Makefile.prog.in	2007-04-23 03:40:08.000000000 -0400
@@ -12,14 +12,14 @@
 
 ALL_LIBS = $(XLIBS) $(LIBS)
 Makefile.lt:
-	echo 'LT_LIBS='`echo $(ALL_LIBS)|sed 's/\.a/.la/g'` >Makefile.lt
+	echo 'LT_LIBS='`echo $(XLIBS)|sed 's/\.a/.la/g'` >Makefile.lt
 
 PROG:=$(shell echo "$(PROG)" | sed '@program_transform_name@')
 
 all: $(PROG)
 
 $(PROG): $(OBJS) $(COBJS) $(LT_LIBS)
-	$(LIBTOOL) --mode=link $(CXX) $(LINKFLAGS) $(CXXFLAGS) $(LDFLAGS) -o $@ $(OBJS) $(COBJS) $(LT_LIBS)
+	$(LIBTOOL) --mode=link $(CXX) $(LINKFLAGS) $(CXXFLAGS) $(LDFLAGS) -o $@ $(OBJS) $(COBJS) $(LT_LIBS) $(LIBS)
 
 install: $(PROG)
 	-test -d $(DESTDIR)$(bindir) || \
diff -Nurd -x'*~' openjade-1.3.2.orig/config/ltmain.sh openjade-1.3.2/config/ltmain.sh
--- openjade-1.3.2.orig/config/ltmain.sh	2002-01-17 08:45:52.000000000 -0500
+++ openjade-1.3.2/config/ltmain.sh	2007-04-23 03:40:08.000000000 -0400
@@ -2858,6 +2858,11 @@
 	if test -n "$export_symbols" && test -n "$archive_expsym_cmds"; then
 	  eval cmds=\"$archive_expsym_cmds\"
 	else
+          if test "x$verstring" = "x0.0"; then
+            tmp_verstring=
+          else
+            tmp_verstring="$verstring"
+          fi
 	  eval cmds=\"$archive_cmds\"
 	fi
 	IFS="${IFS= 	}"; save_ifs="$IFS"; IFS='~'
@@ -3913,10 +3918,10 @@
 
 # Directory that this library needs to be installed in:
 libdir='$install_libdir'"
-	  if test "$installed" = no && test $need_relink = yes; then
-	    $echo >> $output "\
-relink_command=\"$relink_command\""
-	  fi
+#	  if test "$installed" = no && test $need_relink = yes; then
+#	    $echo >> $output "\
+#relink_command=\"$relink_command\""
+#	  fi
 	done
       fi
 
diff -Nurd -x'*~' openjade-1.3.2.orig/configure openjade-1.3.2/configure
--- openjade-1.3.2.orig/configure	2002-12-01 11:18:40.000000000 -0500
+++ openjade-1.3.2/configure	2007-04-23 03:40:08.000000000 -0400
@@ -3063,8 +3063,8 @@
 
 
 case "${host}" in
-  *-*-darwin*)
-    LINKFLAGS="-no-undefined"
+  *darwin*)
+    LINKFLAGS="-allow-undefined"
     ;;
   *)
     if test "$GXX"
@@ -7907,11 +7907,11 @@
     ;;
 
   darwin* | rhapsody*)
-    allow_undefined_flag='-undefined suppress'
+    allow_undefined_flag='-undefined suppress -flat_namespace'
     # FIXME: Relying on posixy $() will cause problems for
     #        cross-compilation, but unfortunately the echo tests do not
     #        yet detect zsh echo's removal of \ escapes.
-    archive_cmds='$CC $(test .$module = .yes && echo -bundle || echo -dynamiclib) $allow_undefined_flag -o $lib $libobjs $deplibs$linkopts -install_name $rpath/$soname $(test -n "$verstring" -a x$verstring != x0.0 && echo $verstring)'
+    archive_cmds='$CXX $(test .$module = .yes && echo -bundle || echo  -dynamiclib) $allow_undefined_flag -o $lib $libs $libobjs $deplibs$linkopts -install_name $rpath/$soname $tmp_verstring'
     # We need to add '_' to the symbols in $export_symbols first
     #archive_expsym_cmds="$archive_cmds"' && strip -s $export_symbols'
     hardcode_direct=yes
@@ -9366,6 +9366,10 @@
 # Is the compiler the GNU C compiler?
 with_gcc=$GCC
 
+# The c++ compiler
+
+CXX=$ac_ct_CXX
+
 # The linker used to build libraries.
 LD=$lt_LD
 
diff -Nurd -x'*~' openjade-1.3.2.orig/spgrove/Makefile.sub openjade-1.3.2/spgrove/Makefile.sub
--- openjade-1.3.2.orig/spgrove/Makefile.sub	2002-11-15 17:46:50.000000000 -0500
+++ openjade-1.3.2/spgrove/Makefile.sub	2007-04-23 03:43:23.000000000 -0400
@@ -1,8 +1,7 @@
 LTVERSION=0:1:0
 LIB=ospgrove
 INCLUDE=-I$(srcdir)/../grove
-DEPLIBS=-lm -L$(TOP)/grove -L$(TOP)/grove/.libs \
-	-L$(TOP)/lib -L$(TOP)/lib/.libs \
+DEPLIBS=-lm \
 	$(LIB_THREADS)
 OBJS=GroveApp.o GroveBuilder.o SdNode.o
 GENSRCS=grove_inst.cxx
diff -Nurd -x'*~' openjade-1.3.2.orig/style/Makefile.sub openjade-1.3.2/style/Makefile.sub
--- openjade-1.3.2.orig/style/Makefile.sub	2002-11-15 17:46:50.000000000 -0500
+++ openjade-1.3.2/style/Makefile.sub	2007-04-23 03:44:04.000000000 -0400
@@ -1,8 +1,6 @@
 LTVERSION=0:1:0
 LIB=ostyle
-DEPLIBS=-lm -L$(TOP)/grove -L$(TOP)/grove/.libs \
-  -L$(TOP)/lib -L$(TOP)/lib/.libs \
-  -L$(TOP)/spgrove -L$(TOP)/spgrove/.libs 
+DEPLIBS=-lm
 OBJS=LangObj.o \
   Collector.o \
   DssslApp.o \
diff -Naur openjade-1.3.2.orig/jade/TeXFOTBuilder.cxx openjade-1.3.2/jade/TeXFOTBuilder.cxx
--- openjade-1.3.2.orig/jade/TeXFOTBuilder.cxx	2002-01-15 10:35:37.000000000 +0000
+++ openjade-1.3.2/jade/TeXFOTBuilder.cxx	2011-03-30 09:39:46.000000000 +0000
@@ -75,6 +75,7 @@
     virtual void end(TeXFOTBuilder &) const = 0;
   };
   class PageFloatFlowObj : public TeXCompoundExtensionFlowObj {
+  public:
     void start(TeXFOTBuilder &fotb, const NodePtr &) const {
       fotb.startPageFloat(nic_);
     }
@@ -88,12 +89,14 @@
       value.convertString(nic_.placement);
       }
     ExtensionFlowObj *copy() const { return new PageFloatFlowObj(*this); }
+    PageFloatFlowObj() {}
   private:
     PageFloatNIC nic_;
     StringC name_;
     StringC placement;
   };
   class PageFootnoteFlowObj : public TeXCompoundExtensionFlowObj {
+  public:
     void start(TeXFOTBuilder &fotb, const NodePtr &) const {
       fotb.startPageFootnote();
     }
@@ -101,6 +104,7 @@
       fotb.endPageFootnote();
     }
     ExtensionFlowObj *copy() const { return new PageFootnoteFlowObj(*this); }
+    PageFootnoteFlowObj() {}
   private:
   };
   //////////////////////////////////////////////////////////////////////
diff -Naur openjade-1.3.2.orig/jade/TransformFOTBuilder.cxx openjade-1.3.2/jade/TransformFOTBuilder.cxx
--- openjade-1.3.2.orig/jade/TransformFOTBuilder.cxx	2002-12-01 14:55:51.000000000 +0000
+++ openjade-1.3.2/jade/TransformFOTBuilder.cxx	2011-03-30 09:38:48.000000000 +0000
@@ -51,6 +51,7 @@
       value.convertString(name_);
     }
     ExtensionFlowObj *copy() const { return new EntityRefFlowObj(*this); }
+    EntityRefFlowObj() {}
   private:
     StringC name_;
   };
@@ -66,10 +67,12 @@
       value.convertString(data_);
     }
     ExtensionFlowObj *copy() const { return new ProcessingInstructionFlowObj(*this); }
+    ProcessingInstructionFlowObj() {}
   private:
     StringC data_;
   };
   class EmptyElementFlowObj : public TransformExtensionFlowObj {
+  public:
     void atomic(TransformFOTBuilder &fotb, const NodePtr &nd) const {
       if (nic_.gi.size() > 0)
 	fotb.emptyElement(nic_);
@@ -98,10 +101,12 @@
       }
     }
     ExtensionFlowObj *copy() const { return new EmptyElementFlowObj(*this); }
+    EmptyElementFlowObj() {}
   private:
     ElementNIC nic_;
   };
   class ElementFlowObj : public TransformCompoundExtensionFlowObj {
+  public:
     void start(TransformFOTBuilder &fotb, const NodePtr &nd) const {
       if (nic_.gi.size() > 0)
 	fotb.startElement(nic_);
@@ -133,10 +138,12 @@
       }
     }
     ExtensionFlowObj *copy() const { return new ElementFlowObj(*this); }
+    ElementFlowObj() {}
   private:
     ElementNIC nic_;
   };
   class EntityFlowObj : public TransformCompoundExtensionFlowObj {
+  public:
     void start(TransformFOTBuilder &fotb, const NodePtr &) const {
       fotb.startEntity(systemId_);
     }
@@ -150,10 +157,12 @@
       value.convertString(systemId_);
     }
     ExtensionFlowObj *copy() const { return new EntityFlowObj(*this); }
+    EntityFlowObj() {}
   private:
     StringC systemId_;
   };
   class DocumentTypeFlowObj : public TransformExtensionFlowObj {
+  public:
     void atomic(TransformFOTBuilder &fotb, const NodePtr &nd) const {
       fotb.documentType(nic_);
     }
@@ -174,6 +183,7 @@
       }
     }
     ExtensionFlowObj *copy() const { return new DocumentTypeFlowObj(*this); }
+    DocumentTypeFlowObj() {}
   private:
     DocumentTypeNIC nic_;
   };

--- openjade-1.3.2/msggen.pl.orig	2013-06-26 20:43:48.000000000 -0400
+++ openjade-1.3.2/msggen.pl	2013-06-26 20:44:37.000000000 -0400
@@ -4,6 +4,7 @@
 # See the file COPYING for copying permission.
 
 use POSIX;
+use Getopt::Std; 
 
 # Package and version.
 $package = 'openjade';
@@ -18,8 +19,7 @@
 undef $opt_l;
 undef $opt_p;
 undef $opt_t;
-do 'getopts.pl';
-&Getopts('l:p:t:');
+getopts('l:p:t:');
 $module = $opt_l;
 $pot_file = $opt_p;
 
