SGI: Development

Netsurf 3.1 - Page 1

So here I am trying to build Netsurf 3.1 for IRIX - and failing miserably.

I have ensured my toolchain ( MIPSPro 7.4 ) is installed and working with all front ends.

So I untar the source from the NetSurf site and give it a try:

Code: Select all

% cd  netsurf-all-3.1
% cd netsurf
%make
ERROR:make:file `Makefile` line 39:Syntax error

So, I though... its one of those ganoo makefiles.

Code: Select all

%gmake
gtk/Makefile.target:24: ** Unable to find library for : PNG (libpng). Stop.


Well then. Doesn't appear to be GCC dependent thus far, but it can't detect libpng. Anyone else want to give me a hand please?
:O3x02L: R16000 700MHz 8GB RAM kanna
:Octane: R12000 300MHz SI 896MB RAM yuuka
:Octane2: R12000A 400MHz V6 2.5GB RAM
:Indy: (Acclaim) R4600 133MHz XL Graphics 32MB RAM
:Indy: (Challenge S) R4600 133MHz (MIPS III Build Server)
Thinkpad W530 i7 3940XM 3GHz, 32GB, K1000M Windows 8.1 Embedded rin
Thinkpad R40 Pentium M 1.5GHz 2GB RAM kasha
I had a brief look at netsurf some time ago. For me it looked quite complicated to build. You have to download some more libraries to build it and if you want to have javascript you need a mozilla js library - this also means js will not be faster than firefox.

If you plan to port anything to Irix, please read the documentation and README files of the package carefully. It is also helpful to look at the release notes of a comparable existing nekoware package, you have to build your environment very carefully before you run configure or gmake. In the first step you should build it as small as possible and if it runs you can add more features like js.
:Tezro: :Fuel: :Octane2: :Octane: :Onyx2: :O2+: :O2: :Indy: :Indigo: :Cube:
I see. Not that I cared about JS on Netsurf, I was more interested in getting an up to date HTML renderer going and remote X11 seems to work OK but is buggy
:O3x02L: R16000 700MHz 8GB RAM kanna
:Octane: R12000 300MHz SI 896MB RAM yuuka
:Octane2: R12000A 400MHz V6 2.5GB RAM
:Indy: (Acclaim) R4600 133MHz XL Graphics 32MB RAM
:Indy: (Challenge S) R4600 133MHz (MIPS III Build Server)
Thinkpad W530 i7 3940XM 3GHz, 32GB, K1000M Windows 8.1 Embedded rin
Thinkpad R40 Pentium M 1.5GHz 2GB RAM kasha
If you do `make dist` from the top of the source tree it should rebuild the whole package into a cross platform tar.gz and excise all the GNU-isms from the makefiles. I say "should" because not everyone uses the auto tools the way they're intended... :|
Project:
Temporarily lost at sea...
Plan:
World domination! Or something...

:Tezro: :Octane2:
vishnu wrote: If you do `make dist` from the top of the source tree it should rebuild the whole package into a cross platform tar.gz and excise all the GNU-isms from the makefiles. I say "should" because not everyone uses the auto tools the way they're intended

It would appear that Netsurf doesn't use autotools at all. They've got their own build system, AFAICT.

I had a quick look at it and its instructions. It doesn't look like Netsurf's QUICK-START instructions will work. That method relies heavily on their custom env.sh script which doesn't look good for IRIX. The Netsurf BUILDING-GTK instructions, however, do look viable. I'll keep working on it over the weekend and see how far I get. (Unless somebody else beats me to the finish line!)

So far I've seen some minor annoyances, but nothing terrible. It seems to assume GNU make and GNU install, for example. Their build system doesn't know about MIPS Pro (nor would I expect it to, really). Those shouldn't be show stoppers, though. (But who knows what lurks in the depths!)
:Indigo2IMP: :Octane: :Indigo: :O3x0:
Sun SPARCstation 20, Blade 2500, T5240
HP C8000
jpstewart wrote: It would appear that Netsurf doesn't use autotools at all. They've got their own build system,
Ha ha, I should have looked! :|
jpstewart wrote: It seems to assume GNU make and GNU install, for example.
Hence the makefile errors, GNU only thinks "embrace and extend" is evil when Micro$oft does it... :shock:
Project:
Temporarily lost at sea...
Plan:
World domination! Or something...

