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