[981dbbc] | 1 | #!/bin/bash |
---|
| 2 | |
---|
| 3 | # --------------------------------------------------------------------------- |
---|
| 4 | # This script fixes the seamonkye-plugin.pc file and adds libxul.pc. |
---|
| 5 | # These changes enable the compilation of OpenJDK and its browser plugin. |
---|
| 6 | # It will probably also be beneficial to the compilation of browser plugins |
---|
| 7 | # in general. |
---|
| 8 | # |
---|
| 9 | # Author: Eric Hameleers <alien@slackware.com> December 2011 |
---|
| 10 | # --------------------------------------------------------------------------- |
---|
| 11 | |
---|
| 12 | # Automatically determine the architecture we're building on: |
---|
| 13 | if [ -z "$ARCH" ]; then |
---|
| 14 | case "$( uname -m )" in |
---|
| 15 | i?86) export ARCH=i486 ;; |
---|
| 16 | arm*) export ARCH=arm ;; |
---|
| 17 | # Unless $ARCH is already set, use uname -m for all other archs: |
---|
| 18 | *) export ARCH=$( uname -m ) ;; |
---|
| 19 | esac |
---|
| 20 | fi |
---|
| 21 | |
---|
| 22 | if [ "$ARCH" = "x86_64" ]; then |
---|
| 23 | LIBDIRSUFFIX="64" |
---|
| 24 | else |
---|
| 25 | LIBDIRSUFFIX="" |
---|
| 26 | fi |
---|
| 27 | |
---|
| 28 | # Fix the seamonkey-plugin.pc file: |
---|
| 29 | sed -i -e '/^Cflags: /s, -I${includedir}/java -I${includedir}/plugin, -I${includedir} -DXP_UNIX,' /usr/lib${LIBDIRSUFFIX}/pkgconfig/seamonkey-plugin.pc |
---|
| 30 | |
---|
| 31 | # Add a libxul.pc file if needed: |
---|
| 32 | if [ ! -f /usr/lib${LIBDIRSUFFIX}/pkgconfig/libxul.pc ]; then |
---|
| 33 | SEAMONKEY=$(echo /usr/lib${LIBDIRSUFFIX}/seamonkey-* | tail -1 | cut -f2 -d-) |
---|
| 34 | cat <<EOT > /usr/lib${LIBDIRSUFFIX}/pkgconfig/libxul.pc |
---|
| 35 | prefix=/usr |
---|
| 36 | libdir=/usr/lib${LIBDIRSUFFIX}/seamonkey-$SEAMONKEY |
---|
| 37 | includedir=/usr/include/seamonkey-$SEAMONKEY |
---|
| 38 | idldir=/usr/share/idl/seamonkey-$SEAMONKEY |
---|
| 39 | |
---|
| 40 | Name: libxul |
---|
| 41 | Description: The Mozilla Runtime and Embedding Engine |
---|
| 42 | Version: $SEAMONKEY |
---|
| 43 | Requires: seamonkey-nspr >= 4.7.1 |
---|
| 44 | Libs: -L\${libdir} -lxul -lxpcom |
---|
| 45 | Cflags: -I\${includedir} -fshort-wchar |
---|
| 46 | EOT |
---|
| 47 | fi |
---|
| 48 | |
---|