summaryrefslogtreecommitdiff
path: root/legacy/eet/m4
diff options
context:
space:
mode:
authorVincent Torri <vincent.torri@gmail.com>2012-07-01 09:47:48 +0000
committerVincent Torri <vincent.torri@gmail.com>2012-07-01 09:47:48 +0000
commit344b3f5d84b4ed4c7af958d46c303d6efb753847 (patch)
tree4b05d0ac320ec19fbb137edbe5c4dfed7b0a16cc /legacy/eet/m4
parent54f22b1e7bccfa2895a960f0d432d27c529cc8c4 (diff)
Eet: add nice m4 macros to check functions and libraries. Will be usable easily in the merge, per EFL lib
Please, test. config.h is the same (except useless macro HAVE_ICONV_H) and compilation is correct on linux and mingw here SVN revision: 73095
Diffstat (limited to 'legacy/eet/m4')
-rw-r--r--legacy/eet/m4/efl_check_funcs.m4435
-rw-r--r--legacy/eet/m4/efl_check_libs.m4120
-rw-r--r--legacy/eet/m4/efl_fnmatch.m443
3 files changed, 555 insertions, 43 deletions
diff --git a/legacy/eet/m4/efl_check_funcs.m4 b/legacy/eet/m4/efl_check_funcs.m4
new file mode 100644
index 0000000000..3714969b99
--- /dev/null
+++ b/legacy/eet/m4/efl_check_funcs.m4
@@ -0,0 +1,435 @@
1dnl Copyright (C) 2012 Vincent Torri <vincent dot torri at gmail dot com>
2dnl This code is public domain and can be freely used or copied.
3
4dnl Macros that check functions availability for the EFL:
5
6dnl dirfd
7dnl dladdr
8dnl dlopen
9dnl fnmatch
10dnl iconv
11dnl setxattr (an al.)
12dnl shm_open
13
14
15dnl _EFL_CHECK_FUNC_DIRFD is for internal use
16dnl _EFL_CHECK_FUNC_DIRFD(EFL, ACTION-IF-FOUND, ACTION-IF-NOT-FOUND)
17
18AC_DEFUN([_EFL_CHECK_FUNC_DIRFD],
19[
20AC_LINK_IFELSE(
21 [
22 AC_LANG_PROGRAM(
23 [[
24#ifdef HAVE_DIRENT_H
25# include <dirent.h>
26#endif
27 ]],
28 [[
29int main(void)
30{
31 DIR *dirp;
32 return dirfd(dirp);
33}
34 ]])
35 ],
36 [_efl_have_fct="yes"],
37 [_efl_have_fct="no"])
38
39AS_IF([test "x${_efl_have_fct}" = "xyes"], [$2], [$3])
40])
41
42dnl _EFL_CHECK_FUNC_DLADDR_PRIV is for internal use
43dnl _EFL_CHECK_FUNC_DLADDR_PRIV(EFL, LIB, ACTION-IF-FOUND, ACTION-IF-NOT-FOUND)
44
45AC_DEFUN([_EFL_CHECK_FUNC_DLADDR_PRIV],
46[
47m4_pushdef([UPEFL], m4_translit([$1], [-a-z], [_A-Z]))dnl
48m4_pushdef([DOWNEFL], m4_translit([$1], [-A-Z], [_a-z]))dnl
49
50LIBS_save="${LIBS}"
51LIBS="${LIBS} $2"
52AC_LINK_IFELSE(
53 [AC_LANG_PROGRAM(
54 [[
55#define _GNU_SOURCE
56#include <dlfcn.h>
57 ]],
58 [[
59int res = dladdr(0, 0);
60 ]])],
61 [
62 m4_defn([UPEFL])[]_LIBS="${m4_defn([UPEFL])[]_LIBS} $2"
63 requirements_libs_[]m4_defn([DOWNEFL])="${requirements_libs_[]m4_defn([DOWNEFL])} $2"
64 _efl_have_fct="yes"
65 ],
66 [_efl_have_fct="no"])
67
68LIBS="${LIBS_save}"
69
70AS_IF([test "x${_efl_have_fct}" = "xyes"], [$3], [$4])
71
72m4_popdef([DOWNEFL])
73m4_popdef([UPEFL])
74])
75
76dnl _EFL_CHECK_FUNC_DLADDR is for internal use
77dnl _EFL_CHECK_FUNC_DLADDR(EFL, ACTION-IF-FOUND, ACTION-IF-NOT-FOUND)
78
79AC_DEFUN([_EFL_CHECK_FUNC_DLADDR],
80[
81m4_pushdef([UPEFL], m4_translit([$1], [-a-z], [_A-Z]))dnl
82m4_pushdef([DOWNEFL], m4_translit([$1], [-A-Z], [_a-z]))dnl
83
84case "$host_os" in
85 mingw*)
86 _efl_have_fct="yes"
87 requirements_libs_[]m4_defn([DOWNEFL])="${requirements_libs_[]m4_defn([DOWNEFL])} -ldl"
88 m4_defn([UPEFL])[]_LIBS="${m4_defn([UPEFL])[]_LIBS} -ldl"
89 ;;
90 *)
91 _efl_have_fct="no"
92
93dnl Check is dladdr is in libc
94 _EFL_CHECK_FUNC_DLADDR_PRIV([$1], [], [_efl_have_fct="yes"], [_efl_have_fct="no"])
95
96dnl Check is dlopen is in libdl
97 if test "x${_efl_have_fct}" = "xno" ; then
98 _EFL_CHECK_FUNC_DLADDR_PRIV([$1], [-ldl], [_efl_have_fct="yes"], [_efl_have_fct="no"])
99 fi
100 ;;
101esac
102
103AS_IF([test "x${_efl_have_fct}" = "xyes"], [$2], [$3])
104
105m4_popdef([DOWNEFL])
106m4_popdef([UPEFL])
107])
108
109dnl _EFL_CHECK_FUNC_DLOPEN_PRIV is for internal use
110dnl _EFL_CHECK_FUNC_DLOPEN_PRIV(EFL, LIB, ACTION-IF-FOUND, ACTION-IF-NOT-FOUND)
111
112AC_DEFUN([_EFL_CHECK_FUNC_DLOPEN_PRIV],
113[
114m4_pushdef([UPEFL], m4_translit([$1], [-a-z], [_A-Z]))dnl
115m4_pushdef([DOWNEFL], m4_translit([$1], [-A-Z], [_a-z]))dnl
116
117LIBS_save="${LIBS}"
118LIBS="${LIBS} $2"
119AC_LINK_IFELSE(
120 [AC_LANG_PROGRAM(
121 [[
122#include <dlfcn.h>
123 ]],
124 [[
125void *h = dlopen(0, 0);
126 ]])],
127 [
128 m4_defn([UPEFL])[]_LIBS="${m4_defn([UPEFL])[]_LIBS} $2"
129 requirements_libs_[]m4_defn([DOWNEFL])="${requirements_libs_[]m4_defn([DOWNEFL])} $2"
130 _efl_have_fct="yes"
131 ],
132 [_efl_have_fct="no"])
133
134LIBS="${LIBS_save}"
135
136AS_IF([test "x${_efl_have_fct}" = "xyes"], [$3], [$4])
137
138m4_popdef([DOWNEFL])
139m4_popdef([UPEFL])
140])
141
142dnl _EFL_CHECK_FUNC_DLOPEN is for internal use
143dnl _EFL_CHECK_FUNC_DLOPEN(EFL, ACTION-IF-FOUND, ACTION-IF-NOT-FOUND)
144
145AC_DEFUN([_EFL_CHECK_FUNC_DLOPEN],
146[
147m4_pushdef([UPEFL], m4_translit([$1], [-a-z], [_A-Z]))dnl
148m4_pushdef([DOWNEFL], m4_translit([$1], [-A-Z], [_a-z]))dnl
149
150case "$host_os" in
151 mingw*)
152 _efl_have_fct="yes"
153 requirements_libs_[]m4_defn([DOWNEFL])="${requirements_libs_[]m4_defn([DOWNEFL])} -ldl"
154 m4_defn([UPEFL])[]_LIBS="${m4_defn([UPEFL])[]_LIBS} -ldl"
155 ;;
156 *)
157 _efl_have_fct="no"
158
159dnl Check is dlopen is in libc
160 _EFL_CHECK_FUNC_DLOPEN_PRIV([$1], [], [_efl_have_fct="yes"], [_efl_have_fct="no"])
161
162dnl Check is dlopen is in libdl
163 if test "x${_efl_have_fct}" = "xno" ; then
164 _EFL_CHECK_FUNC_DLOPEN_PRIV([$1], [-ldl], [_efl_have_fct="yes"], [_efl_have_fct="no"])
165 fi
166 ;;
167esac
168
169AS_IF([test "x${_efl_have_fct}" = "xyes"], [$2], [$3])
170
171m4_popdef([DOWNEFL])
172m4_popdef([UPEFL])
173])
174
175dnl _EFL_CHECK_FUNC_FNMATCH_PRIV is for internal use
176dnl _EFL_CHECK_FUNC_FNMATCH_PRIV(EFL, LIB, ACTION-IF-FOUND, ACTION-IF-NOT-FOUND)
177
178AC_DEFUN([_EFL_CHECK_FUNC_FNMATCH_PRIV],
179[
180m4_pushdef([UPEFL], m4_translit([$1], [-a-z], [_A-Z]))dnl
181m4_pushdef([DOWNEFL], m4_translit([$1], [-A-Z], [_a-z]))dnl
182
183LIBS_save="${LIBS}"
184LIBS="${LIBS} $2"
185AC_LINK_IFELSE(
186 [AC_LANG_PROGRAM(
187 [[
188#include <stdlib.h>
189#include <fnmatch.h>
190 ]],
191 [[
192int g = fnmatch(NULL, NULL, 0);
193 ]])],
194 [
195 m4_defn([UPEFL])[]_LIBS="${m4_defn([UPEFL])[]_LIBS} $2"
196 requirements_libs_[]m4_defn([DOWNEFL])="${requirements_libs_[]m4_defn([DOWNEFL])} $2"
197 _efl_have_fct="yes"
198 ],
199 [_efl_have_fct="no"])
200
201LIBS="${LIBS_save}"
202
203AS_IF([test "x${_efl_have_fct}" = "xyes"], [$3], [$4])
204
205m4_popdef([DOWNEFL])
206m4_popdef([UPEFL])
207])
208
209dnl _EFL_CHECK_FUNC_FNMATCH is for internal use
210dnl _EFL_CHECK_FUNC_FNMATCH(EFL, ACTION-IF-FOUND, ACTION-IF-NOT-FOUND)
211
212AC_DEFUN([_EFL_CHECK_FUNC_FNMATCH],
213[
214case "$host_os" in
215 mingw*)
216 _efl_have_fct="yes"
217 ;;
218 *)
219dnl Check is fnmatch is in libc
220 _EFL_CHECK_FUNC_FNMATCH_PRIV([$1], [], [_efl_have_fct="yes"], [_efl_have_fct="no"])
221
222dnl Check is fnmatch is in libfnmatch
223 if test "x${_efl_have_fct}" = "xno" ; then
224 _EFL_CHECK_FUNC_FNMATCH_PRIV([$1], [-lfnmatch], [_efl_have_fct="yes"], [_efl_have_fct="no"])
225 fi
226
227dnl Check is fnmatch is in libiberty
228 if test "x${_efl_have_fct}" = "xno" ; then
229 _EFL_CHECK_FUNC_FNMATCH_PRIV([$1], [-liberty], [_efl_have_fct="yes"], [_efl_have_fct="no"])
230 fi
231 ;;
232esac
233
234AS_IF([test "x${_efl_have_fct}" = "xyes"], [$2], [$3])
235])
236
237dnl _EFL_CHECK_FUNC_ICONV_PRIV is for internal use
238dnl _EFL_CHECK_FUNC_ICONV_PRIV(EFL, LIB, ACTION-IF-FOUND, ACTION-IF-NOT-FOUND)
239
240AC_DEFUN([_EFL_CHECK_FUNC_ICONV_PRIV],
241[
242m4_pushdef([UPEFL], m4_translit([$1], [-a-z], [_A-Z]))dnl
243m4_pushdef([DOWNEFL], m4_translit([$1], [-A-Z], [_a-z]))dnl
244
245LIBS_save="${LIBS}"
246LIBS="${LIBS} $2"
247AC_LINK_IFELSE(
248 [AC_LANG_PROGRAM(
249 [[
250#include <stdlib.h>
251#include <iconv.h>
252 ]],
253 [[
254iconv_t ic;
255size_t count = iconv(ic, NULL, NULL, NULL, NULL);
256 ]])],
257 [
258 m4_defn([UPEFL])[]_LIBS="${m4_defn([UPEFL])[]_LIBS} $2"
259 requirements_libs_[]m4_defn([DOWNEFL])="${requirements_libs_[]m4_defn([DOWNEFL])} $2"
260 _efl_have_fct="yes"
261 ],
262 [_efl_have_fct="no"])
263
264LIBS="${LIBS_save}"
265
266AS_IF([test "x${_efl_have_fct}" = "xyes"], [$3], [$4])
267
268m4_popdef([DOWNEFL])
269m4_popdef([UPEFL])
270])
271
272dnl _EFL_CHECK_FUNC_ICONV is for internal use
273dnl _EFL_CHECK_FUNC_ICONV(EFL, ACTION-IF-FOUND, ACTION-IF-NOT-FOUND)
274
275AC_DEFUN([_EFL_CHECK_FUNC_ICONV],
276[
277AC_ARG_WITH([iconv-link],
278 AC_HELP_STRING([--with-iconv-link=ICONV_LINK], [explicitly specify an iconv link option]),
279 [
280 _efl_have_fct="yes"
281 iconv_libs=${withval}
282 ],
283 [_efl_have_fct="no"])
284
285AC_MSG_CHECKING([for explicit iconv link options])
286if test "x${iconv_libs}" = "x" ; then
287 AC_MSG_RESULT([no explicit iconv link option])
288else
289 AC_MSG_RESULT([${iconv_libs}])
290fi
291
292dnl Check is iconv is in libc
293if test "x${_efl_have_fct}" = "xno" ; then
294 _EFL_CHECK_FUNC_ICONV_PRIV([$1], [], [_efl_have_fct="yes"], [_efl_have_fct="no"])
295fi
296
297dnl Check is iconv is in libiconv
298if test "x${_efl_have_fct}" = "xno" ; then
299 _EFL_CHECK_FUNC_ICONV_PRIV([$1], [-liconv], [_efl_have_fct="yes"], [_efl_have_fct="no"])
300fi
301
302dnl Check is iconv is in libiconv_plug
303if test "x${_efl_have_fct}" = "xno" ; then
304 _EFL_CHECK_FUNC_ICONV_PRIV([$1], [-liconv_plug], [_efl_have_fct="yes"], [_efl_have_fct="no"])
305fi
306
307AS_IF([test "x${_efl_have_fct}" = "xyes"], [$2], [$3])
308])
309
310dnl _EFL_CHECK_FUNC_SETXATTR is for internal use
311dnl _EFL_CHECK_FUNC_SETXATTR(EFL, ACTION-IF-FOUND, ACTION-IF-NOT-FOUND)
312
313AC_DEFUN([_EFL_CHECK_FUNC_SETXATTR],
314[
315AC_COMPILE_IFELSE(
316 [AC_LANG_PROGRAM(
317 [[
318#include <stdlib.h>
319#include <sys/types.h>
320#include <sys/xattr.h>
321 ]],
322 [[
323size_t tmp = listxattr("/", NULL, 0);
324tmp = getxattr("/", "user.ethumb.md5", NULL, 0);
325setxattr("/", "user.ethumb.md5", NULL, 0, 0);
326 ]])],
327 [_efl_have_fct="yes"],
328 [_efl_have_fct="no"])
329
330AS_IF([test "x${_efl_have_fct}" = "xyes"], [$2], [$3])
331])
332
333dnl _EFL_CHECK_FUNC_SHM_OPEN_PRIV is for internal use
334dnl _EFL_CHECK_FUNC_SHM_OPEN_PRIV(EFL, LIB, ACTION-IF-FOUND, ACTION-IF-NOT-FOUND)
335
336AC_DEFUN([_EFL_CHECK_FUNC_SHM_OPEN_PRIV],
337[
338m4_pushdef([UPEFL], m4_translit([$1], [-a-z], [_A-Z]))dnl
339m4_pushdef([DOWNEFL], m4_translit([$1], [-A-Z], [_a-z]))dnl
340
341LIBS_save="${LIBS}"
342LIBS="${LIBS} $2"
343AC_LINK_IFELSE(
344 [AC_LANG_PROGRAM(
345 [[
346#include <sys/mman.h>
347#include <sys/stat.h> /* For mode constants */
348#include <fcntl.h> /* For O_* constants */
349 ]],
350 [[
351int fd;
352
353fd = shm_open("/dev/null", O_RDONLY, S_IRWXU | S_IRWXG | S_IRWXO);
354 ]])],
355 [
356 m4_defn([UPEFL])[]_LIBS="$m4_defn([UPEFL])[]_LIBS $2"
357 requirements_libs_[]m4_defn([DOWNEFL])="${requirements_libs_[]m4_defn([DOWNEFL])} $2"
358 _efl_have_fct="yes"
359 ],
360 [_efl_have_fct="no"])
361
362LIBS="${LIBS_save}"
363
364AS_IF([test "x${_efl_have_fct}" = "xyes"], [$3], [$4])
365
366m4_popdef([DOWNEFL])
367m4_popdef([UPEFL])
368])
369
370dnl _EFL_CHECK_FUNC_SHM_OPEN is for internal use
371dnl _EFL_CHECK_FUNC_SHM_OPEN(EFL, ACTION-IF-FOUND, ACTION-IF-NOT-FOUND)
372
373AC_DEFUN([_EFL_CHECK_FUNC_SHM_OPEN],
374[
375_efl_have_fct="no"
376
377dnl Check is shm_open is in libc
378_EFL_CHECK_FUNC_SHM_OPEN_PRIV([$1], [],
379 [_efl_have_fct="yes"],
380 [_efl_have_fct="no"])
381
382dnl Check is shm_open is in librt
383if test "x${_efl_have_fct}" = "xno" ; then
384 _EFL_CHECK_FUNC_SHM_OPEN_PRIV([$1], [-lrt],
385 [_efl_have_fct="yes"],
386 [_efl_have_fct="no"])
387fi
388
389AS_IF([test "x${_efl_have_fct}" = "xyes"], [$2], [$3])
390])
391
392dnl Macro that checks function availability
393dnl
394dnl EFL_CHECK_FUNC(EFL, FUNCTION)
395dnl AC_DEFINE : EFL_HAVE_FUNCTION (FUNCTION being replaced by its value)
396dnl result in efl_func_function (function being replaced by its value)
397
398AC_DEFUN([EFL_CHECK_FUNC],
399[
400m4_pushdef([UP], m4_translit([$2], [-a-z], [_A-Z]))dnl
401m4_pushdef([DOWN], m4_translit([$2], [-A-Z], [_a-z]))dnl
402
403m4_default([_EFL_CHECK_FUNC_]m4_defn([UP]))($1, [have_fct="yes"], [have_fct="no"])
404
405if test "x$2" = "xsetxattr" ; then
406 AC_MSG_CHECKING([for extended attributes])
407else
408 AC_MSG_CHECKING([for ]m4_defn([DOWN]))
409fi
410
411AC_MSG_RESULT([${have_fct}])
412
413if test "x${have_fct}" = "xyes" ; then
414 if test "x$2" = "xsetxattr" ; then
415 AC_DEFINE([HAVE_XATTR], [1], [Define to 1 if you have the `listxattr', `setxattr' and `getxattr' functions.])
416 else
417 AC_DEFINE([HAVE_]m4_defn([UP]), [1], [Define to 1 if you have the `]m4_defn([DOWN])[' function.])
418 fi
419fi
420
421efl_func_[]m4_defn([DOWN])="${have_fct}"
422
423m4_popdef([DOWN])
424m4_popdef([UP])
425])
426
427dnl Macro that iterates over a sequence of space separated functions
428dnl and that calls EFL_CHECK_FUNC() for each of these functions
429dnl
430dnl EFL_CHECK_FUNCS(EFL, FUNCTIONS)
431
432AC_DEFUN([EFL_CHECK_FUNCS],
433[
434m4_foreach_w([fct], [$2], [EFL_CHECK_FUNC($1, m4_defn([fct]))])
435])
diff --git a/legacy/eet/m4/efl_check_libs.m4 b/legacy/eet/m4/efl_check_libs.m4
new file mode 100644
index 0000000000..ea2fc8e793
--- /dev/null
+++ b/legacy/eet/m4/efl_check_libs.m4
@@ -0,0 +1,120 @@
1dnl Copyright (C) 2012 Vincent Torri <vincent dot torri at gmail dot com>
2dnl This code is public domain and can be freely used or copied.
3
4dnl Macro that check dependencies libraries for the EFL:
5
6dnl libjpeg
7dnl zlib
8
9dnl _EFL_CHECK_LIB_LIBJPEG is for internal use
10dnl _EFL_CHECK_LIB_LIBJPEG(EFL, ACTION-IF-FOUND, ACTION-IF-NOT-FOUND)
11
12AC_DEFUN([_EFL_CHECK_LIB_LIBJPEG],
13[
14m4_pushdef([UPEFL], m4_translit([$1], [-a-z], [_A-Z]))dnl
15m4_pushdef([DOWNEFL], m4_translit([$1], [-A-Z], [_a-z]))dnl
16
17AC_CHECK_HEADER([jpeglib.h],
18 [have_dep="yes"],
19 [
20 AC_MSG_ERROR(["Cannot find jpeglib.h. Make sure your CFLAGS environment variable contains include lines for the location of this file"])
21 have_dep="no"
22 ])
23
24if test "x${have_dep}" = "xyes" ; then
25 AC_CHECK_LIB([jpeg], [jpeg_std_error],
26 [
27 have_dep="yes"
28 requirements_libs_[]m4_defn([DOWNEFL])="${requirements_libs_[]m4_defn([DOWNEFL])} -ljpeg"
29 ],
30 [
31 AC_MSG_ERROR("Cannot find libjpeg library. Make sure your LDFLAGS environment variable contains include lines for the location of this file")
32 have_dep="no"
33 ])
34fi
35
36AS_IF([test "x${have_dep}" = "xyes"], [$2], [$3])
37
38m4_popdef([DOWNEFL])
39m4_popdef([UPEFL])
40])
41
42dnl _EFL_CHECK_LIB_ZLIB is for internal use
43dnl _EFL_CHECK_LIB_ZLIB(EFL, ACTION-IF-FOUND, ACTION-IF-NOT-FOUND)
44
45AC_DEFUN([_EFL_CHECK_LIB_ZLIB],
46[
47m4_pushdef([UPEFL], m4_translit([$1], [-a-z], [_A-Z]))dnl
48m4_pushdef([DOWNEFL], m4_translit([$1], [-A-Z], [_a-z]))dnl
49
50PKG_CHECK_EXISTS([zlib],
51 [
52 _efl_have_lib="yes"
53 requirements_pc_[]m4_defn([DOWNEFL])="${requirements_pc_[]m4_defn([DOWNEFL])} zlib"
54 ],
55 [
56 AC_MSG_ERROR(["Cannot find zlib.PC. Make sure your PKG_CONFIG_PATH environment variable contains include lines for the location of this file"])
57 _efl_have_lib="no"
58 ])
59
60if test "x${_efl_have_lib}" = "xno" ; then
61 AC_CHECK_HEADER([zlib.h],
62 [_efl_have_lib="yes"],
63 [
64 AC_MSG_ERROR(["Cannot find zlib.h. Make sure your CFLAGS environment variable contains include lines for the location of this file"])
65 _efl_have_lib="no"
66 ])
67
68 if test "x${_efl_have_lib}" = "xyes" ; then
69 AC_CHECK_LIB([z], [zlibVersion],
70 [
71 _efl_have_lib="yes"
72 requirements_libs_[]m4_defn([DOWNEFL])="${requirements_libs_[]m4_defn([DOWNEFL])} -lz"
73 ],
74 [
75 AC_MSG_ERROR(["Cannot find libjpeg library. Make sure your LDFLAGS environment variable contains include lines for the location of this file"])
76 _efl_have_lib="no"
77 ])
78 fi
79fi
80
81AS_IF([test "x${_efl_have_lib}" = "xyes"], [$2], [$3])
82
83m4_popdef([DOWNEFL])
84m4_popdef([UPEFL])
85])
86
87dnl Macro that checks for a library
88dnl
89dnl EFL_CHECK_LIB(EFL, LIBRARY)
90dnl AC_DEFINE : EFL_HAVE_LIBRARY (LIBRARY being replaced by its value)
91
92AC_DEFUN([EFL_CHECK_LIB],
93[
94m4_pushdef([UP], m4_translit([$2], [-a-z], [_A-Z]))dnl
95m4_pushdef([DOWN], m4_translit([$2], [-A-Z], [_a-z]))dnl
96
97m4_default([_EFL_CHECK_LIB_]m4_defn([UP]))($1, [have_lib="yes"], [have_lib="no"])
98
99AC_MSG_CHECKING([for ]m4_defn([DOWN]))
100AC_MSG_RESULT([${have_lib}])
101
102if test "x${have_lib}" = "xyes" ; then
103 AC_DEFINE([HAVE_]m4_defn([UP]), [1], [Define to 1 if the `]m4_defn([DOWN])[' library is installed.])
104fi
105
106efl_lib_[]m4_defn([DOWN])="${have_lib}"
107
108m4_popdef([DOWN])
109m4_popdef([UP])
110])
111
112dnl Macro that iterates over a sequence of white separated libraries
113dnl and that calls EFL_CHECK_LIB() for each of these libraries
114dnl
115dnl EFL_CHECK_LIBS(EFL, LIBRARIES)
116
117AC_DEFUN([EFL_CHECK_LIBS],
118[
119m4_foreach_w([lib], [$2], [EFL_CHECK_LIB($1, m4_defn([lib]))])
120]) \ No newline at end of file
diff --git a/legacy/eet/m4/efl_fnmatch.m4 b/legacy/eet/m4/efl_fnmatch.m4
deleted file mode 100644
index b5555ee338..0000000000
--- a/legacy/eet/m4/efl_fnmatch.m4
+++ /dev/null
@@ -1,43 +0,0 @@
1dnl Copyright (C) 2010 Vincent Torri <vtorri at univ-evry dot fr>
2dnl That code is public domain and can be freely used or copied.
3
4dnl Macro that check if fnmatch functions are available or not.
5
6dnl Usage: EFL_CHECK_FNMATCH([, ACTION-IF-FOUND [, ACTION-IF-NOT-FOUND]])
7dnl Call AC_SUBST(EFL_FNMATCH_LIBS)
8
9AC_DEFUN([EFL_CHECK_FNMATCH],
10[
11
12AC_CHECK_HEADER([fnmatch.h], [_efl_have_fnmatch="yes"], [_efl_have_fnmatch="no"])
13
14if test "x${_efl_have_fnmatch}" = "xyes" ; then
15 AC_SEARCH_LIBS([fnmatch],
16 [fnmatch evil iberty],
17 [_efl_have_fnmatch="yes"],
18 [_efl_have_fnmatch="no"])
19fi
20
21EFL_FNMATCH_LIBS=""
22
23if (! test "x${ac_cv_search_fnmatch}" = "xnone required") && (! test "x${ac_cv_search_fnmatch}" = "xno") && (! test "x${ac_cv_search_fnmatch}" = "x-levil") ; then
24 EFL_FNMATCH_LIBS=${ac_cv_search_fnmatch}
25fi
26
27if test "x${_efl_have_fnmatch}" != "xyes" -a "x${enable_exotic}" = "xyes"; then
28 LDFLAGS_SAVE="$LDFLAGS"
29 LDFLAGS="$LDFLAGS $EXOTIC_LIBS"
30 AC_CHECK_LIB([exotic], [fnmatch],
31 [_efl_have_fnmatch="yes"],
32 [_efl_have_fnmatch="no"])
33
34 if test "x${_efl_have_fnmatch}" = "xyes"; then
35 EFL_FNMATCH_LIBS="exotic"
36 fi
37fi
38
39AC_SUBST(EFL_FNMATCH_LIBS)
40
41AS_IF([test "x$_efl_have_fnmatch" = "xyes"], [$1], [$2])
42
43])