It is currently not my best interest to figure out how to compile Chrome from scratch (they appear to be using some gclient custom build tools). However, the precompiled binary snapshots require more recent versions of FreeType, Gtk+, and NSS (network security service, as part of Mozilla) than that available on BU Linux (which is a RHEL/CentOS 5 derivative).
Compiling Gtk+ is a nightmare because of the sheer number of dependencies. Here I'm listing the packages I need. The listing format is "target: dependencies"
- gtk+: atk glib cairo pango jasper fontconfig
- pango: cairo freetype glib
- cairo: libpng freetype pixman fontconfig
- fontconfig: freetype
- atk: glib
- glib:
- libpng:
- freetype:
- pixman:
- jasper:
- PREFIX := ... # you pick a convenient location
- export CFLAGS := ... # you pick the compilation options, e.g. -march=i686 -O3
- export CPPFLAGS := -I$(PREFIX)/include
- export LDFLAGS := -L$(PREFIX)/lib
- export PKG_CONFIG_LIBDIR := $(PREFIX)/lib/pkgconfig
- export PATH := $(PREFIX)/bin:$(PATH)
- export LD_LIBRARY_PATH := $(PREFIX)/lib
I also wrote a script to essentially do the following. This will be left as an exercise to the reader.
- Given a target name like gtk+, locate the source package tar.gz and unpack it.
- Make a new object files directory and run the configure script there as the current working directory. If the build fails, you can just remove the object directory to get a clean slate, instead of needing to unpack the source files again.
- Do the traditional make and make install.
- Touch the target as a file, so make doesn't have to repeat building and installing a target if it already succeeded.
# Assuming the build script is called build.sh in the current directory. BUILD := ./build.sh
gtk+: export LDFLAGS := -lm # for jasper gtk+: atk glib cairo pango jasper fontconfig $(BUILD) $@On the other hand, NSS has its own build instruction, so I did it manually. The resulting nss shared objects must be symlinked in a particular way:
- Add ".1d" suffix: libnss3, libnssutil3, libsmime3, libssl3.
- Add ".0d" suffix: libplds4, libplc4, libnspr4.
I also compiled my own gcc 4.3/4.4, and without a recent gcc and libstdc++.so.6, you will get a dynamic linking error with the symbol GLIBCXX_X_Y_Z.
No comments:
Post a Comment