[Lunar-commits] r17876 - moonbase/trunk/libs/glibc

Auke Kok sofar at lunar-linux.org
Mon Jan 2 04:09:27 UTC 2006


Author: sofar
Date: 2006-01-02 04:09:24 +0000 (Mon, 02 Jan 2006)
New Revision: 17876

Modified:
   moonbase/trunk/libs/glibc/BUILD
   moonbase/trunk/libs/glibc/BUILD.sparc64
Log:
nptl enabling fixes: I'll need to explain how this works in the mailinglist at one point - otherwise this module does NOT change your threadtype.


Modified: moonbase/trunk/libs/glibc/BUILD
===================================================================
--- moonbase/trunk/libs/glibc/BUILD	2006-01-02 04:00:16 UTC (rev 17875)
+++ moonbase/trunk/libs/glibc/BUILD	2006-01-02 04:09:24 UTC (rev 17876)
@@ -1,5 +1,38 @@
 (
 
+  if [ -n "$FORCE_THREADS" ]; then
+    if [ "$FORCE_THREADS" != "nptl" -a "$FORCE_THREADS" != "linuxthreads" ]; then
+      message "${PROBLEM_COLOR}Bad thread architecture: \"$FORCE_THREADS\", must be"
+      message "\"nptl\" or \"linuxthreads\"${DEFAULT_COLOR}"
+      exit 1
+    fi
+    if ! query "Force thread type to $FORCE_THREADS ?" n ; then
+      message "${PROBLEM_COLOR}If you don't know what you're doing, then I don't know either!"
+      message "Don't set FORCE_THREADS and try again!${DEFAULT_COLOR}"
+      exit 1
+    else
+      THREADS=$FORCE_THREADS
+    fi
+  else
+    case $(getconf GNU_LIBPTHREAD_VERSION) in
+      NPTL*)
+        THREADS=nptl
+        ;;
+      linux*)
+        THREADS=linuxthreads
+        ;;
+      *)
+    	message "${PROBLEM_COLOR}Cannot detect threading type of your glibc - this is very bad"
+	message "Please fix your glibc library before continuing.${DEFAULT_COLOR}"
+	exit 1
+    esac
+  fi
+
+  case $THREADS in
+    nptl)          OPTS="$OPTS --enable-add-ons=$THREADS --with-__thread --with-tls" ;;
+    linuxthreads)  OPTS="$OPTS --enable-add-ons=$THREADS --without-__thread" ;;
+  esac
+
   if [ -n "$MAKES" ] && [ "$MAKES" -gt 1 ] ; then
     sedit "s/# PARALLELMFLAGS = -j 4/PARALLELMFLAGS = -j $MAKES/" Makefile.in
   fi
@@ -19,66 +52,48 @@
   cd $INSTALL_ROOT
 
   if module_installed kernel-headers-2.6 ; then
-     KERNEL_HEADERS="/usr/include"
+     OPTS="$OPTS --with-headers=/usr/include"
   else
-     KERNEL_HEADERS="/usr/src/linux/include"
+     OPTS="$OPTS --with-headers=/usr/src/linux/include"
   fi
 
-  ../configure --host=$BUILD                           \
-               --build=$BUILD                          \
-               --enable-add-ons=linuxthreads           \
+  ../configure --prefix=/usr                           \
+               --infodir=/usr/share/info               \
+               --mandir=/usr/share/man                 \
                --with-elf                              \
-               --with-headers=${KERNEL_HEADERS}        \
                --with-gd=no                            \
-               --without-__thread                      \
                --without-cvs                           \
                --enable-shared                         \
-               --infodir=/usr/share/info               \
-               --mandir=/usr/share/man                 \
-               --prefix=/usr                           \
                $OPTS                                  &&
   # explicitly exit here since the following code unsets $?
   make || exit 1
 
   # Preserve the old glibc temporarily
