summaryrefslogtreecommitdiffstats
path: root/meta/recipes-devtools/icecc-create-env
diff options
context:
space:
mode:
authorDmitry Eremin-Solenikov <dbaryshkov@gmail.com>2011-09-23 23:46:37 +0400
committerRichard Purdie <richard.purdie@linuxfoundation.org>2011-09-28 14:58:47 +0100
commit62ea046099c9220a3b08b0898e26104da76614fe (patch)
tree5307aa739a9a66f9909ae80cf683a45c2afb9eb1 /meta/recipes-devtools/icecc-create-env
parent82785064ac9059da83aa657b9ed8f8ff4a488ef8 (diff)
downloadpoky-62ea046099c9220a3b08b0898e26104da76614fe.tar.gz
icecc-create-env-native: provide the script right in the tree
There is no point in downloading a tarball with no clear upstream (other than icecc itself) and then patching it. Rather put new script in the source tree. (From OE-Core rev: 409fa8ca4d37ad407faaa2a8935e9d2bb89776c9) Signed-off-by: Dmitry Eremin-Solenikov <dbaryshkov@gmail.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta/recipes-devtools/icecc-create-env')
-rwxr-xr-xmeta/recipes-devtools/icecc-create-env/icecc-create-env-native/icecc-create-env192
-rw-r--r--meta/recipes-devtools/icecc-create-env/icecc-create-env-native/icecc-lto-update.patch103
-rw-r--r--meta/recipes-devtools/icecc-create-env/icecc-create-env-native_0.1.bb8
3 files changed, 194 insertions, 109 deletions
diff --git a/meta/recipes-devtools/icecc-create-env/icecc-create-env-native/icecc-create-env b/meta/recipes-devtools/icecc-create-env/icecc-create-env-native/icecc-create-env
new file mode 100755
index 0000000000..7e4dbc414e
--- /dev/null
+++ b/meta/recipes-devtools/icecc-create-env/icecc-create-env-native/icecc-create-env
@@ -0,0 +1,192 @@
1#! /usr/bin/env bash
2# icecc -- A simple distributed compiler system
3#
4# Copyright (C) 2004 by the Icecream Authors
5# GPL
6
7target_files=
8
9is_contained ()
10{
11 case " $target_files " in
12 *" $1 "* ) return 0 ;;
13 *"=$1 "* ) return 0;;
14 * ) return 1 ;;
15 esac
16}
17
18add_file ()
19{
20 local name="$1"
21 local path="$1";
22 if test -n "$2"; then
23 name="$2"
24 fi
25 test -z "$name" && return
26 # ls -H isn't really the same as readlink, but
27 # readlink is not portable enough.
28 path=`ls -H $path`
29 toadd="$name=$path"
30 is_contained "$toadd" && return
31 if test -z "$silent"; then
32 echo "adding file $toadd"
33 fi
34 target_files="$target_files $toadd"
35 if test -x "$path"; then
36 # Only call ldd when it makes sense
37 if file -L "$path" | grep 'ELF' > /dev/null 2>&1; then
38 if ! file -L "$path" | grep 'static' > /dev/null 2>&1; then
39 # ldd now outputs ld as /lib/ld-linux.so.xx on current nptl based glibc
40 # this regexp parse the outputs like:
41 # ldd /usr/bin/gcc
42 # linux-gate.so.1 => (0xffffe000)
43 # libc.so.6 => /lib/tls/libc.so.6 (0xb7e81000)
44 # /lib/ld-linux.so.2 (0xb7fe8000)
45 # covering both situations ( with => and without )
46 for lib in `ldd "$path" | sed -n 's,^[^/]*\(/[^ ]*\).*,\1,p'`; do
47 test -f "$lib" || continue
48 # Check wether the same library also exists in the parent directory,
49 # and prefer that on the assumption that it is a more generic one.
50 local baselib=`echo "$lib" | sed 's,\(/[^/]*\)/.*\(/[^/]*\)$,\1\2,'`
51 test -f "$baselib" && lib=$baselib
52 add_file "$lib"
53 done
54 fi
55 fi
56 fi
57}
58
59# backward compat
60if test "$1" = "--respect-path"; then
61 shift
62fi
63
64#add a --silent switch to avoid "broken pipe" errors when calling this scipt from within OE
65if test "$1" = "--silent"; then
66 silent=1
67 shift
68fi
69
70
71added_gcc=$1
72shift
73added_gxx=$1
74shift
75added_as=$1
76shift
77archive_name=$1
78
79if test -z "$added_gcc" || test -z "$added_gxx" ; then
80 echo "usage: $0 <gcc_path> <g++_path>"
81 exit 1
82fi
83
84if ! test -x "$added_gcc" ; then
85 echo "'$added_gcc' is no executable."
86 exit 1
87fi
88
89if ! test -x "$added_gxx" ; then
90 echo "'$added_gcc' is no executable."
91 exit 1
92fi
93
94
95
96add_file $added_gcc /usr/bin/gcc
97add_file $added_gxx /usr/bin/g++
98
99if test -z "$added_as" ; then
100 add_file /usr/bin/as /usr/bin/as
101else
102 if ! test -x "$added_as" ; then
103 echo "'$added_as' is no executable."
104 exit 1
105 fi
106
107 add_file $added_as /usr/bin/as
108fi
109
110add_file `$added_gcc -print-prog-name=cc1` /usr/bin/cc1
111add_file `$added_gxx -print-prog-name=cc1plus` /usr/bin/cc1plus
112specfile=`$added_gcc -print-file-name=specs`
113if test -n "$specfile" && test -e "$specfile"; then
114 add_file "$specfile"
115fi
116
117ltofile=`$added_gcc -print-prog-name=lto1`
118pluginfile="${ltofile%lto1}liblto_plugin.so"
119if test -r "$pluginfile"
120then
121 add_file $pluginfile ${pluginfile#*usr}
122 add_file $pluginfile /usr${pluginfile#*usr}
123fi
124
125tempdir=`mktemp -d /tmp/iceccenvXXXXXX`
126new_target_files=
127for i in $target_files; do
128 case $i in
129 *=/*)
130 target=`echo $i | cut -d= -f1`
131 path=`echo $i | cut -d= -f2`
132 ;;
133 *)
134 path=$i
135 target=$i
136 ;;
137 esac
138 mkdir -p $tempdir/`dirname $target`
139 cp -p $path $tempdir/$target
140 if test -f $tempdir/$target -a -x $tempdir/$target; then
141 strip -s $tempdir/$target 2>/dev/null
142 fi
143 target=`echo $target | cut -b2-`
144 new_target_files="$new_target_files $target"
145done
146
147#sort the files
148target_files=`for i in $new_target_files; do echo $i; done | sort`
149
150#test if an archive name was supplied
151#if not use the md5 of all files as the archive name
152if test -z "$archive_name"; then
153 md5sum=NONE
154 for file in /usr/bin/md5sum /bin/md5 /usr/bin/md5; do
155 if test -x $file; then
156 md5sum=$file
157 break
158 fi
159 done
160
161 #calculate md5 and use it as the archive name
162 archive_name=`for i in $target_files; do test -f $tempdir/$i && $md5sum $tempdir/$i; done | sed -e 's/ .*$//' | $md5sum | sed -e 's/ .*$//'`.tar.gz || {
163 if test -z "$silent"; then
164 echo "Couldn't compute MD5 sum."
165 fi
166 exit 2
167 }
168 mydir=`pwd`
169else
170 mydir="`dirname "$archive_name"`"
171
172 #check if we have a full path or only a filename
173 if test "$mydir" = "." ; then
174 mydir=`pwd`
175 else
176 mydir=""
177 fi
178fi
179
180if test -z "$silent"; then
181echo "creating $archive_name"
182fi
183
184cd $tempdir
185tar -czhf "$mydir/$archive_name" $target_files || {
186 if test -z "$silent"; then
187 echo "Couldn't create archive"
188 fi
189 exit 3
190}
191cd ..
192rm -rf $tempdir
diff --git a/meta/recipes-devtools/icecc-create-env/icecc-create-env-native/icecc-lto-update.patch b/meta/recipes-devtools/icecc-create-env/icecc-create-env-native/icecc-lto-update.patch
deleted file mode 100644
index a7af2e3a98..0000000000
--- a/meta/recipes-devtools/icecc-create-env/icecc-create-env-native/icecc-lto-update.patch
+++ /dev/null
@@ -1,103 +0,0 @@
1--- a/icecc-create-env 2006-12-14 09:50:46.000000000 +0300
2+++ b/icecc-create-env 2011-08-31 17:52:45.000000000 +0400
3@@ -27,9 +27,6 @@
4 # readlink is not portable enough.
5 path=`ls -H $path`
6 toadd="$name=$path"
7- if test "$name" = "$path"; then
8- toadd=$path
9- fi
10 is_contained "$toadd" && return
11 if test -z "$silent"; then
12 echo "adding file $toadd"
13@@ -117,6 +114,14 @@
14 add_file "$specfile"
15 fi
16
17+ltofile=`$added_gcc -print-prog-name=lto1`
18+pluginfile="${ltofile%lto1}liblto_plugin.so"
19+if test -r "$pluginfile"
20+then
21+ add_file $pluginfile ${pluginfile#*usr}
22+ add_file $pluginfile /usr${pluginfile#*usr}
23+fi
24+
25 tempdir=`mktemp -d /tmp/iceccenvXXXXXX`
26 new_target_files=
27 for i in $target_files; do
28@@ -140,49 +147,44 @@
29 done
30
31 #sort the files
32- target_files=`for i in $new_target_files; do echo $i; done | sort`
33+target_files=`for i in $new_target_files; do echo $i; done | sort`
34
35 #test if an archive name was supplied
36 #if not use the md5 of all files as the archive name
37 if test -z "$archive_name"; then
38-md5sum=NONE
39-for file in /usr/bin/md5sum /bin/md5 /usr/bin/md5; do
40- if test -x $file; then
41- md5sum=$file
42- break
43- fi
44-done
45+ md5sum=NONE
46+ for file in /usr/bin/md5sum /bin/md5 /usr/bin/md5; do
47+ if test -x $file; then
48+ md5sum=$file
49+ break
50+ fi
51+ done
52
53-#calculate md5 and use it as the archive name
54-archive_name=`for i in $target_files; do $md5sum $tempdir/$i; done | sed -e 's/ .*$//' | $md5sum | sed -e 's/ .*$//'` || {
55- if test -z "$silent"; then
56- echo "Couldn't compute MD5 sum."
57+ #calculate md5 and use it as the archive name
58+ archive_name=`for i in $target_files; do test -f $tempdir/$i && $md5sum $tempdir/$i; done | sed -e 's/ .*$//' | $md5sum | sed -e 's/ .*$//'`.tar.gz || {
59+ if test -z "$silent"; then
60+ echo "Couldn't compute MD5 sum."
61+ fi
62+ exit 2
63+ }
64+ mydir=`pwd`
65+else
66+ mydir="`dirname "$archive_name"`"
67+
68+ #check if we have a full path or only a filename
69+ if test "$mydir" = "." ; then
70+ mydir=`pwd`
71+ else
72+ mydir=""
73 fi
74- exit 2
75-}
76-
77 fi
78
79 if test -z "$silent"; then
80-echo "creating $archive_name.tar.gz"
81+echo "creating $archive_name"
82 fi
83
84-if test -z "$archive_name"; then
85- mydir=`pwd`
86-else
87-# mydir=dirname ${archive_name}
88- mydir=${archive_name%/*}
89-
90-#check if we have a full path or only a filename
91- if test -z "$mydir"; then
92- mydir=`pwd`
93- else
94- mydir=""
95- fi
96-
97-fi
98 cd $tempdir
99-tar -czhf "$mydir/$archive_name".tar.gz $target_files || {
100+tar -czhf "$mydir/$archive_name" $target_files || {
101 if test -z "$silent"; then
102 echo "Couldn't create archive"
103 fi
diff --git a/meta/recipes-devtools/icecc-create-env/icecc-create-env-native_0.1.bb b/meta/recipes-devtools/icecc-create-env/icecc-create-env-native_0.1.bb
index 9a440baccf..621384387b 100644
--- a/meta/recipes-devtools/icecc-create-env/icecc-create-env-native_0.1.bb
+++ b/meta/recipes-devtools/icecc-create-env/icecc-create-env-native_0.1.bb
@@ -7,7 +7,7 @@ PRIORITY = "optional"
7LICENSE = "GPLv2+" 7LICENSE = "GPLv2+"
8LIC_FILES_CHKSUM = "file://icecc-create-env;beginline=2;endline=5;md5=ae1df3d6a058bfda40b66094c5f6065f" 8LIC_FILES_CHKSUM = "file://icecc-create-env;beginline=2;endline=5;md5=ae1df3d6a058bfda40b66094c5f6065f"
9 9
10PR = "r1" 10PR = "r2"
11 11
12DEPENDS = "" 12DEPENDS = ""
13INHIBIT_DEFAULT_DEPS = "1" 13INHIBIT_DEFAULT_DEPS = "1"
@@ -15,8 +15,7 @@ INHIBIT_DEFAULT_DEPS = "1"
15inherit native 15inherit native
16 16
17PATCHTOOL = "patch" 17PATCHTOOL = "patch"
18SRC_URI = "http://www.digital-opsis.com/openembedded/icecc-create-env-${PV}.tar.gz \ 18SRC_URI = "file://icecc-create-env"
19 file://icecc-lto-update.patch "
20 19
21S = "${WORKDIR}" 20S = "${WORKDIR}"
22 21
@@ -24,6 +23,3 @@ do_install() {
24 install -d ${D}/${bindir} 23 install -d ${D}/${bindir}
25 install -m 0755 ${WORKDIR}/icecc-create-env ${D}/${bindir} 24 install -m 0755 ${WORKDIR}/icecc-create-env ${D}/${bindir}
26} 25}
27
28SRC_URI[md5sum] = "641ec45fe377529c7fd914f77b11b44f"
29SRC_URI[sha256sum] = "9ff8360375432a7a5c476cc6d55b3fdea9d6f3edc080d295a60421d8f47b1834"