mkheaders 3.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104
  1. #!/bin/sh
  2. # Copyright (C) 2002, 2007, 2009 Free Software Foundation, Inc.
  3. #This file is part of GCC.
  4. #GCC is free software; you can redistribute it and/or modify it under
  5. #the terms of the GNU General Public License as published by the Free
  6. #Software Foundation; either version 3, or (at your option) any later
  7. #version.
  8. #GCC is distributed in the hope that it will be useful, but WITHOUT
  9. #ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
  10. #FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
  11. #for more details.
  12. #You should have received a copy of the GNU General Public License
  13. #along with GCC; see the file COPYING3. If not see
  14. #<http://www.gnu.org/licenses/>.
  15. # Basic information
  16. target=mips-openwrt-linux-musl
  17. target_noncanonical=mips-openwrt-linux-musl
  18. version=5.3.0
  19. VERBOSE=0
  20. while [ x$1 = x-v ] ; do
  21. shift
  22. VERBOSE=`expr $VERBOSE + 1`
  23. done
  24. export VERBOSE
  25. if [ x$1 = x--help ] ; then
  26. echo "Usage: mkheaders [options] [prefix [isysroot]]"
  27. echo "Options:"
  28. echo " -v Print more output (may be repeated for even more output)"
  29. echo " --help This help"
  30. echo " --version Print version information"
  31. exit 0
  32. fi
  33. if [ x$1 = x--version ] ; then
  34. echo "mkheaders (GCC) version $version"
  35. echo "Copyright 2002, 2007, 2009 Free Software Foundation, Inc."
  36. echo "This program is free software; you may redistribute it under the"
  37. echo "terms of the GNU General Public License. This program has"
  38. echo "absolutely no warranty."
  39. exit 0
  40. fi
  41. # Common prefix for installation directories.
  42. if [ x$1 != x ] ; then
  43. prefix=$1
  44. shift
  45. else
  46. prefix=/srv/openwrt/ar71xx/build/staging_dir/toolchain-mips_34kc_gcc-5.3.0_musl-1.1.15
  47. fi
  48. # Allow for alternate isysroot in which to find headers
  49. if [ x$1 != x ] ; then
  50. isysroot=$1
  51. shift
  52. else
  53. isysroot=
  54. fi
  55. # Directory in which to put host dependent programs and libraries
  56. exec_prefix=${prefix}
  57. # Directory in which to put the directories used by the compiler.
  58. libdir=${exec_prefix}/lib
  59. libexecdir=${exec_prefix}/libexec
  60. # Directory in which the compiler finds libraries, etc.
  61. libsubdir=${libdir}/gcc/${target_noncanonical}/${version}
  62. # Directory in which the compiler finds executables
  63. libexecsubdir=${libexecdir}/gcc/${target_noncanonical}/${version}
  64. itoolsdir=${libexecsubdir}/install-tools
  65. itoolsdatadir=${libsubdir}/install-tools
  66. incdir=${libsubdir}/include-fixed
  67. mkinstalldirs="/bin/bash ${itoolsdir}/mkinstalldirs"
  68. cd ${itoolsdir}
  69. rm -rf ${incdir}/*
  70. for ml in `cat ${itoolsdatadir}/fixinc_list`; do
  71. sysroot_headers_suffix=`echo ${ml} | sed -e 's/;.*$//'`
  72. multi_dir=`echo ${ml} | sed -e 's/^[^;]*;//'`
  73. subincdir=${incdir}${multi_dir}
  74. . ${itoolsdatadir}/mkheaders.conf
  75. if [ x${STMP_FIXINC} != x ] ; then
  76. TARGET_MACHINE="${target}" target_canonical="${target}" \
  77. MACRO_LIST="${itoolsdatadir}/macro_list" \
  78. /bin/bash ./fixinc.sh ${subincdir} \
  79. ${isysroot}${SYSTEM_HEADER_DIR} ${OTHER_FIXINCLUDES_DIRS}
  80. rm -f ${subincdir}/syslimits.h
  81. if [ -f ${subincdir}/limits.h ]; then
  82. mv ${subincdir}/limits.h ${subincdir}/syslimits.h
  83. else
  84. cp ${itoolsdatadir}/gsyslimits.h ${subincdir}/syslimits.h
  85. fi
  86. fi
  87. cp ${itoolsdatadir}/include${multi_dir}/limits.h ${subincdir}
  88. done