diff options
author | kpfleming <kpfleming@f38db490-d61c-443f-a65b-d21fe96a405b> | 2008-10-20 05:06:29 +0000 |
---|---|---|
committer | kpfleming <kpfleming@f38db490-d61c-443f-a65b-d21fe96a405b> | 2008-10-20 05:06:29 +0000 |
commit | 0e959dc59a7808321582ab926df8677b81f2ef8c (patch) | |
tree | c9ed67c0ffe74cb16322c96d459e5e826b912524 /autoconf/ast_func_fork.m4 | |
parent | f2eeaf54c03ab0dfb007c29fc8b2e2654fbe6428 (diff) |
Merged revisions 151242-151243 via svnmerge from
https://origsvn.digium.com/svn/asterisk/trunk
................
r151242 | kpfleming | 2008-10-20 07:59:04 +0300 (Mon, 20 Oct 2008) | 9 lines
Merged revisions 151240 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.4
........
r151240 | kpfleming | 2008-10-20 07:45:56 +0300 (Mon, 20 Oct 2008) | 3 lines
break up acinclude.m4 into individual files, which will make it easier to maintain, easier to add new macros (less patching) and will ease maintenance of these macros across Asterisk branches
........
................
r151243 | kpfleming | 2008-10-20 08:00:56 +0300 (Mon, 20 Oct 2008) | 9 lines
Merged revisions 151241 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.4
........
r151241 | kpfleming | 2008-10-20 07:57:33 +0300 (Mon, 20 Oct 2008) | 2 lines
rename this macro to properly reflect what it does
........
................
git-svn-id: http://svn.digium.com/svn/asterisk/branches/1.6.1@151245 f38db490-d61c-443f-a65b-d21fe96a405b
Diffstat (limited to 'autoconf/ast_func_fork.m4')
-rw-r--r-- | autoconf/ast_func_fork.m4 | 59 |
1 files changed, 59 insertions, 0 deletions
diff --git a/autoconf/ast_func_fork.m4 b/autoconf/ast_func_fork.m4 new file mode 100644 index 000000000..37bf0c397 --- /dev/null +++ b/autoconf/ast_func_fork.m4 @@ -0,0 +1,59 @@ +# AST_FUNC_FORK +# ------------- +AN_FUNCTION([fork], [AST_FUNC_FORK]) +AN_FUNCTION([vfork], [AST_FUNC_FORK]) +AC_DEFUN([AST_FUNC_FORK], +[AC_REQUIRE([AC_TYPE_PID_T])dnl +AC_CHECK_HEADERS(vfork.h) +AC_CHECK_FUNCS(fork vfork) +if test "x$ac_cv_func_fork" = xyes; then + _AST_FUNC_FORK +else + ac_cv_func_fork_works=$ac_cv_func_fork +fi +if test "x$ac_cv_func_fork_works" = xcross; then + case $host in + *-*-amigaos* | *-*-msdosdjgpp* | *-*-uclinux* | *-*-linux-uclibc* ) + # Override, as these systems have only a dummy fork() stub + ac_cv_func_fork_works=no + ;; + *) + ac_cv_func_fork_works=yes + ;; + esac + AC_MSG_WARN([result $ac_cv_func_fork_works guessed because of cross compilation]) +fi +ac_cv_func_vfork_works=$ac_cv_func_vfork +if test "x$ac_cv_func_vfork" = xyes; then + _AC_FUNC_VFORK +fi; +if test "x$ac_cv_func_fork_works" = xcross; then + ac_cv_func_vfork_works=$ac_cv_func_vfork + AC_MSG_WARN([result $ac_cv_func_vfork_works guessed because of cross compilation]) +fi + +if test "x$ac_cv_func_vfork_works" = xyes; then + AC_DEFINE(HAVE_WORKING_VFORK, 1, [Define to 1 if `vfork' works.]) +else + AC_DEFINE(vfork, fork, [Define as `fork' if `vfork' does not work.]) +fi +if test "x$ac_cv_func_fork_works" = xyes; then + AC_DEFINE(HAVE_WORKING_FORK, 1, [Define to 1 if `fork' works.]) +fi +])# AST_FUNC_FORK + + +# _AST_FUNC_FORK +# ------------- +AC_DEFUN([_AST_FUNC_FORK], + [AC_CACHE_CHECK(for working fork, ac_cv_func_fork_works, + [AC_RUN_IFELSE( + [AC_LANG_PROGRAM([AC_INCLUDES_DEFAULT], + [ + /* By Ruediger Kuhlmann. */ + return fork () < 0; + ])], + [ac_cv_func_fork_works=yes], + [ac_cv_func_fork_works=no], + [ac_cv_func_fork_works=cross])])] +)# _AST_FUNC_FORK |