4 # Script to take the generated "config.h" from autoconf and make the
5 # macros within it namespace safe (ie wrapping them in _GLIBCPP_ so
6 # that "HAVE_LC_MESSAGES" becomes "_GLIBCPP_HAVE_LC_MESSAGES" etc etc.
8 echo "running mkc++config"
11 if [ ! -d "$BUILD_DIR" ]; then
12 echo "build directory $BUILD_DIR not found, exiting."
17 if [ ! -d "$SRC_DIR" ]; then
18 echo "source directory $SRC_DIR not found, exiting."
22 BASE_H
="$SRC_DIR/bits/c++config"
23 IN_H
="$BUILD_DIR/config.h"
24 OUT_H
="$BUILD_DIR/bits/c++config.h"
26 if [ ! -f $IN_H ]; then
27 echo "necessary file $IN_H not found, exiting"
31 if [ ! -d "$BUILD_DIR/bits" ]; then
32 mkdir
"$BUILD_DIR/bits"
37 # sed config.h from autoconf and make it namespace safe.
38 sed 's/HAVE_/_GLIBCPP_HAVE_/g' < $IN_H > temp-1
39 sed 's/PACKAGE/_GLIBCPP_PACKAGE/g' < temp-1
> temp-2
40 sed 's/VERSION/_GLIBCPP_VERSION/g' < temp-2
> temp-3
41 sed 's/WORDS_/_GLIBCPP_WORDS_/g' < temp-3
> temp-4
45 # cat this into generated bits/c++config.h
46 cat $BASE_H temp-4
> $OUT_H
47 rm temp-1 temp-2 temp-3 temp-4
51 # complete macro guards for resulting file
54 #endif // _CPP_CPPCONFIG_