From 17e03003d6c97d518121fd194fcbafa6201881ed Mon Sep 17 00:00:00 2001 From: barbieri Date: Mon, 4 Jan 2010 19:18:45 +0000 Subject: [PATCH] PATH_MAX check, by Lutin. git-svn-id: http://svn.enlightenment.org/svn/e/trunk/evas@44886 7cbeb6ba-43b4-40fd-8cce-4c39aea84d33 --- configure.ac | 1 + m4/efl_path_max.m4 | 33 +++++++++++++++++++++++++++++++++ 2 files changed, 34 insertions(+) create mode 100644 m4/efl_path_max.m4 diff --git a/configure.ac b/configure.ac index d62af97..8eb6fef 100644 --- a/configure.ac +++ b/configure.ac @@ -25,6 +25,7 @@ SNAP=`echo $PACKAGE_VERSION | awk -F. '{printf("%s", $4);}'` version_info=`expr $VMAJ + $VMIN`":$VMIC:$VMIN" AC_SUBST(version_info) +EFL_CHECK_PATH_MAX ### Needed information diff --git a/m4/efl_path_max.m4 b/m4/efl_path_max.m4 new file mode 100644 index 0000000..2c9b60a --- /dev/null +++ b/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 -- 2.7.4