Building Release Binaries

Jeff Kaufman edited this page Mar 4, 2016 · 28 revisions

The psol/ directory includes just the parts of mod_pagespeed that ports need in order to build. By preparing it for people we can let others build with a much simpler flow.

First we build binaries. We want to build these on a linux system running a toolchain at least as old as any we might want to distribute to. A CentOS 5 VM is good here, because that's going to be running GCC 4.1. We want both 32 and 64 bit binaries, so you need two VMs or a chroot.

On each VM, build PSOL from source stopping once you have pagespeed_automatic.a. Check if you have a Release version of pagespeed_automatic.a available from creating the release in the first place:

find . -name pagespeed_automatic.a -ls

If not, build specifying BUILDTYPE=Release. If you do, you can proceed to the next step, but you'll probably need to come back here to build the Debug version later.

Now the two VMs have all the Release binaries built. Copy them down to your system:

scp hostname-32-bit:mod_pagespeed/src/pagespeed_automatic.a \
   /path/to/your/new/psol/lib/Release/linux/ia32/
scp hostname-64-bit:mod_pagespeed/src/pagespeed_automatic.a \
   /path/to/your/new/psol/lib/Release/linux/x64/

Then on each VM, start over to make Debug builds. This is:

$ cd ~/mod_pagespeed/src/pagespeed/automatic
$ make clean
$ cd ~/mod_pagespeed/src

Then run make again, as in the build doc, but with BUILDTYPE=Debug. Continue with the doc from there, and when you build in pagespeed/automatic you should also use a BUILDTYPE=Debug argument with make all.

Run the same scps again, this time to lib/Debug/....

At this point psol/lib is built. To build psol/include, run:

mod_pagespeed/src/include VERSION /path/to/psol/

Now we need to test that our new psol directory works. If there isn't already a branch for tracking this release, make one and get it building against this svn tag. Then on both the 64 bit and 32 bit VMs build nginx following the installation instructions, using the release-tracking branch and the psol/ you built. Make sure it passes tests. Then repeat the building from the ./configure step, this time specifying --with-debug to make sure that the debug binaries are good too.