Support program-suffix configuration
Add "--program-suffix" in configuration stage via binsuffix defination.
For example, if binsuffix is set to "-12" the binary will be compiled
as below format:
gcc-12
cpp-12
...
The binsuffix is set to %{nil} to make sure the files name are same
with previous release.
Signed-off-by: Chenxi Mao <chenxi.mao@suse.com>
This commit is contained in:
parent
a63c1aaaf9
commit
0fce60c9dc
72
gcc-12.spec
72
gcc-12.spec
@ -13,6 +13,7 @@
|
|||||||
%global scl_prefix gcc-toolset-12-
|
%global scl_prefix gcc-toolset-12-
|
||||||
%global _prefix /opt/openEuler/gcc-toolset-12/root/usr
|
%global _prefix /opt/openEuler/gcc-toolset-12/root/usr
|
||||||
%global gcc_ver %{nil}
|
%global gcc_ver %{nil}
|
||||||
|
%define binsuffix %{nil}
|
||||||
%define __provides_exclude ^lib.*$
|
%define __provides_exclude ^lib.*$
|
||||||
%endif
|
%endif
|
||||||
|
|
||||||
@ -84,7 +85,7 @@
|
|||||||
Summary: Various compilers (C, C++, Objective-C, ...)
|
Summary: Various compilers (C, C++, Objective-C, ...)
|
||||||
Name: %{?scl_prefix}gcc%{gcc_ver}
|
Name: %{?scl_prefix}gcc%{gcc_ver}
|
||||||
Version: 12.2.1
|
Version: 12.2.1
|
||||||
Release: 10
|
Release: 11
|
||||||
# libgcc, libgfortran, libgomp, libstdc++ and crtstuff have
|
# libgcc, libgfortran, libgomp, libstdc++ and crtstuff have
|
||||||
# GCC Runtime Exception.
|
# GCC Runtime Exception.
|
||||||
License: GPLv3+ and GPLv3+ with exceptions and GPLv2+ with exceptions and LGPLv2+ and BSD
|
License: GPLv3+ and GPLv3+ with exceptions and GPLv2+ with exceptions and LGPLv2+ and BSD
|
||||||
@ -696,6 +697,9 @@ CONFIGURE_OPTS="\
|
|||||||
%endif
|
%endif
|
||||||
%ifnarch sparc sparcv9 ppc
|
%ifnarch sparc sparcv9 ppc
|
||||||
--build=%{gcc_target_platform} \
|
--build=%{gcc_target_platform} \
|
||||||
|
%endif
|
||||||
|
%if 0%{?scl:1}
|
||||||
|
--program-suffix=%{binsuffix}
|
||||||
%endif
|
%endif
|
||||||
"
|
"
|
||||||
|
|
||||||
@ -847,13 +851,13 @@ FULLPATH=%{buildroot}%{_prefix}/lib/gcc/%{gcc_target_platform}/%{gcc_major}
|
|||||||
FULLEPATH=%{buildroot}%{_prefix}/libexec/gcc/%{gcc_target_platform}/%{gcc_major}
|
FULLEPATH=%{buildroot}%{_prefix}/libexec/gcc/%{gcc_target_platform}/%{gcc_major}
|
||||||
|
|
||||||
# fix some things
|
# fix some things
|
||||||
ln -sf gcc %{buildroot}%{_prefix}/bin/cc
|
ln -sf gcc%{binsuffix} %{buildroot}%{_prefix}/bin/cc
|
||||||
rm -f %{buildroot}%{_prefix}/lib/cpp
|
rm -f %{buildroot}%{_prefix}/lib/cpp
|
||||||
ln -sf ../bin/cpp %{buildroot}/%{_prefix}/lib/cpp
|
ln -sf ../bin/cpp%{binsuffix} %{buildroot}/%{_prefix}/lib/cpp
|
||||||
ln -sf gfortran %{buildroot}%{_prefix}/bin/f95
|
ln -sf gfortran%{binsuffix} %{buildroot}%{_prefix}/bin/f95
|
||||||
rm -f %{buildroot}%{_infodir}/dir
|
rm -f %{buildroot}%{_infodir}/dir
|
||||||
gzip -9 %{buildroot}%{_infodir}/*.info*
|
gzip -9 %{buildroot}%{_infodir}/*.info*
|
||||||
ln -sf gcc %{buildroot}%{_prefix}/bin/gnatgcc
|
ln -sf gcc%{binsuffix} %{buildroot}%{_prefix}/bin/gnatgcc
|
||||||
mkdir -p %{buildroot}%{_fmoddir}
|
mkdir -p %{buildroot}%{_fmoddir}
|
||||||
|
|
||||||
%if %{build_go}
|
%if %{build_go}
|
||||||
@ -1584,12 +1588,12 @@ cd obj-%{gcc_target_platform}
|
|||||||
|
|
||||||
%post go
|
%post go
|
||||||
%{_sbindir}/update-alternatives --install \
|
%{_sbindir}/update-alternatives --install \
|
||||||
%{_prefix}/bin/go go %{_prefix}/bin/go.gcc 92 \
|
%{_prefix}/bin/go go %{_prefix}/bin/go%{binsuffix}.gcc 92 \
|
||||||
--slave %{_prefix}/bin/gofmt gofmt %{_prefix}/bin/gofmt.gcc
|
--slave %{_prefix}/bin/gofmt gofmt %{_prefix}/bin/gofmt.gcc
|
||||||
|
|
||||||
%preun go
|
%preun go
|
||||||
if [ $1 = 0 ]; then
|
if [ $1 = 0 ]; then
|
||||||
%{_sbindir}/update-alternatives --remove go %{_prefix}/bin/go.gcc
|
%{_sbindir}/update-alternatives --remove go %{_prefix}/bin/go%{binsuffix}.gcc
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# Because glibc Prereq's libgcc and /sbin/ldconfig
|
# Because glibc Prereq's libgcc and /sbin/ldconfig
|
||||||
@ -1651,30 +1655,29 @@ end
|
|||||||
%{_prefix}/bin/cc
|
%{_prefix}/bin/cc
|
||||||
%{_prefix}/bin/c89
|
%{_prefix}/bin/c89
|
||||||
%{_prefix}/bin/c99
|
%{_prefix}/bin/c99
|
||||||
%{_prefix}/bin/gcc
|
%{_prefix}/bin/gcc%{binsuffix}
|
||||||
%{_prefix}/bin/gcov
|
%{_prefix}/bin/gcov%{binsuffix}
|
||||||
%{_prefix}/bin/gcov-tool
|
%{_prefix}/bin/gcov-tool%{binsuffix}
|
||||||
%{_prefix}/bin/gcov-dump
|
%{_prefix}/bin/gcov-dump%{binsuffix}
|
||||||
%{_prefix}/bin/gcc-ar
|
%{_prefix}/bin/gcc-ar%{binsuffix}
|
||||||
%{_prefix}/bin/gcc-nm
|
%{_prefix}/bin/gcc-nm%{binsuffix}
|
||||||
%{_prefix}/bin/gcc-ranlib
|
%{_prefix}/bin/gcc-ranlib%{binsuffix}
|
||||||
%{_prefix}/bin/lto-dump
|
%{_prefix}/bin/lto-dump%{binsuffix}
|
||||||
%ifarch ppc
|
%ifarch ppc
|
||||||
%{_prefix}/bin/%{_target_platform}-gcc
|
%{_prefix}/bin/%{_target_platform}-gcc%{binsuffix}
|
||||||
%endif
|
%endif
|
||||||
%ifarch sparc64 sparcv9
|
%ifarch sparc64 sparcv9
|
||||||
%{_prefix}/bin/sparc-%{_vendor}-%{_target_os}-gcc
|
%{_prefix}/bin/sparc-%{_vendor}-%{_target_os}-gcc%{binsuffix}
|
||||||
%endif
|
%endif
|
||||||
%ifarch ppc64 ppc64p7
|
%ifarch ppc64 ppc64p7
|
||||||
%{_prefix}/bin/ppc-%{_vendor}-%{_target_os}-gcc
|
%{_prefix}/bin/ppc-%{_vendor}-%{_target_os}-gcc%{binsuffix}
|
||||||
%endif
|
%endif
|
||||||
%{_prefix}/bin/%{gcc_target_platform}-gcc
|
%{_prefix}/bin/%{gcc_target_platform}-gcc*
|
||||||
%{_prefix}/bin/%{gcc_target_platform}-gcc-%{gcc_major}
|
%{_mandir}/man1/gcc%{binsuffix}.1*
|
||||||
%{_mandir}/man1/gcc.1*
|
%{_mandir}/man1/gcov%{binsuffix}.1*
|
||||||
%{_mandir}/man1/gcov.1*
|
%{_mandir}/man1/gcov-tool%{binsuffix}.1*
|
||||||
%{_mandir}/man1/gcov-tool.1*
|
%{_mandir}/man1/gcov-dump%{binsuffix}.1*
|
||||||
%{_mandir}/man1/gcov-dump.1*
|
%{_mandir}/man1/lto-dump%{binsuffix}.1*
|
||||||
%{_mandir}/man1/lto-dump.1*
|
|
||||||
%{_infodir}/gcc*
|
%{_infodir}/gcc*
|
||||||
%dir %{_prefix}/lib/gcc
|
%dir %{_prefix}/lib/gcc
|
||||||
%dir %{_prefix}/lib/gcc/%{gcc_target_platform}
|
%dir %{_prefix}/lib/gcc/%{gcc_target_platform}
|
||||||
@ -1975,8 +1978,8 @@ end
|
|||||||
|
|
||||||
%files -n %{?scl_prefix}cpp%{gcc_ver}
|
%files -n %{?scl_prefix}cpp%{gcc_ver}
|
||||||
%{_prefix}/lib/cpp
|
%{_prefix}/lib/cpp
|
||||||
%{_prefix}/bin/cpp
|
%{_prefix}/bin/cpp%{binsuffix}
|
||||||
%{_mandir}/man1/cpp.1*
|
%{_mandir}/man1/cpp%{binsuffix}.1*
|
||||||
%{_infodir}/cpp*
|
%{_infodir}/cpp*
|
||||||
%dir %{_prefix}/libexec/gcc
|
%dir %{_prefix}/libexec/gcc
|
||||||
%dir %{_prefix}/libexec/gcc/%{gcc_target_platform}
|
%dir %{_prefix}/libexec/gcc/%{gcc_target_platform}
|
||||||
@ -1990,10 +1993,10 @@ end
|
|||||||
%license gcc/COPYING* COPYING.RUNTIME
|
%license gcc/COPYING* COPYING.RUNTIME
|
||||||
|
|
||||||
%files c++
|
%files c++
|
||||||
%{_prefix}/bin/%{gcc_target_platform}-*++
|
%{_prefix}/bin/%{gcc_target_platform}-*++%{binsuffix}
|
||||||
%{_prefix}/bin/g++
|
%{_prefix}/bin/g++%{binsuffix}
|
||||||
%{_prefix}/bin/c++
|
%{_prefix}/bin/c++%{binsuffix}
|
||||||
%{_mandir}/man1/g++.1*
|
%{_mandir}/man1/g++%{binsuffix}.1*
|
||||||
%dir %{_prefix}/lib/gcc
|
%dir %{_prefix}/lib/gcc
|
||||||
%dir %{_prefix}/lib/gcc/%{gcc_target_platform}
|
%dir %{_prefix}/lib/gcc/%{gcc_target_platform}
|
||||||
%dir %{_prefix}/lib/gcc/%{gcc_target_platform}/%{gcc_major}
|
%dir %{_prefix}/lib/gcc/%{gcc_target_platform}/%{gcc_major}
|
||||||
@ -2126,9 +2129,9 @@ end
|
|||||||
%endif
|
%endif
|
||||||
|
|
||||||
%files gfortran
|
%files gfortran
|
||||||
%{_prefix}/bin/gfortran
|
%{_prefix}/bin/gfortran%{binsuffix}
|
||||||
%{_prefix}/bin/f95
|
%{_prefix}/bin/f95
|
||||||
%{_mandir}/man1/gfortran.1*
|
%{_mandir}/man1/gfortran%{binsuffix}.1*
|
||||||
%{_infodir}/gfortran*
|
%{_infodir}/gfortran*
|
||||||
%dir %{_prefix}/lib/gcc
|
%dir %{_prefix}/lib/gcc
|
||||||
%dir %{_prefix}/lib/gcc/%{gcc_target_platform}
|
%dir %{_prefix}/lib/gcc/%{gcc_target_platform}
|
||||||
@ -2655,6 +2658,9 @@ end
|
|||||||
%doc rpm.doc/changelogs/libcc1/ChangeLog*
|
%doc rpm.doc/changelogs/libcc1/ChangeLog*
|
||||||
|
|
||||||
%changelog
|
%changelog
|
||||||
|
* Fri Nov 18 2022 Chenxi Mao <chenxi.mao@suse.com> 12.2.1-11
|
||||||
|
- Support --program-suffix configuration
|
||||||
|
|
||||||
* Thu Nov 17 2022 Chenxi Mao <chenxi.mao@suse.com> 12.2.1-10
|
* Thu Nov 17 2022 Chenxi Mao <chenxi.mao@suse.com> 12.2.1-10
|
||||||
- Customized package name
|
- Customized package name
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user