summaryrefslogtreecommitdiff
path: root/classes/java.bbclass
blob: 17f833ce3d04e3602bef5fc347dccf0891fef364 (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
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
# Defines the commonly used target directories and provides a convenience
# function to install jar files.
#
# All the default directory locations herein resemble locations chosen in
# the Debian distribution.

# Jar location on target
datadir_java ?= ${datadir}/java

# JNI library location on target
libdir_jni ?= ${libdir}/jni

# JVM bundle location on target
libdir_jvm ?= ${libdir}/jvm

STAGING_DATADIR_JAVA ?= ${STAGING_DATADIR}/java
STAGING_LIBDIR_JNI ?= ${STAGING_LIBDIR}/jni
STAGING_LIBDIR_JVM ?= ${STAGING_LIBDIR}/jvm

oe_jarinstall() {
  # Purpose: Install a jar file and create all the given symlinks to it.
  # Example:
  # oe_jarinstall foo-1.3.jar foo.jar
  # Installs foo-1.3.jar and creates symlink foo.jar.
  #
  # oe_jarinstall -s foo-1.3.jar foo.jar
  # Installs foo-1.3.jar to staging and creates symlink foo.jar.
  #
  # oe_jarinstall -r foo-1.3.jar foo_1_3.jar foo.jar
  # Installs foo_1_3.jar as foo-1.3.jar and creates a symlink to this.
  #
  dir=${D}${datadir_java}
  destname=""
  while [ "$#" -gt 0 ]; do
    case "$1" in
    -s)
      dir=${STAGING_DATADIR_JAVA}
      ;;
    -r)
      shift
      destname=$1
      ;;
    -*)
      oefatal "oe_jarinstall: unknown option: $1"
      ;;
    *)
      break;
      ;;
    esac
    shift
  done

  jarname=$1
  destname=${destname:-`basename $jarname`}
  shift

  install -d $dir
  install -m 0644 $jarname $dir/$destname

  # Creates symlinks out of the remaining arguments.
  while [ "$#" -gt 0 ]; do
    if [ -e $dir/$1 ]; then
      oewarn "file was in the way. removing:" $dir/$1
      rm $dir/$1
    fi
    ln -s $destname $dir/$1
    shift
  done
}

oe_makeclasspath() {
  # Purpose: Generate a classpath variable from the given Jar file names
  # where the ".jar" has been omitted.
  #
  # oe_makeclasspath foo baz bar
  # Prints ${datadir_java}/foo.jar:${datadir_java}/baz.jar:${datadir_java}/bar.jar
  #
  # oe_makeclasspath -s foo baz bar
  # Prints ${STAGING_DATADIR_JAVA}/foo.jar:${STAGING_DATADIR_JAVA}/baz.jar:${STAGING_DATADIR_JAVA}/bar.jar
  #
  # Provide the -s at the beginning otherwise strange things happen.
  #
  dir=${datadir_java}
	classpath=
	delimiter=

  while [ "$#" -gt 0 ]; do
    case "$1" in
    -s)
      dir=${STAGING_DATADIR_JAVA}
      ;;
    -*)
      oefatal "oe_makeclasspath: unknown option: $1"
      ;;
    *)
      classpath=$classpath$delimiter$dir/$1.jar
      delimiter=":"
      ;;
    esac
    shift
  done

	echo $classpath
}

