OSDN Git Service

Daily bump.
[pf3gnuchains/gcc-fork.git] / gcc / mklibgcc.in
index fa923bf..5973006 100644 (file)
@@ -29,6 +29,8 @@ echo 'srcdir = @srcdir@'
 echo 'VPATH = @srcdir@'
 echo 'EQ = ='
 echo
+echo 'force:'
+echo
 
 # Detect gcc as OLDCC.  This indicates a target for which LIB1FUNCS
 # is not needed.  This is not quite the same as libgcc1.null, even
@@ -63,13 +65,13 @@ make_compile='$(MAKE) GCC_FOR_TARGET="$(GCC_FOR_TARGET)" \
          LANGUAGES="$(LANGUAGES)"'
 
 # Dependancies for libgcc1.c
-libgcc1_c_dep='$(srcdir)/libgcc1.c $(CONFIG_H)'
+libgcc1_c_dep='stmp-dirs $(srcdir)/libgcc1.c $(CONFIG_H)'
 
 # Dependancies for libgcc2.c
-libgcc2_c_dep='$(srcdir)/libgcc2.c $(CONFIG_H) $(MACHMODE_H) longlong.h frame.h gbl-ctors.h config.status stmp-int-hdrs tsystem.h'
+libgcc2_c_dep='stmp-dirs $(srcdir)/libgcc2.c $(CONFIG_H) $(MACHMODE_H) longlong.h frame.h gbl-ctors.h config.status stmp-int-hdrs tsystem.h'
 
 # Dependancies for fp-bit.c
-fpbit_c_dep='config.status tsystem.h'
+fpbit_c_dep='stmp-dirs config.status tsystem.h'
 
 #
 # Build libgcc1 components.
@@ -92,9 +94,15 @@ case X"$LIBGCC1" in
         flags=`echo ${ml} | sed -e 's/^[^;]*;//' -e 's/@/ -/g'`;
         out="libgcc/${dir}/${name}${objext}"
 
-        echo ${out}: '$(srcdir)/config/$(LIB1ASMSRC)'
+        echo ${out}: stmp-dirs '$(srcdir)/config/$(LIB1ASMSRC)'
        echo "  $gcc_compile" $flags -DL$name -xassembler-with-cpp \
          -c '$(srcdir)/config/$(LIB1ASMSRC)' -o $out
+
+       # Remove any objects from LIB2FUNCS that are defined as optimized
+       # assembly code in LIB1ASMFUNCS.
+       LIB2FUNCS=`echo $LIB2FUNCS | sed -e 's/^'$name' //' \
+                                        -e 's/ '$name' / /' \
+                                        -e 's/ '$name'$//'`
       done
       libgcc1_objs="$libgcc1_objs ${name}${objext}"
     done
@@ -106,9 +114,9 @@ case X"$LIBGCC1" in
 
       echo $out: $libgcc1_c_dep
       if [ -z "@NO_MINUS_C_MINUS_O@" ]; then
-       echo "  $oldcc_compile" $flags -c libgcc1.c -o $out
+       echo "  $oldcc_compile" -DL$name $flags -c '$(srcdir)/libgcc1.c' -o $out
       else
-       echo "  $oldcc_compile" $flags -c libgcc1.c
+       echo "  $oldcc_compile" -DL$name $flags -c '$(srcdir)/libgcc1.c'
        echo "  mv libgcc1${objext} $out"
       fi
 
@@ -212,7 +220,7 @@ for file in $LIB2ADD; do
     fprime=`cat $file`
     for f in $fprime; do
 
-      lastout=""
+      lastout="stmp-dirs $file"
       for ml in $MULTILIBS; do
         dir=`echo ${ml} | sed -e 's/;.*$//' -e 's/=/$(EQ)/g'`
         flags=`echo ${ml} | sed -e 's/^[^;]*;//' -e 's/@/ -/g'`;
@@ -241,7 +249,7 @@ for file in $LIB2ADD; do
        flags="$flags -xassembler-with-cpp"
       fi
 
-      echo $out: $file
+      echo $out: stmp-dirs $file
       echo "   $gcc_compile" $flags -c $file -o $out
     done
     libgcc2_objs="$libgcc2_objs ${oname}${objext}"
@@ -273,23 +281,25 @@ for ml in $MULTILIBS; do
 done
 
 echo ""
-all=""
+all=stmp-dirs
+dirs=libgcc
 
 for ml in $MULTILIBS; do
   dir=`echo ${ml} | sed -e 's/;.*$//' -e 's/=/$(EQ)/g'`
-  if [ $dir = . ]; then
-    echo "libgcc:; mkdir libgcc"
-    all="$all libgcc"
-  else
-    echo "${dir}:; mkdir ${dir}"
-    echo "libgcc/${dir}:; mkdir libgcc/${dir}"
-    all="$all libgcc/${dir} ${dir}"
+  if [ $dir != . ]; then
+    dirs="$dirs ${dir} libgcc/${dir}"
   fi
   all="$all ${dir}/libgcc.a"
 done
 
+echo 'stmp-dirs: force'
+echo ' for d in '"$dirs"'; do \'
+echo '   if [ -d $$d ]; then true; else mkdir $$d; fi \'
+echo ' done'
+echo ' if [ -f stmp-dirs ]; then true; else touch stmp-dirs; fi'
+
 for f in $EXTRA_MULTILIB_PARTS; do
-  lastout=""
+  lastout="stmp-dirs force"
   for ml in $MULTILIBS; do
     dir=`echo ${ml} | sed -e 's/;.*$//' -e 's/=/$(EQ)/g'`
     flags=`echo ${ml} | sed -e 's/^[^;]*;//' -e 's/@/ -/g'`;