DEVDIR=$PWD
C_INC=$C_INCLUDE_PATH
CPLUS_INC=$CPLUS_INCLUDE_PATH


export CFLAGS_FOR_BUILD="$(echo $C_INCLUDE_PATH |  awk   'BEGIN { RS=":"; STR=""} {STR=STR" -I"$0} END {print STR}')"
export CPPFLAGS_FOR_BUILD="$(echo $CPLUS_INCLUDE_PATH |  awk   'BEGIN { RS=":"; STR=""} {STR=STR" -I"$0} END {print STR}')"
export CPP_FOR_BUILD=$(which cpp)

. $DEVDIR/toolchains/i686-gnu-complete/activate.sh

rm -rf $DEVDIR/gnu_things/gcc
mkdir $DEVDIR/gnu_things/gcc
cd $DEVDIR/gnu_things/gcc
$DEVDIR/src/gcc/gcc-13.1.0/configure  \
	--build=x86-64-linux \
	--host=i686-gnu \
	--target=i686-gnu \
	--disable-multilib \
	--disable-threads \
	--disable-nls \
	--enable-languages=c \
	--prefix= \
	--with-sysroot=${DEVDIR}/gnu/install \
	--disable-gcov \
	--disable-libcilkrts \
	--disable-libssp \
	--disable-bootstrap \
	--disable-libsanitizer \
	--with-gmp=$DEVDIR/gnu_things/install \
	--with-mpc=$DEVDIR/gnu_things/install \
	--with-mpfr=$DEVDIR/gnu_things/install \
	--with-isl=$DEVDIR/gnu_things/install \
	CFLAGS_FOR_BUILD="$CFLAGS_FOR_BUILD -D_OBSTACK_INTERFACE_VERSION=1" \
	CPPFLAGS_FOR_BUILD="$CPPFLAGS_FOR_BUILD -D_OBSTACK_INTERFACE_VERSION=1"
make all-gcc
