[tex-live] Some compilation issues on IRIX.

Olaf Weber olaf at infovore.xs4all.nl
Fri Dec 29 11:26:18 CET 2006


Several build issues came up with the IRIX compilation, where I was
using the native compilers.

-- worked around --

* The hardest problems to address are that the headers for libfontconfig
  are installed in /usr/freeware/include, but the library comes out of
  /usr/freeware/lib32, not /usr/freeware/lib, and moreover I need to add
  an -rpath /usr/freeware/lib32 option to ensure the library will be
  found.  The configure scripts as they are today require some editing
  to make this possible.  At present I have no packaged solution for
  this, but I can cope and would advise against major surgery to the
  configure scripts at this point.

  Ultimately, what is needed is two options like these, but for
  fontconfig.

  --with-freetype-libdir=DIR
                          Specify directory where the libfreetype resides.
  --with-freetype-include=DIR
                          Specify the freetype header files location.



* To get templates correctly instantiated with the lkcd-typetools I need
  to use 'CC -ar' instead of 'ar' in two places.


* My build system has libiconv.so installed, and the xdvi configure
  script picks up on that, but since the libconv.so is not present by
  default it must be removed from the link line by hand.


-- resolved --

* To run XeTeX, install fw_fontconfig and its dependencies.


* As before I'm using the motif widgets in xdvi.  These are a default
  part of the IRIX desktop.


* In dvi2tty.c the compiler pointed out a place where likely '=' is
  used but '==' is meant.

Index: texk/dvi2tty/dvi2tty.c
===================================================================
--- texk/dvi2tty/dvi2tty.c      (revision 2989)
+++ texk/dvi2tty/dvi2tty.c      (working copy)
@@ -315,7 +315,7 @@
         if ((optch = optarg[j]) == '\0')
             break;
         j++;
-        if ((strchr(OPTWARG, optch) != NULL) && (optarg[j]='\0')) {
+        if ((strchr(OPTWARG, optch) != NULL) && (optarg[j]=='\0')) {
                 if (--Argc <= 0)
                     usage(noarg);
                 optarg = *++Argv;



* For the XeTeX compilation, I need ALL_CXXFLAGS to be defined
  somewhere:

Index: texk/make/common.mk
===================================================================
--- texk/make/common.mk (revision 2978)
+++ texk/make/common.mk (working copy)
@@ -20,6 +20,7 @@
 ALL_CPPFLAGS = $(DEFS) -I. -I$(srcdir) -I$(kpathsea_parent) \
   -I$(kpathsea_srcdir_parent) $(prog_cflags) $(CPPFLAGS)
 ALL_CFLAGS = $(ALL_CPPFLAGS) $(CFLAGS)
+ALL_CXXFLAGS = $(ALL_CPPFLAGS) $(CXXFLAGS)
 compile = $(CC) $(ALL_CFLAGS)

 .SUFFIXES:



* dvipng needs libm and wasn't pulling it in automatically.

Index: texk/dvipng/Makefile.in
===================================================================
--- texk/dvipng/Makefile.in     (revision 2978)
+++ texk/dvipng/Makefile.in     (working copy)
@@ -57,7 +57,7 @@

 lib_cppflags = $(GDCPPFLAGS) $(FREETYPE2CPPFLAGS) $(LIBT1CPPFLAGS) \
                $(LIBPNGCPPFLAGS) $(ZLIBCPPFLAGS) -I.. -I$(srcdir)/..
-lib_libs = $(LDGD) $(LDFREETYPE2) $(LDLIBT1) $(LDLIBPNG) $(LDZLIB)
+lib_libs = $(LDGD) $(LDFREETYPE2) $(LDLIBT1) $(LDLIBPNG) $(LDZLIB) -lm

 CC = @CC@
 CFLAGS = @CFLAGS@ -Wall



* I ran into some issues regarding the use of 'index()/rindex()' versus
  'strchr()/strrchr()'.  The simplest solution is to just use strchr()
  and strrchr() in all places.  I'd like to check these changes in.

Index: utils/pdfopen/pdfopen.c
===================================================================
--- utils/pdfopen/pdfopen.c     (revision 2978)
+++ utils/pdfopen/pdfopen.c     (working copy)
@@ -41,8 +41,8 @@
     }
     strcpy(filename,argv[2]);
        strcpy(basefile,filename);
-       if (rindex(basefile,'/'))
-         basefile = rindex(basefile,'/')+1;
+       if (strrchr(basefile,'/'))
+         basefile = strrchr(basefile,'/')+1;

     winname = malloc(strlen(argv[2])+1+strlen(READERWINPREFIX));
     if (winname == NULL ) {
Index: texk/detex/detex.l
===================================================================
--- texk/detex/detex.l  (revision 2978)
+++ texk/detex/detex.l  (working copy)
@@ -293,7 +293,7 @@
 #ifdef KPATHSEA
        kpse_set_program_name (rgsbArgs[0], NULL);
 #endif
-       if ((sbProgName = rindex(rgsbArgs[0], '/')) != NULL)
+       if ((sbProgName = strrchr(rgsbArgs[0], '/')) != NULL)
            sbProgName++;
        else
            sbProgName = rgsbArgs[0];
@@ -532,7 +532,7 @@
        if (csbIncList == 0)    /* no list */
            return(1);
        (void)strcpy(sbBase, sbFile);
-       if ((pch = rindex(sbBase, '.')) != NULL)
+       if ((pch = strrchr(sbBase, '.')) != NULL)
            *pch = '\0';
        i = 0;
        while ((i < csbIncList) && rgsbIncList[i])
@@ -602,7 +602,7 @@

        while (sbList && *sbList && csbList < csbMax) {
            rgsbList[csbList++] = sbList;
-           if (sbList = index(sbList, chSep))
+           if (sbList = strchr(sbList, chSep))
                *sbList++ = '\0';
        }
        return(sbList && *sbList ? ERROR : csbList);
@@ -648,7 +648,7 @@
 #endif

            /* If sbFile ends in .tex then it must be there */
-           if ((pch = rindex(sbFullPath, '.')) != NULL
+           if ((pch = strrchr(sbFullPath, '.')) != NULL
                        && (strcmp(pch, ".tex") == 0))
                if ((fp = fopen(sbFullPath, "r")) != NULL)
                    return(fp);
Index: texk/web2c/pdftexdir/ttf2afm.c
===================================================================
--- texk/web2c/pdftexdir/ttf2afm.c      (revision 2978)
+++ texk/web2c/pdftexdir/ttf2afm.c      (working copy)
@@ -1029,7 +1029,7 @@
     cur_file_name = argv[optind];
     if (print_cmap) {
         bname = xstrdup(xbasename(cur_file_name));
-        if ((s = rindex(bname, '.')) != NULL)
+        if ((s = strrchr(bname, '.')) != NULL)
             *s = 0;
     }
     if ((fontfile =


-- 
Olaf Weber

               (This space left blank for technical reasons.)



More information about the tex-live mailing list