You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

81 lines
2.8 KiB

  1. #!/bin/bash
  2. #
  3. # Copyright 2005-2013 Intel Corporation. All Rights Reserved.
  4. #
  5. # This file is part of Threading Building Blocks.
  6. #
  7. # Threading Building Blocks is free software; you can redistribute it
  8. # and/or modify it under the terms of the GNU General Public License
  9. # version 2 as published by the Free Software Foundation.
  10. #
  11. # Threading Building Blocks is distributed in the hope that it will be
  12. # useful, but WITHOUT ANY WARRANTY; without even the implied warranty
  13. # of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  14. # GNU General Public License for more details.
  15. #
  16. # You should have received a copy of the GNU General Public License
  17. # along with Threading Building Blocks; if not, write to the Free Software
  18. # Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
  19. #
  20. # As a special exception, you may use this file as part of a free software
  21. # library without restriction. Specifically, if other files instantiate
  22. # templates or use macros or inline functions from this file, or you compile
  23. # this file and link it with other files to produce an executable, this
  24. # file does not by itself cause the resulting executable to be covered by
  25. # the GNU General Public License. This exception does not however
  26. # invalidate any other reasons why the executable file might be covered by
  27. # the GNU General Public License.
  28. # Script used to generate tbbvars.[c]sh scripts
  29. bin_dir="$PWD" #
  30. cd "$tbb_root" # keep this comments here
  31. tbb_root="$PWD" # to make it unsensible
  32. cd "$bin_dir" # to EOL encoding
  33. [ "`uname`" = "Darwin" ] && dll_path="DYLD_LIBRARY_PATH" || dll_path="LD_LIBRARY_PATH" #
  34. [ -f ./tbbvars.sh ] || cat >./tbbvars.sh <<EOF
  35. #!/bin/bash
  36. export TBBROOT="${tbb_root}" #
  37. tbb_bin="${bin_dir}" #
  38. if [ -z "\$CPATH" ]; then #
  39. export CPATH="\${TBBROOT}/include" #
  40. else #
  41. export CPATH="\${TBBROOT}/include:\$CPATH" #
  42. fi #
  43. if [ -z "\$LIBRARY_PATH" ]; then #
  44. export LIBRARY_PATH="\${tbb_bin}" #
  45. else #
  46. export LIBRARY_PATH="\${tbb_bin}:\$LIBRARY_PATH" #
  47. fi #
  48. if [ -z "\$${dll_path}" ]; then #
  49. export ${dll_path}="\${tbb_bin}" #
  50. else #
  51. export ${dll_path}="\${tbb_bin}:\$${dll_path}" #
  52. fi #
  53. ${TBB_CUSTOM_VARS_SH} #
  54. EOF
  55. [ -f ./tbbvars.csh ] || cat >./tbbvars.csh <<EOF
  56. #!/bin/csh
  57. setenv TBBROOT "${tbb_root}" #
  58. setenv tbb_bin "${bin_dir}" #
  59. if (! \$?CPATH) then #
  60. setenv CPATH "\${TBBROOT}/include" #
  61. else #
  62. setenv CPATH "\${TBBROOT}/include:\$CPATH" #
  63. endif #
  64. if (! \$?LIBRARY_PATH) then #
  65. setenv LIBRARY_PATH "\${tbb_bin}" #
  66. else #
  67. setenv LIBRARY_PATH "\${tbb_bin}:\$LIBRARY_PATH" #
  68. endif #
  69. if (! \$?${dll_path}) then #
  70. setenv ${dll_path} "\${tbb_bin}" #
  71. else #
  72. setenv ${dll_path} "\${tbb_bin}:\$${dll_path}" #
  73. endif #
  74. ${TBB_CUSTOM_VARS_CSH} #
  75. EOF
  76. # Workaround for copying Android* specific libgnustl_shared.so library to "."
  77. if [ ! -z "${LIB_GNU_STL_ANDROID}" ]; then
  78. cp ${LIB_GNU_STL_ANDROID}/libgnustl_shared.so .
  79. fi