58 Patch0: gcc.patch |
58 Patch0: gcc.patch |
59 |
59 |
60 # build information |
60 # build information |
61 Prefix: %{l_prefix} |
61 Prefix: %{l_prefix} |
62 BuildRoot: %{l_buildroot} |
62 BuildRoot: %{l_buildroot} |
63 BuildPreReq: OpenPKG, openpkg >= 20060823, make |
63 BuildPreReq: OpenPKG, openpkg >= 20060823, make, libtool |
64 PreReq: OpenPKG, openpkg >= 20060823 |
64 PreReq: OpenPKG, openpkg >= 20060823 |
65 %if "%{with_binutils}" == "yes" |
65 %if "%{with_binutils}" == "yes" |
66 BuildPreReq: binutils >= 2.14 |
66 BuildPreReq: binutils >= 2.14 |
67 PreReq: binutils >= 2.14 |
67 PreReq: binutils >= 2.14 |
68 %endif |
68 %endif |
106 %endif |
106 %endif |
107 %if "%{with_fortran}" == "yes" |
107 %if "%{with_fortran}" == "yes" |
108 %setup -q -T -D -b 4 |
108 %setup -q -T -D -b 4 |
109 %endif |
109 %endif |
110 %patch -p0 |
110 %patch -p0 |
|
111 %{l_shtool} subst -v -s \ |
|
112 -e 's;\(gmplibs="-lmpc\) \(-lmpfr -lgmp\);\1 -lm \2;' \ |
|
113 configure |
111 %{l_shtool} subst -v -s \ |
114 %{l_shtool} subst -v -s \ |
112 -e 's;PREFIX_INCLUDE_DIR;PREFIX_INCLUDE_DIR_DISABLED;g' \ |
115 -e 's;PREFIX_INCLUDE_DIR;PREFIX_INCLUDE_DIR_DISABLED;g' \ |
113 gcc/configure |
116 gcc/configure |
114 if [ ".%{V_comp}" != . ]; then |
117 if [ ".%{V_comp}" != . ]; then |
115 %{l_shtool} subst -v -s \ |
118 %{l_shtool} subst -v -s \ |
132 # create build sub-directory |
135 # create build sub-directory |
133 %{l_shtool} mkdir -p obj |
136 %{l_shtool} mkdir -p obj |
134 cd obj |
137 cd obj |
135 |
138 |
136 # solve strange compatability problems |
139 # solve strange compatability problems |
137 case "%{l_platform -t}" in |
140 %if "%{with_binutils}" == "yes" |
138 *-sunos* ) |
141 # determine ld(1) and as(1) usage, allowing either |
139 %if "%{with_binutils}" == "no" |
142 # one to be from the GNU distribution of binutils |
140 ( echo "Building GCC on Solaris OS requires GNU as, however" |
143 LD=%{l_tool_locate ld ld} |
141 echo "the OS native linker will be used in place of GNU ld." |
144 AS=%{l_tool_locate as as} |
142 echo "" |
|
143 echo "To solve this problem, install the binutils package" |
|
144 echo "and build GCC again using the option 'with_binutils'." |
|
145 echo "OpenPKG will ignore GNU ld but use GNU as to build GCC." |
|
146 echo "" |
|
147 echo "Please note that this condition applies to OpenPKG" |
|
148 echo "building of the GCC package on Solaris only!" |
|
149 ) | %{l_rpmtool} msg -b -t warn |
|
150 exit 1; |
|
151 ;; |
|
152 %else |
145 %else |
153 # locate ld(1) and as(1), using the GNU assembler |
146 # locate ld(1) and as(1), using the GNU assembler |
154 # but ignoring the presence of any OpenPKG linker |
147 # but ignoring the presence of any OpenPKG linker |
155 LD=`PATH=/bin:/sbin:/usr/bin:/usr/sbin:/usr/ccs/bin:/opt/bin:/opt/sbin \ |
148 LD=`PATH=/bin:/sbin:/usr/bin:/usr/sbin:/usr/ccs/bin:/opt/bin:/opt/sbin which ld` |
156 which ld` |
149 AS=`PATH=/bin:/sbin:/usr/bin:/usr/sbin:/usr/ccs/bin:/opt/bin:/opt/sbin which as` |
157 ;; |
150 %endif |
158 %endif |
|
159 *-* ) |
|
160 # determine ld(1) and as(1) usage, allowing either |
|
161 # one to be from the GNU distribution of binutils |
|
162 LD=%{l_tool_locate ld ld} |
|
163 ;; |
|
164 esac |
|
165 l_with_gnu_ld_as="" |
151 l_with_gnu_ld_as="" |
166 AS=%{l_tool_locate as as} |
|
167 echo $LD | grep '^/' >/dev/null && l_with_gnu_ld_as="--with-ld=$LD" |
152 echo $LD | grep '^/' >/dev/null && l_with_gnu_ld_as="--with-ld=$LD" |
168 echo $AS | grep '^/' >/dev/null && l_with_gnu_ld_as="${l_with_gnu_ld_as} --with-as=$AS" |
153 echo $AS | grep '^/' >/dev/null && l_with_gnu_ld_as="${l_with_gnu_ld_as} --with-as=$AS" |
169 $LD --version </dev/null 2>/dev/null | grep "^GNU ld " >/dev/null && l_with_gnu_ld_as="${l_with_gnu_ld_as} --with-gnu-ld" || l_with_gnu_ld_as="${l_with_gnu_ld_as} --without-gnu-ld" |
154 $LD --version </dev/null 2>/dev/null | grep "^GNU ld " >/dev/null && l_with_gnu_ld_as="${l_with_gnu_ld_as} --with-gnu-ld" || l_with_gnu_ld_as="${l_with_gnu_ld_as} --without-gnu-ld" |
170 $AS --version </dev/null 2>/dev/null | grep "^GNU assembler " >/dev/null && l_with_gnu_ld_as="${l_with_gnu_ld_as} --with-gnu-as" || l_with_gnu_ld_as="${l_with_gnu_ld_as} --without-gnu-as" |
155 $AS --version </dev/null 2>/dev/null | grep "^GNU assembler " >/dev/null && l_with_gnu_ld_as="${l_with_gnu_ld_as} --with-gnu-as" || l_with_gnu_ld_as="${l_with_gnu_ld_as} --without-gnu-as" |
171 |
156 |