summaryrefslogtreecommitdiffstats
path: root/m4/efl_path_max.m4
diff options
context:
space:
mode:
authorJérémy Zurcher <jeremy@asynk.ch>2013-12-06 15:05:31 +0100
committerJérémy Zurcher <jeremy@asynk.ch>2013-12-06 15:05:31 +0100
commitca99540270f229485e64caed4aa949e129ddf1d8 (patch)
treea7fd9f49078ceb25c6f4d01f0c8bb8505f78dd7c /m4/efl_path_max.m4
downloadeina_graph-ca99540270f229485e64caed4aa949e129ddf1d8.zip
eina_graph-ca99540270f229485e64caed4aa949e129ddf1d8.tar.gz
Initial commit
Diffstat (limited to 'm4/efl_path_max.m4')
-rw-r--r--m4/efl_path_max.m436
1 files changed, 36 insertions, 0 deletions
diff --git a/m4/efl_path_max.m4 b/m4/efl_path_max.m4
new file mode 100644
index 0000000..f57bfd2
--- /dev/null
+++ b/m4/efl_path_max.m4
@@ -0,0 +1,36 @@
+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 <limits.h>, 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 limits.h])
+AC_COMPILE_IFELSE(
+ [AC_LANG_PROGRAM(
+ [[
+#include <limits.h>
+ ]],
+ [[
+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