18-symlinks 2.0 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152
  1. # Build script for essential symlinks.
  2. #
  3. # Copyright (c) 2014-2019 Matias Fonzo, <selk@dragora.org>.
  4. #
  5. # Licensed under the Apache License, Version 2.0 (the "License");
  6. # you may not use this file except in compliance with the License.
  7. # You may obtain a copy of the License at
  8. #
  9. # http://www.apache.org/licenses/LICENSE-2.0
  10. #
  11. # Unless required by applicable law or agreed to in writing, software
  12. # distributed under the License is distributed on an "AS IS" BASIS,
  13. # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  14. # See the License for the specific language governing permissions and
  15. # limitations under the License.
  16. # Essential symbolic links for rootdir
  17. # Binaries
  18. for file in awk bash cat dd echo env file grep ln ls pwd rm sed sh stty
  19. do
  20. ln -sf "/tools/bin/${file}" "${rootdir}/bin"
  21. done
  22. ln -sf gcc /tools/bin/cc
  23. ln -sf /tools/bin/perl "${rootdir}/usr/bin"
  24. ln -sf /tools/bin/install "${rootdir}/usr/bin"
  25. ln -sf /proc/self/mounts "${rootdir}/etc/mtab"
  26. # Libraries
  27. ln -sf /tools/lib${libSuffix}/libgcc_s.so "${rootdir}/usr/lib${libSuffix}"
  28. ln -sf /tools/lib${libSuffix}/libgcc_s.so.1 "${rootdir}/usr/lib${libSuffix}"
  29. ln -sf /tools/lib${libSuffix}/libstdc++.so "${rootdir}/usr/lib${libSuffix}"
  30. ln -sf /tools/lib${libSuffix}/libstdc++.so.6 "${rootdir}/usr/lib${libSuffix}"
  31. ln -sf /tools/lib${libSuffix}/libstdc++.a "${rootdir}/usr/lib${libSuffix}"
  32. ln -sf /tools/lib${libSuffix}/libssp.so "${rootdir}/usr/lib${libSuffix}"
  33. ln -sf /tools/lib${libSuffix}/libssp.so.0 "${rootdir}/usr/lib${libSuffix}"
  34. ln -sf /tools/lib${libSuffix}/libssp.so.0.0.0 "${rootdir}/usr/lib${libSuffix}"
  35. ln -sf /tools/lib${libSuffix}/libssp.a "${rootdir}/usr/lib${libSuffix}"
  36. ln -sf /tools/lib${libSuffix}/libssp_nonshared.a "${rootdir}/usr/lib${libSuffix}"
  37. # Strip temporary prefix
  38. for file in libstdc++.la libssp.la libssp_nonshared.la
  39. do
  40. sed -e 's/tools/usr/' /tools/lib${libSuffix}/$file \
  41. > "${rootdir}/usr/lib${libSuffix}/$file"
  42. done
  43. unset file