#!/bin/sh
-# Copyright (C) 2002 Free Software Foundation, Inc.
+# Copyright (C) 2002, 2007 Free Software Foundation, Inc.
#This file is part of GCC.
#You should have received a copy of the GNU General Public License
#along with GCC; see the file COPYING. If not, write to the Free
-#Software Foundation, 59 Temple Place - Suite 330, Boston, MA
-#02111-1307, USA.
+#Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA
+#02110-1301, USA.
# Basic information
target=@target@
export VERBOSE
if [ x$1 = x--help ] ; then
- echo "Usage: mkheaders [options] [prefix]"
+ echo "Usage: mkheaders [options] [prefix [isysroot]]"
echo "Options:"
echo " -v Print more output (may be repeated for even more output)"
echo " --help This help"
if [ x$1 = x--version ] ; then
echo "mkheaders (GCC) version $version"
- echo "Copyright 2002 Free Software Foundation, Inc."
+ echo "Copyright 2002, 2007 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."
# Common prefix for installation directories.
if [ x$1 != x ] ; then
prefix=$1
+ shift
else
prefix=@prefix@
fi
+
+# Allow for alternate isysroot in which to find headers
+if [ x$1 != x ] ; then
+ isysroot=$1
+ shift
+else
+ isysroot=
+fi
+
# Directory in which to put host dependent programs and libraries
exec_prefix=@exec_prefix@
# Directory in which to put the directories used by the compiler.
TARGET_MACHINE="${target}" target_canonical="${target}" \
MACRO_LIST="${itoolsdatadir}/macro_list" \
@SHELL@ ./fixinc.sh ${incdir} \
- ${SYSTEM_HEADER_DIR} ${OTHER_FIXINCLUDES_DIRS}
+ ${isysroot}${SYSTEM_HEADER_DIR} ${OTHER_FIXINCLUDES_DIRS}
rm -f ${incdir}/syslimits.h
if [ -f ${incdir}/limits.h ]; then
mv ${incdir}/limits.h ${incdir}/syslimits.h
if [ x${STMP_FIXPROTO} != x ] ; then
mkinstalldirs="@SHELL@ ${itoolsdir}/mkinstalldirs"
export FIXPROTO_DEFINES mkinstalldirs
- @SHELL@ fixproto ${incdir} ${incdir} ${SYSTEM_HEADER_DIR} || exit 1
+ @SHELL@ fixproto ${incdir} ${incdir} ${isysroot}${SYSTEM_HEADER_DIR} || exit 1
fi