summaryrefslogtreecommitdiff
path: root/legacy/eet/m4/efl_fnmatch.m4
blob: b5555ee3384b420942ade9612fc031eec03b33ca (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
dnl Copyright (C) 2010 Vincent Torri <vtorri at univ-evry dot fr>
dnl That code is public domain and can be freely used or copied.

dnl Macro that check if fnmatch functions are available or not.

dnl Usage: EFL_CHECK_FNMATCH([, ACTION-IF-FOUND [, ACTION-IF-NOT-FOUND]])
dnl Call AC_SUBST(EFL_FNMATCH_LIBS)

AC_DEFUN([EFL_CHECK_FNMATCH],
[

AC_CHECK_HEADER([fnmatch.h], [_efl_have_fnmatch="yes"], [_efl_have_fnmatch="no"])

if test "x${_efl_have_fnmatch}" = "xyes" ; then
   AC_SEARCH_LIBS([fnmatch],
      [fnmatch evil iberty],
      [_efl_have_fnmatch="yes"],
      [_efl_have_fnmatch="no"])
fi

EFL_FNMATCH_LIBS=""

if (! test "x${ac_cv_search_fnmatch}" = "xnone required") && (! test "x${ac_cv_search_fnmatch}" = "xno") && (! test "x${ac_cv_search_fnmatch}" = "x-levil") ; then
   EFL_FNMATCH_LIBS=${ac_cv_search_fnmatch}
fi

if test "x${_efl_have_fnmatch}" != "xyes" -a "x${enable_exotic}" = "xyes"; then
   LDFLAGS_SAVE="$LDFLAGS"
   LDFLAGS="$LDFLAGS $EXOTIC_LIBS"
   AC_CHECK_LIB([exotic], [fnmatch],
		[_efl_have_fnmatch="yes"],
		[_efl_have_fnmatch="no"])

   if test "x${_efl_have_fnmatch}" = "xyes"; then
      EFL_FNMATCH_LIBS="exotic"
   fi
fi

AC_SUBST(EFL_FNMATCH_LIBS)

AS_IF([test "x$_efl_have_fnmatch" = "xyes"], [$1], [$2])

])