#!/bin/sh
target=@target@
target_alias=@target_alias@
version=@gcc_version@
VERBOSE=0
while [ x$1 = x-v ] ; do
shift
VERBOSE=`expr $VERBOSE + 1`
done
export VERBOSE
if [ x$1 = x--help ] ; then
echo "Usage: mkheaders [options] [prefix]"
echo "Options:"
echo " -v Print more output (may be repeated for even more output)"
echo " --help This help"
echo " --version Print version information"
exit 0
fi
if [ x$1 = x--version ] ; then
echo "mkheaders (GCC) version $version"
echo "Copyright 2002 Free Software Foundation, Inc."
echo "This program is free software; you may redistribute it under the"
echo "terms of the GNU General Public License. This program has"
echo "absolutely no warranty."
exit 0
fi
if [ x$1 != x ] ; then
prefix=$1
else
prefix=@prefix@
fi
local_prefix=@local_prefix@
exec_prefix=@exec_prefix@
libdir=@libdir@
libsubdir=${libdir}/gcc-lib/${target_alias}/${version}
build_tooldir=${exec_prefix}/${target_alias}
local_includedir=${local_prefix}/include
includedir=${prefix}/include
itoolsdir=${libsubdir}/install-tools
incdir=${libsubdir}/include
. ${itoolsdir}/mkheaders.conf
cd ${itoolsdir}
rm -rf ${incdir}/*
if [ x${STMP_FIXINC} != x ] ; then
TARGET_MACHINE="${target}" target_canonical="${target}" \
${SHELL} ./fixinc.sh ${incdir} \
${SYSTEM_HEADER_DIR} ${OTHER_FIXINCLUDES_DIRS}
rm -f ${incdir}/syslimits.h
if [ -f ${incdir}/limits.h ]; then
mv ${incdir}/limits.h ${incdir}/syslimits.h
else
cp gsyslimits.h ${incdir}/syslimits.h
fi
fi
cp include/* ${incdir}
if [ x${STMP_FIXPROTO} != x ] ; then
mkinstalldirs="${SHELL} ${itoolsdir}/mkinstalldirs"
export FIXPROTO_DEFINES mkinstalldirs
${SHELL} fixproto ${incdir} ${incdir} ${SYSTEM_HEADER_DIR} || exit 1
fi