OSDN Git Service

Changed some config of openrc.
[resuse/spec.git] / glibc.spec
1 %bcond_with    fast_build
2 %define flavor %{nil}
3 %bcond_with build_all
4 %define build_main 1
5 %define build_utils %{with build_all}
6 %define build_testsuite %{with build_all}
7 %if "%flavor" == "utils"
8 %if %{with ringdisabled}
9 ExclusiveArch:  do_not_build
10 %endif
11 %define build_main 0
12 %define build_utils 1
13 %define build_testsuite 0
14 %endif
15 %if "%flavor" == "testsuite"
16 %if %{with ringdisabled}
17 ExclusiveArch:  do_not_build
18 %endif
19 %define build_main 0
20 %define build_utils 0
21 %define build_testsuite 1
22 %endif
23 %if %{build_main}
24 %define name_suffix %{nil}
25 %else
26 %define name_suffix -%{flavor}-src
27 %endif
28 Name:           glibc%{name_suffix}
29 Summary:        Standard Shared Libraries (from the GNU C Library)
30 License:        LGPL-2.1+ AND LGPL-2.1+ with GCC-exception-2.0 AND GPL-2.0+
31 Group:          System/Libraries
32
33 %define enablekernel 3.2
34
35 Version:        2.32
36 Release:        1
37 URL:            https://www.gnu.org/software/libc/
38 Source:         https://mirrors.ustc.edu.cn/gnu/glibc/glibc-%{version}.tar.xz
39 Source1:        https://mirrors.ustc.edu.cn/gnu/glibc/glibc-%{version}.tar.xz.sig
40
41 %if %{with fast_build} || %{build_utils} && %{without build_all}
42 %define build_profile 0
43 %define build_locales 0
44 %define build_html 0
45 %else
46 # Default:
47 %define build_profile 1
48 %define build_locales 1
49 %define build_html 1
50 %endif
51 %if %{build_utils}
52 Requires:       glibc = %{version}
53 %endif
54 BuildRoot:      %{_tmppath}/%{name}-%{version}-build
55
56 ##Default not enable libselinux
57 %description
58 The GNU C Library provides the most important standard libraries used
59 by nearly all programs: the standard C library, the standard math
60 library, and the POSIX thread library. A system is not functional
61 without these libraries.
62
63 %prep
64 %setup
65 # If build in OpenSUSE
66 ## export SUSE_ASNEEDED=0
67 chmod +x benchtests/scripts/*.py scripts/pylint
68 find . -name configure | xargs touch
69
70 %build
71 if [ -x /bin/uname.bin ]; then
72         /bin/uname.bin -a
73 else
74         uname -a
75 fi
76 uptime || :
77 ulimit -a
78 nice
79 GCC=gcc
80 GXX=g++
81 %define target %{_target_cpu}-essential-linux
82 echo "#define CONFHOST \"%{target}\"" >> version.h
83 EnableKernel="--enable-kernel=%{enablekernel}"
84 rm -rf build
85 mkdir build
86 pushd build
87
88 ../configure CC="$GCC" CXX="$GXX"   \
89 --prefix=%{_prefix} \
90 --with-headers=%{_prefix}/include \
91 $EnableKernel \
92 --build=%{target} --host=%{target} \
93 --enable-bind-now \
94 --enable-tunables \
95 --enable-systemtap \
96 --enable-stackguard-randomization \
97 %ifarch x86_64
98 --enable-static-pie \
99 --enable-cet \
100 %endif
101 --disable-werror \
102 --disable-profile \
103 --disable-timezone-tools \
104 --disable-selinux \
105 --disable-crypt
106
107 make %{?_smp_mflags}
108 cd ..
109 make %{?_smp_mflags} -C build html 
110
111 %check
112 %if %{build_testsuite}
113 export TIMEOUTFACTOR=16
114 # The testsuite does its own malloc checking
115 unset MALLOC_CHECK_
116 make %{?_smp_mflags} -C build -k check || {
117   cd build
118   o=$-
119   set +x
120   for sum in subdir-tests.sum */subdir-tests.sum; do
121     while read s t; do
122       case $s in
123         XPASS:|PASS:)
124           echo ++++++ $s $t ++++++
125           ;;
126         *) # X?FAIL:
127           echo ------ $s $t ------
128           test ! -f $t.out || cat $t.out
129           ;;
130         esac
131     done < $sum
132   done
133   set -$o
134   # Fail build if there where compilation errors during testsuite run
135   test -f tests.sum
136 }
137 %else
138 make %{?_smp_mflags} -C build check-abi
139 %endif
140
141 %install