Skip navigation

Category Archives: Open Source

Random thought #1
– Can I have a step-by-step how-to…
– No.
– ..that works without any additional work?
– No.
– Do you always say “no”?
– Yes.

None: ode
1. A lyric poem with complex stanza forms

I have these chronic problems with missing or invalid header files. Today I’m going to deal with one of them.

Headers in question are X11/Xos.h and X11/Xfuncproto.h from my attempt to build firefox for mingw32. (Note that I have no idea what X11 is. And I suspect that X11 is something very obvious.). They are the missing dependency in several different files: cppsetup.c, include.c, parse.c, main.c, def.h.

It obviously looks like a group of source files that include the same header file def.h, that includes the missing headers X11/Xos.h and X11/Xfuncproto.h. So, I will go straight to def.h

def.h:
#ifndef NO_X11
#include <X11/Xos.h>
#include <X11/Xfuncproto.h>

Ok, this suggest that these are actually external headers, that I supposedly have under /usr/include/X11 or /usr/X11/include. So what is X11? X11 core headers? I feel like I’m missing something very obvious. However, after some time “poking” around, I think, I need xorg-x11-proto-devel package.

After installing it, I got my X11 headers under /usr/include/X11. And now I can continue with the firefox build.

A couple of days ago I was able to put together a working toolchain to compile windows binaries. Today I’m going to try and compile a firefox build with it.

First of all, I’m going to get a firefox build that passed unit tests. To do that, I need to go to tinderbox and look for “WINNT 5.2 mozilla-central build”. Next step is to find the latest successful source code revision.

Right now (March 21st, 5:35 pm GMT) the latest “green” revision is 1633e6077d77.

Since I already have mozilla-central source on my machine, I’m just going to update to this revision. Under mozilla-central folder:
hg pull
hg update -r 1633e6077d77

Read More »

Today I’m going to compile Firefox for Windows on a Linux box. And for that I’m not going to reinvent the wheel, but follow an existing guide.

This is what I’m going to need:

  • GNU Binutils – This is linker, assembler, and various other tools.
  • GCC 4.3 – I have GCC 4.4.3. I might have to install GCC 4.3, if GCC 4.4.3 doesn’t play well with Dehydra.
  • mingw-runtim, w32api, and Cygwin winsup – It has something to do with GCC cross compiler.
  • Netscape wintools – This is something that is need for some xpidl. A quick search reveals that it (might) stands for [X]Cross Platform Interface Definition Language.
  • And, off course, configuring Firefox build.
  1. binutils-2.18 surprisingly installed with no problems.
  2. Install mingw-runtime-3.14
  3. Same for w32api-3.11.
  4. Get GCC 4.3 source and winsup-src-20100315.

I had to get mpfr to install GCC, but other than that everything went without a problem.

Time to check the compiler:
[root@xxxxxx ~]# osd/mingw32/bin/i686-mingw32-gcc -v
Using built-in specs.
Target: i686-mingw32
Configured with: ../gcc-4.3.0/configure --prefix=/root/osd/mingw32/ --target=i686-mingw32 --with-gnu-ld --with-gnu-as --enable-__cxa_atexit --enable-languages=c,c++
Thread model: win32
gcc version 4.3.0 (GCC)

[root@xxxxxx ~]# osd/mingw32/bin/i686-mingw32-gcc test.c -o test.exe
[root@xxxxxx ~]# ls test*
test.c test.exe

On Windows:
C:\>test.exe
hello world!

I’m almost ready to build Firefox.

Thunderbird is an email application from Mozilla. It happened to have a bug where it highlights false email addresses with “mailto” tags. For example, it would highlight “a@a…”, which is clearly an invalid email address. I’m going to try to fix it.

It’s going to be a nice distraction from my Mac adventure

Here is the plan for bullet point lovers:

  1. Register on landfill and file the bug
  2. Get Thunderbird source code and build a debug build
  3. Find where and whan needs to be fixed
  4. Submit a diff to my bug report
  5. Get someone to review it

Read More »

As a part of my DXR project work I will have to cross-compile Firefox for Mac and Windows on a Linux box.

I’m going to start with a Mac build and follow instructions in this blog post in my attempt to build it.

I need to get toolwhip source code and compile cctools and ld64. These are the parts of a custom toolchain. To spice things up I will also need Apple’s gcc.

Read More »

