Difference between revisions of "Pkgsrc on IRIX"

From WTFwiki
Jump to navigation Jump to search
(→‎Build problems: lang/gcc34)
Line 202: Line 202:
 
=== lang/gcc34 ===
 
=== lang/gcc34 ===
  
'''INCOMPLETE'''
+
This is a big one. You need to fix several getopt.h problems, you need to edit the spec file in work/obj/gcc to remove the space after the -R several times(it comes back again and again). You need to edit the Makefile in work/obj/mips-sgi-irix6.5/libstdc++-v3 and work/obj/mips-sgi-irix6.5/libobjc and comment out the MULTIDIRS line. I have obtained a working gcc 3.4 compiler using this method with SGI's freeware gcc 3.3 compiler as the host.
 
 
This is a big one. You need to fix several getopt.h problems, you need to edit the spec file in work/obj/gcc to remove the space after the -R several times(it comes back again and again). You need to edit the Makefile in work/obj/mips-sgi-irix6.5/libstdc++-v3 and comment out the MULTIDIRS line.
 
  
 
== Useful links ==
 
== Useful links ==

Revision as of 10:58, 27 June 2007

Introduction

SGI no longer packages 'freeware' for IRIX, as it was discontinued in 2006. Nekoware aims to be a community-driven replacement but I've found many packages to be compiled with far too many dependancies (vim needing GTK, etc) and not everything I want is available. Therefore, much like my experience with Opensolaris, I turned to pkgsrc...

Build machine

Here's the `hinv` output:

 2 300 MHZ IP30 Processors
 CPU: MIPS R12000 Processor Chip Revision: 2.3
 FPU: MIPS R12010 Floating Point Chip Revision: 0.0
 Main memory size: 2048 Mbytes
 Xbow ASIC: Revision 1.3
 Instruction cache size: 32 Kbytes
 Data cache size: 32 Kbytes
 Secondary unified instruction/data cache size: 2 Mbytes
 Integral SCSI controller 0: Version QL1040B (rev. 2), single ended
   Disk drive: unit 1 on SCSI controller 0
 Integral SCSI controller 1: Version QL1040B (rev. 2), single ended
   CDROM: unit 6 on SCSI controller 1
 IOC3/IOC4 serial port: tty1
 IOC3/IOC4 serial port: tty2
 IOC3 parallel port: plp1
 Graphics board: ESI with texture option
 Graphics board: ESI
 Integral Fast Ethernet: ef0, version 1, pci 2
 Iris Audio Processor: version RAD revision 12.0, number 1
 uname -a => IRIX64 IRIS 6.5 01090133 IP30

The machine is running a fresh install of IRIX 6.5.29.

Bootstrapping pkgsrc using gcc

As of pkgsrc 2007q1 pkgsrc bootstraps out of the box, unlike some earlier versions that have problems with PRIu64.

Download the SGI freeware binary of gcc from SGI freeware and read the documentation.

Make sure you have compiler_dev.sw.base installed (notably c_dev and c++_dev). These can be found on your IRIX 6.5 developer foundation CD.

Install the gcc tardist using the `tardist` command as root.

Add /usr/freeware/bin to your $PATH.

Patch your spec file if you want to default gcc to 64 bit mips4 mode as noted here or download a pre-patched spec. I had to patch on a freebsd box because IRIX' patch didn't like the diff.

Download pkgsrc 2007q1 or later from netbsd's ftp and untar it to /usr.

cd into /usr/pkgsrc/bootstrap, set CC=gcc and ./bootstrap

TO BE CONTINUED

Build problems

Building gcc from pkgsrc

I currently don't know how to do this. The SGI freeware gcc binary seems to be working fine.

lang/perl5

Configure fails with invalid option -64 or some such nonsense, edit the pkgsrc Makefile and remove it.

In 32 bit mode, perl is a royal bitch. It's absolutely convinced that you want to build it in 64 bit mode on IRIX64. you have to edit the hints/irix_6 file to tell it not to do the -mabi=64 crap. Also, you need to add -lpthreads to libs in the toplevel Makefile. This was a major pain, might post detailed changes if I can ever be bothered to do it again...

fonts/fontconfig

Makes dumbass assumptions about the system. Here's a patch for pkgsrc's makefile to make it work:

 diff -r1.62 Makefile
 30a31
 > CONFIGURE_ARGS+=      --libdir=/usr/pkg/lib --includedir=/usr/pkg/include --with-arch=mips4
 32a34,35
 > LDFLAGS+=-L/usr/pkg/lib
 >

archivers/unzip

