summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRichard Purdie <rpurdie@linux.intel.com>2009-11-02 17:10:51 +0000
committerRichard Purdie <rpurdie@linux.intel.com>2009-11-13 12:15:22 +0000
commit6ea78d648951e5bbe9669412c0863daaf7f49ca5 (patch)
tree85d8442493787783cb1ad08659f38ca2ccd32cc2
parent1383f0fb4ccae5622439e2eb02711c57aa2b4c24 (diff)
downloadpoky-6ea78d648951e5bbe9669412c0863daaf7f49ca5.tar.gz
autotools.bbclass: Separate out useful staging functions into base.bbclass and call from autotools classes
Signed-off-by: Richard Purdie <rpurdie@linux.intel.com>
-rw-r--r--meta/classes/autotools.bbclass49
-rw-r--r--meta/classes/base.bbclass60
2 files changed, 64 insertions, 45 deletions
diff --git a/meta/classes/autotools.bbclass b/meta/classes/autotools.bbclass
index 5ddf8baa07..bd88184a74 100644
--- a/meta/classes/autotools.bbclass
+++ b/meta/classes/autotools.bbclass
@@ -170,34 +170,11 @@ autotools_stage_includes() {
170} 170}
171 171
172autotools_stage_dir() { 172autotools_stage_dir() {
173 from="$1" 173 sysroot_stage_dir $1 ${STAGE_TEMP_PREFIX}$2
174 to="$2"
175 prefix="${STAGE_TEMP_PREFIX}"
176 # This will remove empty directories so we can ignore them
177 rmdir "$from" 2> /dev/null || true
178 if [ -d "$from" ]; then
179 mkdir -p "$prefix$to"
180 cp -fpPR "$from"/* "$prefix$to"
181 fi
182} 174}
183 175
184autotools_stage_libdir() { 176autotools_stage_libdir() {
185 from="$1" 177 sysroot_stage_libdir $1 ${STAGE_TEMP_PREFIX}$2
186 to="$2"
187
188 olddir=`pwd`
189 cd $from
190 las=$(find . -name \*.la -type f)
191 cd $olddir
192 echo "Found la files: $las"
193 for i in $las
194 do
195 sed -e 's/^installed=yes$/installed=no/' \
196 -e '/^dependency_libs=/s,${WORKDIR}[[:alnum:]/\._+-]*/\([[:alnum:]\._+-]*\),${STAGING_LIBDIR}/\1,g' \
197 -e "/^dependency_libs=/s,\([[:space:]']\)${libdir},\1${STAGING_LIBDIR},g" \
198 -i $from/$i
199 done
200 autotools_stage_dir $from $to
201} 178}
202 179
203 180
@@ -209,26 +186,8 @@ autotools_stage_all() {
209 rm -rf ${STAGE_TEMP} 186 rm -rf ${STAGE_TEMP}
210 mkdir -p ${STAGE_TEMP} 187 mkdir -p ${STAGE_TEMP}
211 oe_runmake DESTDIR="${STAGE_TEMP}" install 188 oe_runmake DESTDIR="${STAGE_TEMP}" install
212 autotools_stage_dir ${STAGE_TEMP}/${includedir} ${STAGING_INCDIR} 189
213 if [ "${BUILD_SYS}" = "${HOST_SYS}" ]; then 190 sysroot_stage_dirs ${STAGE_TEMP} ${STAGE_TEMP_PREFIX}
214 autotools_stage_dir ${STAGE_TEMP}/${bindir} ${STAGING_DIR_HOST}${bindir}
215 autotools_stage_dir ${STAGE_TEMP}/${sbindir} ${STAGING_DIR_HOST}${sbindir}
216 autotools_stage_dir ${STAGE_TEMP}/${base_bindir} ${STAGING_DIR_HOST}${base_bindir}
217 autotools_stage_dir ${STAGE_TEMP}/${base_sbindir} ${STAGING_DIR_HOST}${base_sbindir}
218 autotools_stage_dir ${STAGE_TEMP}/${libexecdir} ${STAGING_DIR_HOST}${libexecdir}
219 fi
220 if [ -d ${STAGE_TEMP}/${libdir} ]
221 then
222 autotools_stage_libdir ${STAGE_TEMP}/${libdir} ${STAGING_LIBDIR}
223 fi
224 if [ -d ${STAGE_TEMP}/${base_libdir} ]
225 then
226 autotools_stage_libdir ${STAGE_TEMP}/${base_libdir} ${STAGING_DIR_HOST}${base_libdir}
227 fi
228 rm -rf ${STAGE_TEMP}/${mandir} || true
229 rm -rf ${STAGE_TEMP}/${infodir} || true
230 autotools_stage_dir ${STAGE_TEMP}/${datadir} ${STAGING_DATADIR}
231 #rm -rf ${STAGE_TEMP}
232} 191}
233 192
234EXPORT_FUNCTIONS do_configure do_install 193EXPORT_FUNCTIONS do_configure do_install
diff --git a/meta/classes/base.bbclass b/meta/classes/base.bbclass
index 7dbac018ea..9e78ce2927 100644
--- a/meta/classes/base.bbclass
+++ b/meta/classes/base.bbclass
@@ -922,6 +922,66 @@ base_do_compile() {
922 fi 922 fi
923} 923}
924 924
925
926sysroot_stage_dir() {
927 src="$1"
928 dest="$2"
929 # This will remove empty directories so we can ignore them
930 rmdir "$src" 2> /dev/null || true
931 if [ -d "$src" ]; then
932 mkdir -p "$dest"
933 cp -fpPR "$src"/* "$dest"
934 fi
935}
936
937sysroot_stage_libdir() {
938 src="$1"
939 dest="$2"
940
941 olddir=`pwd`
942 cd $src
943 las=$(find . -name \*.la -type f)
944 cd $olddir
945 echo "Found la files: $las"
946 for i in $las
947 do
948 sed -e 's/^installed=yes$/installed=no/' \
949 -e '/^dependency_libs=/s,${WORKDIR}[[:alnum:]/\._+-]*/\([[:alnum:]\._+-]*\),${STAGING_LIBDIR}/\1,g' \
950 -e "/^dependency_libs=/s,\([[:space:]']\)${libdir},\1${STAGING_LIBDIR},g" \
951 -i $src/$i
952 done
953 sysroot_stage_dir $src $dest
954}
955
956sysroot_stage_dirs() {
957 from="$1"
958 to="$2"
959
960 sysroot_stage_dir $from${includedir} $to${STAGING_INCDIR}
961 if [ "${BUILD_SYS}" = "${HOST_SYS}" ]; then
962 sysroot_stage_dir $from${bindir} $to${STAGING_DIR_HOST}${bindir}
963 sysroot_stage_dir $from${sbindir} $to${STAGING_DIR_HOST}${sbindir}
964 sysroot_stage_dir $from${base_bindir} $to${STAGING_DIR_HOST}${base_bindir}
965 sysroot_stage_dir $from${base_sbindir} $to${STAGING_DIR_HOST}${base_sbindir}
966 sysroot_stage_dir $from${libexecdir} $to${STAGING_DIR_HOST}${libexecdir}
967 fi
968 if [ -d $from${libdir} ]
969 then
970 sysroot_stage_libdir $from/${libdir} $to${STAGING_LIBDIR}
971 fi
972 if [ -d $from${base_libdir} ]
973 then
974 sysroot_stage_libdir $from${base_libdir} $to${STAGING_DIR_HOST}${base_libdir}
975 fi
976 sysroot_stage_dir $from${datadir} $to${STAGING_DATADIR}
977}
978
979
980sysroot_stage_all() {
981 sysroot_stage_dirs ${D} ${SYSROOT_DESTDIR}
982}
983
984
925base_do_stage () { 985base_do_stage () {
926 : 986 :
927} 987}