:Tezro: :Octane2:
vishnu wrote: Hence the makefile errors, GNU only thinks "embrace and extend" is evil when Micro$oft does it... :shock:

Well, naturally! GNU is Righteousness and Purity - independent projects should welcome absorption into the Collective!
Computers: Amiga 1200, DEC VAXStation 4000/60, DEC MicroPDP-11/73
Synthesizers: Roland JX-10/SH-09/HS-80/MT-32/D-50, Yamaha DX7-II/V50/TX7/TG33/FB-01, Korg MS-20 Mini/ARP Odyssey/DW-8000/M1, Ensoniq SQ-80, E-mu Emax HD/Proteus-2, Casio CZ-5000, Moog Satellite, Sequential Circuits Prophet-600
I give up. Looks harder than I initially thought. Good on someone else if they can do it.
:O3x02L: R16000 700MHz 8GB RAM kanna
:Octane: R12000 300MHz SI 896MB RAM yuuka
:Octane2: R12000A 400MHz V6 2.5GB RAM
:Indy: (Acclaim) R4600 133MHz XL Graphics 32MB RAM
:Indy: (Challenge S) R4600 133MHz (MIPS III Build Server)
Thinkpad W530 i7 3940XM 3GHz, 32GB, K1000M Windows 8.1 Embedded rin
Thinkpad R40 Pentium M 1.5GHz 2GB RAM kasha
I had a working NetSurf some time ago. When the number of lib dependencies grew, somewhere along the line the binary core dumped.
I don't have the O2 with me here now, but I can look it up next time I fire the Blue Demon up and check which was the last working version.
Sitting in a room.....thinkin' shit up. :evil:

:O2: 400MHz R12k - :320: Dual 600MHz PIII - HP Alphaserver DS15 - Digital DECstation5000/133 - Dell T3500 - Apple G4 Cube dual 500MHz/GF6200 - Newton Messagepad 2100 - Apple PowerBook 2400c/G3@240 - Apple PowerMacintosh 6100/66 - Apple PowerMacintosh 6500/G3@500MHz - Apple Workgroup Server 9150/120 G3@280 - Apple Macintosh IIfx - Apple Macintosh LC475 (OC Full 040 33MHz) - Apple Macintosh Color Classic (Full 040 40Mhz Mystic upgrade) - Sun Cobalt Cube 3 - EBOX 3300A-JSK - Tadpole RDI UltraBook IIi - Compaq Armada 4120 - Digital HiNote Ultra II - HP OmniBook 425 - HP 200LX - Crossbeam C12
With only a minor tweak to the Makefiles, I've built most of the included libraries with GCC on IRIX. I'm not 100% sure yet, but I think the ones that didn't build aren't strictly necessary anyway. I'm planning to work on the NetSurf core later today.

Building with MIPS Pro will be a different story. Their custom build system looks (at first glance) to be fairly portable. But then the Makefiles for the individual libraries go and add GCC-specific options to the compiler command line. Depending on how it goes with GCC, I may or may not attempt to build with MIPS Pro.

