gcc/libstdc++-v3/mkc++config
Benjamin Kosnik 5e53dba6a8 configure.in: Simplify use of AC_CACHE_SAVE.
2000-10-29  Benjamin Kosnik  <bkoz@redhat.com>

	* configure.in: Simplify use of AC_CACHE_SAVE.  Put linked files
	in $(top_builddir)/include/bits, not $(top_builddir)/bits, to help
	with libgcj build issues and improve consistency with the source
	directory's include directory setup.
	* configure: Regenerate.
	* acinclude.m4: Same here.
	* aclocal.m4: Regenerate.
	* mknumeric_limits (OUT_H): Also change paths here.
	* mkcheck.in (C_DIR): And here.
	* mkc++config (OUT_H): And here.
	* libmath/Makefile.am (INCLUDES): And here.
	* src/Makefile.am (INCLUDES): Change to $(top_builddir)/include.
	* libio/Makefile.am: Ditto.
	* libsupc++/Makefile.am (INCLUDES): Ditto.

From-SVN: r37134
2000-10-29 22:32:30 +00:00

63 lines
1.3 KiB
Bash
Executable File

#! /bin/sh
# 2000-02-01 bkoz
# Script to take the generated "config.h" from autoconf and make the
# macros within it namespace safe (ie wrapping them in _GLIBCPP_ so
# that "HAVE_LC_MESSAGES" becomes "_GLIBCPP_HAVE_LC_MESSAGES" etc etc.
echo "running mkc++config"
BUILD_DIR=$1
if [ ! -d "$BUILD_DIR" ]; then
echo "build directory $BUILD_DIR not found, exiting."
exit 1
fi
SRC_DIR=$2
if [ ! -d "$SRC_DIR" ]; then
echo "source directory $SRC_DIR not found, exiting."
exit 1
fi
BASE_H="$SRC_DIR/include/bits/c++config"
IN_H="$BUILD_DIR/config.h"
OUT_H="$BUILD_DIR/include/bits/c++config.h"
if [ ! -f $IN_H ]; then
echo "necessary file $IN_H not found, exiting"
exit 1
fi
if [ ! -d "$BUILD_DIR/include" ]; then
mkdir "$BUILD_DIR/include"
fi
if [ ! -d "$BUILD_DIR/include/bits" ]; then
mkdir "$BUILD_DIR/include/bits"
fi
# Part 1
# sed config.h from autoconf and make it namespace safe.
sed 's/HAVE_/_GLIBCPP_HAVE_/g' < $IN_H > temp-1
sed 's/PACKAGE/_GLIBCPP_PACKAGE/g' < temp-1 > temp-2
sed 's/VERSION/_GLIBCPP_VERSION/g' < temp-2 > temp-3
sed 's/WORDS_/_GLIBCPP_WORDS_/g' < temp-3 > temp-4
# Part 2
# cat this into generated bits/c++config.h
cat $BASE_H temp-4 > $OUT_H
rm temp-1 temp-2 temp-3 temp-4
# Part 3
# complete macro guards for resulting file
cat <<EOF >> $OUT_H
#endif // _CPP_CPPCONFIG_
EOF
exit 0