From a60083c90ef44fad1b16ccf697e4c69dc83ebdf3 Mon Sep 17 00:00:00 2001 From: Gustavo Sverzut Barbieri Date: Mon, 4 Jan 2010 19:20:15 +0000 Subject: [PATCH] PATH_MAX checks, by Lutin. SVN revision: 44887 --- legacy/ecore/configure.ac | 2 ++ legacy/ecore/m4/efl_path_max.m4 | 33 +++++++++++++++++++++++++++++++++ 2 files changed, 35 insertions(+) create mode 100644 legacy/ecore/m4/efl_path_max.m4 diff --git a/legacy/ecore/configure.ac b/legacy/ecore/configure.ac index 4687f2d7bf..0e54d33026 100644 --- a/legacy/ecore/configure.ac +++ b/legacy/ecore/configure.ac @@ -30,6 +30,8 @@ AC_SUBST(version_info) AM_GNU_GETTEXT_VERSION([0.12.1]) AM_GNU_GETTEXT([external]) +EFL_CHECK_PATH_MAX + case "$host_os" in mingw32ce* | cegcc*) ;; diff --git a/legacy/ecore/m4/efl_path_max.m4 b/legacy/ecore/m4/efl_path_max.m4 new file mode 100644 index 0000000000..2c9b60afe7 --- /dev/null +++ b/legacy/ecore/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 4096 + +AC_DEFUN([EFL_CHECK_PATH_MAX], +[ + +default_max=m4_default([$1], "4096") +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