#
# You can define min_kernel macro by "rpm --define 'min_kernel version'"
-# default is 2.2.0 (no changes up to 2.3.25)
+# default is 2.4.6
#
# Conditional build:
%bcond_without fp # build without frame pointer (pass \--enable-omitfp)
# glibc-kernel-headers (evil, breakage etc., don't use)
%bcond_without dist_kernel # for above, allow non-distribution kernel
%bcond_with idn # build with included libidn
+%bcond_with nptl # use nptl instead of linuxthreads
+%bcond_without tls # do not use tls
%bcond_without tests # do not perform "make test"
+
#
# TODO:
# - localedb-gen man pages(?)
# posix zoneinfo dir removed, /etc/rc.d/init.d/timezone must be changed
# in order to use this version!
#
-%{!?min_kernel:%global min_kernel 2.4.6}
+
+%{!?min_kernel:%global min_kernel 2.4.6}
+
+%if %{with nptl}
+%ifarch i686 athlon amd64 ia64 s390 s390x sparcv9 ppc ppc64
+%if "%{min_kernel}" < "2.6.0"
+%global min_kernel 2.6.0
+%endif
+%else
+%undefine with_nptl
+%endif
+%endif
+
+%if %{with tls}
+%ifnarch i686 athlon amd64 ia64 s390 s390x alpha alphaev6 sparc sparcv9 ppc ppc64
+%undefine with_tls
+%endif
+%endif
+
%define gkh_version 7:2.6.0.3
Summary: GNU libc
Summary(de): GNU libc
Summary(uk): GNU libc ×ÅÒÓ¦§ 2.3
Name: glibc
Version: 2.3.3
-Release: 0.1
+Release: 0.20040101.3%{?with_nptl:+nptl}
Epoch: 6
License: LGPL
Group: Libraries
# borrowed from util-linux
Source7: sln.8
Source8: %{name}-localedb-gen
-# Source10-md5: ded0b439efe16dd29ce5a24d3d3dcebf
Patch0: %{name}-info.patch
Patch1: %{name}-initgroups-overflow.patch
Patch2: %{name}-pld.patch
Patch24: %{name}-includes.patch
Patch26: %{name}-alpha-fix-as-syntax.patch
Patch27: %{name}-soinit-EH_FRAME.patch
+Patch28: %{name}-fix-asserts.patch
Patch30: %{name}-sparc-errno_fix.patch
Patch31: %{name}-make.patch
+Patch32: %{name}-tests-io-tmp.patch
URL: http://www.gnu.org/software/libc/
BuildRequires: automake
BuildRequires: binutils >= 2.13.90.0.2
%endif
%description -n %{name}64
-64-bit GNU libc libraries for sparc64 architecture.
+64-bit GNU libc libraries for 64bit architecture.
%description -n %{name}64 -l es
-Bibliotecas GNU libc de 64 bits para la arquitectura sparc64.
+Bibliotecas GNU libc de 64 bits para la arquitectura 64bit.
%description -n %{name}64 -l pl
-Biblioteki 64-bitowe GNU libc dla architektury sparc64.
+Biblioteki 64-bitowe GNU libc dla architektury 64bit.
%package -n %{name}64-devel
Summary: Development files for 64-bit GNU libc libraries
Requires: %{name}-devel = %{epoch}:%{version}-%{release}
%description -n %{name}64-devel
-Development files for 64-bit GNU libc libraries for sparc64
+Development files for 64-bit GNU libc libraries for 64bit
architecture.
%description -n %{name}64-devel -l es
Ficheros de desarrollo para las bibliotecas GNU libc de 64 bits para la
-arquitectura sparc64.
+arquitectura 64bit.
%description -n %{name}64-devel -l pl
Pliki do programowania z u¿yciem 64-bitowych bibliotek GNU libc dla
-architektury sparc64.
+architektury 64bit.
%package -n %{name}64-static
Summary: Static 64-bit GNU libc libraries
# don't know, if it is good idea, for brave ones
#%patch19 -p1
%{?with_kernelheaders:%patch23}
-%{?without_kernelheaders:%patch24 -p1}
+%{?!with_kernelheaders:%patch24 -p1}
%patch26 -p1
%patch27 -p1
+%patch28 -p1
%patch30
%patch31 -p1
+%patch32 -p1
chmod +x scripts/cpp
# avoid stripping ld.so by -s in rpmldflags
LDFLAGS=" " ; export LDFLAGS
../%configure \
- --enable-add-ons=linuxthreads \
--enable-kernel="%{min_kernel}" \
- --enable-profile \
--%{!?with_fp:en}%{?with_fp:dis}able-omitfp \
+%if %{with nptl}
+ --enable-add-ons=nptl \
+ --with-tls \
+ --disable-profile \
+%else
+ %{?with_tls:--with-tls} \
+ --enable-add-ons=linuxthreads \
+ --enable-profile \
+%endif
%if %{with kernelheaders}
CPPFLAGS="-I%{_kernelsrcdir}/include" \
- --with-headers=%{_kernelsrcdir}/include
+ --with-headers=%{_kernelsrcdir}/include
%else
CPPFLAGS="-I%{_includedir}" \
- --with-headers=%{_includedir}
+ --with-headers=%{_includedir}
%endif
# problem compiling with --enable-bounded (must be reported to libc-alpha)
%{__make} %{?parallelmkflags}
-%{?with_tests:%{__make} test}
+%if %{with tests}
+env LANGUAGE=C LC_ALL=C \
+%{__make} tests 2>&1 | awk '
+BEGIN { file = "" }
+{
+ if (($0 ~ /\*\*\* \[.*\.out\] Error/) && (file == "")) {
+ file=$0;
+ gsub(/.*\[/, NIL, file);
+ gsub(/\].*/, NIL, file);
+ }
+ print $0;
+}
+END { if (file != "") { print "ERROR OUTPUT FROM " file; system("cat " file); exit(1); } }'
+%endif
%install
rm -rf $RPM_BUILD_ROOT
mv -f $RPM_BUILD_ROOT/%{_lib}/libpcprofile.so $RPM_BUILD_ROOT%{_libdir}
%endif
+%if %{without nptl}
%{__make} -C ../linuxthreads/man
install ../linuxthreads/man/*.3thr $RPM_BUILD_ROOT%{_mandir}/man3
+%endif
rm -rf $RPM_BUILD_ROOT%{_datadir}/zoneinfo/{localtime,posixtime,posixrules,posix/*}
rm -rf ../documentation
install -d ../documentation
+%if %{without nptl}
cp -f ../linuxthreads/ChangeLog ../documentation/ChangeLog.threads
cp -f ../linuxthreads/Changes ../documentation/Changes.threads
cp -f ../linuxthreads/README ../documentation/README.threads
+%endif
cp -f ../crypt/README.ufc-crypt ../documentation/
cp -f ../ChangeLog* ../documentation
%{_libdir}/librt.a
%{_libdir}/libutil.a
+%if %{without nptl}
%files profile
%defattr(644,root,root,755)
%{_libdir}/lib*_p.a
+%endif
%files pic
%defattr(644,root,root,755)