From 826ecfdccc38534856ba535ef363e9df6ffa675c Mon Sep 17 00:00:00 2001 From: Gustavo Sverzut Barbieri Date: Tue, 22 Dec 2009 13:55:15 +0000 Subject: [PATCH] check for PATH_MAX and define it if not available (ie: Hurd) By: Albin Tonnerre (Lutin) SVN revision: 44656 --- legacy/edje/configure.ac | 1 + legacy/edje/m4/efl_path_max.m4 | 33 +++++++++++++++++++++++++++++++++ 2 files changed, 34 insertions(+) create mode 100644 legacy/edje/m4/efl_path_max.m4 diff --git a/legacy/edje/configure.ac b/legacy/edje/configure.ac index 13f21a0f61..0f4e2debe4 100644 --- a/legacy/edje/configure.ac +++ b/legacy/edje/configure.ac @@ -37,6 +37,7 @@ AC_SUBST(release_info) AC_DEFINE_UNQUOTED(SHARED_LIB_SUFFIX, "$shrext_cmds", [Suffix for shared objects]) +EFL_CHECK_PATH_MAX ### Default options with respect to host diff --git a/legacy/edje/m4/efl_path_max.m4 b/legacy/edje/m4/efl_path_max.m4 new file mode 100644 index 0000000000..f8d14c0455 --- /dev/null +++ b/legacy/edje/m4/efl_path_max.m4 @@ -0,0 +1,33 @@ +dnl Check for PATH_MAX in limits.h, and define a default value if not found +dnl This is a workaround for systems not providing PATH_MAX, like GNU/Hurd + +dnl EFL_CHECK_PATH_MAX([DEFAULT_VALUE_IF_NOT_FOUND]) +dnl +dnl If PATH_MAX is not defined in , defines it +dnl to DEFAULT_VALUE_IF_NOT_FOUND if it exists, or fallback +dnl to using 2048 + +AC_DEFUN([EFL_CHECK_PATH_MAX], +[ + +default_max=m4_default([$1], "2048") +AC_LANG_PUSH([C]) + +AC_MSG_CHECKING([for PATH_MAX in limit.h]) +AC_COMPILE_IFELSE( + [AC_LANG_PROGRAM([[#include ]], + [[int i = PATH_MAX]]) + ], + AC_MSG_RESULT([yes]), + [ + AC_DEFINE_UNQUOTED([PATH_MAX], + [${default_max}], + [default value since PATH_MAX is not defined]) + AC_MSG_RESULT([no: using ${default_max}]) + ] +) + +AC_LANG_POP([C]) + +]) +dnl end of efl_path_max.m4