I’m going to attempt to build a firefox on my windows machine. I’m going to follow “simple firefox build”  doc in MDC.

First of all, I’m going to get Mozilla build tools for windows. I’m running windows 7 and VS2008, so I do not need to worry about .NET Framework. But I will most likely need some of the windows SDKs.

Mozilla build tools is going to install lots of stuff to “drive:\mozilla-build” (by default). Next thing I’m going to do is to set environment to use VS2008. In cmd under mozilla-build folder execute start-msvc9.bat.

C:\mozilla-build>start-msvc9.bat
"Mozilla tools directory: C:\mozilla-build\"
Windows SDK directory: C:\Program Files\Microsoft SDKs\Windows\v6.0A\
Windows SDK version: 6.0A
Setting environment for using Microsoft Visual Studio 2008 x86 tools.
Mozilla build environment: MSVC version 9.

I guess, it worked.

Next step is to get the source code. Mozilla uses HG to manage source code (you can get HG here). I’m going to get the code from the main tree:

hg clone http://hg.mozilla.org/mozilla-central/

I’m doing it over my college wireless. It’s probably not the best idea, because there is 1GB of source code data.

C:\Program Files (x86)\Mercurial>hg clone http://hg.mozilla.org/mozilla-central/
destination directory: mozilla-central
requesting all changes
adding changesets
adding manifests
transaction abort!
rollback completed
abort: connection ended unexpectedly

Thought so… So, first step should have been “look for a lan cable”.

Here is a “haiku”:

Found a LAN cable
Broadband connection is nice
Very Cold outside

Before I build I have to make sure that there is no spaces in the path to “make”. And I have to have a mozconfig file in the build directory.

mozconfig should containt the following lines:
. $topsrcdir/browser/config/mozconfig
mk_add_options MOZ_OBJDIR=@TOPSRCDIR@/objdir-ff-release
mk_add_options MOZ_MAKE_FLAGS="-j4"

So now when I have the source code all I have to do is “make -f client.mk”. Spirits of my ancestors tell me that “make” is a unix program. Here is where MozillaBuild comes into play. Under “drive:\mozilla-build”, I’m going to execute “start-msvc9.bat” to get a build console. Inside the console I’m going to execute “make -f client.mk” to start compiling firefox.

And SDK version check fails:

checking for Windows SDK being recent enough... no
configure: error: You are targeting Windows version 0x06010000, but your SDK only supports up to version 0x06000000.

It basically requires windows 7 SDK, that can be downloaded here. 3 ISO files, 1500 mb each. I will reduce the world carbon dioxide emissions by not downloading those files. Instead, I’m going to add “ac_add_options –with-windows-version=600” to mozconfig and see if it works.

I will see you after the brea… after it builds.

It failed with the following error:

cl : Command line error D8027 : cannot execute ‘c:\Program Files (x86)\Microsoft Visual Studio 9.0\VC\BIN\c2.dll’

I have another “haiku”:

Building Firefox
Installing Visual Studio SP1
Not good at all

I let VS2008 SP1 install first and re-started “make”. Now, I just need to wait for it to finish.

An hour later the build is finished. Time to test.

drive:\mozilla-build\mozilla-central\objdir-ff-release\dist\bin\firefox.exe

Welcome to Minefield

Minefield installed
It has not crashed on me
Broken Promises

Overall, it wasn’t too difficult to do “simple firefox build”. The main requirements are keyboard, monitor, and patience… and a lan cable.

After reading the article on the Academic source code dust-up symptom of CS education, I can understand Kyle’s professor position on the matter. Universities and colleges have to have a way to evaluate students’ performance in a course. Aside from exams and mid-terms, students’ performance is mostly evaluated based on their assignment and lab work (at least at the Seneca college). And since those assignments and labs, for the most part, are very specific to the subject, it makes students to do research to solve various problems they encounter.

Now, let’s say there is a solution out there, that can be copied and will work right away. A honest student wouldn’t copy it without understanding, but rather review existing solutions, apply them, and get something out of them. Another student would just copy the solution. That student hasn’t done any work and learnt nothing.

There is middle ground here. Without openly sharing complete solutions, students can discuss and share solutions to specific problems. ‘This is how I handled user sessions on my JSP website’ or ‘This is how I ported this solution to Windows’. Students can review each others work and collaborate. So that everybody learns from each others experience in a way that still allows to evaluate all students based on the work they have done in the course.