As of 2016-02-26, there will be no more posts for this blog. s/blog/pba/
Showing posts with label compilation. Show all posts

I keep my experiences on compiling in this blog post, the compilation is the standard ./configure && make. The resolutions listed here is for Fedora.

Error
checking for GTK... configure: error: GTK+-2.8 is required to compile gtk-engines
Resolution
gtk2-devel package is not installed or too old.

Error
configure: error: No C++ compiler found
Resolution
gcc-c++ package is not installed.

Error
$ make
[snip]
gcc "-Wall" "--std=c99" "-Os" "-s" -o ".pm-cache/34-1-utils" ".pm-cache/1-utils.o" ".pm-cache/2-main.o" ".pm-cache/3-lua.o" ".pm-cache/4-word.o" ".pm-cache/5-bit.o" ".pm-cache/6-screen.o" ".pm-cache/32-31-7-_prologue.o" ".pm-cache/33-dpy.o" "-lm" "-lncursesw" "-llua5.1"
/usr/bin/ld: cannot find -llua5.1
Resolution
If you are sure you have installed the library, then this is usually caused by the different naming (convention) of /usr/lib[64]/*.so on different distributions or you are compiling on x86_64 but the compiling script find the wrong directory for *.so and can't find a such name (If found, the error message should be about ELF Class is not compitable). You may need to open Makefile and change -llua5.1 to -llua whereever you find.

I created a new blog on WordPress.com, then I felt the dashboard is really really slow. I hoped the Google Gears can improve speed a lot.

Checkout from repository
$ svn checkout http://gears.googlecode.com/svn/trunk/ gears-read-only
$ cd gears-read-only

Patching

There is an patch in this comment. However this patch would not work with more efforts, because it still use the Gecko comes with repository and that Gecko in subversion has 32-bit binary stuff, we need the 64-bit binary of Gecko (aka. XULRunner), you can install it on Fedora using yum install xulrunner-devel.x86_64.

My patch for r3234 (include exact same patch from that comment and comment out line 1195 of gears/tools/rules.mk) for Fedora 10 x86_64 can be downloaded in my comment on that issue.

You can patch by running
patch -p0 < r3234-64bit.patch

Copying 64-bit binary

Starting building process by running
cd gears
make BROWSER=FF3

The process will be stopped with the following error message:
/usr/bin/ld: skipping incompatible ../third_party/gecko_1.9/linux/gecko_sdk/lib/libxpcom.so when searching for -lxpcom
/usr/bin/ld: cannot find -lxpcom
collect2: ld returned 1 exit status
make[1]: *** [bin-opt/linux-x86_64/ff3/libgears.so] Error 1
make: *** [default] Error 2
 [ 2 ] livibetter@dfed ~/var/src/gea/gears > file ../third_party/gecko_1.9/linux/gecko_sdk/lib/libxpcom.so
../third_party/gecko_1.9/linux/gecko_sdk/lib/libxpcom.so: ELF 32-bit LSB shared object, Intel 80386, version 1 (SYSV), dynamically linked, not stripped

Now we need to do the follows:
cp /usr/lib64/xulrunner-sdk-1.9/sdk/lib/libxpcom.so ../third_party/gecko_1.9/linux/gecko_sdk/lib/libxpcom.so
cp /usr/lib64/xulrunner-sdk-1.9/sdk/lib/libxpcomglue_s.a ../third_party/gecko_1.9/linux/gecko_sdk/lib/libxpcomglue_s.a
cp /usr/lib64/xulrunner-sdk-1.9/sdk/lib/libxul.so ../third_party/gecko_1.9/linux/gecko_sdk/lib/libxul.so
cp /usr/lib64/xulrunner-1.9/xpt_link ../third_party/gecko_1.9/linux/gecko_sdk/bin/xpt_link
chmod +x ../third_party/gecko_1.9/linux/gecko_sdk/bin/xpt_link

Build again, you should have no problem this time.

Packaging XPI installer

Packing can be done by running
make installers

The XPI should be generated under gears/bin-opt/installers.

You can download it here.

Testing

There are few demos that you can try out. I got no errors when ran them.

I thought I needed to do some tricks in order to put them all together, but it turns out none is needed. The following is cited from README:

Installing multiple versions
----------------------------

On Unix and Mac systems if you intend to install multiple versions of Python
using the same installation prefix (--prefix argument to the configure
script) you must take care that your primary python executable is not
overwritten by the installation of a different versio.  All files and
directories installed using "make altinstall" contain the major and minor
version and can thus live side-by-side.  "make install" also creates
${prefix}/bin/python which refers to ${prefix}/bin/pythonX.Y.  If you intend
to install multiple versions using the same prefix you must decide which
version (if any) is your "primary" version.  Install that version using
"make install".  Install all other versions using "make altinstall".

For example, if you want to install Python 2.5, 2.6 and 3.0 with 2.6 being
the primary version, you would execute "make install" in your 2.6 build
directory and "make altinstall" in the others.

All I did is:
./configure --prefix=/usr
make
su -c "make altinstall"
for both Python 2.6.1 and Python 3.0.

Since Python 3.0 is compatible with current any Python programs, never make install Python 3.0 unless you are 100% sure your system doesn't use Python scripts for system maintenance. On Fedora, Yum is very important Python script. If you have done, rpm and Koji are your savers.

As you can see on Koji, Python 2.6 seems to be the primary version on Fedora 11.

When I make 2.6, there are few bits missing:
Failed to find the necessary bits to build these modules:
bsddb185           dl                 imageop
sunaudiodev
To find the necessary bits, look in setup.py in detect_modules() for the module's name.

After checked the setup.py, I think they are not necessary on my system.