aboutsummaryrefslogtreecommitdiffstats
path: root/acinclude.m4
diff options
context:
space:
mode:
authorkpfleming <kpfleming@f38db490-d61c-443f-a65b-d21fe96a405b>2006-08-21 20:12:18 +0000
committerkpfleming <kpfleming@f38db490-d61c-443f-a65b-d21fe96a405b>2006-08-21 20:12:18 +0000
commit1251c2c93407b4be04db7bc51aae16b3a61bfe05 (patch)
treea9b38b324e925a6a6924cf5cc9c07f20e93d9fe4 /acinclude.m4
parent3426d30f6a3b9f88b87e19b3b9046d9cc80f071f (diff)
use a customized configure macro to tell the script that uCLinux does not have fork() that works
drop all startup options and code related to forking if it is not available git-svn-id: http://svn.digium.com/svn/asterisk/trunk@40790 f38db490-d61c-443f-a65b-d21fe96a405b
Diffstat (limited to 'acinclude.m4')
-rw-r--r--acinclude.m460
1 files changed, 60 insertions, 0 deletions
diff --git a/acinclude.m4 b/acinclude.m4
index 1bd093703..b621923ef 100644
--- a/acinclude.m4
+++ b/acinclude.m4
@@ -115,3 +115,63 @@ if test "x$GNU_MAKE" = "xNot Found" ; then
fi
AC_SUBST([GNU_MAKE])
])
+
+# 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* )
+ # 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