forked from Imagelibrary/rtems
154 lines
4.1 KiB
Plaintext
154 lines
4.1 KiB
Plaintext
%install
|
|
%if "%{_prefix}" != "/usr"
|
|
export PATH="%{_bindir}:${PATH}"
|
|
%endif
|
|
rm -rf $RPM_BUILD_ROOT
|
|
|
|
cd build
|
|
|
|
make DESTDIR=$RPM_BUILD_ROOT install
|
|
cd ..
|
|
|
|
%if %build_newlib
|
|
cd build/@tool_target@/newlib
|
|
make DESTDIR=$RPM_BUILD_ROOT install-info
|
|
cd ../../..
|
|
%endif
|
|
|
|
%if "%{gcc_version}" <= "4.1.2"
|
|
# Misplaced header file
|
|
if test -f $RPM_BUILD_ROOT%{_includedir}/mf-runtime.h; then
|
|
mv $RPM_BUILD_ROOT%{_includedir}/mf-runtime.h \
|
|
$RPM_BUILD_ROOT%{gcclib}/@tool_target@/%{gcc_version}/include/
|
|
fi
|
|
%endif
|
|
|
|
# host library
|
|
rm -f ${RPM_BUILD_ROOT}%{_libdir}/libiberty.a
|
|
|
|
# We use the version from binutils
|
|
rm -f $RPM_BUILD_ROOT%{_bindir}/@tool_target@-c++filt%{_exeext}
|
|
|
|
%if %build_gnat
|
|
# Seemingly a VAX tool. Not meaningful, here.
|
|
rm -f $RPM_BUILD_ROOT%{_bindir}/vxaddr2line%{_exeext}
|
|
%endif
|
|
|
|
%if %build_infos
|
|
# We don't ship info/dir
|
|
rm -f $RPM_BUILD_ROOT%{_infodir}/dir
|
|
touch $RPM_BUILD_ROOT%{_infodir}/dir
|
|
%else
|
|
# Conflict with a native GCC's infos
|
|
rm -rf $RPM_BUILD_ROOT%{_infodir}
|
|
|
|
# Conflict with a native GCC's man pages
|
|
rm -rf $RPM_BUILD_ROOT%{_mandir}/man7
|
|
%endif
|
|
|
|
%if %build_fortran
|
|
# # Bug in gcc-4.0.0pre
|
|
# mv $RPM_BUILD_ROOT%{_bindir}/gfortran $RPM_BUILD_ROOT%{_bindir}/@tool_target@-gfortran
|
|
%endif
|
|
|
|
%if "%{gcc_version}" >= "3.4"
|
|
# Bug in gcc-3.4.0pre
|
|
rm -f $RPM_BUILD_ROOT%{_bindir}/@tool_target@-@tool_target@-gcjh%{_exeext}
|
|
%endif
|
|
|
|
%if "%{gcc_version}" >= "3.3"
|
|
# Bug in gcc-3.3.x/gcc-3.4.x: Despite we don't need fixincludes, it installs
|
|
# the fixinclude-install-tools
|
|
rm -rf ${RPM_BUILD_ROOT}%{gcclib}/@tool_target@/%{gcc_version}/install-tools
|
|
rm -rf ${RPM_BUILD_ROOT}%{gccexec}/@tool_target@/%{gcc_version}/install-tools
|
|
%endif
|
|
|
|
# Bug in gcc > 4.1.0: Installs an unused, empty directory
|
|
if test -d ${RPM_BUILD_ROOT}%{_prefix}/@tool_target@/include/bits; then
|
|
rmdir ${RPM_BUILD_ROOT}%{_prefix}/@tool_target@/include/bits
|
|
fi
|
|
|
|
# Collect multilib subdirectories
|
|
f=`build/gcc/xgcc -Bbuild/gcc/ --print-multi-lib | sed -e 's,;.*$,,'`
|
|
|
|
%if %build_newlib
|
|
echo "%defattr(-,root,root,-)" > build/files.newlib
|
|
TGTDIR="%{_exec_prefix}/@tool_target@/lib"
|
|
for i in $f; do
|
|
case $i in
|
|
\.) echo "%dir ${TGTDIR}" >> build/files.newlib
|
|
;;
|
|
*) echo "%dir ${TGTDIR}/$i" >> build/files.newlib
|
|
;;
|
|
esac
|
|
done
|
|
%endif
|
|
|
|
rm -f dirs ;
|
|
echo "%defattr(-,root,root,-)" >> dirs
|
|
%if "%{_prefix}" != "/usr"
|
|
echo "%dir %{_prefix}" >> dirs
|
|
echo "%dir %{_libdir}" >> dirs
|
|
%if "%{gcc_version}" >= "3.4"
|
|
echo "%dir %{_libexecdir}" >> dirs
|
|
%endif
|
|
%endif
|
|
echo "%dir %{gcclib}" >> dirs
|
|
echo "%dir %{gcclib}/@tool_target@" >> dirs
|
|
|
|
TGTDIR="%{gcclib}/@tool_target@/%{gcc_version}"
|
|
for i in $f; do
|
|
case $i in
|
|
\.) echo "%dir ${TGTDIR}" >> dirs
|
|
;;
|
|
*) echo "%dir ${TGTDIR}/$i" >> dirs
|
|
;;
|
|
esac
|
|
done
|
|
|
|
# Collect files to go into different packages
|
|
cp dirs build/files.gcc
|
|
cp dirs build/files.gfortran
|
|
cp dirs build/files.objc
|
|
cp dirs build/files.gcj
|
|
cp dirs build/files.g++
|
|
|
|
TGTDIR="%{gcclib}/@tool_target@/%{gcc_version}"
|
|
f=`find ${RPM_BUILD_ROOT}${TGTDIR} ! -type d -print | sed -e "s,^$RPM_BUILD_ROOT,,g"`;
|
|
for i in $f; do
|
|
case $i in
|
|
*lib*.la) rm ${RPM_BUILD_ROOT}/$i ;; # ignore: gcc produces bogus libtool libs
|
|
*f771) ;;
|
|
*f951) ;;
|
|
*cc1) ;;
|
|
*cc1obj) ;;
|
|
*cc1plus) ;; # ignore: explicitly put into rpm elsewhere
|
|
*collect2) ;;
|
|
*libobjc*) echo "$i" >> build/files.objc ;;
|
|
*include/objc*) ;;
|
|
*include/g++*);;
|
|
*include/c++*);;
|
|
*finclude/*);;
|
|
*adainclude*);;
|
|
*adalib*);;
|
|
*gnat1);;
|
|
*jc1) ;;
|
|
*jvgenmain) ;;
|
|
*/libgfortran*.*) echo "$i" >> build/files.gfortran ;;
|
|
*/libstdc++.*) echo "$i" >> build/files.g++ ;;
|
|
*/libsupc++.*) echo "$i" >> build/files.g++ ;;
|
|
*) echo "$i" >> build/files.gcc ;;
|
|
esac
|
|
done
|
|
|
|
TGTDIR="%{_exec_prefix}/@tool_target@/lib"
|
|
f=`find ${RPM_BUILD_ROOT}${TGTDIR} ! -type d -print | sed -e "s,^$RPM_BUILD_ROOT,,g"`;
|
|
for i in $f; do
|
|
case $i in
|
|
*lib*.la) rm ${RPM_BUILD_ROOT}/$i;; # ignore - gcc produces bogus libtool libs
|
|
*libiberty.a) rm ${RPM_BUILD_ROOT}/$i ;; # ignore - GPL'ed
|
|
# all other files belong to newlib
|
|
*) echo "$i" >> build/files.newlib ;;
|
|
esac
|
|
done
|