15 |
|
%install |
16 |
|
mkdir -p %i/etc/scram.d |
17 |
|
|
18 |
< |
# Determine the GCC_ROOT if "use system compiler is used. |
18 |
> |
# Determine the GCC_ROOT if "use system compiler" is used. |
19 |
|
if [ "X$GCC_ROOT" = X ] |
20 |
|
then |
21 |
|
export GCC_PATH=`which gcc` || exit 1 |
22 |
|
export GCC_ROOT=`echo $GCC_PATH | sed -e 's|/bin/gcc||'` |
23 |
|
export GCC_VERSION=`gcc -v 2>&1 | grep "gcc version" | sed 's|[^0-9]*\([0-9].[0-9].[0-9]\).*|\1|'` || exit 1 |
24 |
+ |
%if "%(echo %cmsos | grep osx >/dev/null && echo true)" == "true" |
25 |
|
export G77_ROOT=$GFORTRAN_MACOSX_ROOT |
26 |
+ |
%else |
27 |
+ |
export G77_ROOT=$GCC_ROOT |
28 |
+ |
%endif |
29 |
|
else |
30 |
|
export GCC_PATH |
31 |
|
export GCC_ROOT |
172 |
|
# Then handle compiler specific options. E.g. enable |
173 |
|
# optimizations as they become available in gcc. |
174 |
|
COMPILER_CXXFLAGS= |
175 |
+ |
# The following is the default even if not set here |
176 |
+ |
F77_MMD="-MMD" |
177 |
|
case %cmsplatf in |
178 |
|
*_gcc4[56789]* ) |
179 |
|
COMPILER_CXXFLAGS="$COMPILER_CXXFLAGS -std=c++0x -ftree-vectorize" |
180 |
+ |
F77_MMD="-cpp -MMD" |
181 |
|
;; |
182 |
|
esac |
183 |
+ |
export F77_MMD |
184 |
|
|
185 |
|
case %cmsplatf in |
186 |
|
*_gcc4[3456789]* ) |
215 |
|
perl -p -i -e 's|\@([^@]*)\@|$ENV{$1}|g' %i/etc/scram.d/*.xml |
216 |
|
|
217 |
|
%post |
218 |
< |
[ "X$RPM_INSTALL_PREFIX" == "X$CMS_INSTALL_PREFIX" ] || perl -p -i -e "s|$RPM_INSTALL_PREFIX|$CMS_INSTALL_PREFIX|g" $RPM_INSTALL_PREFIX/%{pkgrel}/etc/scram.d/*.xml |
218 |
> |
%{relocateConfig}etc/scram.d/*.xml |
219 |
|
echo "GCC_TOOLFILE_ROOT='$CMS_INSTALL_PREFIX/%{pkgrel}'; export GCC_TOOLFILE_ROOT" > $RPM_INSTALL_PREFIX/%{pkgrel}/etc/profile.d/init.sh |
220 |
|
echo "setenv GCC_TOOLFILE_ROOT '$CMS_INSTALL_PREFIX/%{pkgrel}'" > $RPM_INSTALL_PREFIX/%{pkgrel}/etc/profile.d/init.csh |