#!/bin/bash # --------------------------------------------------------------------------- # This script fixes the seamonkye-plugin.pc file and adds libxul.pc. # These changes enable the compilation of OpenJDK and its browser plugin. # It will probably also be beneficial to the compilation of browser plugins # in general. # # Author: Eric Hameleers December 2011 # --------------------------------------------------------------------------- # Automatically determine the architecture we're building on: if [ -z "$ARCH" ]; then case "$( uname -m )" in i?86) export ARCH=i486 ;; arm*) export ARCH=arm ;; # Unless $ARCH is already set, use uname -m for all other archs: *) export ARCH=$( uname -m ) ;; esac fi if [ "$ARCH" = "x86_64" ]; then LIBDIRSUFFIX="64" else LIBDIRSUFFIX="" fi # Fix the seamonkey-plugin.pc file: sed -i -e '/^Cflags: /s, -I${includedir}/java -I${includedir}/plugin, -I${includedir} -DXP_UNIX,' /usr/lib${LIBDIRSUFFIX}/pkgconfig/seamonkey-plugin.pc # Add a libxul.pc file if needed: if [ ! -f /usr/lib${LIBDIRSUFFIX}/pkgconfig/libxul.pc ]; then SEAMONKEY=$(echo /usr/lib${LIBDIRSUFFIX}/seamonkey-* | tail -1 | cut -f2 -d-) cat < /usr/lib${LIBDIRSUFFIX}/pkgconfig/libxul.pc prefix=/usr libdir=/usr/lib${LIBDIRSUFFIX}/seamonkey-$SEAMONKEY includedir=/usr/include/seamonkey-$SEAMONKEY idldir=/usr/share/idl/seamonkey-$SEAMONKEY Name: libxul Description: The Mozilla Runtime and Embedding Engine Version: $SEAMONKEY Requires: seamonkey-nspr >= 4.7.1 Libs: -L\${libdir} -lxul -lxpcom Cflags: -I\${includedir} -fshort-wchar EOT fi