summaryrefslogtreecommitdiff
path: root/gcc/mklibgcc.in
diff options
context:
space:
mode:
authorrth <rth@138bc75d-0d04-0410-961f-82ee72b054a4>2000-10-04 20:53:29 +0000
committerrth <rth@138bc75d-0d04-0410-961f-82ee72b054a4>2000-10-04 20:53:29 +0000
commita1415e6dd820bb7d4d4ae813a0491707a533a843 (patch)
tree4f82b9e33e90bba937926f41eb632d07c81d7017 /gcc/mklibgcc.in
parenteae914e28dc4509a3eac92c0cfb3d877673ba678 (diff)
downloadgcc-a1415e6dd820bb7d4d4ae813a0491707a533a843.tar.gz
* configure.in (enable-shared): New.
* Makefile.in (LIBGCC_DEPS): Depend on EXTRA_PARTS as well. (libgcc.mk): Pass SHLIB_LINK, SHLIB_LIBS, SHLIB_MULTILIB to mklibgcc. * mklibgcc.in: Use them to link shared a libgcc. * config/t-linux (SHLIB_LINK, SHLIB_LIBS): New. * config/alpha/t-ieee (SHLIB_MULTILIB): New. * config/mips/t-iris6 (SHLIB_LINK, SHLIB_LIBS): New. * config/sparc/t-sol2 (SHLIB_LINK, SHLIB_LIBS): New. * configure.in (alpha-osf*): Use t-osf and x-osf. * config/alpha/t-osf: New file. * config/alpha/t-osf4: New file. * config/alpha/x-osf: New file. * config/alpha/x-alpha: Remove file. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@36715 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/mklibgcc.in')
-rw-r--r--gcc/mklibgcc.in43
1 files changed, 43 insertions, 0 deletions
diff --git a/gcc/mklibgcc.in b/gcc/mklibgcc.in
index 8d93141ac89..54dcf2b848c 100644
--- a/gcc/mklibgcc.in
+++ b/gcc/mklibgcc.in
@@ -23,6 +23,9 @@
# LIBGCC
# MULTILIBS
# EXTRA_MULTILIB_PARTS
+# SHLIB_LINK
+# SHLIB_LIBS
+# SHLIB_MULTILIB
# Make needs VPATH to be literal.
echo 'srcdir = @srcdir@'
@@ -49,6 +52,10 @@ EOF
rm -f $tmp
fi
+# Disable SHLIB_LINK if shared libgcc not enabled.
+if [ "@enable_shared@" = "no" ]; then
+ SHLIB_LINK=""
+fi
# Build lines.
@@ -258,6 +265,7 @@ done
for ml in $MULTILIBS; do
dir=`echo ${ml} | sed -e 's/;.*$//' -e 's/=/$(EQ)/g'`
+ flags=`echo ${ml} | sed -e 's/^[^;]*;//' -e 's/@/ -/g'`;
libgcc_objs=""
for o in $libgcc1_objs; do
@@ -278,6 +286,24 @@ for ml in $MULTILIBS; do
echo ' if $(RANLIB_TEST_FOR_TARGET) ; then' \\
echo ' $(RANLIB_FOR_TARGET)' ${dir}/libgcc.a ';' \\
echo ' else true; fi;'
+
+ if [ "$SHLIB_LINK" ]; then
+ if [ -z "$SHLIB_MULTILIB" ]; then
+ if [ "$dir" = "." ]; then
+ shlib_base_name="libgcc_s";
+ else
+ shlib_base_name=libgcc_s_`echo $dir | sed s,/,_,g`
+ fi
+ echo ""
+ echo "${dir}/${shlib_base_name}.so: $libgcc_objs"
+ echo " $SHLIB_LINK $flags -o ${shlib_base_name}.so $libgcc_objs $SHLIB_LIBS" | sed "s/@shlib_base_name@/$shlib_base_name/g"
+ elif [ "$SHLIB_MULTILIB" = "$dir" ]; then
+ shlib_base_name="libgcc_s";
+ echo ""
+ echo "${shlib_base_name}.so: $libgcc_objs"
+ echo " $SHLIB_LINK $flags -o ${shlib_base_name}.so $libgcc_objs $SHLIB_LIBS" | sed "s/@shlib_base_name@/$shlib_base_name/g"
+ fi
+ fi
done
dirs=libgcc
@@ -306,6 +332,23 @@ for ml in $MULTILIBS; do
dirs="$dirs ${dir} libgcc/${dir}"
fi
all="$all ${dir}/libgcc.a"
+ if [ "$SHLIB_LINK" ]; then
+ if [ -z "$SHLIB_MULTILIB" ]; then
+ if [ "$dir" = "." ]; then
+ suff="";
+ else
+ suff=_`echo $dir | sed s,/,_,g`
+ fi
+ all="$all ${dir}/libgcc_s${suff}.so"
+ elif [ "$SHLIB_MULTILIB" = "$dir" ]; then
+ all="$all libgcc_s.so"
+ fi
+ if [ "$dir" = "." ]; then
+ suff="";
+ else
+ suff=_`echo $dir | sed s,/,_,g`
+ fi
+ fi
done
echo 'stmp-dirs: force'