Lines 555-557
Link Here
|
555 |
rm -rf "${E2FSPROGS_DIR}" > /dev/null |
555 |
rm -rf "${E2FSPROGS_DIR}" > /dev/null |
556 |
fi |
556 |
fi |
557 |
} |
557 |
} |
|
|
558 |
|
559 |
compile_v86d() { |
560 |
if [ ! -f "${V86D_BINCACHE}" ] |
561 |
then |
562 |
local myARCH="${ARCH}" myABI="${ABI}" |
563 |
|
564 |
if [ -z "$(grep V86D ${KERNEL_DIR}/include/linux/connector.h)" ]; then |
565 |
eerror "You a kernel tree patched with uvesafb for v86d." |
566 |
die "Kernel not patched with uvesafb." |
567 |
fi |
568 |
|
569 |
case ${ARCH} in |
570 |
amd64) a=x86_64 ;; |
571 |
mips) gen_die 'TODO: Use the $ABI' ;; |
572 |
x86) a=i386 ;; |
573 |
*) a=${ARCH} ;; |
574 |
esac |
575 |
KLIBCARCH=${a} |
576 |
|
577 |
case ${ARCH} in |
578 |
# Merged arches |
579 |
x86|amd64) a=x86 ;; |
580 |
ppc*) a=powerpc ;; |
581 |
# Non-merged |
582 |
alpha|arm|ia64|m68k|mips|sh|sparc*) a=${ARCH} ;; |
583 |
*) gen_die "TODO: Update the code for your asm-ARCH symlink" ;; |
584 |
esac |
585 |
KLIBCASMARCH=${a} |
586 |
|
587 |
unset ABI ARCH KBUILD_OUTPUT |
588 |
|
589 |
# klibc |
590 |
print_info 1 'v86d: >> Unpacking klibc...' |
591 |
[ ! -f "${KLIBC_SRCTAR}" ] && |
592 |
gen_die "Could not find klibc source tarball: ${KLIBC_SRCTAR}. Please place it there, or place another version, changing /etc/genkernel.conf as necessary!" |
593 |
rm -rf "${KLIBC_DIR}" |
594 |
tar -xpf "${KLIBC_SRCTAR}" |
595 |
[ ! -d "${KLIBC_DIR}" ] && |
596 |
gen_die "klibc directory ${KLIBC_DIR} invalid" |
597 |
cd "${KLIBC_DIR}" |
598 |
# point klibc to kernel sourse |
599 |
ln -snf "${KERNEL_DIR}" linux |
600 |
apply_patches klibc ${KLIBC_VER} |
601 |
# compile klibc |
602 |
print_info 1 'v86d: >> Compiling klibc...' |
603 |
${UTILS_MAKE} \ |
604 |
EXTRA_KLIBCAFLAGS="-Wa,--noexecstack" \ |
605 |
EXTRA_KLIBCLDFLAGS="-z,noexecstack" \ |
606 |
HOSTCC="${UTILS_CC}" CC="${UTILS_CC}" \ |
607 |
LD="${UTILS_LD}" AS="${UTILS_AS}" \ |
608 |
INSTALLDIR="${TEMP}/klibc-install" \ |
609 |
KLIBCARCH=${KLIBCARCH} \ |
610 |
KLIBCASMARCH=${KLIBCASMARCH} \ |
611 |
SHLIBDIR="${TEMP}/klibc-install/lib" \ |
612 |
libdir="${TEMP}/klibc-install/lib" \ |
613 |
bindir="${TEMP}/klibc-install/bin" \ |
614 |
mandir="${TEMP}/klibc-install/usr/share/man" install >> ${LOGFILE} 2>&1 || gen_die "Failed to compile klibc" |
615 |
linkname="${TEMP}/klibc-install/include/asm" |
616 |
if [ -L "${linkname}" ] && [ ! -e "${linkname}" ]; then |
617 |
ln -snf asm-${KLIBCASMARCH} "${linkname}" |
618 |
fi |
619 |
|
620 |
# v86d |
621 |
print_info 1 'v86d: >> Unpacking v86d...' |
622 |
[ ! -f "${V86D_SRCTAR}" ] && |
623 |
gen_die "Could not find v86d source tarball: ${E2FSPROGS_SRCTAR}. Please place it there, or place another version, changing /etc/genkernel.conf as necessary!" |
624 |
cd "${TEMP}" |
625 |
rm -rf "${V86D_DIR}" |
626 |
tar -xpf "${V86D_SRCTAR}" |
627 |
[ ! -d "${V86D_DIR}" ] && |
628 |
gen_die "v86d directory ${V86D_DIR} invalid" |
629 |
cd "${V86D_DIR}" |
630 |
apply_patches v86d ${V86D_VER} |
631 |
print_info 1 'v86d: >> Configuring...' |
632 |
./configure --with-klibc >> ${LOGFILE} 2>&1 || |
633 |
gen_die 'Configuring v86d failed!' |
634 |
print_info 1 'v86d: >> Compiling...' |
635 |
${UTILS_MAKE} KDIR="${KERNEL_DIR}" CC="${TEMP}/klibc-install/bin/klcc" >> ${LOGFILE} 2>&1 || |
636 |
gen_die 'Compiling v86d failed!' |
637 |
print_info 1 'v86d: >> Copying to cache...' |
638 |
[ -f "v86d" ] || |
639 |
gen_die 'v86d executable does not exist!' |
640 |
strip "v86d" || |
641 |
gen_die 'Could not strip v86d binary!' |
642 |
bzip2 "v86d" || |
643 |
gen_die 'bzip2 compression of v86d failed!' |
644 |
mv "v86d.bz2" "${V86D_BINCACHE}" || |
645 |
gen_die 'Could not copy the v86d binary to the package directory, does the directory exist?' |
646 |
cd .. |
647 |
rm -rf "${V86D_DIR}" |
648 |
|
649 |
ARCH="${myARCH}" ABI="${myABI}" |
650 |
fi |
651 |
} |