# Creates a simple wrapper script for your Java program.
# The script is written to ${PN} by default. 
#
# Parameters are as follows:
# [options] <output file> <main class> [jar files ...]
#
# Options are
# -o <name> where name is the output file name
#
# It can only take jar files from ${datadir_java}!
oe_java_simple_wrapper() {
  delimiter=
  mainclass=
  classpath=
  output=${PN}

  while [ "$#" -gt 0 ]; do
    case "$1" in
    -o)
      shift
      output=$1
      ;;
    -*)
      oefatal "oe_java_simple_wrapper: unknown option: $1"
      ;;
    *)
      if [ $mainclass ]
      then
        classpath=$classpath$delimiter${datadir_java}/$1
        delimiter=":"
      else
        mainclass=$1
      fi
      ;;
    esac
    shift
  done

  oenote "Creating simple Java wrapper script"
  oenote "Output File: $output"
  oenote "Main Class: $mainclass"
  oenote "Classpath: $classpath"

  echo "#!/bin/sh" > $output
  echo "# This file is autogenerated by the oe_java_simple_wrapper function of OpenEmbedded" >> $output
  echo >> $output
  echo "# You can provide additional VM arguments by setting the VMARGS environment variable." >> $output
  echo "CLASSPATH_ARG=\"-cp $classpath\"" >> $output
  echo >> $output
  echo "MAIN_CLASS=$mainclass" >> $output
  echo >> $output
  echo "# Allows overriding the VM by setting the JAVA environment variable." >> $output
  echo "if [ x\${JAVA} = x ]" >> $output
  echo "then" >> $output
  echo "  JAVA=java" >> $output
  echo "fi" >> $output
  echo >> $output
  echo "exec \${JAVA} \${VMARGS} \${CLASSPATH_ARG} \${MAIN_CLASS} \${@}" >> $output
}
kbits.net/openembedded into bkbits.net:/repos/n/nslu2-linux/openembedded 2005/03/24 20:29:38-05:00 handhelds.org!kergoth Add unionfs version 1.0.11. 2005/03/25 09:16:21+10:30 (none)!rwhitby Fixed the nsswitch.conf for Unslung 2005/03/25 07:38:46+10:30 (none)!rwhitby Merge bk://nslu2-linux@nslu2-linux.bkbits.net/openembedded into home.(none):/home/bitbake/openembedded 2005/03/25 07:38:18+10:30 (none)!rwhitby Added /etc/nsswitch.conf to Unslung rootfs 2005/03/24 12:41:31-08:00 bkbits.net!nslu2-linux.adm Merge bk://oe-devel.bkbits.net/openembedded into bkbits.net:/repos/n/nslu2-linux/openembedded 2005/03/24 21:04:24+01:00 zeckescompany.nl!alwin Merge bk://oe-devel@oe-devel.bkbits.net/openembedded into zeckescompany.nl:/home/ral/progs/Zaurus/oe/openembedded 2005/03/24 21:04:07+01:00 zeckescompany.nl!alwin fixed typo in base-files/c7x0/fstab 2005/03/24 10:41:32-08:00 bkbits.net!nslu2-linux.adm Merge bk://oe-devel.bkbits.net/openembedded into bkbits.net:/repos/n/nslu2-linux/openembedded 2005/03/24 19:07:47+01:00 utwente.nl!koen x11_cvs.bb: add threads.patch 2005/03/24 02:41:28-08:00 bkbits.net!nslu2-linux.adm Merge bk://oe-devel.bkbits.net/openembedded into bkbits.net:/repos/n/nslu2-linux/openembedded 2005/03/24 11:12:07+01:00 uni-frankfurt.de!mickeyl base.bbclass: add function base_conditional that serves as an equivalent of the '?' operator in C. this is very handy to simplify some constructs in our .bb files, i.e. appending things based on if a variable has a certain value or not. Example Use: SRC_URI_append = '{base_conditional(DISTRO_TYPE,debug,file://allow-root-pw.patch,'',d)}' 2005/03/24 11:01:31+01:00 uni-frankfurt.de!mickeyl bump timezones to 1.2.0 2005/03/24 01:41:28-08:00 bkbits.net!nslu2-linux.adm Merge bk://oe-devel.bkbits.net/openembedded into bkbits.net:/repos/n/nslu2-linux/openembedded 2005/03/24 10:17:49+01:00 handhelds.org!CoreDump Just a test, no changes 2005/03/23 17:41:24-08:00 bkbits.net!nslu2-linux.adm Merge bk://oe-devel.bkbits.net/openembedded into bkbits.net:/repos/n/nslu2-linux/openembedded 2005/03/24 01:59:38+01:00 handhelds.org!zecke Libopie2 Visibility changes: -There is no difference between 1.2.0 and cvs in regards to visibility -Quote the string inside the message -Remove include-cvs.pro as it is not needed anymore 2005/03/23 16:41:34-08:00 bkbits.net!nslu2-linux.adm Merge bk://oe-devel.bkbits.net/openembedded into bkbits.net:/repos/n/nslu2-linux/openembedded 2005/03/24 00:45:36+01:00 handhelds.org!zecke Merge bk://oe-devel@oe-devel.bkbits.net/openembedded into handhelds.org:/home/ich/programming/oe/opie_move 2005/03/24 00:44:26+01:00 handhelds.org!zecke Opie 1.1.9 -> 1.2.0: -increment PV on the _cvs.bb files -remove PR from the .bb files 2005/03/23 15:41:25-08:00 bkbits.net!nslu2-linux.adm Merge bk://oe-devel.bkbits.net/openembedded into bkbits.net:/repos/n/nslu2-linux/openembedded 2005/03/24 00:37:00+01:00 handhelds.org!zecke Opie 1.1.9 -> 1.2.0: Update courtsey python and kergoths super cow power über sed skills -mv 1.1.9.bb to 1.2.0.bb -remove PR fromm 1.2.0.bb and _cvs.bb -bump PV in the _cvs.bb 2005/03/24 00:31:44+01:00 zeckescompany.nl!alwin corrected corgikeymap BKrev: 42459626c9gSuz7RwCyChCjKFbynfA 2005-02-03upgrade PV for opie_cvs packagesMichael Lauer1 BKrev: 42022a37vRUPjWB_dcfXY1LBxEnxDg 2005-02-02compute TAG line in opie.bbclass instead of in (all) opie filesMichael Lauer1 BKrev: 42014f09KAfHSQPBUOyP1omr2yGkzA 2005-02-02Merge bk://oe-devel@oe-devel.bkbits.net/openembeddedMichael Lauer1 into r2d2.tm.informatik.uni-frankfurt.de:/local/pkg/oe/packages 2005/02/02 22:44:37+01:00 handhelds.org!zecke Merge bk://oe-devel@oe-devel.bkbits.net/openembedded into handhelds.org:/home/ich/programming/oe/opemembedded-i18n 2005/02/02 22:43:34+01:00 handhelds.org!zecke Opie 1.1.9 will be tagged soon, update the .bb files to use 1.1.9 now BKrev: 42014b5fonMJIdtk9cHQS5Dw2tcXUA 2004-12-27Merge bk://oe-devel.bkbits.net/openembeddednslu2-linux.adm@bkbits.net1 into bkbits.net:/repos/n/nslu2-linux/openembedded 2004/12/27 14:28:28+01:00 dyndns.org!reenoo Merge oe-devel@oe-devel.bkbits.net:openembedded into sugarcube.dyndns.org:/home2/oe/bakery/openembedded 2004/12/27 14:28:11+01:00 dyndns.org!reenoo vlc-gpe: fix FILES. package .desktop file. 2004/12/27 14:00:41+01:00 uni-frankfurt.de!mickeyl opie cvs stuff is now 1.1.8+cvs- 2004/12/27 13:53:14+01:00 uni-frankfurt.de!mickeyl openzaurus 3.5.3 uses opie 1.1.8 and qte 2.3.9 BKrev: 41d010dc7G8fBE-Qnk0n_kXXQwxqPw 2004-12-26Merge bk://oe-devel.bkbits.net/openembeddednslu2-linux.adm@bkbits.net1 into bkbits.net:/repos/n/nslu2-linux/openembedded 2004/12/26 19:26:25+01:00 handhelds.org!zecke Merge bk://oe-devel@oe-devel.bkbits.net/openembedded into handhelds.org:/home/ich/programming/oe/openembedded-opie-rename 2004/12/26 19:25:50+01:00 handhelds.org!zecke Move an included and versioned file 2004/12/26 19:17:32+01:00 handhelds.org!zecke Opie 1.1.8 release: Upgrade Opie Packages from 1.1.7 to 1.1.8 2004/12/26 19:05:14+01:00 (none)!br1 addedd pmacct - promiscuous mode ip accounting BKrev: 41cf058esJl_2uQnVFP-1srwoKz54w 2004-12-09Merge oe-devel@oe-devel.bkbits.net:openembeddedChris Larson2 into hyperion.kergoth.com:/home/kergoth/code/openembedded 2004/12/09 03:39:39-06:00 kergoth.com!kergoth Break people's builds again.. this time moving the packages into a packages/ subdir to clean things up a bit. BKrev: 41b81f3dvlp3rU7_8MUXLcI8LDdDoA