# --- T2-COPYRIGHT-NOTE-BEGIN --- # This copyright note is auto-generated by ./scripts/Create-CopyPatch. # # T2 SDE: package/.../glibc/glibc.conf # Copyright (C) 2004 - 2005 The T2 SDE Project # # More information can be found in the files COPYING and README. # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; version 2 of the License. A copy of the # GNU General Public License can be found in the file COPYING. # --- T2-COPYRIGHT-NOTE-END --- # use at least "-O" when build without optimisation for debugging ... var_insert GCC_WRAPPER_INSERT " " "-O" # Fedora does this - might reduce the segfault rate ... [ $arch = sparc64 ] && var_append GCC_WRAPPER_INSERT " " "-fcall-used-g6" # We must use an 'objdir' directory for building glibc # Disable glibc internal debuging but build debuging and profile # code so we can use this glibc to debug other programs. hook_add preconf 3 "mkdir -p objdir; cd objdir" configprefix='CFLAGS="$CFLAGS -g -DNDEBUG=1"' configscript="../configure" var_remove_regex confopt " " "--libdir.*" var_append confopt " " "--with-gnu-binutils --with-headers=$root/usr/include \ --with-gd=/usr --with-gd-lib=/usr/lib --with-gd-include=/usr/include \ --build=${arch_build} --host=${arch_target}" # control whether to use nptl if [ $SDECFG_PKG_GLIBC_TLS = 1 ] ; then var_append extraconfopt " " \ "--enable-add-ons=nptl --with-tls --with-__thread" else var_append extraconfopt " " \ "--enable-add-ons=linuxthreads --without-tls --without-__thread" fi # control whether to include profiling support if [ $SDECFG_PKG_GLIBC_ENABLE_PROFILE = 1 ] ; then var_append extraconfopt " " "--enable-profile" else var_append extraconfopt " " "--disable-profile" fi var_append makeopt " " "slibdir=/\$slibdir" var_append makeinstopt " " "slibdir=/\$slibdir install_root=\$root" glibc_prepatch() { tarball="`match_source_file -p linuxthreads`" && tar $taropt $tarball } glibc_postmake() { if [ $stagelevel = 0 ] ; then includedir="$base/build/$SDECFG_ID/usr/include" cp -v ../include/features.h $includedir mkdir -p $includedir/{bits,gnu} cp -v bits/stdio_lim.h $includedir/bits touch $includedir/gnu/stubs.h return fi touch $root/$includedir/gnu/stubs.h ln -sf libbsd-compat.a $root/usr/$slibdir/libbsd.a # Misc. stuff # if [ $stagelevel -gt 1 ] ; then # install locales and linuxthread manpages # eval $MAKE localedata/install-locales cp ../localedata/SUPPORTED $root/usr/share/i18n/ mkdir -p $root/usr/share/man/man3 if [ -f /usr/bin/perl ] ; then eval $MAKE -C ../linuxthreads/man \ MANDIR=$root/usr/share/man/man3 all install fi # copy linuxthreads and crypt documentation # cp ../linuxthreads/ChangeLog $docdir/ChangeLog.threads cp ../linuxthreads/Changes $docdir/Changes.threads cp ../linuxthreads/README $docdir/README.threads cp ../linuxthreads/FAQ.html $docdir/FAQ-threads.html cp -r ../linuxthreads/Examples $docdir/examples.threads cp ../crypt/README.ufc-crypt $docdir/README.crypt # NSCD Init script and config # cp $confdir/nscd.conf $confdir/nsswitch.conf $root/etc/ install_init nscd $confdir/nscd.init fi # No wrong absolute path in libc.so # Obsolete? -ReneR # if [ $stagelevel -le 1 ] ; then libcso=$root/usr/$slibdir/libc.so sed 's,/[^ ]*/,,g' < $libcso > $libcso.new mv $libcso.new $libcso fi # Install ld.so.conf # if [ $slibdir = lib64 ] ; then cat > $root/etc/ld.so.conf <<-EOT /lib64 /lib /usr/lib64 /usr/lib /usr/X11/lib64 /usr/X11/lib /opt/*/lib64 /opt/*/lib /usr/local/lib64 /usr/local/lib EOT else cat > $root/etc/ld.so.conf <<-EOT /lib /usr/lib /usr/X11/lib /opt/*/lib /usr/local/lib EOT fi # Move 'ldconfig' and 'sln' binaries # if [ -f "$root/usr/sbin/ldconfig" ] ; then mv -v $root/usr/sbin/ldconfig $root/sbin/ldconfig fi if [ -f "$root/usr/sbin/sln" ] ; then mv -v $root/usr/sbin/sln $root/sbin/sln fi # Create /lib/ld-lsb.so.1 symlink # if [ -f $root/$slibdir/ld-linux-$arch_machine.so.2 ] ; then ln -vfs ld-linux-$arch_machine.so.2 $root/$slibdir/ld-lsb.so.1 elif [ -f $root/$slibdir/ld-linux.so.2 ] ; then ln -vfs ld-linux.so.2 $root/$slibdir/ld-lsb.so.1 fi } # in stage 0 we only extract the headers and all is a bit easier ... if [ $stagelevel -eq 0 ]; then # hack due to sane variable not available and prefix is tools prefix # -ReneR # reset the confopt confopt="--prefix=$base/build/$SDECFG_ID/usr" var_append confopt " " "--build=\$arch_build --host=\$arch_target" # due to assembler check - and we do not yet have as ... [ $arch = hppa ] && var_append confopt " " "--enable-hacker-mode" # just use linuxthreads for the header extraction - so we do not require # that new compilers for the bootstrap process -ReneR var_append confopt " " "--enable-add-ons=linuxthreads --without-tls" # do not build anything - just install the headers makeopt="" makeinstopt="-k cross-compiling=yes install-headers" fi [[ $libdir = *lib64 ]] && slibdir=lib64 || slibdir=lib [ $stagelevel -eq 1 ] && var_append patchfiles " " $confdir/no_path_in_glibcso.diff hook_add prepatch 3 "glibc_prepatch" hook_add postmake 5 "glibc_postmake"