PR optimization/9325, PR java/6391
[official-gcc.git] / gcc / mklibgcc.in
blobff29f752f1527a38f114fccdf22e405ced1d9c04
1 #!/bin/sh
2 # Construct makefile for libgcc.
3 # Copyright (C) 2000, 2002, 2003 Free Software Foundation, Inc.
5 # This file is part of GCC.
7 # Arguments, taken from the environment, since there are a lot
8 # of them, and positional args becomes quite ugly.
10 # objext
11 # LIB1ASMFUNCS
12 # LIB2FUNCS_ST
13 # LIBGCOV
14 # LIB2ADD
15 # LIB2ADD_ST
16 # LIB2ADDEH
17 # LIB2ADDEHDEP
18 # FPBIT
19 # FPBIT_FUNCS
20 # LIB2_DIVMOD_FUNCS
21 # DPBIT
22 # DPBIT_FUNCS
23 # TPBIT
24 # TPBIT_FUNCS
25 # LIBGCC
26 # MULTILIBS
27 # EXTRA_MULTILIB_PARTS
28 # SHLIB_EXT
29 # SHLIB_LINK
30 # SHLIB_MULTILIB
31 # SHLIB_MKMAP
32 # SHLIB_MKMAP_OPTS
33 # SHLIB_MAPFILES
34 # SHLIB_NM_FLAGS
35 # SHLIB_INSTALL
36 # MULTILIB_OSDIRNAMES
38 # Make needs VPATH to be literal.
39 echo 'srcdir = @srcdir@'
40 echo 'VPATH = @srcdir@'
41 echo 'EQ = ='
42 echo
43 echo 'force:'
44 echo
46 # Library members defined in libgcc2.c.
47 lib2funcs='_muldi3 _negdi2 _lshrdi3 _ashldi3 _ashrdi3
48 _cmpdi2 _ucmpdi2 _floatdidf _floatdisf _fixunsdfsi _fixunssfsi
49 _fixunsdfdi _fixdfdi _fixunssfdi _fixsfdi _fixxfdi _fixunsxfdi
50 _floatdixf _fixunsxfsi _fixtfdi _fixunstfdi _floatditf _clear_cache
51 _trampoline __main _absvsi2 _absvdi2 _addvsi3 _addvdi3
52 _subvsi3 _subvdi3 _mulvsi3 _mulvdi3 _negvsi2 _negvdi2 _ctors
53 _ffssi2 _ffsdi2 _clz _clzsi2 _clzdi2 _ctzsi2 _ctzdi2 _popcount_tab
54 _popcountsi2 _popcountdi2 _paritysi2 _paritydi2'
56 # Disable SHLIB_LINK if shared libgcc not enabled.
57 if [ "@enable_shared@" = "no" ]; then
58 SHLIB_LINK=""
61 # Build lines.
63 gcc_compile='$(GCC_FOR_TARGET) $(LIBGCC2_CFLAGS) $(INCLUDES)'
64 make_compile='$(MAKE) GCC_FOR_TARGET="$(GCC_FOR_TARGET)" \
65 AR_FOR_TARGET="$(AR_FOR_TARGET)" \
66 AR_CREATE_FOR_TARGET="$(AR_CREATE_FOR_TARGET)" \
67 AR_EXTRACT_FOR_TARGET="$(AR_EXTRACT_FOR_TARGET)" \
68 AR_FLAGS_FOR_TARGET="$(AR_FLAGS_FOR_TARGET)" \
69 CC="$(CC)" CFLAGS="$(CFLAGS)" \
70 BUILD_PREFIX="$(BUILD_PREFIX)" \
71 BUILD_PREFIX_1="$(BUILD_PREFIX_1)" \
72 LANGUAGES="$(LANGUAGES)"'
74 # Dependencies for libgcc2.c
75 libgcc2_c_dep='stmp-dirs $(srcdir)/libgcc2.c $(CONFIG_H) coretypes.h $(TM_H) $(MACHMODE_H) longlong.h gbl-ctors.h config.status stmp-int-hdrs tsystem.h'" $LIB2ADDEHDEP"
77 # Dependencies for libgcov.c
78 libgcov_c_dep='stmp-dirs $(srcdir)/libgcov.c $(CONFIG_H) coretypes.h $(TM_H) $(MACHMODE_H) longlong.h gbl-ctors.h config.status stmp-int-hdrs tsystem.h $(srcdir)/gcov-io.h $(srcdir)/gcov-io.c gcov-iov.h'
80 # Dependencies for fp-bit.c
81 fpbit_c_dep='stmp-dirs config.status tsystem.h'
84 # Build libgcc1 components.
87 libgcc1_objs=""
89 for name in $LIB1ASMFUNCS; do
90 for ml in $MULTILIBS; do
91 dir=`echo ${ml} | sed -e 's/;.*$//' -e 's/=/$(EQ)/g'`
92 flags=`echo ${ml} | sed -e 's/^[^;]*;//' -e 's/@/ -/g'`;
93 out="libgcc/${dir}/${name}${objext}"
95 echo ${out}: stmp-dirs '$(srcdir)/config/$(LIB1ASMSRC)'
96 echo " $gcc_compile" $flags -DL$name -xassembler-with-cpp \
97 -c '$(srcdir)/config/$(LIB1ASMSRC)' -o $out
99 # Remove any objects from lib2funcs and LIB2_DIVMOD_FUNCS that are
100 # defined as optimized assembly code in LIB1ASMFUNCS.
101 lib2funcs=`echo $lib2funcs | sed -e 's/^'$name' //' \
102 -e 's/ '$name' / /' \
103 -e 's/ '$name'$//'`
104 LIB2_DIVMOD_FUNCS=`echo $LIB2_DIVMOD_FUNCS | sed -e 's/^'$name' //' \
105 -e 's/ '$name' / /' \
106 -e 's/ '$name'$//'`
107 done
108 libgcc1_objs="$libgcc1_objs ${name}${objext}"
109 done
112 # Build libgcc2 components.
115 libgcc2_objs=""
116 libgcc2_st_objs=""
117 libgcc2_eh_objs=""
119 for name in $lib2funcs; do
120 for ml in $MULTILIBS; do
121 dir=`echo ${ml} | sed -e 's/;.*$//' -e 's/=/$(EQ)/g'`
122 flags=`echo ${ml} | sed -e 's/^[^;]*;//' -e 's/@/ -/g'`;
123 out="libgcc/${dir}/${name}${objext}"
125 echo $out: $libgcc2_c_dep
126 echo " $gcc_compile" '$(MAYBE_USE_COLLECT2)' $flags -DL$name \
127 -c '$(srcdir)/libgcc2.c' -o $out
128 done
129 libgcc2_objs="$libgcc2_objs ${name}${objext}"
130 done
132 for name in $LIB2FUNCS_ST; do
133 for ml in $MULTILIBS; do
134 dir=`echo ${ml} | sed -e 's/;.*$//' -e 's/=/$(EQ)/g'`
135 flags=`echo ${ml} | sed -e 's/^[^;]*;//' -e 's/@/ -/g'`;
136 out="libgcc/${dir}/${name}${objext}"
138 echo $out: $libgcc2_c_dep
139 echo " $gcc_compile" '$(MAYBE_USE_COLLECT2)' $flags -DL$name \
140 -c '$(srcdir)/libgcc2.c' -o $out
141 done
142 libgcc2_st_objs="$libgcc2_st_objs ${name}${objext}"
143 done
145 for name in $LIB2_DIVMOD_FUNCS; do
146 for ml in $MULTILIBS; do
147 dir=`echo ${ml} | sed -e 's/;.*$//' -e 's/=/$(EQ)/g'`
148 flags=`echo ${ml} | sed -e 's/^[^;]*;//' -e 's/@/ -/g'`;
149 out="libgcc/${dir}/${name}${objext}"
151 echo $out: $libgcc2_c_dep
152 echo " $gcc_compile" '$(MAYBE_USE_COLLECT2)' $flags -DL$name \
153 -c '$(srcdir)/libgcc2.c' -fexceptions -fnon-call-exceptions -o $out
154 done
155 libgcc2_objs="$libgcc2_objs ${name}${objext}"
156 done
158 if [ "$FPBIT" ]; then
159 for name in $FPBIT_FUNCS; do
160 for ml in $MULTILIBS; do
161 dir=`echo ${ml} | sed -e 's/;.*$//' -e 's/=/$(EQ)/g'`
162 flags=`echo ${ml} | sed -e 's/^[^;]*;//' -e 's/@/ -/g'`;
163 out="libgcc/${dir}/${name}${objext}"
165 echo $out: $FPBIT $fpbit_c_dep
166 echo " $gcc_compile" -DFINE_GRAINED_LIBRARIES $flags -DL$name \
167 -c $FPBIT -o $out
168 done
169 libgcc2_objs="$libgcc2_objs ${name}${objext}"
170 done
173 if [ "$DPBIT" ]; then
174 for name in $DPBIT_FUNCS; do
175 for ml in $MULTILIBS; do
176 dir=`echo ${ml} | sed -e 's/;.*$//' -e 's/=/$(EQ)/g'`
177 flags=`echo ${ml} | sed -e 's/^[^;]*;//' -e 's/@/ -/g'`;
178 out="libgcc/${dir}/${name}${objext}"
180 echo $out: $DPBIT $fpbit_c_dep
181 echo " $gcc_compile" -DFINE_GRAINED_LIBRARIES $flags -DL$name \
182 -c $DPBIT -o $out
183 done
184 libgcc2_objs="$libgcc2_objs ${name}${objext}"
185 done
188 if [ "$TPBIT" ]; then
189 for name in $TPBIT_FUNCS; do
190 for ml in $MULTILIBS; do
191 dir=`echo ${ml} | sed -e 's/;.*$//' -e 's/=/$(EQ)/g'`
192 flags=`echo ${ml} | sed -e 's/^[^;]*;//' -e 's/@/ -/g'`;
193 out="libgcc/${dir}/${name}${objext}"
195 echo $out: $TPBIT $fpbit_c_dep
196 echo " $gcc_compile" -DFINE_GRAINED_LIBRARIES $flags -DL$name \
197 -c $TPBIT -o $out
198 done
199 libgcc2_objs="$libgcc2_objs ${name}${objext}"
200 done
203 for file in $LIB2ADD; do
204 name=`echo $file | sed -e 's/[.][cSo]$//' -e 's/[.]asm$//' -e 's/[.]txt$//'`
205 oname=`echo $name | sed -e 's,.*/,,'`
207 for ml in $MULTILIBS; do
208 dir=`echo ${ml} | sed -e 's/;.*$//' -e 's/=/$(EQ)/g'`
209 flags=`echo ${ml} | sed -e 's/^[^;]*;//' -e 's/@/ -/g'`;
210 out="libgcc/${dir}/${oname}${objext}"
211 if [ ${name}.asm = ${file} ]; then
212 flags="$flags -xassembler-with-cpp"
215 echo $out: stmp-dirs $file
216 echo " $gcc_compile" $flags -c $file -o $out
217 done
218 libgcc2_objs="$libgcc2_objs ${oname}${objext}"
219 done
221 for file in $LIB2ADDEH; do
222 name=`echo $file | sed -e 's/[.][cSo]$//' -e 's/[.]asm$//' -e 's/[.]txt$//'`
223 oname=`echo $name | sed -e 's,.*/,,'`
225 for ml in $MULTILIBS; do
226 dir=`echo ${ml} | sed -e 's/;.*$//' -e 's/=/$(EQ)/g'`
227 flags=`echo ${ml} | sed -e 's/^[^;]*;//' -e 's/@/ -/g'`;
228 out="libgcc/${dir}/${oname}${objext}"
229 if [ ${name}.asm = ${file} ]; then
230 flags="$flags -xassembler-with-cpp"
233 echo $out: stmp-dirs $file
234 echo " $gcc_compile" $flags -fexceptions -c $file -o $out
235 done
236 if [ "$SHLIB_LINK" ]; then
237 libgcc2_eh_objs="$libgcc2_eh_objs ${oname}${objext}"
238 else
239 libgcc2_objs="$libgcc2_objs ${oname}${objext}"
241 done
243 for file in $LIB2ADD_ST; do
244 name=`echo $file | sed -e 's/[.][cSo]$//' -e 's/[.]asm$//' -e 's/[.]txt$//'`
245 oname=`echo $name | sed -e 's,.*/,,'`
247 for ml in $MULTILIBS; do
248 dir=`echo ${ml} | sed -e 's/;.*$//' -e 's/=/$(EQ)/g'`
249 flags=`echo ${ml} | sed -e 's/^[^;]*;//' -e 's/@/ -/g'`;
250 out="libgcc/${dir}/${oname}${objext}"
251 if [ ${name}.asm = ${file} ]; then
252 flags="$flags -xassembler-with-cpp"
255 echo $out: stmp-dirs $file
256 echo " $gcc_compile" $flags -c $file -o $out
257 done
258 libgcc2_st_objs="$libgcc2_st_objs ${oname}${objext}"
259 done
262 # build libgcov components
265 libgcov_objs=""
267 for name in $LIBGCOV; do
268 for ml in $MULTILIBS; do
269 dir=`echo ${ml} | sed -e 's/;.*$//' -e 's/=/$(EQ)/g'`
270 flags=`echo ${ml} | sed -e 's/^[^;]*;//' -e 's/@/ -/g'`;
271 out="libgcc/${dir}/${name}${objext}"
273 echo $out: $libgcov_c_dep
274 echo " $gcc_compile" '$(MAYBE_USE_COLLECT2)' $flags -DL$name \
275 -c '$(srcdir)/libgcov.c' -o $out
276 done
277 libgcov_objs="$libgcov_objs ${name}${objext}"
278 done
280 # SHLIB_MKMAP
281 # SHLIB_MKMAP_OPTS
282 # SHLIB_MAPFILES
283 for ml in $MULTILIBS; do
284 dir=`echo ${ml} | sed -e 's/;.*$//' -e 's/=/$(EQ)/g'`
285 flags=`echo ${ml} | sed -e 's/^[^;]*;//' -e 's/@/ -/g'`;
287 libgcc_objs=""
288 libgcc_eh_objs=""
289 for o in $libgcc1_objs; do
290 libgcc_objs="$libgcc_objs libgcc/${dir}/$o"
291 done
292 for o in $libgcc2_objs; do
293 libgcc_objs="$libgcc_objs libgcc/${dir}/$o"
294 done
295 for o in $libgcc2_eh_objs; do
296 libgcc_eh_objs="$libgcc_eh_objs libgcc/${dir}/$o"
297 done
298 libgcc_sh_objs="$libgcc_objs $libgcc_eh_objs"
299 shlib_deps="$libgcc_sh_objs"
301 libgcc_st_objs=""
302 for o in $libgcc2_st_objs; do
303 libgcc_st_objs="$libgcc_st_objs libgcc/${dir}/$o"
304 done
306 libgcov_a_objs=""
307 for o in $libgcov_objs; do
308 libgcov_a_objs="$libgcov_a_objs libgcc/${dir}/$o"
309 done
311 if [ "$SHLIB_LINK" -a "$SHLIB_MKMAP" ]; then
312 mapfile="libgcc/${dir}/libgcc.map"
313 tmpmapfile="libgcc/${dir}/tmp-libgcc.map"
314 # This uses a here document instead of echos because some shells
315 # will convert the \1 in the second sed command to a control-A.
316 # The behavior of here documents is more predictable.
317 cat <<EOF
319 ${mapfile}: $SHLIB_MKMAP $SHLIB_MAPFILES $libgcc_sh_objs
320 { \$(NM_FOR_TARGET) $SHLIB_NM_FLAGS $libgcc_sh_objs; echo %%; \\
321 cat $SHLIB_MAPFILES \\
322 | sed -e '/^[ ]*#/d' \\
323 -e 's/^%\(if\|else\|elif\|endif\|define\)/#\1/' \\
324 | $gcc_compile $flags -E -xassembler-with-cpp -; \\
325 } | \$(AWK) -f $SHLIB_MKMAP $SHLIB_MKMAP_OPTS > ${tmpmapfile}
326 mv '$tmpmapfile' \$@
329 shlib_deps="$shlib_deps $mapfile"
331 # Depend on EXTRA_MULTILIB_PARTS, since that's where crtbegin/end
332 # usually are put in a true multilib situation.
333 for f in $EXTRA_MULTILIB_PARTS; do
334 shlib_deps="$shlib_deps $dir/$f"
335 done
337 libgcc_a_objs="$libgcc_objs $libgcc_st_objs"
339 if [ "@libgcc_visibility@" = yes -a "$SHLIB_LINK" ]; then
340 libgcc_a_objs=
341 echo ""
342 echo "libgcc/${dir}/stacknote.s: stmp-dirs"
343 echo ' @( echo | $(GCC_FOR_TARGET) $(LIBGCC2_CFLAGS) '${flags}' -S -o - -xc - | grep .note.GNU-stack || : ) > $@.tmp'
344 echo ' @mv -f $@.tmp $@'
345 echo ""
346 for o in $libgcc_objs $libgcc_st_objs; do
347 # .oS objects will have all non-local symbol definitions .hidden
348 oS=`echo ${o} | sed s~${objext}'$~.oS~g'`
349 echo "${oS}: stmp-dirs libgcc/${dir}/stacknote.s ${o}"
350 echo ' ( $(NM_FOR_TARGET) '${SHLIB_NM_FLAGS} ${o}' | $(AWK) '\''NF == 3 { print "\t.hidden", $$3 }'\''; cat libgcc/${dir}/stacknote.s ) | $(GCC_FOR_TARGET) $(LIBGCC2_CFLAGS) '${flags}' -r -nostdinc -nostdlib -o $@ '${o}' -xassembler -'
351 libgcc_a_objs="${libgcc_a_objs} ${oS}"
352 done
355 # Each of these .a files depends on stmp-dirs. It would seem that
356 # this dependency is redundant, since each of the object files
357 # itself depends on stmp-dirs. However, it is possible that there
358 # are in fact no object files. In that case, the stmp-dirs
359 # dependency is required; the directory containing the archive must
360 # exist before the archive itself can be created.
361 echo ""
362 echo "${dir}/libgcc.a: stmp-dirs $libgcc_a_objs"
363 echo " -rm -rf ${dir}/libgcc.a"
364 echo ' $(AR_CREATE_FOR_TARGET)' ${dir}/libgcc.a $libgcc_a_objs
365 echo ' $(RANLIB_FOR_TARGET)' ${dir}/libgcc.a
367 echo ""
368 echo "${dir}/libgcov.a: stmp-dirs $libgcov_a_objs"
369 echo " -rm -rf ${dir}/libgcov.a"
370 echo ' $(AR_CREATE_FOR_TARGET)' ${dir}/libgcov.a $libgcov_a_objs
371 echo ' $(RANLIB_FOR_TARGET)' ${dir}/libgcov.a
373 if [ "$SHLIB_LINK" ]; then
375 echo ""
376 echo "${dir}/libgcc_eh.a: stmp-dirs $libgcc_eh_objs"
377 echo " -rm -rf ${dir}/libgcc_eh.a"
378 echo ' $(AR_CREATE_FOR_TARGET)' ${dir}/libgcc_eh.a $libgcc_eh_objs
379 echo ' $(RANLIB_FOR_TARGET)' ${dir}/libgcc_eh.a
381 if [ -z "$SHLIB_MULTILIB" ]; then
382 if [ "$dir" = . ]; then
383 shlib_base_name=libgcc_s
384 else
385 shlib_base_name=libgcc_s_`echo $dir | sed s,/,_,g`
387 shlib_so_name="$shlib_base_name"
388 shlib_dir=
389 if [ -n "$MULTILIB_OSDIRNAMES" ]; then
390 if [ "$dir" != . ]; then
391 gcc_multilib_dir=`./xgcc -B./ $flags --print-multi-directory`
392 os_multilib_dir=`./xgcc -B./ $flags --print-multi-os-directory`
393 shlib_dir="$dir"/
394 gcc_multilib_sup=`echo $gcc_multilib_dir | sed 's~^[^/]*/~~'`
395 os_multilib_base=`echo $os_multilib_dir | sed -n "s~/${gcc_multilib_sup}\$~~p"`
396 if [ -z "$os_multilib_base" ]; then
397 shlib_so_name=libgcc_s
398 else
399 shlib_so_name=libgcc_s_`echo $gcc_multilib_sup | sed s,/,_,g`
403 echo ""
404 echo "${dir}/${shlib_base_name}${SHLIB_EXT}: $shlib_deps"
405 echo " $SHLIB_LINK" \
406 | sed -e "s%@multilib_flags@%$flags%g" \
407 -e "s%@multilib_dir@%$dir%g" \
408 -e "s%@shlib_objs@%$libgcc_sh_objs%g" \
409 -e "s%@shlib_base_name@%$shlib_base_name%g" \
410 -e "s%@shlib_map_file@%$mapfile%g" \
411 -e "s%@shlib_so_name@%$shlib_so_name%g" \
412 -e "s%@shlib_dir@%$shlib_dir%g"
413 elif [ "$SHLIB_MULTILIB" = "$dir" ]; then
414 shlib_base_name="libgcc_s";
415 echo ""
416 echo "${shlib_base_name}${SHLIB_EXT}: $shlib_deps"
417 echo " $SHLIB_LINK" \
418 | sed -e "s%@multilib_flags@%$flags%g" \
419 -e "s%@multilib_dir@%$dir%g" \
420 -e "s%@shlib_objs@%$libgcc_sh_objs%g" \
421 -e "s%@shlib_base_name@%$shlib_base_name%g" \
422 -e "s%@shlib_map_file@%$mapfile%g" \
423 -e "s%@shlib_so_name@%$shlib_base_name%g" \
424 -e "s%@shlib_dir@%%g"
427 done
429 dirs=libgcc
430 for ml in $MULTILIBS; do
431 dir=`echo ${ml} | sed -e 's/;.*$//' -e 's/=/$(EQ)/g'`
432 if [ $dir != . ]; then
433 dirs="$dirs ${dir} libgcc/${dir}"
435 done
436 echo ''
437 echo 'libgcc-stage-start:'
438 echo ' for dir in '"${dirs}"'; do \'
439 echo ' if [ -d $(stage)/$$dir ]; then true; else '$mkinstalldirs' $(stage)/$$dir; fi; \'
440 echo ' done'
441 echo ' -for dir in '"${dirs}"'; do \'
442 echo ' mv $$dir/*'"${objext}"' $(stage)/$$dir; \'
443 echo ' test ! -f $$dir/stacknote.s || mv $$dir/stacknote.s $(stage)/$$dir; \'
444 echo ' test ! -f $$dir/libgcc.a || mv $$dir/lib* $(stage)/$$dir; \'
445 echo ' done'
447 echo ""
448 all=stmp-dirs
449 dirs=libgcc
451 for ml in $MULTILIBS; do
452 dir=`echo ${ml} | sed -e 's/;.*$//' -e 's/=/$(EQ)/g'`
453 if [ $dir != . ]; then
454 dirs="$dirs ${dir} libgcc/${dir}"
456 all="$all ${dir}/libgcc.a ${dir}/libgcov.a"
457 if [ "$SHLIB_LINK" ]; then
458 all="$all ${dir}/libgcc_eh.a"
459 if [ -z "$SHLIB_MULTILIB" ]; then
460 if [ "$dir" = "." ]; then
461 suff="";
462 else
463 suff=_`echo $dir | sed s,/,_,g`
465 all="$all ${dir}/libgcc_s${suff}${SHLIB_EXT}"
466 elif [ "$SHLIB_MULTILIB" = "$dir" ]; then
467 all="$all libgcc_s${SHLIB_EXT}"
470 done
472 echo 'stmp-dirs: force'
473 echo ' for d in '"$dirs"'; do \'
474 echo ' if [ -d $$d ]; then true; else '$mkinstalldirs' $$d; fi; \'
475 echo ' done'
476 echo ' if [ -f stmp-dirs ]; then true; else touch stmp-dirs; fi'
478 for f in $EXTRA_MULTILIB_PARTS; do
479 for ml in $MULTILIBS; do
480 dir=`echo ${ml} | sed -e 's/;.*$//' -e 's/=/$(EQ)/g'`
481 flags=`echo ${ml} | sed -e 's/^[^;]*;//' -e 's/@/ -/g'`;
482 case $dir in
483 .) out=$f ; t= ;;
484 *) out=$dir/$f ; t=$dir/ ;;
485 esac
486 case $out in
487 # Prevent `make' from interpreting $out as a macro assignment
488 *'$(EQ)'*) targ="T_TARGET=$out T_TARGET" ;;
489 *) targ=$out ;;
490 esac
492 echo $out: stmp-dirs
493 echo " $make_compile" \\
494 echo ' LIBGCC2_CFLAGS="$(LIBGCC2_CFLAGS)' $flags '" ' \\
495 echo ' MULTILIB_CFLAGS="'$flags'"' T=$t $targ
497 all="$all $out"
498 done
499 done
501 echo ""
502 echo "all: $all"
504 echo ""
505 echo "install: $all"
506 for ml in $MULTILIBS; do
507 dir=`echo ${ml} | sed -e 's/;.*$//' -e 's/=/$(EQ)/g'`
508 flags=`echo ${ml} | sed -e 's/^[^;]*;//' -e 's/@/ -/g'`;
509 if [ $dir != . ]; then
510 ldir='$(DESTDIR)$(libsubdir)'/$dir
511 echo " if [ -d $ldir ]; then true; else $mkinstalldirs $ldir; chmod a+rx $ldir; fi;"
512 else
513 ldir='$(DESTDIR)$(libsubdir)'
515 echo ' $(INSTALL_DATA)' ${dir}/libgcc.a ${ldir}/
516 echo ' $(RANLIB_FOR_TARGET)' ${ldir}/libgcc.a
517 echo ' $(INSTALL_DATA)' ${dir}/libgcov.a ${ldir}/
518 echo ' $(RANLIB_FOR_TARGET)' ${ldir}/libgcov.a
520 if [ "$SHLIB_LINK" ]; then
521 echo ' $(INSTALL_DATA)' ${dir}/libgcc_eh.a ${ldir}/
522 echo ' $(RANLIB_FOR_TARGET)' ${ldir}/libgcc_eh.a
524 if [ -z "$SHLIB_MULTILIB" ]; then
525 if [ "$dir" = . ]; then
526 shlib_base_name=libgcc_s
527 else
528 shlib_base_name=libgcc_s_`echo $dir | sed s,/,_,g`
530 shlib_so_name="$shlib_base_name"
531 shlib_dir=
532 shlib_slibdir_qual=
533 if [ -n "$MULTILIB_OSDIRNAMES" ]; then
534 gcc_multilib_dir=`./xgcc -B./ $flags --print-multi-directory`
535 os_multilib_dir=`./xgcc -B./ $flags --print-multi-os-directory`
536 if [ "$dir" != . ]; then
537 shlib_dir="$dir"/
539 gcc_multilib_sup=`echo $gcc_multilib_dir | sed 's~^[^/]*/~~'`
540 os_multilib_base=`echo $os_multilib_dir | sed -n "s~/${gcc_multilib_sup}\$~~p"`
541 if [ -z "$os_multilib_base" ]; then
542 shlib_so_name=libgcc_s
543 if [ "$os_multilib_dir" != "." ]; then
544 shlib_slibdir_qual="/$os_multilib_dir"
546 else
547 shlib_so_name=libgcc_s_`echo $gcc_multilib_sup | sed s,/,_,g`
548 shlib_slibdir_qual="/$os_multilib_base"
551 echo " $SHLIB_INSTALL" \
552 | sed -e "s%@shlib_base_name@%$shlib_base_name%g" \
553 -e "s%@shlib_so_name@%$shlib_so_name%g" \
554 -e "s%@shlib_dir@%$shlib_dir%g" \
555 -e "s%@shlib_slibdir_qual@%$shlib_slibdir_qual%g"
556 elif [ "$SHLIB_MULTILIB" = "$dir" ]; then
557 shlib_base_name="libgcc_s";
558 echo " $SHLIB_INSTALL" \
559 | sed -e "s%@shlib_base_name@%$shlib_base_name%g" \
560 -e "s%@shlib_so_name@%$shlib_base_name%g" \
561 -e "s%@shlib_dir@%%g" \
562 -e "s%@shlib_slibdir_qual@%%g"
565 done
566 for f in $EXTRA_MULTILIB_PARTS; do
567 for ml in $MULTILIBS; do
568 dir=`echo ${ml} | sed -e 's/;.*$//' -e 's/=/$(EQ)/g'`
569 if [ $dir != . ]; then
570 out=${dir}/$f
571 ldir='$(DESTDIR)$(libsubdir)'/$dir
572 else
573 out=$f
574 ldir='$(DESTDIR)$(libsubdir)'
576 echo ' $(INSTALL_DATA)' $out $ldir/
577 done
578 done