[PATCH] Build on Solaris 8 with Sun's compilers

Jason Riedy <[email protected]>
Newsgroups gmane.comp.tex.tetex.beta
Message-ID <[email protected]>
Appended is a patch that lets the current pretest (2.99.1.20041026)
build, pass tests, and seem to work on Solaris 8 with Sun's 8.0
compilers.

The C++ compiler is more picky, the C compiler doesn't generate
out-of-line functions when it successfully inlines, and you need
alloca.h to use alloca.

All the changes should still work for any compiler and really
shouldn't affect performance, but I haven't tested that.  
Unfortunately, I don't have the time to submit patches to each 
original project.  (And the dvipng from preview-latex's CVS 
didn't seem to need the change last time I looked.)

Thanks for the great TeX distribution!

Jason, not subscribed

diff -ur ../tetex-src-beta-2.99.1.20041026/libs/xpdf/xpdf/GlobalParams.h ./libs/xpdf/xpdf/GlobalParams.h
--- ../tetex-src-beta-2.99.1.20041026/libs/xpdf/xpdf/GlobalParams.h	2004-05-16 01:14:11.000000000 -0700
+++ ./libs/xpdf/xpdf/GlobalParams.h	2004-10-27 14:12:04.958226000 -0700
@@ -47,6 +47,10 @@
   displayFontTT
 };
 
+struct DFP_t1_tt_ {
+  GString *fileName;
+};
+
 class DisplayFontParam {
 public:
 
@@ -55,12 +59,8 @@
 				//   generic CID fonts
   DisplayFontParamKind kind;
   union {
-    struct {
-      GString *fileName;
-    } t1;
-    struct {
-      GString *fileName;
-    } tt;
+    struct DFP_t1_tt_ t1;
+    struct DFP_t1_tt_ tt;
   };
 
   DisplayFontParam(GString *nameA, DisplayFontParamKind kindA);
diff -ur ../tetex-src-beta-2.99.1.20041026/texk/dvipng/dvipng.h ./texk/dvipng/dvipng.h
--- ../tetex-src-beta-2.99.1.20041026/texk/dvipng/dvipng.h	2004-10-23 12:45:08.000000000 -0700
+++ ./texk/dvipng/dvipng.h	2004-10-28 09:24:32.620095000 -0700
@@ -27,6 +27,10 @@
 #define DVIPNG_H
 #include "config.h"
 
+#if defined(HAVE_ALLOCA_H)
+#include <alloca.h>
+#endif
+
 #define  STRSIZE         255     /* stringsize for file specifications  */
 
 #define  FIRSTFNTCHAR  0
diff -ur ../tetex-src-beta-2.99.1.20041026/texk/dvipng/font.c ./texk/dvipng/font.c
--- ../tetex-src-beta-2.99.1.20041026/texk/dvipng/font.c	2004-07-01 05:25:43.000000000 -0700
+++ ./texk/dvipng/font.c	2004-10-27 14:12:36.108230000 -0700
@@ -188,7 +188,7 @@
 }
 
 #ifdef HAVE_FT2_OR_LIBT1
-inline char* kpse_find_t1_or_tt(char* filename) 
+char* kpse_find_t1_or_tt(char* filename) 
 {
     char* filepath = kpse_find_file(filename, kpse_type1_format, false);
 #ifdef HAVE_FT2
diff -ur ../tetex-src-beta-2.99.1.20041026/texk/dvipng/fontmap.c ./texk/dvipng/fontmap.c
--- ../tetex-src-beta-2.99.1.20041026/texk/dvipng/fontmap.c	2004-07-01 05:24:46.000000000 -0700
+++ ./texk/dvipng/fontmap.c	2004-10-27 14:12:42.528223000 -0700
@@ -29,7 +29,7 @@
 static struct filemmap psfont_mmap;
 static struct psfontmap *psfontmap=NULL;
 
-inline char* newword(char** buffer, char* end) 
+char* newword(char** buffer, char* end) 
 {
   char *word,*pos=*buffer;
 
diff -ur ../tetex-src-beta-2.99.1.20041026/texk/web2c/pdftexdir/avl.h ./texk/web2c/pdftexdir/avl.h
--- ../tetex-src-beta-2.99.1.20041026/texk/web2c/pdftexdir/avl.h	2004-02-24 22:58:06.000000000 -0800
+++ ./texk/web2c/pdftexdir/avl.h	2004-10-27 14:13:46.038224000 -0700
@@ -28,6 +28,10 @@
 
 #include <stddef.h>
 
+#if defined(__cplusplus)
+extern "C" {
+#endif
+
 /* Function types. */
 typedef int avl_comparison_func (const void *avl_a, const void *avl_b,
                                  void *avl_param);
@@ -112,4 +116,8 @@
 void *avl_t_cur (struct avl_traverser *);
 void *avl_t_replace (struct avl_traverser *, void *);
 
+#if defined(__cplusplus)
+}
+#endif
+
 #endif /* avl.h */
diff -ur ../tetex-src-beta-2.99.1.20041026/texk/web2c/pdftexdir/epdf.h ./texk/web2c/pdftexdir/epdf.h
--- ../tetex-src-beta-2.99.1.20041026/texk/web2c/pdftexdir/epdf.h	2004-06-07 00:51:33.000000000 -0700
+++ ./texk/web2c/pdftexdir/epdf.h	2004-10-27 14:14:10.728222000 -0700
@@ -97,16 +97,6 @@
 /* config.c */
 extern integer cfgpar(integer);
 
-/* avl.c */
-typedef int avl_comparison_func (const void *avl_a, const void *avl_b, void *avl_param);
-typedef void avl_item_func (void *avl_item, void *avl_param);
-extern struct avl_table *avl_create (avl_comparison_func *, void *, struct libavl_allocator *);
-extern void avl_destroy (struct avl_table *, avl_item_func *);
-extern void **avl_probe (struct avl_table *, void *);
-extern void *avl_insert (struct avl_table *, void *);
-extern void *avl_delete (struct avl_table *, const void *);
-extern void *avl_find (const struct avl_table *, const void *);
-
 /* avlstuff.c */
 extern void avl_put_obj (integer, integer);
 extern integer avl_find_obj (integer, integer, integer);
diff -ur ../tetex-src-beta-2.99.1.20041026/texk/web2c/pdftexdir/pdftoepdf.cc ./texk/web2c/pdftexdir/pdftoepdf.cc
--- ../tetex-src-beta-2.99.1.20041026/texk/web2c/pdftexdir/pdftoepdf.cc	2004-06-07 00:51:34.000000000 -0700
+++ ./texk/web2c/pdftexdir/pdftoepdf.cc	2004-10-27 14:14:23.678234000 -0700
@@ -43,8 +43,8 @@
 #include "GlobalParams.h"
 #include "Error.h"
 
-#include "epdf.h"
 #include "avl.h"
+#include "epdf.h"
 
 static const char perforce_id[] = 
     "$Id: //depot/Build/source.development/TeX/texk/web2c/pdftexdir/pdftoepdf.cc#49 $";
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.