use efl_fnmatch macro

SVN revision: 45847
This commit is contained in:
Vincent Torri 2010-02-03 20:13:56 +00:00
parent 58e14477d7
commit 88d43e8435
2 changed files with 23 additions and 17 deletions

View File

@ -260,10 +260,6 @@ AC_HEADER_ASSERT
AC_HEADER_DIRENT
AC_HEADER_TIME
AC_CHECK_HEADER([fnmatch.h],
[dummy="yes"],
[AC_MSG_ERROR([Cannot find fnmatch.h. Make sure your CFLAGS environment variable contains include lines for the location of this file. MinGW users: see the INSTALL file])])
### Checks for types
@ -365,19 +361,7 @@ case "$host_os" in
esac
AC_SUBST(dlopen_libs)
fnmatch_libs=""
AC_CHECK_FUNCS([fnmatch], [res="yes"], [res="no"])
if test "x$res" = "xno"; then
AC_SEARCH_LIBS([fnmatch],
[fnmatch evil iberty],
[res="yes"],
[res="no"])
if test "x$res" = "xno"; then
AC_MSG_ERROR([Cannot find fnmatch() in neither libc nor libfnmatch, nor libiberty, nor libevil])
fi
fnmatch_libs="${ac_cv_search_fnmatch}"
fi
AC_SUBST(fnmatch_libs)
EFL_CHECK_FNMATCH([], [AC_MSG_ERROR([Cannot find fnmatch()])])
# iconv library
iconv_libs=""

View File

@ -0,0 +1,22 @@
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]])
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
AS_IF([test "x$_efl_have_fnmatch" = "xyes"], [$1], [$2])
])