summaryrefslogtreecommitdiffstats
path: root/source.local/l/openjdk/fix_seamonkey_pkgconfig.sh
blob: 671d227b0bd90be59cf77bf27d68f3de49f1e9db (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
#!/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 <alien@slackware.com> 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 <<EOT > /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