Details (and patches) to follow.
:Indigo2IMP: :Octane: :Indigo: :O3x0:
Sun SPARCstation 20, Blade 2500, T5240
HP C8000
And another update for anyone still following along: NetSurf 3.1 builds with GCC on IRIX once you tweak a few defines in the Makefiles and set up your environment (especially PKG_CONFIG_PATH) correctly. Note that I said "builds". Not "runs". :(

If anyone wants to try debugging it, let me know and I'll post instructions and a patch for building it yourself. Otherwise, I'll try to debug it myself over the course of the coming week (although I'll probably only be able to work on it in the evenings).

Today was a holiday around here, and I'd been wanting an excuse to spend some quality time with my Octane. :D This project fit the bill quite nicely!
:Indigo2IMP: :Octane: :Indigo: :O3x0:
Sun SPARCstation 20, Blade 2500, T5240
HP C8000
I like to help debugging. I think the best way is to post your environment and patches in this thread.
:Tezro: :Fuel: :Octane2: :Octane: :Onyx2: :O2+: :O2: :Indy: :Indigo: :Cube:
You will need all of the following libraries installed:
  • neko_gtk+-2.12.12
  • neko_curl-7.19.7
  • neko_libpng-1.2.47
  • neko_libjpg-1.2.1
  • neko_librsvg-2.18.2
  • neko_libiconv-1.14
(See also my note about librsvg if you have trouble with it.)

You will need the following utilities to get through the build process:
  • neko_make-3.82
  • neko_pkgconfig-0.23
  • neko_fileutils-4.1
  • neko_gperf-3.0.4
  • neko_perl-5.8.9
  • neko_perl_html_parser-3.55
  • neko_expat-2.1.0
  • neko_tar-1.26

You'll also need GCC. I used a self-compiled GCC, but neko_gcc47-4.7.1 should also work.

Make sure that /usr/nekoware/bin is first in your path. You'll need install (from neko_fileutils), perl, and tar from Nekoware to come before the standard IRIX ones which won't work with the NetSurf build system.

Download and extract the netsurf-all-3.1.tar.gz source code. In the resulting netsurf-all-3.1 directory, do as recommended by the NetSurf docs (assuming you extracted it into ${HOME} -- adjust to suit your own path):

Code: Select all

mkdir workspace
mkdir workspace/inst

export PREFIX=${HOME}/netsurf-all-3.1/workspace/inst
export PKG_CONFIG_PATH=${PREFIX}/lib/pkgconfig::

Note the two colons at the end of PKG_CONFIG_PATH. That's not a typo.

Then to build with GCC:

Code: Select all

export CC=gcc
export CFLAGS="-mabi=n32 -mips4"
export CXX=g++
export CXXFLAGS="-mabi=n32 -mips4"
export CPPFLAGS="-I/usr/nekoware/include"
export LDFLAGS="-L/usr/nekoware/lib -Wl,-rpath -Wl,/usr/nekoware/lib"


Apply the attached patch (with "patch -p1 <../netsurf-irix.patch" from within the netsurf-all-3.1 directory). It mainly changes "-std=c99" to "-std=gnu99" in the options passed to GCC. (The IRIX headers disable all extensions in ANSI c99 mode but enable them in gnu99 mode.) The patch also adds a couple of missing includes in places, creates two configuration files, and makes one small change to work with the GTK version in Nekoware. (Note that NetSurf says it works with GTK 2.12+ but some features seem to be from 2.16 and 2.18. They produce warnings when I try to start up NetSurf.)

Then for each of the following subdirectories (in order), "cd" into it and run "gmake install". (I've ignored the top-level Makefile for now.)
  • buildsystem
  • libparseutils
  • libwapcaplet
  • libhubub
  • libcss
  • libnsgif
  • libnsbmp
  • librosprite
  • libdom
  • netsurf

You should have a netsurf binary in ${PREFIX}/bin. Check with ldd to make sure it's linked against the right Nekoware libraries. (NetSurf's own libraries were statically linked if you followed my process.) Try running it with "./netsurf -v" (assuming you're in ${PREFIX}/bin). On my system the NetSurf window opens and in the console there are a whole lot of harmless-looking Gtk-WARNING messages, a couple of GLib-GObject messages that worry me, and NetSurf's own very detailed log messages stop after it logs calling "gtk/window.c gui_window_set_icon". Then it just sits there eating 100% CPU.

That's as far as i got over the weekend. Thanks, diegel, for offering to help debug this. If anyone else wants to pitch in, I hope the above instructions are sufficiently detailed. And if we get it built and working with GCC, I'll look into buiding it with MIPS Pro.
:Indigo2IMP: :Octane: :Indigo: :O3x0:
Sun SPARCstation 20, Blade 2500, T5240
HP C8000
And here's the patch that I forgot to attach to the previous post. Oops! :oops:
:Indigo2IMP: :Octane: :Indigo: :O3x0:
Sun SPARCstation 20, Blade 2500, T5240
HP C8000
And yet another thing I forgot to mention earlier (and that should have been included in the patch :oops: ): watch out for '%zu' in printf statements, especially the LOG macro. IRIX printf doesn't like the z. Running NetSurf in verbose mode (i.e., with the '-v' option) will spew binary garbage. Change '%zu' to simply '%u' instead, before compiling it. The occurence in netsurf/image/png.c, line 181 in particular caused me problems. It's used a few other places, too, and they should all be removed.
:Indigo2IMP: :Octane: :Indigo: :O3x0:
Sun SPARCstation 20, Blade 2500, T5240
HP C8000
niice work jpstewart but being gtk2 based and coming with gcc specials do you think that it's a big difference compared to firefox?
don't get me wrong it's great to see any sort of irix effort however i wonder if that effort wouldn't be better spent on dillo
Out of interest, what libraries does SeaMonkey use these days? I know that the interface of the current IRIX port is far more responsive than Firefox's interface, and of course current SeaMonkey uses up-to-date versions of Gecko and SpiderMonkey. Wondering if it might be more feasible to port than recent versions of Firefox - which I seem to remember were just a bridge too far for IRIX.
Systems in use:
:Fuel: - Lithium : R14000 600MHz CPU, 4GB RAM, V10 Graphics, 36GB 15k HDD & 300GB 10k HDD, New/quiet fans, IRIX 6.5.30
:Indigo2IMP: - Nitrogen : R10000 195MHz CPU, 384MB RAM, SolidIMPACT Graphics, 36GB 15k HDD & 300GB 10k HDD, New/quiet fans, IRIX 6.5.22
Other systems in storage: :O2: x 2, :Indy: x 2
As the resident Mozilla Tier 3 porter, I think you'll find most of the same problems porting SeaMonkey that you would with Firefox. While there are some widget differences, they are ultimately both XUL-based. Ditto for Songbird or T-bird.
smit happens.

:Fuel: bigred , 900MHz R16K, 4GB RAM, V12 DCD, 6.5.30
:Indy: indy , 150MHz R4400SC, 256MB RAM, XL24, 6.5.10
:Indigo2IMP: purplehaze , R10000, Solid IMPACT
probably posted from Image bruce , Quad 2.5GHz PowerPC 970MP, 16GB RAM, Mac OS X 10.4.11
plus IBM POWER6 p520 * Apple Network Server 500 * HP C8000 * BeBox * Solbourne S3000 * Commodore 128 * many more...
foetz wrote: niice work jpstewart but being gtk2 based and coming with gcc specials do you think that it's a big difference compared to firefox?
don't get me wrong it's great to see any sort of irix effort however i wonder if that effort wouldn't be better spent on dillo

Frankly, I have no idea. My involvement here is basically just a quirk of timing. I saw TeamBlackFox's post on the Saturday morning of a long weekend and thought to myself, "that sounds like something fun to work on this weekend". That was pretty much the entirety of my thought process. :lol: I certainly never considered any of the questions you're asking and I personally am probably not in a position to answer them even if I had thought about them!

Once I got into the build process, I discovered that the Makefiles add lots of GCC options to the command line, so I figured I'd try building with GCC as first step to ease the porting process. (I.e., first worry about operating system portability issues, then worry about compiler portability problems.) But now that I've built it with GCC and it's not working, I'm not so sure that was good idea. I (re-)discovered this in the IRIX c99 manpage today:
cc(1) wrote: The gcc compiler does not correctly pass/return structures that are smaller than 16 bytes and which are not 8 bytes. gcc is consistent with itself, but not consistent with the MIPSpro C compiler, so the only failures that can happen are when mixing code compiled with the two compilers.

That same issue is also mentioned (although not specifically about SGI) in the "Incompatibilites" section of the GCC documentation, too. NetSurf passes a lot of structs back and forth with GTK. I can't help but wonder if that's (part of) the problem with my GCC build. AFAIK, the neko_gtk package was compiled with MIPSpro.

I'm hoping to get a chance to try again to build with MIPSpro this coming weekend. Unless, of course, somebody else gets its working first.
:Indigo2IMP: :Octane: :Indigo: :O3x0:
Sun SPARCstation 20, Blade 2500
HP C8000
jpstewart wrote: [ NetSurf passes a lot of structs back and forth with GTK. I can't help but wonder if that's (part of) the problem with my GCC build. AFAIK, the neko_gtk package was compiled with MIPSpro.

Hate to splash cold water but if you are using the gtk2 that diegel recently built, pretty sure it is gcc. The release notes seemed to indicate that, anyhow.
two girls for every boy ...