diff options
-rw-r--r-- | m4/efl_check_funcs.m4 | 41 |
1 files changed, 37 insertions, 4 deletions
diff --git a/m4/efl_check_funcs.m4 b/m4/efl_check_funcs.m4 index 8d8b388..e538db7 100644 --- a/m4/efl_check_funcs.m4 +++ b/m4/efl_check_funcs.m4 | |||
@@ -60,13 +60,21 @@ dnl _EFL_CHECK_FUNC_DLADDR is for internal use | |||
60 | dnl _EFL_CHECK_FUNC_DLADDR(EFL, VARIABLE) | 60 | dnl _EFL_CHECK_FUNC_DLADDR(EFL, VARIABLE) |
61 | AC_DEFUN([_EFL_CHECK_FUNC_DLADDR], | 61 | AC_DEFUN([_EFL_CHECK_FUNC_DLADDR], |
62 | [ | 62 | [ |
63 | dllibs="" | ||
64 | case "$host_os" in | ||
65 | linux*) | ||
66 | dllibs="-ldl" | ||
67 | ;; | ||
68 | *) | ||
69 | ;; | ||
70 | esac | ||
63 | case "$host_os" in | 71 | case "$host_os" in |
64 | mingw*) | 72 | mingw*) |
65 | $2="yes" | 73 | $2="yes" |
66 | EFL_ADD_LIBS([$1], [lib/evil/libdl.la]) | 74 | EFL_ADD_LIBS([$1], [lib/evil/libdl.la]) |
67 | ;; | 75 | ;; |
68 | *) | 76 | *) |
69 | EFL_FIND_LIB_FOR_CODE([$1], [-ldl], [$2], [[ | 77 | EFL_FIND_LIB_FOR_CODE([$1], [$dllibs], [$2], [[ |
70 | #ifndef _GNU_SOURCE | 78 | #ifndef _GNU_SOURCE |
71 | # define _GNU_SOURCE | 79 | # define _GNU_SOURCE |
72 | #endif | 80 | #endif |
@@ -81,13 +89,21 @@ dnl _EFL_CHECK_FUNC_DLOPEN is for internal use | |||
81 | dnl _EFL_CHECK_FUNC_DLOPEN(EFL, VARIABLE) | 89 | dnl _EFL_CHECK_FUNC_DLOPEN(EFL, VARIABLE) |
82 | AC_DEFUN([_EFL_CHECK_FUNC_DLOPEN], | 90 | AC_DEFUN([_EFL_CHECK_FUNC_DLOPEN], |
83 | [ | 91 | [ |
92 | dllibs="" | ||
93 | case "$host_os" in | ||
94 | linux*) | ||
95 | dllibs="-ldl" | ||
96 | ;; | ||
97 | *) | ||
98 | ;; | ||
99 | esac | ||
84 | case "$host_os" in | 100 | case "$host_os" in |
85 | mingw*) | 101 | mingw*) |
86 | $2="yes" | 102 | $2="yes" |
87 | EFL_ADD_LIBS([$1], [lib/evil/libdl.la]) | 103 | EFL_ADD_LIBS([$1], [lib/evil/libdl.la]) |
88 | ;; | 104 | ;; |
89 | *) | 105 | *) |
90 | EFL_FIND_LIB_FOR_CODE([$1], [-ldl], [$2], [[ | 106 | EFL_FIND_LIB_FOR_CODE([$1], [$dllibs], [$2], [[ |
91 | #include <dlfcn.h> | 107 | #include <dlfcn.h> |
92 | ]], [[void *h = dlopen(0, 0);]]) | 108 | ]], [[void *h = dlopen(0, 0);]]) |
93 | ;; | 109 | ;; |
@@ -98,13 +114,21 @@ dnl _EFL_CHECK_FUNC_DLSYM is for internal use | |||
98 | dnl _EFL_CHECK_FUNC_DLSYM(EFL, VARIABLE) | 114 | dnl _EFL_CHECK_FUNC_DLSYM(EFL, VARIABLE) |
99 | AC_DEFUN([_EFL_CHECK_FUNC_DLSYM], | 115 | AC_DEFUN([_EFL_CHECK_FUNC_DLSYM], |
100 | [ | 116 | [ |
117 | dllibs="" | ||
118 | case "$host_os" in | ||
119 | linux*) | ||
120 | dllibs="-ldl" | ||
121 | ;; | ||
122 | *) | ||
123 | ;; | ||
124 | esac | ||
101 | case "$host_os" in | 125 | case "$host_os" in |
102 | mingw*) | 126 | mingw*) |
103 | $2="yes" | 127 | $2="yes" |
104 | EFL_ADD_LIBS([$1], [lib/evil/libdl.la]) | 128 | EFL_ADD_LIBS([$1], [lib/evil/libdl.la]) |
105 | ;; | 129 | ;; |
106 | *) | 130 | *) |
107 | EFL_FIND_LIB_FOR_CODE([$1], [-ldl], [$2], [[ | 131 | EFL_FIND_LIB_FOR_CODE([$1], [$dllibs], [$2], [[ |
108 | #ifndef _GNU_SOURCE | 132 | #ifndef _GNU_SOURCE |
109 | # define _GNU_SOURCE | 133 | # define _GNU_SOURCE |
110 | #endif | 134 | #endif |
@@ -215,7 +239,16 @@ fi | |||
215 | dnl _EFL_CHECK_FUNC_SHM_OPEN is for internal use | 239 | dnl _EFL_CHECK_FUNC_SHM_OPEN is for internal use |
216 | dnl _EFL_CHECK_FUNC_SHM_OPEN(EFL, VARIABLE) | 240 | dnl _EFL_CHECK_FUNC_SHM_OPEN(EFL, VARIABLE) |
217 | AC_DEFUN([_EFL_CHECK_FUNC_SHM_OPEN], | 241 | AC_DEFUN([_EFL_CHECK_FUNC_SHM_OPEN], |
218 | [EFL_FIND_LIB_FOR_CODE([$1], [-lrt], [$2], [[ | 242 | [ |
243 | shmlibs="" | ||
244 | case "$host_os" in | ||
245 | linux*) | ||
246 | shmlibs="-lrt" | ||
247 | ;; | ||
248 | *) | ||
249 | ;; | ||
250 | esac | ||
251 | EFL_FIND_LIB_FOR_CODE([$1], [$shmlibs], [$2], [[ | ||
219 | #include <sys/mman.h> | 252 | #include <sys/mman.h> |
220 | #include <sys/stat.h> /* For mode constants */ | 253 | #include <sys/stat.h> /* For mode constants */ |
221 | #include <fcntl.h> /* For O_* constants */ | 254 | #include <fcntl.h> /* For O_* constants */ |