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.
33 # EXTRA_MULTILIB_PARTS
44 # Make needs VPATH to be literal.
45 echo 'srcdir = @srcdir@'
46 echo 'VPATH = @srcdir@'
52 # Library members defined in libgcc2.c.
53 lib2funcs
='_muldi3 _negdi2 _lshrdi3 _ashldi3 _ashrdi3
54 _cmpdi2 _ucmpdi2 _floatdidf _floatdisf _fixunsdfsi _fixunssfsi
55 _fixunsdfdi _fixdfdi _fixunssfdi _fixsfdi _fixxfdi _fixunsxfdi
56 _floatdixf _fixunsxfsi _fixtfdi _fixunstfdi _floatditf _clear_cache
57 _enable_execute_stack _trampoline __main _absvsi2 _absvdi2 _addvsi3
58 _addvdi3 _subvsi3 _subvdi3 _mulvsi3 _mulvdi3 _negvsi2 _negvdi2 _ctors
59 _ffssi2 _ffsdi2 _clz _clzsi2 _clzdi2 _ctzsi2 _ctzdi2 _popcount_tab
60 _popcountsi2 _popcountdi2 _paritysi2 _paritydi2'
62 # Disable SHLIB_LINK if shared libgcc not enabled.
63 if [ "@enable_shared@" = "no" ]; then
69 gcc_compile
='$(GCC_FOR_TARGET) $(LIBGCC2_CFLAGS) $(INCLUDES)'
70 make_compile
='$(MAKE) GCC_FOR_TARGET="$(GCC_FOR_TARGET)" \
71 AR_FOR_TARGET="$(AR_FOR_TARGET)" \
72 AR_CREATE_FOR_TARGET="$(AR_CREATE_FOR_TARGET)" \
73 AR_EXTRACT_FOR_TARGET="$(AR_EXTRACT_FOR_TARGET)" \
74 AR_FLAGS_FOR_TARGET="$(AR_FLAGS_FOR_TARGET)" \
75 CC="$(CC)" CFLAGS="$(CFLAGS)" \
76 BUILD_PREFIX="$(BUILD_PREFIX)" \
77 BUILD_PREFIX_1="$(BUILD_PREFIX_1)" \
78 LANGUAGES="$(LANGUAGES)"'
80 # Generic dependencies for libgcc
81 libgcc_dep
='$(CONFIG_H) coretypes.h $(TM_H) $(MACHMODE_H) longlong.h config.status stmp-int-hdrs tsystem.h'
83 # Dependencies for libgcc2.c
84 libgcc2_c_dep
='stmp-dirs $(srcdir)/libgcc2.c gbl-ctors.h'" $libgcc_dep"
86 # Dependencies for libgcov.c
87 libgcov_c_dep
='stmp-dirs $(srcdir)/libgcov.c $(srcdir)/gcov-io.h $(srcdir)/gcov-io.c gcov-iov.h'" $libgcc_dep"
89 # Dependencies for fp-bit.c
90 fpbit_c_dep
='stmp-dirs config.status tsystem.h'
93 # Build libgcc1 components.
98 for name
in $LIB1ASMFUNCS; do
99 for ml
in $MULTILIBS; do
100 dir
=`echo ${ml} | sed -e 's/;.*$//' -e 's/=/$(EQ)/g'`
101 flags
=`echo ${ml} | sed -e 's/^[^;]*;//' -e 's/@/ -/g'`;
102 out
="libgcc/${dir}/${name}${objext}"
104 echo ${out}: stmp-dirs
'$(srcdir)/config/$(LIB1ASMSRC)'
105 echo " $gcc_compile" $flags -DL$name -xassembler-with-cpp \
106 -c '$(srcdir)/config/$(LIB1ASMSRC)' -o $out
108 # Remove any objects from lib2funcs and LIB2_DIVMOD_FUNCS that are
109 # defined as optimized assembly code in LIB1ASMFUNCS.
110 lib2funcs
=`echo $lib2funcs | sed -e 's/^'$name' //' \
111 -e 's/ '$name' / /' \
113 LIB2_DIVMOD_FUNCS
=`echo $LIB2_DIVMOD_FUNCS | sed -e 's/^'$name' //' \
114 -e 's/ '$name' / /' \
117 libgcc1_objs
="$libgcc1_objs ${name}${objext}"
121 # Build libgcc2 components.
126 libgcc2_eh_static_objs
=""
127 libgcc2_eh_shared_objs
=""
129 for name
in $lib2funcs; do
130 for ml
in $MULTILIBS; do
131 dir
=`echo ${ml} | sed -e 's/;.*$//' -e 's/=/$(EQ)/g'`
132 flags
=`echo ${ml} | sed -e 's/^[^;]*;//' -e 's/@/ -/g'`;
133 out
="libgcc/${dir}/${name}${objext}"
135 echo $out: $libgcc2_c_dep
136 echo " $gcc_compile" $flags -DL$name \
137 -c '$(srcdir)/libgcc2.c' -o $out
139 libgcc2_objs
="$libgcc2_objs ${name}${objext}"
142 for name
in $LIB2FUNCS_ST; do
143 for ml
in $MULTILIBS; do
144 dir
=`echo ${ml} | sed -e 's/;.*$//' -e 's/=/$(EQ)/g'`
145 flags
=`echo ${ml} | sed -e 's/^[^;]*;//' -e 's/@/ -/g'`;
146 out
="libgcc/${dir}/${name}${objext}"
148 echo $out: $libgcc2_c_dep
149 echo " $gcc_compile" $flags -DL$name \
150 -c '$(srcdir)/libgcc2.c' -o $out
152 libgcc2_st_objs
="$libgcc2_st_objs ${name}${objext}"
155 for name
in $LIB2_DIVMOD_FUNCS; do
156 for ml
in $MULTILIBS; do
157 dir
=`echo ${ml} | sed -e 's/;.*$//' -e 's/=/$(EQ)/g'`
158 flags
=`echo ${ml} | sed -e 's/^[^;]*;//' -e 's/@/ -/g'`;
159 out
="libgcc/${dir}/${name}${objext}"
161 echo $out: $libgcc2_c_dep
162 echo " $gcc_compile" $flags -DL$name \
163 -c '$(srcdir)/libgcc2.c' -fexceptions -fnon-call-exceptions -o $out
165 libgcc2_objs
="$libgcc2_objs ${name}${objext}"
168 if [ "$FPBIT" ]; then
169 for name
in $FPBIT_FUNCS; do
170 for ml
in $MULTILIBS; do
171 dir
=`echo ${ml} | sed -e 's/;.*$//' -e 's/=/$(EQ)/g'`
172 flags
=`echo ${ml} | sed -e 's/^[^;]*;//' -e 's/@/ -/g'`;
173 out
="libgcc/${dir}/${name}${objext}"
175 echo $out: $FPBIT $fpbit_c_dep
176 echo " $gcc_compile" -DFINE_GRAINED_LIBRARIES $flags -DL$name \
179 libgcc2_objs
="$libgcc2_objs ${name}${objext}"
183 if [ "$DPBIT" ]; then
184 for name
in $DPBIT_FUNCS; do
185 for ml
in $MULTILIBS; do
186 dir
=`echo ${ml} | sed -e 's/;.*$//' -e 's/=/$(EQ)/g'`
187 flags
=`echo ${ml} | sed -e 's/^[^;]*;//' -e 's/@/ -/g'`;
188 out
="libgcc/${dir}/${name}${objext}"
190 echo $out: $DPBIT $fpbit_c_dep
191 echo " $gcc_compile" -DFINE_GRAINED_LIBRARIES $flags -DL$name \
194 libgcc2_objs
="$libgcc2_objs ${name}${objext}"
198 if [ "$TPBIT" ]; then
199 for name
in $TPBIT_FUNCS; do
200 for ml
in $MULTILIBS; do
201 dir
=`echo ${ml} | sed -e 's/;.*$//' -e 's/=/$(EQ)/g'`
202 flags
=`echo ${ml} | sed -e 's/^[^;]*;//' -e 's/@/ -/g'`;
203 out
="libgcc/${dir}/${name}${objext}"
205 echo $out: $TPBIT $fpbit_c_dep
206 echo " $gcc_compile" -DFINE_GRAINED_LIBRARIES $flags -DL$name \
209 libgcc2_objs
="$libgcc2_objs ${name}${objext}"
213 for file in $LIB2ADD; do
214 name
=`echo $file | sed -e 's/[.][cSo]$//' -e 's/[.]asm$//' -e 's/[.]txt$//'`
215 oname
=`echo $name | sed -e 's,.*/,,'`
217 for ml
in $MULTILIBS; do
218 dir
=`echo ${ml} | sed -e 's/;.*$//' -e 's/=/$(EQ)/g'`
219 flags
=`echo ${ml} | sed -e 's/^[^;]*;//' -e 's/@/ -/g'`;
220 out
="libgcc/${dir}/${oname}${objext}"
221 if [ ${name}.asm
= ${file} ]; then
222 flags
="$flags -xassembler-with-cpp"
225 echo $out: stmp-dirs
$file $libgcc_dep
226 echo " $gcc_compile" $flags -c $file -o $out
228 libgcc2_objs
="$libgcc2_objs ${oname}${objext}"
231 for file in $LIB2ADDEH; do
232 name
=`echo $file | sed -e 's/[.][cSo]$//' -e 's/[.]asm$//' -e 's/[.]txt$//'`
233 oname
=`echo $name | sed -e 's,.*/,,'`
235 for ml
in $MULTILIBS; do
236 dir
=`echo ${ml} | sed -e 's/;.*$//' -e 's/=/$(EQ)/g'`
237 flags
=`echo ${ml} | sed -e 's/^[^;]*;//' -e 's/@/ -/g'`;
238 out
="libgcc/${dir}/${oname}${objext}"
239 if [ ${name}.asm
= ${file} ]; then
240 flags
="$flags -xassembler-with-cpp"
243 echo $out: stmp-dirs
$file $LIB2ADDEHDEP $libgcc_dep
244 echo " $gcc_compile" $flags -fexceptions -c $file -o $out
246 if [ -z "$SHLIB_LINK" ]; then
247 libgcc2_objs
="$libgcc2_objs ${oname}${objext}"
251 if [ "$SHLIB_LINK" ]; then
252 # Those should be in libgcc_eh.a.
253 for file in $LIB2ADDEHSTATIC; do
254 name
=`echo $file | sed -e 's/[.][cSo]$//' -e 's/[.]asm$//' -e 's/[.]txt$//'`
255 oname
=`echo $name | sed -e 's,.*/,,'`
256 libgcc2_eh_static_objs
="$libgcc2_eh_static_objs ${oname}${objext}"
259 # Those should be in libgcc.so.
260 for file in $LIB2ADDEHSHARED; do
261 name
=`echo $file | sed -e 's/[.][cSo]$//' -e 's/[.]asm$//' -e 's/[.]txt$//'`
262 oname
=`echo $name | sed -e 's,.*/,,'`
263 libgcc2_eh_shared_objs
="$libgcc2_eh_shared_objs ${oname}${objext}"
267 for file in $LIB2ADD_ST; do
268 name
=`echo $file | sed -e 's/[.][cSo]$//' -e 's/[.]asm$//' -e 's/[.]txt$//'`
269 oname
=`echo $name | sed -e 's,.*/,,'`
271 for ml
in $MULTILIBS; do
272 dir
=`echo ${ml} | sed -e 's/;.*$//' -e 's/=/$(EQ)/g'`
273 flags
=`echo ${ml} | sed -e 's/^[^;]*;//' -e 's/@/ -/g'`;
274 out
="libgcc/${dir}/${oname}${objext}"
275 if [ ${name}.asm
= ${file} ]; then
276 flags
="$flags -xassembler-with-cpp"
279 echo $out: stmp-dirs
$file $libgcc_dep
280 echo " $gcc_compile" $flags -c $file -o $out
282 libgcc2_st_objs
="$libgcc2_st_objs ${oname}${objext}"
285 if [ "$LIBUNWIND" ]; then
286 libunwind_static_objs
=""
287 libunwind_shared_objs
=""
288 for file in $LIBUNWIND; do
289 name
=`echo $file | sed -e 's/[.][cSo]$//' -e 's/[.]asm$//' -e 's/[.]txt$//'`
290 oname
=`echo $name | sed -e 's,.*/,,'`
292 for ml
in $MULTILIBS; do
293 dir
=`echo ${ml} | sed -e 's/;.*$//' -e 's/=/$(EQ)/g'`
294 flags
=`echo ${ml} | sed -e 's/^[^;]*;//' -e 's/@/ -/g'`;
295 out
="libgcc/${dir}/${oname}${objext}"
296 if [ ${name}.asm
= ${file} ]; then
297 flags
="$flags -xassembler-with-cpp"
300 echo $out: stmp-dirs
$file $LIBUNWINDDEP
301 echo " $gcc_compile" $flags -fexceptions -c $file -o $out
302 echo ${out}s
: stmp-dirs
$file $LIBUNWINDDEP
303 echo " $gcc_compile" $flags -fexceptions -DSHARED -c $file -o ${out}s
305 libunwind_static_objs
="$libunwind_static_objs ${oname}${objext}"
306 libunwind_shared_objs
="$libunwind_shared_objs ${oname}${objext}s"
311 # build libgcov components
316 for name
in $LIBGCOV; do
317 for ml
in $MULTILIBS; do
318 dir
=`echo ${ml} | sed -e 's/;.*$//' -e 's/=/$(EQ)/g'`
319 flags
=`echo ${ml} | sed -e 's/^[^;]*;//' -e 's/@/ -/g'`;
320 out
="libgcc/${dir}/${name}${objext}"
322 echo $out: $libgcov_c_dep
323 echo " $gcc_compile" $flags -DL$name \
324 -c '$(srcdir)/libgcov.c' -o $out
326 libgcov_objs
="$libgcov_objs ${name}${objext}"
332 for ml
in $MULTILIBS; do
333 dir
=`echo ${ml} | sed -e 's/;.*$//' -e 's/=/$(EQ)/g'`
334 flags
=`echo ${ml} | sed -e 's/^[^;]*;//' -e 's/@/ -/g'`;
337 libgcc_eh_static_objs
=""
338 libgcc_eh_shared_objs
=""
339 for o
in $libgcc1_objs; do
340 libgcc_objs
="$libgcc_objs libgcc/${dir}/$o"
342 for o
in $libgcc2_objs; do
343 libgcc_objs
="$libgcc_objs libgcc/${dir}/$o"
345 for o
in $libgcc2_eh_static_objs; do
346 libgcc_eh_static_objs
="$libgcc_eh_static_objs libgcc/${dir}/$o"
348 for o
in $libgcc2_eh_shared_objs; do
349 libgcc_eh_shared_objs
="$libgcc_eh_shared_objs libgcc/${dir}/$o"
351 libgcc_sh_objs
="$libgcc_objs $libgcc_eh_shared_objs"
352 shlib_deps
="$libgcc_sh_objs"
355 for o
in $libgcc2_st_objs; do
356 libgcc_st_objs
="$libgcc_st_objs libgcc/${dir}/$o"
360 for o
in $libgcov_objs; do
361 libgcov_a_objs
="$libgcov_a_objs libgcc/${dir}/$o"
364 if [ "$LIBUNWIND" ]; then
366 for o
in $libunwind_static_objs; do
367 libunwind_a_objs
="$libunwind_a_objs libgcc/${dir}/$o"
370 for o
in $libunwind_shared_objs; do
371 libunwind_sh_objs
="$libunwind_sh_objs libgcc/${dir}/$o"
373 shlibunwind_deps
="$libunwind_sh_objs"
376 if [ "$SHLIB_LINK" -a "$SHLIB_MKMAP" ]; then
377 mapfile
="libgcc/${dir}/libgcc.map"
378 tmpmapfile
="libgcc/${dir}/tmp-libgcc.map"
379 # This uses a here document instead of echos because some shells
380 # will convert the \1 in the second sed command to a control-A.
381 # The behavior of here documents is more predictable.
384 ${mapfile}: $SHLIB_MKMAP $SHLIB_MAPFILES $libgcc_sh_objs
385 { \$(NM_FOR_TARGET) $SHLIB_NM_FLAGS $libgcc_sh_objs; echo %%; \\
386 cat $SHLIB_MAPFILES \\
387 | sed -e '/^[ ]*#/d' \\
388 -e 's/^%\(if\|else\|elif\|endif\|define\)/#\1/' \\
389 | $gcc_compile $flags -E -xassembler-with-cpp -; \\
390 } | \$(AWK) -f $SHLIB_MKMAP $SHLIB_MKMAP_OPTS > ${tmpmapfile}
394 shlib_deps
="$shlib_deps $mapfile"
396 # Depend on EXTRA_MULTILIB_PARTS, since that's where crtbegin/end
397 # usually are put in a true multilib situation.
398 for f
in $EXTRA_MULTILIB_PARTS; do
399 shlib_deps
="$shlib_deps $dir/$f"
402 libgcc_a_objs
="$libgcc_objs $libgcc_st_objs"
404 if [ "@libgcc_visibility@" = yes -a "$SHLIB_LINK" ]; then
407 echo "libgcc/${dir}/stacknote.s: stmp-dirs"
408 echo ' @( echo | $(GCC_FOR_TARGET) $(LIBGCC2_CFLAGS) '${flags}' -S -o - -xc - | grep .note.GNU-stack || : ) > $@.tmp'
409 echo ' @mv -f $@.tmp $@'
411 for o
in $libgcc_objs $libgcc_st_objs; do
412 # .oS objects will have all non-local symbol definitions .hidden
413 oS
=`echo ${o} | sed s~${objext}'$~.oS~g'`
414 echo "${oS}: stmp-dirs libgcc/${dir}/stacknote.s ${o}"
415 # non-GNU nm emits three fields even for undefined and typeless symbols,
416 # so explicitly omit them
417 echo ' ( $(NM_FOR_TARGET) '${SHLIB_NM_FLAGS} ${o}' | $(AWK) '\''NF == 3 && $$2 !~ /^[UN]$$/ { print "\t.hidden", $$3 }'\''; cat libgcc/${dir}/stacknote.s ) | $(GCC_FOR_TARGET) $(LIBGCC2_CFLAGS) '${flags}' -r -nostdinc -nostdlib -o $@ '${o}' -xassembler -'
418 libgcc_a_objs
="${libgcc_a_objs} ${oS}"
422 # Each of these .a files depends on stmp-dirs. It would seem that
423 # this dependency is redundant, since each of the object files
424 # itself depends on stmp-dirs. However, it is possible that there
425 # are in fact no object files. In that case, the stmp-dirs
426 # dependency is required; the directory containing the archive must
427 # exist before the archive itself can be created.
429 echo "${dir}/libgcc.a: stmp-dirs $libgcc_a_objs"
430 echo " -rm -rf ${dir}/libgcc.a"
431 echo ' $(AR_CREATE_FOR_TARGET)' ${dir}/libgcc.a
$libgcc_a_objs
432 echo ' $(RANLIB_FOR_TARGET)' ${dir}/libgcc.a
435 echo "${dir}/libgcov.a: stmp-dirs $libgcov_a_objs"
436 echo " -rm -rf ${dir}/libgcov.a"
437 echo ' $(AR_CREATE_FOR_TARGET)' ${dir}/libgcov.a
$libgcov_a_objs
438 echo ' $(RANLIB_FOR_TARGET)' ${dir}/libgcov.a
440 if [ "$LIBUNWIND" ]; then
442 echo "${dir}/libunwind.a: stmp-dirs $libunwind_a_objs"
443 echo " -rm -rf ${dir}/libunwind.a"
444 echo ' $(AR_CREATE_FOR_TARGET)' ${dir}/libunwind.a
$libunwind_a_objs
445 echo ' $(RANLIB_FOR_TARGET)' ${dir}/libunwind.a
447 echo "${dir}/libgcc.a: ${dir}/libunwind.a"
450 if [ "$SHLIB_LINK" ]; then
453 echo "${dir}/libgcc_eh.a: stmp-dirs $libgcc_eh_static_objs"
454 echo " -rm -rf ${dir}/libgcc_eh.a"
455 echo ' $(AR_CREATE_FOR_TARGET)' ${dir}/libgcc_eh.a
$libgcc_eh_static_objs
456 echo ' $(RANLIB_FOR_TARGET)' ${dir}/libgcc_eh.a
458 if [ -z "$SHLIB_MULTILIB" ]; then
459 if [ "$dir" = .
]; then
460 shlib_base_name
=libgcc_s
461 shlibunwind_base_name
=libunwind
463 shlib_base_name
=libgcc_s_
`echo $dir | sed s,/,_,g`
464 shlibunwind_base_name
=libunwind_
`echo $dir | sed s,/,_,g`
466 shlib_so_name
="$shlib_base_name"
467 shlibunwind_so_name
="$shlibunwind_base_name"
468 if [ "$LIBUNWIND" ]; then
469 shlib_deps
="$shlib_deps ${dir}/${shlibunwind_base_name}${SHLIB_EXT}"
473 if [ -n "$MULTILIB_OSDIRNAMES" ]; then
474 if [ "$dir" != .
]; then
475 gcc_multilib_dir
=`./xgcc -B./ $flags --print-multi-directory`
476 os_multilib_dir
=`./xgcc -B./ $flags --print-multi-os-directory`
478 gcc_multilib_sup
=`echo $gcc_multilib_dir | sed 's~^[^/]*/~~'`
479 os_multilib_base
=`echo $os_multilib_dir | sed -n "s~/${gcc_multilib_sup}\$~~p"`
480 if [ -z "$os_multilib_base" ]; then
481 shlib_so_name
=libgcc_s
482 shlibunwind_so_name
=libunwind
483 if [ "$os_multilib_dir" != "." ]; then
484 shlib_slibdir_qual
="/$os_multilib_dir"
487 shlib_so_name
=libgcc_s_
`echo $gcc_multilib_sup | sed s,/,_,g`
488 shlibunwind_so_name
=libunwind_
`echo $gcc_multilib_sup | sed s,/,_,g`
489 shlib_slibdir_qual
="/$os_multilib_base"
494 echo "${dir}/${shlib_base_name}${SHLIB_EXT}: $shlib_deps"
495 echo " $SHLIB_LINK" \
496 |
sed -e "s%@multilib_flags@%$flags%g" \
497 -e "s%@multilib_dir@%$dir%g" \
498 -e "s%@shlib_objs@%$libgcc_sh_objs%g" \
499 -e "s%@shlib_base_name@%$shlib_base_name%g" \
500 -e "s%@shlib_map_file@%$mapfile%g" \
501 -e "s%@shlib_so_name@%$shlib_so_name%g" \
502 -e "s%@shlib_dir@%$shlib_dir%g" \
503 -e "s%@shlib_slibdir_qual@%%g"
504 if [ "$LIBUNWIND" ]; then
506 echo "${dir}/${shlibunwind_base_name}${SHLIB_EXT}: $shlibunwind_deps"
507 echo " $SHLIBUNWIND_LINK" \
508 |
sed -e "s%@multilib_flags@%$flags%g" \
509 -e "s%@multilib_dir@%$dir%g" \
510 -e "s%@shlib_objs@%$libunwind_sh_objs%g" \
511 -e "s%@shlib_base_name@%$shlibunwind_base_name%g" \
512 -e "s%@shlib_so_name@%$shlibunwind_so_name%g" \
513 -e "s%@shlib_dir@%$shlib_dir%g" \
514 -e "s%@shlib_slibdir_qual@%%g"
516 elif [ "$SHLIB_MULTILIB" = "$dir" ]; then
517 shlib_base_name
="libgcc_s";
518 shlibunwind_base_name
="libunwind";
520 echo "${shlib_base_name}${SHLIB_EXT}: $shlib_deps"
521 echo " $SHLIB_LINK" \
522 |
sed -e "s%@multilib_flags@%$flags%g" \
523 -e "s%@multilib_dir@%$dir%g" \
524 -e "s%@shlib_objs@%$libgcc_sh_objs%g" \
525 -e "s%@shlib_base_name@%$shlib_base_name%g" \
526 -e "s%@shlib_map_file@%$mapfile%g" \
527 -e "s%@shlib_so_name@%$shlib_base_name%g" \
528 -e "s%@shlib_dir@%%g" \
529 -e "s%@shlib_slibdir_qual@%%g"
530 if [ "$LIBUNWIND" ]; then
532 echo "${shlibunwind_base_name}${SHLIB_EXT}: $shlibunwind_deps"
533 echo " $SHLIBUNWIND_LINK" \
534 |
sed -e "s%@multilib_flags@%$flags%g" \
535 -e "s%@multilib_dir@%$dir%g" \
536 -e "s%@shlib_objs@%$libgcc_sh_objs%g" \
537 -e "s%@shlib_base_name@%$shlibunwind_base_name%g" \
538 -e "s%@shlib_so_name@%$shlibunwind_base_name%g" \
539 -e "s%@shlib_dir@%%g" \
540 -e "s%@shlib_slibdir_qual@%%g"
547 for ml
in $MULTILIBS; do
548 dir
=`echo ${ml} | sed -e 's/;.*$//' -e 's/=/$(EQ)/g'`
549 if [ $dir != .
]; then
550 dirs="$dirs ${dir} libgcc/${dir}"
554 echo 'libgcc-stage-start:'
555 echo ' for dir in '"${dirs}"'; do \'
556 echo ' if [ -d $
(stage
)/$
$dir ]; then true
; else '$mkinstalldirs' $
(stage
)/$
$dir; fi; \'
558 echo ' -for dir in '"${dirs}"'; do \'
559 echo ' mv $
$dir/*'"${objext}"' $
(stage
)/$
$dir; \'
560 echo ' test ! -f $$dir/stacknote.s || mv $$dir/stacknote.s $(stage)/$$dir; \'
561 echo ' test ! -f $
$dir/libgcc.a ||
mv $
$dir/lib
* $
(stage
)/$
$dir; \'
568 for ml
in $MULTILIBS; do
569 dir
=`echo ${ml} | sed -e 's/;.*$//' -e 's/=/$(EQ)/g'`
570 if [ $dir != .
]; then
571 dirs="$dirs ${dir} libgcc/${dir}"
573 all
="$all ${dir}/libgcc.a ${dir}/libgcov.a"
574 if [ "$LIBUNWIND" ]; then
575 all
="$all ${dir}/libunwind.a"
577 if [ "$SHLIB_LINK" ]; then
578 all
="$all ${dir}/libgcc_eh.a"
579 if [ -z "$SHLIB_MULTILIB" ]; then
580 if [ "$dir" = "." ]; then
583 suff
=_
`echo $dir | sed s,/,_,g`
585 all
="$all ${dir}/libgcc_s${suff}${SHLIB_EXT}"
586 if [ "$LIBUNWIND" ]; then
587 all
="$all ${dir}/${dir}/libunwind${suff}${SHLIB_EXT}"
589 elif [ "$SHLIB_MULTILIB" = "$dir" ]; then
590 all
="$all libgcc_s${SHLIB_EXT}"
591 if [ "$LIBUNWIND" ]; then
592 all
="$all ${dir}/${dir}/libunwind${SHLIB_EXT}"
598 echo 'stmp-dirs: force'
599 echo ' for d in '"$dirs"'; do \'
600 echo ' if [ -d $
$d ]; then true
; else '$mkinstalldirs' $
$d; fi; \'
602 echo ' if [ -f stmp-dirs ]; then true; else touch stmp-dirs; fi'
604 for f
in $EXTRA_MULTILIB_PARTS; do
605 for ml
in $MULTILIBS; do
606 dir
=`echo ${ml} | sed -e 's/;.*$//' -e 's/=/$(EQ)/g'`
607 flags
=`echo ${ml} | sed -e 's/^[^;]*;//' -e 's/@/ -/g'`;
610 *) out
=$dir/$f ; t
=$dir/ ;;
613 # Prevent `make' from interpreting $out as a macro assignment
614 *'$(EQ)'*) targ
="T_TARGET=$out T_TARGET" ;;
619 echo " $make_compile" \\
620 echo ' LIBGCC2_CFLAGS="$(LIBGCC2_CFLAGS)' $flags '" ' \\
621 echo ' MULTILIB_CFLAGS="'$flags'"' T
=$t $targ
632 for ml
in $MULTILIBS; do
633 dir
=`echo ${ml} | sed -e 's/;.*$//' -e 's/=/$(EQ)/g'`
634 flags
=`echo ${ml} | sed -e 's/^[^;]*;//' -e 's/@/ -/g'`;
635 if [ $dir != .
]; then
636 ldir
='$(DESTDIR)$(libsubdir)'/$dir
637 echo " if [ -d $ldir ]; then true; else $mkinstalldirs $ldir; chmod a+rx $ldir; fi;"
639 ldir
='$(DESTDIR)$(libsubdir)'
641 echo ' $(INSTALL_DATA)' ${dir}/libgcc.a
${ldir}/
642 echo ' $(RANLIB_FOR_TARGET)' ${ldir}/libgcc.a
643 echo ' $(INSTALL_DATA)' ${dir}/libgcov.a
${ldir}/
644 echo ' $(RANLIB_FOR_TARGET)' ${ldir}/libgcov.a
646 if [ "$SHLIB_LINK" ]; then
647 echo ' $(INSTALL_DATA)' ${dir}/libgcc_eh.a
${ldir}/
648 echo ' $(RANLIB_FOR_TARGET)' ${ldir}/libgcc_eh.a
650 if [ -z "$SHLIB_MULTILIB" ]; then
651 if [ "$dir" = .
]; then
652 shlib_base_name
=libgcc_s
653 shlibunwind_base_name
=libunwind
655 shlib_base_name
=libgcc_s_
`echo $dir | sed s,/,_,g`
656 shlibunwind_base_name
=libunwind_
`echo $dir | sed s,/,_,g`
658 shlib_so_name
="$shlib_base_name"
659 shlibunwind_so_name
="$shlibunwind_base_name"
662 if [ -n "$MULTILIB_OSDIRNAMES" ]; then
663 gcc_multilib_dir
=`./xgcc -B./ $flags --print-multi-directory`
664 os_multilib_dir
=`./xgcc -B./ $flags --print-multi-os-directory`
665 if [ "$dir" != .
]; then
668 gcc_multilib_sup
=`echo $gcc_multilib_dir | sed 's~^[^/]*/~~'`
669 os_multilib_base
=`echo $os_multilib_dir | sed -n "s~/${gcc_multilib_sup}\$~~p"`
670 if [ -z "$os_multilib_base" ]; then
671 shlib_so_name
=libgcc_s
672 shlibunwind_so_name
=libunwind
673 if [ "$os_multilib_dir" != "." ]; then
674 shlib_slibdir_qual
="/$os_multilib_dir"
677 shlib_so_name
=libgcc_s_
`echo $gcc_multilib_sup | sed s,/,_,g`
678 shlibunwind_so_name
=libunwind_
`echo $gcc_multilib_sup | sed s,/,_,g`
679 shlib_slibdir_qual
="/$os_multilib_base"
682 echo " $SHLIB_INSTALL" \
683 |
sed -e "s%@shlib_base_name@%$shlib_base_name%g" \
684 -e "s%@shlib_so_name@%$shlib_so_name%g" \
685 -e "s%@shlib_dir@%$shlib_dir%g" \
686 -e "s%@shlib_slibdir_qual@%$shlib_slibdir_qual%g"
687 if [ "$LIBUNWIND" ]; then
688 echo " $SHLIBUNWIND_INSTALL" \
689 |
sed -e "s%@shlib_base_name@%$shlibunwind_base_name%g" \
690 -e "s%@shlib_so_name@%$shlibunwind_so_name%g" \
691 -e "s%@shlib_dir@%$shlib_dir%g" \
692 -e "s%@shlib_slibdir_qual@%$shlib_slibdir_qual%g"
693 libunwinddir
='$(DESTDIR)$(slibdir)$(shlib_slibdir_qual)/$(shlib_dir)'
694 echo ' $(INSTALL_DATA)' ${dir}/libunwind.a
${libunwinddir}/
695 echo ' $(RANLIB_FOR_TARGET)' ${libunwinddir}/libunwind.a
697 elif [ "$SHLIB_MULTILIB" = "$dir" ]; then
698 shlib_base_name
="libgcc_s";
699 echo " $SHLIB_INSTALL" \
700 |
sed -e "s%@shlib_base_name@%$shlib_base_name%g" \
701 -e "s%@shlib_so_name@%$shlib_base_name%g" \
702 -e "s%@shlib_dir@%%g" \
703 -e "s%@shlib_slibdir_qual@%%g"
704 if [ "$LIBUNWIND" ]; then
705 echo " $SHLIBUNWIND_INSTALL" \
706 |
sed -e "s%@shlib_base_name@%$shlibunwind_base_name%g" \
707 -e "s%@shlib_so_name@%$shlibunwind_base_name%g" \
708 -e "s%@shlib_dir@%%g" \
709 -e "s%@shlib_slibdir_qual@%%g"
710 libunwinddir
='$(DESTDIR)$(slibdir)'
711 echo ' $(INSTALL_DATA)' ${dir}/libunwind.a
${libunwinddir}/
712 echo ' $(RANLIB_FOR_TARGET)' ${libunwinddir}/libunwind.a
717 for f
in $EXTRA_MULTILIB_PARTS; do
718 for ml
in $MULTILIBS; do
719 dir
=`echo ${ml} | sed -e 's/;.*$//' -e 's/=/$(EQ)/g'`
720 if [ $dir != .
]; then
722 ldir
='$(DESTDIR)$(libsubdir)'/$dir
725 ldir
='$(DESTDIR)$(libsubdir)'
727 echo ' $(INSTALL_DATA)' $out $ldir/