Lines 586-588
Link Here
|
586 |
rm -rf "${UNIONFS_FUSE_DIR}" > /dev/null |
586 |
rm -rf "${UNIONFS_FUSE_DIR}" > /dev/null |
587 |
fi |
587 |
fi |
588 |
} |
588 |
} |
|
|
589 |
|
590 |
compile_v86d() { |
591 |
if [ ! -f "${V86D_BINCACHE}" ] |
592 |
then |
593 |
local myARCH="${ARCH}" myABI="${ABI}" |
594 |
|
595 |
if [ -z "$(grep V86D ${KERNEL_DIR}/include/linux/connector.h)" ]; then |
596 |
gen_die "You a kernel tree patched with uvesafb for v86d. Kernel not patched with uvesafb." |
597 |
fi |
598 |
|
599 |
case ${ARCH} in |
600 |
amd64) a=x86_64 ;; |
601 |
mips) gen_die 'TODO: Use the $ABI' ;; |
602 |
x86) a=i386 ;; |
603 |
*) a=${ARCH} ;; |
604 |
esac |
605 |
KLIBCARCH=${a} |
606 |
|
607 |
case ${ARCH} in |
608 |
# Merged arches |
609 |
x86|x86_64) a=x86 ;; |
610 |
ppc*) a=powerpc ;; |
611 |
# Non-merged |
612 |
alpha|arm|ia64|m68k|mips|sh|sparc*) a=${ARCH} ;; |
613 |
*) gen_die "TODO: Update the code for your asm-ARCH symlink" ;; |
614 |
esac |
615 |
KLIBCASMARCH=${a} |
616 |
|
617 |
unset ABI ARCH KBUILD_OUTPUT |
618 |
|
619 |
# klibc |
620 |
print_info 1 'v86d: >> Unpacking klibc...' |
621 |
[ ! -f "${KLIBC_SRCTAR}" ] && |
622 |
gen_die "Could not find klibc source tarball: ${KLIBC_SRCTAR}. Please place it there, or place another version, changing /etc/genkernel.conf as necessary!" |
623 |
cd "${TEMP}" |
624 |
rm -rf "${KLIBC_DIR}" |
625 |
tar -xpf "${KLIBC_SRCTAR}" |
626 |
[ ! -d "${KLIBC_DIR}" ] && |
627 |
gen_die "klibc directory ${KLIBC_DIR} invalid" |
628 |
cd "${KLIBC_DIR}" |
629 |
# point klibc to kernel sourse |
630 |
ln -snf "${KERNEL_DIR}" linux |
631 |
apply_patches klibc ${KLIBC_VER} |
632 |
# compile klibc |
633 |
print_info 1 'v86d: >> Compiling klibc...' |
634 |
${UTILS_MAKE} \ |
635 |
EXTRA_KLIBCAFLAGS="-Wa,--noexecstack" \ |
636 |
EXTRA_KLIBCLDFLAGS="-z,noexecstack" \ |
637 |
HOSTCC="${UTILS_CC}" CC="${UTILS_CC}" \ |
638 |
LD="${UTILS_LD}" AS="${UTILS_AS}" \ |
639 |
INSTALLDIR="${TEMP}/klibc-install" \ |
640 |
KLIBCARCH=${KLIBCARCH} \ |
641 |
KLIBCASMARCH=${KLIBCASMARCH} \ |
642 |
SHLIBDIR="${TEMP}/klibc-install/lib" \ |
643 |
libdir="${TEMP}/klibc-install/lib" \ |
644 |
bindir="${TEMP}/klibc-install/bin" \ |
645 |
mandir="${TEMP}/klibc-install/usr/share/man" install >> ${LOGFILE} 2>&1 || gen_die "Failed to compile klibc" |
646 |
linkname="${TEMP}/klibc-install/include/asm" |
647 |
if [ -L "${linkname}" ] && [ ! -e "${linkname}" ]; then |
648 |
ln -snf asm-${KLIBCASMARCH} "${linkname}" |
649 |
fi |
650 |
|
651 |
# v86d |
652 |
print_info 1 'v86d: >> Unpacking v86d...' |
653 |
[ ! -f "${V86D_SRCTAR}" ] && |
654 |
gen_die "Could not find v86d source tarball: ${V86D_SRCTAR}. Please place it there, or place another version, changing /etc/genkernel.conf as necessary!" |
655 |
cd "${TEMP}" |
656 |
rm -rf "${V86D_DIR}" |
657 |
tar -xpf "${V86D_SRCTAR}" |
658 |
[ ! -d "${V86D_DIR}" ] && |
659 |
gen_die "v86d directory ${V86D_DIR} invalid" |
660 |
cd "${V86D_DIR}" |
661 |
apply_patches v86d ${V86D_VER} |
662 |
print_info 1 'v86d: >> Configuring...' |
663 |
./configure --with-klibc --with-x86emu >> ${LOGFILE} 2>&1 || |
664 |
gen_die 'Configuring v86d failed!' |
665 |
print_info 1 'v86d: >> Compiling...' |
666 |
${UTILS_MAKE} KDIR="${KERNEL_DIR}" CC="${TEMP}/klibc-install/bin/klcc" >> ${LOGFILE} 2>&1 || |
667 |
gen_die 'Compiling v86d failed!' |
668 |
print_info 1 'v86d: >> Copying to cache...' |
669 |
[ -f "v86d" ] || |
670 |
gen_die 'v86d executable does not exist!' |
671 |
strip "v86d" || |
672 |
gen_die 'Could not strip v86d binary!' |
673 |
bzip2 "v86d" || |
674 |
gen_die 'bzip2 compression of v86d failed!' |
675 |
mv "v86d.bz2" "${V86D_BINCACHE}" || |
676 |
gen_die 'Could not copy the v86d binary to the package directory, does the directory exist?' |
677 |
cd .. |
678 |
rm -rf "${V86D_DIR}" |
679 |
|
680 |
ARCH="${myARCH}" ABI="${myABI}" |
681 |
fi |
682 |
} |