File:  [ELWIX - Embedded LightWeight unIX -] / embedaddon / php / TSRM / tsrm.m4
Revision 1.1.1.2 (vendor branch): download - view: text, annotated - select for diffs - revision graph
Tue May 29 12:34:34 2012 UTC (12 years, 1 month ago) by misho
Branches: php, MAIN
CVS tags: v5_4_3elwix, v5_4_29p0, v5_4_29, v5_4_20p0, v5_4_20, v5_4_17p0, v5_4_17, HEAD
php 5.4.3+patches

    1: 
    2: dnl TSRM_CHECK_GCC_ARG(ARG, ACTION-IF-FOUND, ACTION-IF-NOT_FOUND)	
    3: AC_DEFUN([TSRM_CHECK_GCC_ARG],[
    4:   gcc_arg_name=[ac_cv_gcc_arg]translit($1,A-Z-,a-z_)
    5:   AC_CACHE_CHECK([whether $CC supports $1], [ac_cv_gcc_arg]translit($1,A-Z-,a-z_), [
    6:   echo 'void somefunc() { };' > conftest.c
    7:   cmd='$CC $1 -c conftest.c'
    8:   if eval $cmd 2>&1 | egrep -e $1 >/dev/null ; then
    9:     ac_result=no
   10:   else
   11:     ac_result=yes
   12:   fi
   13:   eval $gcc_arg_name=$ac_result
   14:   rm -f conftest.*
   15:   ])
   16:   if eval test "\$$gcc_arg_name" = "yes"; then
   17:     $2
   18:   else
   19:     :
   20:     $3
   21:   fi
   22: ])
   23: 
   24: AC_DEFUN([TSRM_BASIC_CHECKS],[
   25: 
   26: AC_REQUIRE([AC_PROG_CC])dnl
   27: dnl AC_REQUIRE([AM_PROG_CC_STDC])dnl
   28: AC_REQUIRE([AC_PROG_CC_C_O])dnl
   29: AC_REQUIRE([AC_PROG_RANLIB])dnl
   30: 
   31: AC_CHECK_HEADERS(stdarg.h)
   32: 
   33: AC_CHECK_FUNCS(sigprocmask)
   34: 
   35: ])
   36: 
   37: 
   38: AC_DEFUN([TSRM_CHECK_PTH],[
   39: 
   40: AC_MSG_CHECKING(for GNU Pth)
   41: PTH_PREFIX="`$1 --prefix`"
   42: if test -z "$PTH_PREFIX"; then
   43:   AC_MSG_RESULT(Please check your Pth installation)
   44: fi
   45: 
   46: CPPFLAGS="$CPPFLAGS `$1 --cflags`"
   47: LDFLAGS="$LDFLAGS `$1 --ldflags`"
   48: LIBS="$LIBS `$1 --libs`"
   49: 
   50: AC_DEFINE(GNUPTH, 1, [Whether you use GNU Pth])
   51: AC_MSG_RESULT(yes - installed in $PTH_PREFIX)
   52: 
   53: ])
   54: 
   55: AC_DEFUN([TSRM_CHECK_ST],[
   56:   if test -r "$1/include/st.h"; then
   57:     CPPFLAGS="$CPPFLAGS -I$1/include"
   58:     LDFLAGS="$LDFLAGS -L$1/lib"
   59:   elif test -r "$1/st.h"; then
   60:     CPPFLAGS="$CPPFLAGS -I$1"
   61:     LDFLAGS="$LDFLAGS -L$1"
   62:   fi
   63:   AC_CHECK_HEADERS(st.h,[],[
   64:     AC_MSG_ERROR([Sorry[,] I was unable to locate the State Threads header file.  Please specify the prefix using --with-tsrm-st=/prefix])
   65:   ])
   66:   LIBS="$LIBS -lst"
   67:   AC_MSG_CHECKING(for SGI's State Threads)
   68:   AC_MSG_RESULT(yes)
   69:   AC_DEFINE(TSRM_ST, 1, [ ])
   70: ])
   71: 
   72: sinclude(threads.m4)
   73: 
   74: AC_DEFUN([TSRM_CHECK_PTHREADS],[
   75: 		
   76: PTHREADS_CHECK
   77: 
   78: if test "$beos_threads" = "1"; then 
   79:   AC_DEFINE(BETHREADS, 1, Whether to use native BeOS threads)
   80: else		
   81:   if test "$pthreads_working" != "yes"; then
   82:     AC_MSG_ERROR(Your system seems to lack POSIX threads.)
   83:   fi
   84: 
   85:   AC_DEFINE(PTHREADS, 1, Whether to use Pthreads)
   86: 
   87:   AC_MSG_CHECKING(for POSIX threads)
   88:   AC_MSG_RESULT(yes)
   89: fi
   90: ])
   91: 
   92: 
   93: AC_DEFUN([TSRM_THREADS_CHECKS],[
   94: 
   95: dnl For the thread implementations, we always use --with-*
   96: dnl to maintain consistency
   97: 
   98: AC_ARG_WITH(tsrm-pth,
   99: [  --with-tsrm-pth[=pth-config]
  100:                           Use GNU Pth],[
  101:   TSRM_PTH=$withval
  102: ],[
  103:   TSRM_PTH=no
  104: ])
  105: 
  106: AC_ARG_WITH(tsrm-st,
  107: [  --with-tsrm-st          Use SGI's State Threads],[
  108:   TSRM_ST=$withval
  109: ],[
  110:   TSRM_ST=no
  111: ])
  112: 
  113: AC_ARG_WITH(tsrm-pthreads,
  114: [  --with-tsrm-pthreads    Use POSIX threads (default)],[
  115:   TSRM_PTHREADS=$withval
  116: ],[
  117:   TSRM_PTHREADS=yes
  118: ])
  119: 
  120: test "$TSRM_PTH" = "yes" && TSRM_PTH=pth-config
  121: 
  122: if test "$TSRM_PTH" != "no"; then
  123:   TSRM_CHECK_PTH($TSRM_PTH)
  124: elif test "$TSRM_ST" != "no"; then
  125:   TSRM_CHECK_ST($TSRM_ST)
  126: elif test "$TSRM_PTHREADS" != "no"; then
  127:   TSRM_CHECK_PTHREADS
  128: fi
  129: 
  130: ])

FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>