mklibgcc.in: Add logic to handle $DFP_ENABLE and $DFP_CFLAGS.
authorBen Elliston <bje@au.ibm.com>
Wed, 1 Mar 2006 05:14:24 +0000 (05:14 +0000)
committerBen Elliston <bje@gcc.gnu.org>
Wed, 1 Mar 2006 05:14:24 +0000 (16:14 +1100)
* mklibgcc.in: Add logic to handle $DFP_ENABLE and $DFP_CFLAGS.
Compile dfp-bit.c from the source directory using -DWIDTH and
$DFP_CFLAGS to control the compilation of that file, rather than
generating width-specific versions in the build directory.
* Makefile.in (libgcc.mk): Pass down DFP_ENABLE and DFP_CFLAGS.
(LIBGCC_DEPS): Replace $(D32PBIT) et al with config/dfp-bit.[hc].

From-SVN: r111595

gcc/ChangeLog
gcc/Makefile.in
gcc/mklibgcc.in

index a6588e8be23309ef9025211c3623897d7e427440..7d842969b56009405c15be19029c1e9d5551ccc7 100644 (file)
@@ -1,3 +1,12 @@
+2006-03-01  Ben Elliston  <bje@au.ibm.com>
+
+       * mklibgcc.in: Add logic to handle $DFP_ENABLE and $DFP_CFLAGS.
+       Compile dfp-bit.c from the source directory using -DWIDTH and
+       $DFP_CFLAGS to control the compilation of that file, rather than
+       generating width-specific versions in the build directory.
+       * Makefile.in (libgcc.mk): Pass down DFP_ENABLE and DFP_CFLAGS.
+       (LIBGCC_DEPS): Replace $(D32PBIT) et al with config/dfp-bit.[hc].
+
 2006-02-28  Zack Weinberg  <zackw@panix.com>
 
        * doc/md.texi: Avoid use of @headitem so that makeinfo <4.7
index 0cd1bec491ad25cca9f8cbf840f3722de0cd4f74..d92e3dc20159088c69f82802d42d60ec42c5f916 100644 (file)
@@ -1415,6 +1415,8 @@ libgcc.mk: config.status Makefile mklibgcc $(LIB2ADD) $(LIB2ADD_ST) specs \
        DPBIT_FUNCS='$(DPBIT_FUNCS)' \
        TPBIT='$(TPBIT)' \
        TPBIT_FUNCS='$(TPBIT_FUNCS)' \
+       DFP_ENABLE='$(DFP_ENABLE)' \
+       DFP_CFLAGS='$(DFP_CFLAGS)' \
        D32PBIT='$(D32PBIT)' \
        D32PBIT_FUNCS='$(D32PBIT_FUNCS)' \
        D64PBIT='$(D64PBIT)' \
@@ -1443,7 +1445,7 @@ LIBGCC_DEPS = $(GCC_PASSES) $(LANGUAGES) stmp-int-hdrs $(STMP_FIXPROTO) \
        libgcc.mk $(srcdir)/libgcc2.c $(srcdir)/libgcov.c $(TCONFIG_H) \
        $(MACHMODE_H) longlong.h gbl-ctors.h config.status $(srcdir)/libgcc2.h \
        tsystem.h $(FPBIT) $(DPBIT) $(TPBIT) $(LIB2ADD) \
-       $(D32PBIT) $(D64PBIT) $(D128PBIT) \
+       config/dfp-bit.h config/dfp-bit.c \
        $(LIB2ADD_ST) $(LIB2ADDEH) $(LIB2ADDEHDEP) $(EXTRA_PARTS) \
        $(srcdir)/config/$(LIB1ASMSRC) \
        $(srcdir)/gcov-io.h $(srcdir)/gcov-io.c gcov-iov.h
index 88e0df029cbba6fc6b4dfad6ee18f0abb479f323..8f67d4b0476bd7e8510c1203ba5e1dc8c602daf3 100644 (file)
@@ -25,6 +25,8 @@
 # FPBIT
 # FPBIT_FUNCS
 # LIB2_DIVMOD_FUNCS
+# DFP_ENABLE
+# DFP_CFLAGS
 # DPBIT
 # DPBIT_FUNCS
 # TPBIT
@@ -368,6 +370,11 @@ for ml in $MULTILIBS; do
   done
 
   if [ "@enable_decimal_float@" = "yes" -a -z "$libgcc_so" ]; then
+    # If $DFP_ENABLE is set, then we want all data type sizes.
+    if [ "$DFP_ENABLE" ] ; then
+       D32PBIT=1; D64PBIT=1; D128PBIT=1
+    fi
+
     # Bring in the DFP support code if D32PBIT, D64PBIT or D128PBIT are set.
     if [ -n "$D32PBIT" -o -n "$D64PBIT" -o -n "$D128PBIT" ] ; then
       dec_filenames="decContext decNumber decRound decLibrary decUtility"
@@ -396,14 +403,18 @@ for ml in $MULTILIBS; do
       dpfuncs_var="${dpbit_var}_FUNCS"
       eval dpbit=\$$dpbit_var
       eval dpfuncs=\$$dpfuncs_var
+      case "$dpbit_var" in
+         D32PBIT)  dpwidth=32 ;;
+         D64PBIT)  dpwidth=64 ;;
+         D128PBIT) dpwidth=128 ;;
+      esac
 
       if [ "$dpbit" ]; then
         for name in $dpfuncs; do
           out="libgcc/${dir}/${name}${objext}"
-         echo $out: $dpbit $fpbit_c_dep
-         echo "        $gcc_compile" -DFINE_GRAINED_LIBRARIES $flags -DL$name \
-           -c $dpbit -o $out
-
+         echo $out: config/dfp-bit.c $fpbit_c_dep
+         echo "        $gcc_compile" -DFINE_GRAINED_LIBRARIES $flags -DL$name -DWIDTH=$dpwidth \
+             $DFP_CFLAGS -c $\(srcdir\)/config/dfp-bit.c -o $out
          echo $libgcc_a: $out
         done
       fi