summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorThomas Gstädtner <thomas@gstaedtner.net>2012-12-26 02:07:45 +0000
committerBruno Dilly <bdilly@profusion.mobi>2012-12-26 02:07:45 +0000
commit8df5be2d1ffd3d9aca7d1e7655ae54d8902203f7 (patch)
tree6c0a6fcbf539535c05813e2c8f8963286e0e6191
parent571ae7e679aaf131563c204a24d59c0839c08da0 (diff)
etrophy: add efl_path_max m4 macro
The check for it in configure.ac already exists. Patch by: Thomas Gstädtner <thomas@gstaedtner.net> SVN revision: 81701
-rw-r--r--m4/efl_path_max.m437
1 files changed, 37 insertions, 0 deletions
diff --git a/m4/efl_path_max.m4 b/m4/efl_path_max.m4
new file mode 100644
index 0000000..3ac29bd
--- /dev/null
+++ b/m4/efl_path_max.m4
@@ -0,0 +1,37 @@
1dnl Check for PATH_MAX in limits.h, and define a default value if not found
2dnl This is a workaround for systems not providing PATH_MAX, like GNU/Hurd
3
4dnl EFL_CHECK_PATH_MAX([DEFAULT_VALUE_IF_NOT_FOUND])
5dnl
6dnl If PATH_MAX is not defined in <limits.h>, defines it
7dnl to DEFAULT_VALUE_IF_NOT_FOUND if it exists, or fallback
8dnl to using 4096
9
10AC_DEFUN([EFL_CHECK_PATH_MAX],
11[
12
13default_max=m4_default([$1], "4096")
14
15AC_LANG_PUSH([C])
16
17AC_MSG_CHECKING([for PATH_MAX in limits.h])
18AC_COMPILE_IFELSE(
19 [AC_LANG_PROGRAM(
20 [[
21#include <limits.h>
22 ]],
23 [[
24int i = PATH_MAX;
25 ]])],
26 [AC_MSG_RESULT([yes])],
27 [
28 AC_DEFINE_UNQUOTED([PATH_MAX],
29 [${default_max}],
30 [default value since PATH_MAX is not defined])
31 AC_MSG_RESULT([no: using ${default_max}])
32 ])
33
34AC_LANG_POP([C])
35
36])
37dnl end of efl_path_max.m4