Accepting request 906501 from science:HPC

- Improve setting of standard binaries (c, c++) for non-base
  versions.
- Improve environment settings: only set CC, CXX etc when
  compilers are installed. Thus, if only gnu<X>-compiler-hpc
  is installed, they will not be set. (forwarded request 906500 from eeich)

OBS-URL: https://build.opensuse.org/request/show/906501
OBS-URL: https://build.opensuse.org/package/show/openSUSE:Factory/gnu-compilers-hpc?expand=0&rev=12
This commit is contained in:
Dominique Leuenberger 2021-07-18 21:44:46 +00:00 committed by Git OBS Bridge
commit 0c35ef3cfa
2 changed files with 16 additions and 1 deletions

View File

@ -1,3 +1,12 @@
-------------------------------------------------------------------
Thu Jul 15 10:22:42 UTC 2021 - Egbert Eich <eich@suse.com>
- Improve setting of standard binaries (c, c++) for non-base
versions.
- Improve environment settings: only set CC, CXX etc when
compilers are installed. Thus, if only gnu<X>-compiler-hpc
is installed, they will not be set.
-------------------------------------------------------------------
Wed Jun 23 06:52:49 UTC 2021 - Egbert Eich <eich@suse.com>

View File

@ -183,11 +183,13 @@ set version %{hpc_cf_dep_version}
prepend-path MODULEPATH %{hpc_modulepath}
prepend-path PATH %{hpc_cf_install_path}/bin
%if 0%{?c_f_ver:1} > 0
if {[file isfile %{_bindir}/gcc%{hpc_gnu_bin_version}]} {
prepend-path MANPATH %{hpc_cf_install_path}/man
setenv CC gcc%{hpc_gnu_bin_version}
setenv CXX g++%{hpc_gnu_bin_version}
setenv FC gfortran%{hpc_gnu_bin_version}
setenv F77 gfortran%{hpc_gnu_bin_version}
}
%else
# nothing to do since gcc is in the default path
%endif
@ -233,15 +235,19 @@ do
;;
esac
done
for i in cc,gcc c++,g++; do
test -e %{hpc_cf_install_path}/bin/${i##*,}%{hpc_gnu_bin_version} \
&& ln -s %{hpc_cf_install_path}/bin/${i%%%%,*} ${i##*,}%{hpc_gnu_bin_version}
fi
%else
# for the base compiler version link to the 'default' binary:
localbindir=%_bindir/
%endif
for i in cc cpp c++
do
test -e %{hpc_cf_install_path}/bin/${i} || ln -sf ${localbindir}${i}%{hpc_gnu_bin_version} %{hpc_cf_install_path}/bin/${i}
done
test -e %{hpc_cf_install_path}/bin/fortran || ln -sf ${localbindir}gfortran%{hpc_gnu_bin_version} %{hpc_cf_install_path}/bin/fc
%endif
%files
%defattr(-,root,root,-)