PageRenderTime 21ms CodeModel.GetById 17ms RepoModel.GetById 0ms app.codeStats 0ms

/js/lib/Socket.IO-node/support/expresso/deps/jscoverage/js/build/hcc

http://github.com/onedayitwillmake/RealtimeMultiplayerNodeJs
Shell | 111 lines | 67 code | 3 blank | 41 comment | 3 complexity | 930315efd857d305a30bfbb5450e2f8a MD5 | raw file
Possible License(s): GPL-2.0, LGPL-2.1, MPL-2.0-no-copyleft-exception, BSD-3-Clause
  1. #!/bin/sh
  2. #
  3. # ***** BEGIN LICENSE BLOCK *****
  4. # Version: MPL 1.1/GPL 2.0/LGPL 2.1
  5. #
  6. # The contents of this file are subject to the Mozilla Public License Version
  7. # 1.1 (the "License"); you may not use this file except in compliance with
  8. # the License. You may obtain a copy of the License at
  9. # http://www.mozilla.org/MPL/
  10. #
  11. # Software distributed under the License is distributed on an "AS IS" basis,
  12. # WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
  13. # for the specific language governing rights and limitations under the
  14. # License.
  15. #
  16. # The Original Code is mozilla.org code.
  17. #
  18. # The Initial Developer of the Original Code is
  19. # Netscape Communications Corporation.
  20. # Portions created by the Initial Developer are Copyright (C) 1998
  21. # the Initial Developer. All Rights Reserved.
  22. #
  23. # Contributor(s):
  24. #
  25. # Alternatively, the contents of this file may be used under the terms of
  26. # either of the GNU General Public License Version 2 or later (the "GPL"),
  27. # or the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
  28. # in which case the provisions of the GPL or the LGPL are applicable instead
  29. # of those above. If you wish to allow use of your version of this file only
  30. # under the terms of either the GPL or the LGPL, and not to allow others to
  31. # use your version of this file under the terms of the MPL, indicate your
  32. # decision by deleting the provisions above and replace them with the notice
  33. # and other provisions required by the GPL or the LGPL. If you do not delete
  34. # the provisions above, a recipient may use your version of this file under
  35. # the terms of any one of the MPL, the GPL or the LGPL.
  36. #
  37. # ***** END LICENSE BLOCK *****
  38. #
  39. # Fix brain-damaged compilers that don't understand -o and -c together
  40. #
  41. CC=`echo $1 | sed -e "s|'||g" -e 's|"||g'`
  42. shift
  43. DASH_C=0
  44. DASH_O=0
  45. DUMMY="XxxXxxX"
  46. GET_OBJECT=0
  47. OBJ="${DUMMY}"
  48. OBJECT="${DUMMY}"
  49. for i in $*
  50. do
  51. [ "${CHECK_O}" = yes ] && {
  52. case $i in
  53. ./*/*.o) OBJECT="$i"
  54. OPTS="${OPTS} -o"
  55. DASH_O=1
  56. ;;
  57. ./*.o) OBJECT="`basename $i`"
  58. i=""
  59. DASH_O=1
  60. ;;
  61. *.o) if [ $i = `basename $i` ]
  62. then
  63. OBJECT="$i"
  64. i=""
  65. else
  66. OPTS="${OPTS} -o"
  67. fi
  68. DASH_O=1
  69. ;;
  70. *) OPTS="${OPTS} -o $i"
  71. DASH_O=1
  72. i=""
  73. ;;
  74. esac
  75. CHECK_O=no
  76. }
  77. case $i in
  78. -c) DASH_C=1
  79. OPTS="${OPTS} -c"
  80. ;;
  81. -o) CHECK_O=yes
  82. ;;
  83. *.c) C_SRC=$i
  84. OPTS="${OPTS} $i"
  85. # cc always creates the .o from the .c name
  86. OBJ=`basename $C_SRC .c`.o
  87. ;;
  88. *.s) S_SRC=$i
  89. OPTS="${OPTS} $i"
  90. # or the .o from the .s name
  91. OBJ=`basename $S_SRC .s`.o
  92. ;;
  93. *.o) OBJECT=$i
  94. OPTS="${OPTS} $i"
  95. ;;
  96. *) OPTS="${OPTS} $i"
  97. ;;
  98. esac
  99. done
  100. ${CC} ${OPTS} || exit $?
  101. # if there was no -c and -o we're done
  102. [ $DASH_C = 1 -a $DASH_O = 1 ] || exit 0
  103. # if $OBJ and $OBJECT are the same we're done
  104. [ $OBJ = $OBJECT ] && exit 0
  105. [ -f $OBJ ] && mv -f $OBJ $OBJECT