Lines 12-20
if [[ ${ROOT:-/} != "/" ]] ; then
Link Here
|
12 |
exit 2 |
12 |
exit 2 |
13 |
fi |
13 |
fi |
14 |
|
14 |
|
15 |
CONFIGROOT="${PORTAGE_CONFIGROOT}/etc/portage" |
15 |
CONFIGROOT="@EPREFIX@/etc/portage" |
16 |
|
16 |
|
17 |
source /etc/init.d/functions.sh || exit 1 |
17 |
source @EPREFIX@/etc/init.d/functions.sh || exit 1 |
18 |
esyslog() { :; } |
18 |
esyslog() { :; } |
19 |
die() { |
19 |
die() { |
20 |
echo |
20 |
echo |
Lines 106-118
parse_target() {
Link Here
|
106 |
- newlib [bare metal/no operating system] |
106 |
- newlib [bare metal/no operating system] |
107 |
- uclibc [not all arches are ported] |
107 |
- uclibc [not all arches are ported] |
108 |
Special Targets: |
108 |
Special Targets: |
109 |
- avr http://www.nongnu.org/avr-libc/ |
109 |
- avr http:/www.nongnu.org/avr-libc/ |
110 |
- bfin http://blackfin.uclinux.org/ |
110 |
- bfin http:/blackfin.uclinux.org/ |
111 |
- h8300 http://h8300-hms.sourceforge.net/ |
111 |
- h8300 http:/h8300-hms.sourceforge.net/ |
112 |
- mingw32 http://www.mingw.org/ |
112 |
- mingw32 http:/www.mingw.org/ |
113 |
- msp430 http://mspgcc.sourceforge.net/ |
113 |
- msp430 http:/mspgcc.sourceforge.net/ |
114 |
- nios2 http://www.altera.com/products/ip/processors/nios2/ni2-index.html |
114 |
- nios2 http:/www.altera.com/products/ip/processors/nios2/ni2-index.html |
115 |
- xc16x http://www.infineon.com/ |
115 |
- xc16x http:/www.infineon.com/ |
116 |
- ee / iop / dvp (ps2) [Playstation 2 targets] |
116 |
- ee / iop / dvp (ps2) [Playstation 2 targets] |
117 |
- ppu / spu (cell) [Cell/Playstation 3 targets] |
117 |
- ppu / spu (cell) [Cell/Playstation 3 targets] |
118 |
Softfloat toolchains: |
118 |
Softfloat toolchains: |
Lines 284-290
setup_portage_vars() {
Link Here
|
284 |
CROSSDEV_OVERLAY=${CROSSDEV_OVERLAY%% *} |
284 |
CROSSDEV_OVERLAY=${CROSSDEV_OVERLAY%% *} |
285 |
|
285 |
|
286 |
# make sure we have a valid logdir |
286 |
# make sure we have a valid logdir |
287 |
: ${PORT_LOGDIR:=/var/log/portage} |
287 |
: ${PORT_LOGDIR:=@EPREFIX@/var/log/portage} |
288 |
mkdir -p "${PORT_LOGDIR}" |
288 |
mkdir -p "${PORT_LOGDIR}" |
289 |
} |
289 |
} |
290 |
|
290 |
|
Lines 302-319
uninstall() {
Link Here
|
302 |
rm -f "${f}"/cross-${CTARGET} |
302 |
rm -f "${f}"/cross-${CTARGET} |
303 |
rmdir "${f}" 2>/dev/null |
303 |
rmdir "${f}" 2>/dev/null |
304 |
elif [[ -f ${f} ]] ; then |
304 |
elif [[ -f ${f} ]] ; then |
305 |
sed -i -e "/cross-${CTARGET}\//d" "${f}" |
305 |
sed -i -e "/cross-${CTARGET}\/d" "${f}" |
306 |
fi |
306 |
fi |
307 |
done |
307 |
done |
308 |
rm -rf "${CONFIGROOT}"/env/cross-${CTARGET} |
308 |
rm -rf "${CONFIGROOT}"/env/cross-${CTARGET} |
309 |
rmdir "${CONFIGROOT}"/env 2>/dev/null |
309 |
rmdir "${CONFIGROOT}"/env 2>/dev/null |
310 |
rm -f /etc/revdep-rebuild/05cross-${CTARGET} |
310 |
rm -f @EPREFIX@/etc/revdep-rebuild/05cross-${CTARGET} |
311 |
rmdir /etc/revdep-rebuild 2>/dev/null |
311 |
rmdir @EPREFIX@/etc/revdep-rebuild 2>/dev/null |
312 |
|
312 |
|
313 |
rmdir /var/db/pkg/cross-${CTARGET} 2>/dev/null |
313 |
rmdir @EPREFIX@/var/db/pkg/cross-${CTARGET} 2>/dev/null |
314 |
if [[ -d /var/db/pkg/cross-${CTARGET} ]] ; then |
314 |
if [[ -d @EPREFIX@/var/db/pkg/cross-${CTARGET} ]] ; then |
315 |
export CLEAN_DELAY=0 |
315 |
export CLEAN_DELAY=0 |
316 |
cd /var/db/pkg |
316 |
cd @EPREFIX@/var/db/pkg |
317 |
for p in cross-${CTARGET}/* ; do |
317 |
for p in cross-${CTARGET}/* ; do |
318 |
emerge -qC =${p} || exit 1 |
318 |
emerge -qC =${p} || exit 1 |
319 |
done |
319 |
done |
Lines 328-357
uninstall() {
Link Here
|
328 |
gprof ld nm objcopy objdump ranlib readelf \ |
328 |
gprof ld nm objcopy objdump ranlib readelf \ |
329 |
size strings strip windmc windres |
329 |
size strings strip windmc windres |
330 |
do |
330 |
do |
331 |
rm -f /usr/bin/${CTARGET}-${b} /usr/${CTARGET}/bin/${b} |
331 |
rm -f @EPREFIX@/usr/bin/${CTARGET}-${b} @EPREFIX@/usr/${CTARGET}/bin/${b} |
332 |
done |
332 |
done |
333 |
rm -f /usr/${CTARGET}/{sys-include,usr} |
333 |
rm -f @EPREFIX@/usr/${CTARGET}/{sys-include,usr} |
334 |
rmdir /usr/${CTARGET}/{include/asm,include} 2>/dev/null |
334 |
rmdir @EPREFIX@/usr/${CTARGET}/{include/asm,include} 2>/dev/null |
335 |
rm -f /usr/bin/${CTARGET}-{gcc,{c,g}++,cpp,gfortran,gcov} |
335 |
rm -f @EPREFIX@/usr/bin/${CTARGET}-{gcc,{c,g}++,cpp,gfortran,gcov} |
336 |
rm -f /etc/env.d/{binutils,gcc}/config-${CTARGET} |
336 |
rm -f @EPREFIX@/etc/env.d/{binutils,gcc}/config-${CTARGET} |
337 |
|
337 |
|
338 |
# clean out files from crossdev itself |
338 |
# clean out files from crossdev itself |
339 |
[[ -e /var/db/pkg/cross-${CTARGET} ]] && rmdir /var/db/pkg/cross-${CTARGET} |
339 |
[[ -e @EPREFIX@/var/db/pkg/cross-${CTARGET} ]] && rmdir @EPREFIX@/var/db/pkg/cross-${CTARGET} |
340 |
rm -f /usr/bin/${CTARGET}-{emerge,fix-root,pkg-config} /usr/bin/emerge-${CTARGET} |
340 |
rm -f @EPREFIX@/usr/bin/${CTARGET}-{emerge,fix-root,pkg-config} @EPREFIX@/usr/bin/emerge-${CTARGET} |
341 |
|
341 |
|
342 |
local f |
342 |
local f |
343 |
for f in make.{conf,globals,profile} ; do |
343 |
for f in make.{conf,globals,profile} ; do |
344 |
f="/usr/${CTARGET}/etc/${f}" |
344 |
f="@EPREFIX@/usr/${CTARGET}/etc/${f}" |
345 |
[[ -L ${f} ]] && rm -f ${f} |
345 |
[[ -L ${f} ]] && rm -f ${f} |
346 |
f="/usr/${CTARGET}/etc/portage/${f##*/}" |
346 |
f="@EPREFIX@/usr/${CTARGET}/etc/portage/${f##*/}" |
347 |
[[ -L ${f} ]] && rm -f ${f} |
347 |
[[ -L ${f} ]] && rm -f ${f} |
348 |
done |
348 |
done |
349 |
find /usr/share/crossdev/etc/ -type f | \ |
349 |
find @EPREFIX@/usr/share/crossdev/etc/ -type f | \ |
350 |
while read f ; do |
350 |
while read f ; do |
351 |
f1=${f} |
351 |
f1=${f} |
352 |
[[ ! -e ${f1} ]] && continue |
352 |
[[ ! -e ${f1} ]] && continue |
353 |
m1=$(set -- `md5sum ${f1}`; echo $1) |
353 |
m1=$(set -- `md5sum ${f1}`; echo $1) |
354 |
f2=/usr/${CTARGET}${f#/usr/share/crossdev} |
354 |
f2=@EPREFIX@/usr/${CTARGET}${f#/usr/share/crossdev} |
355 |
[[ ! -e ${f2} ]] && continue |
355 |
[[ ! -e ${f2} ]] && continue |
356 |
m2=$(set -- `md5sum ${f2}`; echo $1) |
356 |
m2=$(set -- `md5sum ${f2}`; echo $1) |
357 |
if [[ ${m1} == ${m2} ]] ; then |
357 |
if [[ ${m1} == ${m2} ]] ; then |
Lines 360-366
uninstall() {
Link Here
|
360 |
done |
360 |
done |
361 |
|
361 |
|
362 |
# clean out the sysroot, prompting the user if need be |
362 |
# clean out the sysroot, prompting the user if need be |
363 |
for d in /usr/lib/gcc{,-lib}/${CTARGET} /usr/${CTARGET} ; do |
363 |
for d in @EPREFIX@/usr/lib/gcc{,-lib}/${CTARGET} @EPREFIX@/usr/${CTARGET} ; do |
364 |
if [[ ! -d ${d} ]] ; then |
364 |
if [[ ! -d ${d} ]] ; then |
365 |
rm -f "${d}" |
365 |
rm -f "${d}" |
366 |
else |
366 |
else |
Lines 417-425
hr() {
Link Here
|
417 |
|| c=${c##* } |
417 |
|| c=${c##* } |
418 |
fi |
418 |
fi |
419 |
local ext=${1:- _ - ~ -} |
419 |
local ext=${1:- _ - ~ -} |
420 |
local sext=${ext//?/ } |
420 |
local sext=${ext/?/ } |
421 |
local br=$(printf "%$((c + ${#ext}))s") |
421 |
local br=$(printf "%$((c + ${#ext}))s") |
422 |
local banner=${br//${sext}/${ext}} |
422 |
local banner=${br/${sext}/${ext}} |
423 |
echo "${banner:0:${c}}" |
423 |
echo "${banner:0:${c}}" |
424 |
} |
424 |
} |
425 |
ver_get_op() { |
425 |
ver_get_op() { |
Lines 528-534
done
Link Here
|
528 |
setup_portage_vars |
528 |
setup_portage_vars |
529 |
if [[ -z ${CROSSDEV_OVERLAY} ]] ; then |
529 |
if [[ -z ${CROSSDEV_OVERLAY} ]] ; then |
530 |
eerror "You need to specify an output overlay. Please use --ov-output or set" |
530 |
eerror "You need to specify an output overlay. Please use --ov-output or set" |
531 |
eerror "PORTDIR_OVERLAY in your make.conf. A standard setting is: /usr/local/portage" |
531 |
eerror "PORTDIR_OVERLAY in your make.conf. A standard setting is: @EPREFIX@/usr/local/portage" |
532 |
exit 1 |
532 |
exit 1 |
533 |
fi |
533 |
fi |
534 |
|
534 |
|
Lines 827-847
set_portage dev-util insight
Link Here
|
827 |
set_metadata |
827 |
set_metadata |
828 |
|
828 |
|
829 |
# filter out revdep rebuild stuff #182601 |
829 |
# filter out revdep rebuild stuff #182601 |
830 |
mkdir -p /etc/revdep-rebuild |
830 |
mkdir -p @EPREFIX@/etc/revdep-rebuild |
831 |
echo "SEARCH_DIRS_MASK=/usr/${CTARGET}" > /etc/revdep-rebuild/05cross-${CTARGET} |
831 |
echo "SEARCH_DIRS_MASK=@EPREFIX@/usr/${CTARGET}" > @EPREFIX@/etc/revdep-rebuild/05cross-${CTARGET} |
832 |
|
832 |
|
833 |
hr |
833 |
hr |
834 |
|
834 |
|
835 |
####################################### |
835 |
####################################### |
836 |
### Create links for helper scripts ### |
836 |
### Create links for helper scripts ### |
837 |
|
837 |
|
838 |
mkdir -p /usr/${CTARGET} |
838 |
mkdir -p @EPREFIX@/usr/${CTARGET} |
839 |
emerge-wrapper --target ${CTARGET} --init || exit 1 |
839 |
emerge-wrapper --target ${CTARGET} --init || exit 1 |
840 |
|
840 |
|
841 |
################# |
841 |
################# |
842 |
emerged_with_use() { |
842 |
emerged_with_use() { |
843 |
local pkg=$1 use=$2 |
843 |
local pkg=$1 use=$2 |
844 |
grep -qs ${use} /var/db/pkg/cross-${CTARGET}/${pkg}-*/USE |
844 |
grep -qs ${use} @EPREFIX@/var/db/pkg/cross-${CTARGET}/${pkg}-*/USE |
845 |
} |
845 |
} |
846 |
set_eopts_on_pkg_status() { |
846 |
set_eopts_on_pkg_status() { |
847 |
emerged_with_use "$@" \ |
847 |
emerged_with_use "$@" \ |
Lines 869-875
doemerge() {
Link Here
|
869 |
>& "${logfile}" |
869 |
>& "${logfile}" |
870 |
fi |
870 |
fi |
871 |
local _pipestatus=${PIPESTATUS[*]} |
871 |
local _pipestatus=${PIPESTATUS[*]} |
872 |
[[ "${_pipestatus// /}" -eq 0 ]] || die "$1 failed :(" |
872 |
[[ "${_pipestatus/ /}" -eq 0 ]] || die "$1 failed :(" |
873 |
eend 0 |
873 |
eend 0 |
874 |
} |
874 |
} |
875 |
|
875 |
|