The compiler coredumps when building. To fix:

 bmake build (wait for it to segfault)
 cd work/unzip*
 vi Makefile (and remove the definition of LF2)
 gmake clean; gmake generic2 (generic doesn't work..?)
 cd ../../
 bmake install clean

lang/ruby

When you run ruby it complains about not being able to map the soname for libruby. The solution is:

 export LD_LIBRARY64_PATH=/usr/pkg/lib

A more general solution might be around, haven't done the research yet.

For 32 bit mode, ensure that -n32 is in LDFLAGS and LDSHARED in the Makefile.

graphics/tiff

This fails with "invalid preprocessor flag "-c"' or something. IRIX apparently comes with tiff of some sort, so make it a builtin:

 BUILTIN_PKG.tiff=       tiff-3.8
 USE_BUILTIN.tiff=       YES

NOTE this only works for when you're using the 32 bit ABI, there's no 64 bit tiff library...

textproc/groff

groff by default depends on netpbm which depends on tiff, which won't work on 64 bit systems, so disable that stuff:

 PKG_OPTIONS.groff=      -x11 -groff-docs

If groff complains about a broken C++ compiler:

CXX=                    /usr/freeware/bin/g++

bmake clean and try to build it again.

devel/ncurses

This failed for me by complaining about a missing libncurses++.so when linking the demos. This apparently is a libtool issue, but it's way too complex for me to debug. I built it manually with --prefix=/usr/pkg and made it a builtin in mk.conf and things seemed to go well...

See also: a netbsd-bugs report and a reported fix that doesn't work for me

fonts/ttmkfdir2

If it complains about 'optarg' being undeclared it seems to be caused by pkgsrc using the wrong getopt.h header. I manually edited commandline.cpp to have

 #include "/usr/include/getopt.h"

instead of

 #include <getopt.h>

and it seemed to fix it, changing the order of the -I parameters to gcc might do it too...

devel/glib2

Fails with "/usr/pkg/bin/libtool[4381]: syntax error at line 1 : `|' unexpected". I think this is caused by there being '| |' in the command line generated by libtool. Apparently some command is being omitted, but I don't know what or why...

lang/python24

Dunno. Seems broken somehow, haven't figured it out yet.

lang/erlang

The build will fail with an undeclared shiftleft in os_mon. Use the patch from here (you may have to remove the DOS style newlines...)

The install will fail because IRIX' `chmod` doesn't support the -f parameter. Run `grep chmod **/Makefile*` to find the affected makefiles and remove the use of -f

wip/esdl

To fix the undeclared declaration of 'refc' use the patch from here. If you're using 64 bit mode you need to edit c_src/Makefile and set GL_LIBS to use ${OGLDIR}/lib64.

devel/pcre

If this fails with the 'unexpected |' error, rebuild libtool-base. This probably will fix glib2 too...

multimedia/libmp4v2

Doesn't build, don't care to even investigate why.

audio/musicpd

Before you build libao ensure you've enabled IRIX support in the Makefile.common. Check if the irix plugin has been built by doing `ls /usr/pkg/lib/ao/plugins-2`

Add the following to the pkgsrc Makefile:

 LDFLAGS+= -lgen
 CONFIGURE_ARGS+= --enable-ao

You MUST build as root, or the configure script will bitch about mapping sonames. sudo isn't good enough in this case for some reason...

audio/flac

Fails to build libFlac++.so.7.0 for some reason. I think this is related to the ncurses problem. I just edited the FLAC++ stuff out of the Makefile and did a bmake install clean. Very bad, but I needed it built.

audio/libsndfile

CFLAGS incorrectly include -pipe in the makefiles. Fix this somehow and it'll build.

 perl -pi -e 's/-pipe//' **/Makefile

graphics/glitz

Inappropiate #include <stdint.h>. I've modified one of the pkgsrc patches to take care of this:

Edit patches/patch-ab and change:

 #  if defined(__OpenBSD__)

to

 #  if defined(__OpenBSD__) || defined(sgi)

you'll have to regenerate the patch checksum too; remove the line for patch-ab from distinfo and do:

 digest sha1 patch-ab >> ../distinfo

to regenerate the checksum for patch-ab

audio/portaudio

This port is fucked. I got it to build though:

  • bmake configure
  • Edit the work/portaudio Makefile
  • Ensure /usr/pkg/bin/install-sh is being used for INSTALL
  • Add -laudio -lpthread to DLL_LIBS
  • Remove --version-info from the link command
  • Add ${SHARED_FLAGS} to the link command

lang/gcc34

This is a big one. You need to fix several getopt.h problems, you need to edit the spec file in work/obj/gcc to remove the space after the -R several times(it comes back again and again). You need to edit the Makefile in work/obj/mips-sgi-irix6.5/libstdc++-v3 and work/obj/mips-sgi-irix6.5/libobjc and comment out the MULTIDIRS line. I have obtained a working gcc 3.4 compiler using this method with SGI's freeware gcc 3.3 compiler as the host.

Useful links