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

/js/lib/Socket.IO-node/support/expresso/deps/jscoverage/js/build/autoconf/altoptions.m4

http://github.com/onedayitwillmake/RealtimeMultiplayerNodeJs
m4 | 154 lines | 134 code | 16 blank | 4 comment | 0 complexity | 9d5424f08005409373a171e8addeff66 MD5 | raw file
Possible License(s): GPL-2.0, LGPL-2.1, MPL-2.0-no-copyleft-exception, BSD-3-Clause
  1. dnl ***** BEGIN LICENSE BLOCK *****
  2. dnl Version: MPL 1.1/GPL 2.0/LGPL 2.1
  3. dnl
  4. dnl The contents of this file are subject to the Mozilla Public License Version
  5. dnl 1.1 (the "License"); you may not use this file except in compliance with
  6. dnl the License. You may obtain a copy of the License at
  7. dnl http://www.mozilla.org/MPL/
  8. dnl
  9. dnl Software distributed under the License is distributed on an "AS IS" basis,
  10. dnl WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
  11. dnl for the specific language governing rights and limitations under the
  12. dnl License.
  13. dnl
  14. dnl The Original Code is mozilla.org code.
  15. dnl
  16. dnl The Initial Developer of the Original Code is
  17. dnl Netscape Communications Corporation.
  18. dnl Portions created by the Initial Developer are Copyright (C) 1999
  19. dnl the Initial Developer. All Rights Reserved.
  20. dnl
  21. dnl Contributor(s):
  22. dnl
  23. dnl Alternatively, the contents of this file may be used under the terms of
  24. dnl either of the GNU General Public License Version 2 or later (the "GPL"),
  25. dnl or the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
  26. dnl in which case the provisions of the GPL or the LGPL are applicable instead
  27. dnl of those above. If you wish to allow use of your version of this file only
  28. dnl under the terms of either the GPL or the LGPL, and not to allow others to
  29. dnl use your version of this file under the terms of the MPL, indicate your
  30. dnl decision by deleting the provisions above and replace them with the notice
  31. dnl and other provisions required by the GPL or the LGPL. If you do not delete
  32. dnl the provisions above, a recipient may use your version of this file under
  33. dnl the terms of any one of the MPL, the GPL or the LGPL.
  34. dnl
  35. dnl ***** END LICENSE BLOCK *****
  36. dnl altoptions.m4 - An alternative way of specifying command-line options.
  37. dnl These macros are needed to support a menu-based configurator.
  38. dnl This file also includes the macro, AM_READ_MYCONFIG, for reading
  39. dnl the 'myconfig.m4' file.
  40. dnl Send comments, improvements, bugs to Steve Lamm (slamm@netscape.com).
  41. dnl MOZ_ARG_ENABLE_BOOL( NAME, HELP, IF-YES [, IF-NO [, ELSE]])
  42. dnl MOZ_ARG_DISABLE_BOOL( NAME, HELP, IF-NO [, IF-YES [, ELSE]])
  43. dnl MOZ_ARG_ENABLE_STRING( NAME, HELP, IF-SET [, ELSE])
  44. dnl MOZ_ARG_ENABLE_BOOL_OR_STRING( NAME, HELP, IF-YES, IF-NO, IF-SET[, ELSE]]])
  45. dnl MOZ_ARG_WITH_BOOL( NAME, HELP, IF-YES [, IF-NO [, ELSE])
  46. dnl MOZ_ARG_WITHOUT_BOOL( NAME, HELP, IF-NO [, IF-YES [, ELSE])
  47. dnl MOZ_ARG_WITH_STRING( NAME, HELP, IF-SET [, ELSE])
  48. dnl MOZ_ARG_HEADER(Comment)
  49. dnl MOZ_CHECK_PTHREADS( NAME, IF-YES [, ELSE ])
  50. dnl MOZ_READ_MYCONFIG() - Read in 'myconfig.sh' file
  51. dnl MOZ_TWO_STRING_TEST(NAME, VAL, STR1, IF-STR1, STR2, IF-STR2 [, ELSE])
  52. AC_DEFUN([MOZ_TWO_STRING_TEST],
  53. [if test "[$2]" = "[$3]"; then
  54. ifelse([$4], , :, [$4])
  55. elif test "[$2]" = "[$5]"; then
  56. ifelse([$6], , :, [$6])
  57. else
  58. ifelse([$7], ,
  59. [AC_MSG_ERROR([Option, [$1], does not take an argument ([$2]).])],
  60. [$7])
  61. fi])
  62. dnl MOZ_ARG_ENABLE_BOOL(NAME, HELP, IF-YES [, IF-NO [, ELSE]])
  63. AC_DEFUN([MOZ_ARG_ENABLE_BOOL],
  64. [AC_ARG_ENABLE([$1], [$2],
  65. [MOZ_TWO_STRING_TEST([$1], [$enableval], yes, [$3], no, [$4])],
  66. [$5])])
  67. dnl MOZ_ARG_DISABLE_BOOL(NAME, HELP, IF-NO [, IF-YES [, ELSE]])
  68. AC_DEFUN([MOZ_ARG_DISABLE_BOOL],
  69. [AC_ARG_ENABLE([$1], [$2],
  70. [MOZ_TWO_STRING_TEST([$1], [$enableval], no, [$3], yes, [$4])],
  71. [$5])])
  72. dnl MOZ_ARG_ENABLE_STRING(NAME, HELP, IF-SET [, ELSE])
  73. AC_DEFUN([MOZ_ARG_ENABLE_STRING],
  74. [AC_ARG_ENABLE([$1], [$2], [$3], [$4])])
  75. dnl MOZ_ARG_ENABLE_BOOL_OR_STRING(NAME, HELP, IF-YES, IF-NO, IF-SET[, ELSE]]])
  76. AC_DEFUN([MOZ_ARG_ENABLE_BOOL_OR_STRING],
  77. [ifelse([$5], ,
  78. [errprint([Option, $1, needs an "IF-SET" argument.
  79. ])
  80. m4exit(1)],
  81. [AC_ARG_ENABLE([$1], [$2],
  82. [MOZ_TWO_STRING_TEST([$1], [$enableval], yes, [$3], no, [$4], [$5])],
  83. [$6])])])
  84. dnl MOZ_ARG_WITH_BOOL(NAME, HELP, IF-YES [, IF-NO [, ELSE])
  85. AC_DEFUN([MOZ_ARG_WITH_BOOL],
  86. [AC_ARG_WITH([$1], [$2],
  87. [MOZ_TWO_STRING_TEST([$1], [$withval], yes, [$3], no, [$4])],
  88. [$5])])
  89. dnl MOZ_ARG_WITHOUT_BOOL(NAME, HELP, IF-NO [, IF-YES [, ELSE])
  90. AC_DEFUN([MOZ_ARG_WITHOUT_BOOL],
  91. [AC_ARG_WITH([$1], [$2],
  92. [MOZ_TWO_STRING_TEST([$1], [$withval], no, [$3], yes, [$4])],
  93. [$5])])
  94. dnl MOZ_ARG_WITH_STRING(NAME, HELP, IF-SET [, ELSE])
  95. AC_DEFUN([MOZ_ARG_WITH_STRING],
  96. [AC_ARG_WITH([$1], [$2], [$3], [$4])])
  97. dnl MOZ_ARG_HEADER(Comment)
  98. dnl This is used by webconfig to group options
  99. define(MOZ_ARG_HEADER, [# $1])
  100. dnl
  101. dnl Apparently, some systems cannot properly check for the pthread
  102. dnl library unless <pthread.h> is included so we need to test
  103. dnl using it
  104. dnl
  105. dnl MOZ_CHECK_PTHREADS(lib, success, failure)
  106. AC_DEFUN([MOZ_CHECK_PTHREADS],
  107. [
  108. AC_MSG_CHECKING([for pthread_create in -l$1])
  109. echo "
  110. #include <pthread.h>
  111. #include <stdlib.h>
  112. void *foo(void *v) { int a = 1; }
  113. int main() {
  114. pthread_t t;
  115. if (!pthread_create(&t, 0, &foo, 0)) {
  116. pthread_join(t, 0);
  117. }
  118. exit(0);
  119. }" > dummy.c ;
  120. echo "${CC-cc} -o dummy${ac_exeext} dummy.c $CFLAGS $CPPFLAGS -l[$1] $LDFLAGS $LIBS" 1>&5;
  121. ${CC-cc} -o dummy${ac_exeext} dummy.c $CFLAGS $CPPFLAGS -l[$1] $LDFLAGS $LIBS 2>&5;
  122. _res=$? ;
  123. rm -f dummy.c dummy${ac_exeext} ;
  124. if test "$_res" = "0"; then
  125. AC_MSG_RESULT([yes])
  126. [$2]
  127. else
  128. AC_MSG_RESULT([no])
  129. [$3]
  130. fi
  131. ])
  132. dnl MOZ_READ_MYCONFIG() - Read in 'myconfig.sh' file
  133. AC_DEFUN([MOZ_READ_MOZCONFIG],
  134. [AC_REQUIRE([AC_INIT_BINSH])dnl
  135. # Read in '.mozconfig' script to set the initial options.
  136. # See the mozconfig2configure script for more details.
  137. _AUTOCONF_TOOLS_DIR=`dirname [$]0`/[$1]/build/autoconf
  138. . $_AUTOCONF_TOOLS_DIR/mozconfig2configure])