This is the mail archive of the
libstdc++@sources.redhat.com
mailing list for the libstdc++ project.
Make sure failures in mknumeric_limits propagate to configure
- To: libstdc++ at gcc dot gnu dot org
- Subject: Make sure failures in mknumeric_limits propagate to configure
- From: Alexandre Oliva <aoliva at redhat dot com>
- Date: 22 Dec 2000 03:52:34 -0200
- Cc: gcc-patches at gcc dot gnu dot org
- Organization: GCC Team, Red Hat
Ok to install?
Index: libstdc++-v3/ChangeLog
from Alexandre Oliva <aoliva@redhat.com>
* mknumeric_limits: Output to temporary files, and rename them at
the end.
Index: libstdc++-v3/mknumeric_limits
===================================================================
RCS file: /cvs/gcc/egcs/libstdc++-v3/mknumeric_limits,v
retrieving revision 1.5
diff -u -p -r1.5 mknumeric_limits
--- libstdc++-v3/mknumeric_limits 2000/12/14 22:53:59 1.5
+++ libstdc++-v3/mknumeric_limits 2000/12/22 05:47:06
@@ -45,7 +45,7 @@ OUT_H="$BUILD_DIR/include/bits/std_limit
OUT_C="$BUILD_DIR/src/limitsMEMBERS.cc"
if [ -f $OUT_C ]; then
- rm -f $OUT_H OUT_C
+ rm -f $OUT_H $OUT_C $OUT_H-t $OUT_C-t
fi
SRC_DIR=$2
@@ -64,7 +64,9 @@ fi
: ${CXX:="$BUILD_DIR/../../gcc/g++ -B$BUILD_DIR/../../gcc/"}
-cat <<EOF > $OUT_H
+# We output to a temporary file, so that we don't appear to have
+# succeeded unless we actually do.
+cat <<EOF > $OUT_H-t
// The template and inlines for the -*- C++ -*- numeric_limits classes.
// Copyright (C) 1999, 2000 Free Software Foundation, Inc.
@@ -189,9 +191,9 @@ if [ ! -f "$BUILD_DIR/src/gen-num-limits
exit 1
fi
-"$BUILD_DIR/src/gen-num-limits" >> $OUT_H
+"$BUILD_DIR/src/gen-num-limits" >> $OUT_H-t
-cat <<EOF >> $OUT_H
+cat <<EOF >> $OUT_H-t
} // namespace std
#endif // _CPP_NUMERIC_LIMITS
@@ -245,8 +247,8 @@ for type_name in bool char 'signed char'
long 'unsigned long' 'long long' 'unsigned long long' \
float double 'long double'
do
- grep "<$type_name>" $OUT_H >/dev/null 2>&1 || continue
- cat <<EOF >> $OUT_C
+ grep "<$type_name>" $OUT_H-t >/dev/null 2>&1 || continue
+ cat <<EOF >> $OUT_C-t
const bool $trait_name<$type_name>::is_specialized;
const int $trait_name<$type_name>::digits;
@@ -274,8 +276,11 @@ EOF
done
-cat <<EOF >> $OUT_C
+cat <<EOF >> $OUT_C-t
} // namespace std
EOF
+
+mv $OUT_C-t $OUT_C
+mv $OUT_H-t $OUT_H
--
Alexandre Oliva Enjoy Guarana', see http://www.ic.unicamp.br/~oliva/
Red Hat GCC Developer aoliva@{cygnus.com, redhat.com}
CS PhD student at IC-Unicamp oliva@{lsd.ic.unicamp.br, gnu.org}
Free Software Evangelist *Please* write to mailing lists, not to me