-case  "`arch`" in
-  "alpha")
-	  LD=/lib/ld-linux.so.2
+  LD=/lib/ld-linux.so.2
+  GLIBC=/lib/libc.so.6
+  DL=/lib/libdl.so.2
+  M=/lib/libm.so.6
+  RT=/lib/librt.so.1
+  PTHREAD=/lib/libpthread.so.0
+  NSS=/lib/libnss_files.so.2
+  UTIL=/lib/libutil.so.1
+  NSL=/lib/libnsl.so.1
+  CRYPT=/lib/libcrypt.so.1
+  
+  case "`arch`" in
+    alpha)
 	  GLIBC=/lib/libc.so.6.1
 	  DL=/lib/libdl.so.2.1
 	  M=/lib/libm.so.6.1
-	  RT=/lib/librt.so.1
-	  PTHREAD=/lib/libpthread.so.0
-	  NSS=/lib/libnss_files.so.2
-	  UTIL=/lib/libutil.so.1.1
-	  NSL=/lib/libnsl.so.1.1
-	  CRYPT=/lib/libcrypt.so.1.1
 	  ;;
-   ppc)
+     ppc)
 	  LD=/lib/ld.so.1
-	  GLIBC=/lib/libc.so.6
 	  DL=/lib/libdl.so.2
-	  M=/lib/libm.so.6
-	  RT=/lib/librt.so.1
-	  PTHREAD=/lib/libpthread.so.0
-	  NSS=/lib/libnss_files.so.2
-	  UTIL=/lib/libutil.so.1
-	  NSL=/lib/libnsl.so.1
-	  CRYPT=/lib/libcrypt.so.1
 	  ;;
-  *)
-	  LD=/lib/ld-linux.so.2
-	  GLIBC=/lib/libc.so.6
+     *)
 	  DL=/lib/libdl.so.2
-	  M=/lib/libm.so.6
-	  RT=/lib/librt.so.1
-	  PTHREAD=/lib/libpthread.so.0
-	  NSS=/lib/libnss_files.so.2
-	  UTIL=/lib/libutil.so.1
-	  NSL=/lib/libnsl.so.1
-	  CRYPT=/lib/libcrypt.so.1
 	  ;;
-esac
+  esac
 
   cp $LD /lib/ld-lunar.so               &&
   cp $GLIBC /lib/libc-lunar.so          &&
@@ -113,19 +128,13 @@
 
   # Now optionally perform debug symbol stripping only
   if [ "$STRIP" == "y" ] ; then
-    for FN in ld-$VERSION.so libanl-$VERSION.so libBrokenLocale-$VERSION.so \
-        libc-$VERSION.so libcrypt-$VERSION.so libdl-$VERSION.so \
-	libm-$VERSION.so libnsl-$VERSION.so libresolv-$VERSION.so \
-	libnss_compat-$VERSION.so libnss_files-$VERSION.so \
-	libnss_hesiod-$VERSION.so libutil-$VERSION.so \
-	libnss_nis-$VERSION.so libnss_nisplus-$VERSION.so \
-	libpthread-$VERSION.so libmemusage.so \
-	libpcprofile.so libSegFault.so libthread_db-1.0.so 
-    do
+    for FN in ld-$VERSION.so \
+        lib{anl,BrokenLocale,c,crypt,dl,m,nsl,util,pthread,resolv}-$VERSION.so \
+	libnss_{compat,files,hesiod,nis,nisplus}-$VERSION.so \
+	lib{memusage,pcprofile,SegFault,thread_db-1.0}.so ; do
       strip -S /lib/$FN
     done
-    for FN in "/usr/lib/gconv/*.so"
-    do
+    for FN in "/usr/lib/gconv/*.so" ; do
       strip -S $FN
     done
   fi  &&
@@ -138,16 +147,7 @@
   ldconfig                            &&
 
   # Remove the temporary libc
-  rm /lib/ld-lunar.so            &&
-  rm /lib/libc-lunar.so          &&
-  rm /lib/libdl-lunar.so         &&
-  rm /lib/libm-lunar.so          &&
-  rm /lib/librt-lunar.so         &&
-  rm /lib/libpthread-lunar.so    &&
-  rm /lib/libnss_files-lunar.so  &&
-  rm /lib/libutil-lunar.so       &&
-  rm /lib/libnsl-lunar.so        &&
-  rm /lib/libcrypt-lunar.so      &&
+  rm /lib/{ld,lib{c,dl,m,rt,pthread,nss_files,util,nsl,crypt}}-lunar.so  &&
 
   # Generate locale info
   unset   LD_PRELOAD             &&

