# IMPORTANT ! # you must untar add-ons into the source directory before building # the package. This is mostly glibc-linuxthreads. (date; echo $PWD;echo "$0" "$@";set;echo "=============================================";echo) >> /tmp/log # Most of these patches are from crosstool-NG and some of them are needed to fix build issues PATCH_LIST=" 100-ssp-compat.patch 110-respect-env-CPPFLAGS.patch 120-_nss_dns_gethostbyaddr2_r-check-and-adjust-the-buffer-alignment.patch 130-add_prio-macros.patch 140-regex-BZ9697.patch 150-regex-BZ697.patch 160-i386-x86_64-revert-clone-cfi.patch 170-2.10-dns-no-gethostbyname4.patch 180-math-tests.patch 190-queue-header-updates.patch 200-awk-in-C-locale.patch 210-2.9-strlen-hack.patch 220-manual-no-perl.patch 230-2.3.3-localedef-fix-trampoline.patch 240-i386-LOAD_PIC_REG.patch 250-resolv-dynamic.patch 260-fadvise64_64.patch 270-ldbl-nexttowardf.patch 280-section-comments.patch 290-no-inline-gmon.patch 300-2.9-check_native-headers.patch 310-2.3.6-fix-pr631.patch 320-2.9-assume-pipe2.patch 330-2.3.3-china.patch 340-new-valencian-locale.patch 350-2.4-undefine-__i686.patch 360-2.8-nscd-one-fork.patch 370-hppa_glibc-2.7-hppa-nptl-carlos.patch 380-2.3.6-dl_execstack-PaX-support.patch 390-2.3.3_pre20040117-pt_pax.patch 400-tests-sandbox-libdl-paths.patch 410-2.9-fnmatch.patch 420-dont-build-timezone.patch 430-2.7-cross-compile-nptl.patch 440-alpha-glibc-2.4-xstat.patch 450-alpha-glibc-2.5-no-page-header.patch 460-alpha-glibc-2.5-no-asm-elf-header.patch 470-alpha-glibc-2.8-creat.patch 480-alpha-glibc-2.8-cache-shape.patch 490-ptr-mangling.patch 500-ppc-glibc-2.9-atomic.patch 510-sh-no-asm-user-header.patch 520-sh-no-asm-elf-header.patch 530-powerpc-8xx-CPU15-errata.patch 540-alpha-atfcts.patch 550-2.9-elf-begin.patch 560-syslog.patch 570-debug-readlink_chk-readklinkat_chk.patch 600-recent-binutils2.patch 610-fix-nptl-init.patch 900-march-i686.patch 910-typedef-caddr.patch disable-stack-protector.diff " #610-isoc99-needs-fexceptions.diff #611-libio-needs-fexceptions.diff #612-debug-needs-fexceptions.diff PORTS_PATCH_LIST=" 100-arm_linux_tls.patch 110-arm-fix-sjlj-for-fpu.patch 999-fix-sched_setaffinity.patch " FILE_LIST= SRC_FETCH_PATH="http://ftp.gnu.org/gnu/glibc/glibc-2.9.tar.bz2" SRC_FETCH_METHOD="http" LINUXTHREADS_PKGSRC="http://ftp.gnu.org/gnu/glibc/glibc-linuxthreads-2.3.6.tar.bz2" GLIBCPORTS_PKGSRC="http://ftp.gnu.org/gnu/glibc/glibc-ports-2.9.tar.bz2" function do_config { local ret fp #get_cached_file $LINUXTHREADS_PKGSRC .src2 $FLX_SRC_CACHE_DIRS #tar xvf .src2 get_cached_file $GLIBCPORTS_PKGSRC .src2 $FLX_SRC_CACHE_DIRS tar xvf .src2 rm -f ports ; ln -s glibc-ports-* ports for i in $PORTS_PATCH_LIST; do patch -p1 < $PKGDIR/patches/$i; done rm -rf build mkdir -p build/ cd build/ case "$FLX_FLOAT" in none) fp="--without-fp" ;; soft) fp="--with-fp --with-float=soft" ;; softfp) fp="--with-fp --with-float=softfp" ;; hard) fp="--with-fp ;; *) fp="--with-fp ;; esac #opt="${GCC_OPT_SMALL//-malign-functions=0/}" #--cache-file=config.cache \ BUILD_CC=$HOSTCC \ CFLAGS="-m${FLX_ENDIAN:-little}-endian $GCC_CPU_COMMON $GCC_ARCH_COMMON ${GCC_OPT_FAST//-fno-align-jumps/} -U_FORTIFY_SOURCE" \ CC="$CC" AR="$AR" RANLIB="$RANLIB" \ LD_LIBRARY_PATH="" \ BASH_SHELL="/bin/bash" KSH="/bin/bash" \ ../configure --prefix=/usr --build=$FLXHOST \ --host=$FLXTARG --without-cvs \ --disable-profile --disable-debug --without-gd \ --disable-sanity-checks \ --with-headers=$FLXROOTDIR/usr/include --with-__thread \ --enable-shared --with-tls $fp \ --enable-kernel=2.6.32 \ --enable-add-ons=nptl,ports ret=$? cd .. return $ret } function do_compile_only { local ret mkdir -p build/ cd build # $FLXPMAKE => ne termine pas. $FLXMAKE SHELL=/bin/bash ret=$? cd .. return $ret } function do_clean { rm -fr build } function do_prepack { mkdir -p $ROOTDIR/etc && touch $ROOTDIR/etc/ld.so.conf cd build/ $FLXMAKE install install_root=$ROOTDIR prefix=/usr slibdir=/lib \ libdir=/usr/lib libexecdir=/usr/bin rm -f $ROOTDIR/etc/ld.so.cache $ROOTDIR/etc/ld.so.conf rm -f $ROOTDIR/etc/localtime ( cd $ROOTDIR/usr/share/zoneinfo find . -links "+1" -type "f" -exec '/bin/bash' '-c' 'cp --preserve {} {}.dereference.hard; rm -f {}; cp --preserve {}.dereference.hard {}; rm -f {}.dereference.hard' \; ) chmod -w $ROOTDIR/usr/bin/pt_chown if [ "$FLX_BITS" = 64 ] ; then ln -s lib $ROOTDIR/usr/lib64 ln -s lib $ROOTDIR/lib64 fi set_default_perm $ROOTDIR cd .. } function pre_pack { chmod +w $ROOTDIR/sbin/{ldconfig,sln} ${SSTRIP} $ROOTDIR/sbin/{ldconfig,sln} || : chmod -w $ROOTDIR/sbin/{ldconfig,sln} }