source: rtems/contrib/crossrpms/gcc/install.add @ bbdde8b

4.104.11
Last change on this file since bbdde8b was bbdde8b, checked in by Ralf Corsepius <ralf.corsepius@…>, on Aug 26, 2009 at 5:03:54 PM

Move finclude into *-gfortran.

  • Property mode set to 100644
File size: 4.1 KB
Line 
1%install
2%if "%{_prefix}" != "/usr"
3  export PATH="%{_bindir}:${PATH}"
4%endif
5  rm -rf $RPM_BUILD_ROOT
6
7  cd build
8
9  make DESTDIR=$RPM_BUILD_ROOT install
10  cd ..
11
12%if %build_newlib
13  cd build/@tool_target@/newlib
14  make DESTDIR=$RPM_BUILD_ROOT install-info
15  cd ../../..
16%endif
17
18%if "%{gcc_version}" <= "4.1.2"
19# Misplaced header file
20  if test -f $RPM_BUILD_ROOT%{_includedir}/mf-runtime.h; then
21    mv $RPM_BUILD_ROOT%{_includedir}/mf-runtime.h \
22      $RPM_BUILD_ROOT%{gcclib}/@tool_target@/%{gcc_version}/include/
23  fi
24%endif
25
26  # host library
27  rm -f  ${RPM_BUILD_ROOT}%{_libdir}/libiberty.a
28
29  # We use the version from binutils
30  rm -f $RPM_BUILD_ROOT%{_bindir}/@tool_target@-c++filt%{_exeext}
31
32%if %build_gnat
33  # Seemingly a VAX tool. Not meaningful, here.
34  rm -f $RPM_BUILD_ROOT%{_bindir}/vxaddr2line%{_exeext}
35%endif
36
37%if %build_infos
38  # We don't ship info/dir
39  rm -f $RPM_BUILD_ROOT%{_infodir}/dir
40  touch $RPM_BUILD_ROOT%{_infodir}/dir
41%else
42# Conflict with a native GCC's infos
43  rm -rf $RPM_BUILD_ROOT%{_infodir}
44
45# Conflict with a native GCC's man pages
46  rm -rf $RPM_BUILD_ROOT%{_mandir}/man7
47%endif
48
49%if %build_fortran
50#  # Bug in gcc-4.0.0pre
51#  mv $RPM_BUILD_ROOT%{_bindir}/gfortran $RPM_BUILD_ROOT%{_bindir}/@tool_target@-gfortran
52%endif
53
54%if "%{gcc_version}" >= "3.4"
55  # Bug in gcc-3.4.0pre
56  rm -f $RPM_BUILD_ROOT%{_bindir}/@tool_target@-@tool_target@-gcjh%{_exeext}
57%endif
58
59%if "%{gcc_version}" >= "3.3"
60  # Bug in gcc-3.3.x/gcc-3.4.x: Despite we don't need fixincludes, it installs
61  # the fixinclude-install-tools
62  rm -rf ${RPM_BUILD_ROOT}%{gcclib}/@tool_target@/%{gcc_version}/install-tools
63  rm -rf ${RPM_BUILD_ROOT}%{gccexec}/@tool_target@/%{gcc_version}/install-tools
64%endif
65
66  # Bug in gcc > 4.1.0: Installs an unused, empty directory
67  if test -d ${RPM_BUILD_ROOT}%{_prefix}/@tool_target@/include/bits; then
68    rmdir ${RPM_BUILD_ROOT}%{_prefix}/@tool_target@/include/bits
69  fi
70
71  # Collect multilib subdirectories
72  f=`build/gcc/xgcc -Bbuild/gcc/ --print-multi-lib | sed -e 's,;.*$,,'`
73
74%if %build_newlib
75  echo "%defattr(-,root,root,-)" > build/files.newlib
76  TGTDIR="%{_exec_prefix}/@tool_target@/lib"
77  for i in $f; do
78    case $i in
79    \.) echo "%dir ${TGTDIR}" >> build/files.newlib
80      ;;
81    *)  echo "%dir ${TGTDIR}/$i" >> build/files.newlib
82      ;;
83    esac
84  done
85%endif
86
87  rm -f dirs ;
88  echo "%defattr(-,root,root,-)" >> dirs
89%if "%{_prefix}" != "/usr"
90  echo "%dir %{_prefix}" >> dirs
91  echo "%dir %{_libdir}" >> dirs
92%if "%{gcc_version}" >= "3.4"
93  echo "%dir %{_libexecdir}" >> dirs
94%endif
95%endif
96  echo "%dir %{gcclib}" >> dirs
97  echo "%dir %{gcclib}/@tool_target@" >> dirs
98
99  TGTDIR="%{gcclib}/@tool_target@/%{gcc_version}"
100  for i in $f; do
101    case $i in
102    \.) echo "%dir ${TGTDIR}" >> dirs
103      ;;
104    *)  echo "%dir ${TGTDIR}/$i" >> dirs
105      ;;
106    esac
107  done
108
109  # Collect files to go into different packages
110  cp dirs build/files.gcc
111  cp dirs build/files.gfortran
112  cp dirs build/files.objc
113  cp dirs build/files.gcj
114  cp dirs build/files.g++
115
116  TGTDIR="%{gcclib}/@tool_target@/%{gcc_version}"
117  f=`find ${RPM_BUILD_ROOT}${TGTDIR} ! -type d -print | sed -e "s,^$RPM_BUILD_ROOT,,g"`;
118  for i in $f; do
119    case $i in
120    *lib*.la) rm ${RPM_BUILD_ROOT}/$i ;; # ignore: gcc produces bogus libtool libs
121    *f771) ;;
122    *f951) ;;
123    *cc1) ;;
124    *cc1obj) ;;
125    *cc1plus) ;; # ignore: explicitly put into rpm elsewhere
126    *collect2) ;;
127    *libobjc*) echo "$i" >> build/files.objc ;;
128    *include/objc*) ;;
129    *include/g++*);;
130    *include/c++*);;
131    *finclude/*);;
132    *adainclude*);;
133    *adalib*);;
134    *gnat1);;
135    *jc1) ;;
136    *jvgenmain) ;;
137    */libgfortran*.*) echo "$i" >> build/files.gfortran ;;
138    */libstdc++.*) echo "$i" >> build/files.g++ ;;
139    */libsupc++.*) echo "$i" >> build/files.g++ ;;
140    *) echo "$i" >> build/files.gcc ;;
141    esac
142  done
143
144  TGTDIR="%{_exec_prefix}/@tool_target@/lib"
145  f=`find ${RPM_BUILD_ROOT}${TGTDIR} ! -type d -print | sed -e "s,^$RPM_BUILD_ROOT,,g"`;
146  for i in $f; do
147    case $i in
148    *lib*.la) rm ${RPM_BUILD_ROOT}/$i;; # ignore - gcc produces bogus libtool libs
149    *libiberty.a) rm ${RPM_BUILD_ROOT}/$i ;; # ignore - GPL'ed
150# all other files belong to newlib
151    *) echo "$i" >> build/files.newlib ;;
152    esac
153  done
Note: See TracBrowser for help on using the repository browser.