Modified: moonbase/trunk/libs/glibc/BUILD.sparc64
===================================================================
--- moonbase/trunk/libs/glibc/BUILD.sparc64	2006-01-02 04:00:16 UTC (rev 17875)
+++ moonbase/trunk/libs/glibc/BUILD.sparc64	2006-01-02 04:09:24 UTC (rev 17876)
@@ -1,5 +1,6 @@
 (
-
+  #Patch stuff
+  patch_it $SOURCE_CACHE/$SOURCE3 1             # old static-bin segfault
   if [ -n "$MAKES" ] && [ "$MAKES" -gt 1 ] ; then
     sedit "s/# PARALLELMFLAGS = -j 4/PARALLELMFLAGS = -j $MAKES/" Makefile.in
   fi
@@ -22,25 +23,17 @@
   mkdir -p $INSTALL_ROOT &&
   cd $INSTALL_ROOT
 
-  if module_installed kernel-headers-2.6 ; then
-     KERNEL_HEADERS="/usr/include"
-  else
-     KERNEL_HEADERS="/usr/src/linux/include"
-  fi
-
-  ../configure --host=$BUILD                           \
-               --build=$BUILD                          \
-               --enable-add-ons=linuxthreads           \
-               --with-elf                              \
-               --with-headers=${KERNEL_HEADERS}        \
-               --with-gd=no                            \
-               --without-tls                           \
-               --without-__thread                      \
-               --without-cvs                           \
-               --enable-shared                         \
-               --infodir=/usr/share/info               \
-               --mandir=/usr/share/man                 \
-               --prefix=/usr                           \
+  ../configure --host=$BUILD                          \
+               --build=$BUILD                         \
+               --enable-add-ons=linuxthreads          \
+               --with-elf                             \
+               --with-headers=/usr/src/linux/include  \
+               --with-gd=no                           \
+               --without-cvs                          \
+               --enable-shared                        \
+               --infodir=/usr/share/info              \
+               --mandir=/usr/share/man                \
+               --prefix=/usr                          \
                $OPTS                                  &&
   # explicitly exit here since the following code unsets $?
   make || exit 1
@@ -69,35 +62,31 @@
   cp $CRYPT /lib/libcrypt-lunar.so &&
 
   # Setup links for libraries
-  sln /lib/ld-lunar.so $LD               &&
-  sln /lib/libc-lunar.so $GLIBC          &&
-  sln /lib/libdl-lunar.so $DL            &&
-  sln /lib/libm-lunar.so $M              &&
-  sln /lib/librt-lunar.so $RT            &&
-  sln /lib/libpthread-lunar.so $PTHREAD  &&
-  sln /lib/libnss_files-lunar.so $NSS    &&
-  sln /lib/libutil-lunar.so $UTIL        &&
-  sln /lib/libnsl-lunar.so $NSL          &&
-  sln /lib/libcrypt-lunar.so $CRYPT      &&
+  sln /lib/ld-lunar.so $LD     &&
+  sln /lib/libc-lunar.so $GLIBC       &&
+  sln /lib/libdl-lunar.so $DL     &&
+  sln /lib/libm-lunar.so $M       &&
+  sln /lib/librt-lunar.so $RT     &&
+  sln /lib/libpthread-lunar.so $PTHREAD &&
+  sln /lib/libnss_files-lunar.so $NSS &&
+  sln /lib/libutil-lunar.so $UTIL &&
+  sln /lib/libnsl-lunar.so $NSL   &&
+  sln /lib/libcrypt-lunar.so $CRYPT &&
 
-  # clean hack to make sure gnu/stubs.h gets refreshed
-  rm -f /usr/include/gnu/stubs.h  &&
   # This removes the old glibc
-  prepare_install                 &&
+  prepare_install                             &&
 
   # And now we install the new
-  make install                    &&
+  make install                                &&
 
   # Now optionally perform debug symbol stripping only
   if [ "$STRIP" == "y" ] ; then
-    for FN in ld-$VERSION.so libanl-$VERSION.so libBrokenLocale-$VERSION.so \
-        libc-$VERSION.so libcrypt-$VERSION.so libdl-$VERSION.so \
-	libm-$VERSION.so libnsl-$VERSION.so libresolv-$VERSION.so \
-	libnss_compat-$VERSION.so libnss_files-$VERSION.so \
-	libnss_hesiod-$VERSION.so libutil-$VERSION.so \
-	libnss_nis-$VERSION.so libnss_nisplus-$VERSION.so \
-	libpthread-$VERSION.so libmemusage.so \
-	libpcprofile.so libSegFault.so libthread_db-1.0.so 
+    for FN in ld-2.3.5.so libanl-2.3.5.so libBrokenLocale-2.3.5.so libc-2.3.5.so   \
+              libcrypt-2.3.5.so libdl-2.3.5.so libm-2.3.5.so libmemusage.so        \
+              libnsl-2.3.5.so libnss_compat-2.3.5.so libnss_files-2.3.5.so         \
+              libnss_hesiod-2.3.5.so libnss_nis-2.3.5.so libnss_nisplus-2.3.5.so   \
+              libpcprofile.so libpthread-0.10.so libresolv-2.3.5.so libSegFault.so \
+              libthread_db-1.0.so libutil-2.3.5.so
     do
       strip -S /lib/$FN
     done
@@ -105,31 +94,39 @@
     do
       strip -S $FN
     done
-  fi  &&
+  fi                                          &&
   
   # Added a symlink for ash and others
-  ln -sf /usr/lib/libbsd-compat.a /usr/lib/libbsd.a  &&
+  ln -sf /usr/lib/libbsd-compat.a /usr/lib/libbsd.a &&
 
   # Rebuild the ld cache
-  rm -f /etc/ld.so.cache 2>/dev/null  &&
-  ldconfig                            &&
+  rm -f /etc/ld.so.cache 2>/dev/null          &&
+  ldconfig                                    &&
 
   # Remove the temporary libc
-  rm /lib/ld-lunar.so            &&
-  rm /lib/libc-lunar.so          &&
-  rm /lib/libdl-lunar.so         &&
-  rm /lib/libm-lunar.so          &&
-  rm /lib/librt-lunar.so         &&
-  rm /lib/libpthread-lunar.so    &&
-  rm /lib/libnss_files-lunar.so  &&
-  rm /lib/libutil-lunar.so       &&
-  rm /lib/libnsl-lunar.so        &&
-  rm /lib/libcrypt-lunar.so      &&
+  rm /lib/ld-lunar.so                         &&
+  rm /lib/libc-lunar.so                       &&
+  rm /lib/libdl-lunar.so                      &&
+  rm /lib/libm-lunar.so                       &&
+  rm /lib/librt-lunar.so                      &&
+  rm /lib/libpthread-lunar.so                 &&
+  rm /lib/libnss_files-lunar.so               &&
+  rm /lib/libutil-lunar.so                    &&
+  rm /lib/libnsl-lunar.so                     &&
+  rm /lib/libcrypt-lunar.so                   &&
 
   # Generate locale info
-  unset   LD_PRELOAD             &&
+  unset   LD_PRELOAD                          &&
   if  [  -z  "$GLIBC_LOCALES"  ];  then
-    make localedata/install-locales || exit 1
+    cat  $SCRIPT_DIRECTORY/locales  |
+    while  read  LOCALE  DESCRIPTION;  do
+      INPUTFILE=`echo  $LOCALE  |  cut  -d /  -f1`
+        CHARMAP=`echo  $LOCALE  |  cut  -d /  -f2`
+      mkdir  -p  /usr/lib/locale/$INPUTFILE
+      echo "localedef  -i  $INPUTFILE  -f  $CHARMAP  $INPUTFILE"
+            localedef  -i  $INPUTFILE  -f  $CHARMAP  $INPUTFILE
+    done
+    true
   else
     for  LOCALE  in  $GLIBC_LOCALES;  do
       INPUTFILE=`echo  $LOCALE  |  cut  -d /  -f1`



More information about the Lunar-commits mailing list