use efl_fnmatch m4 macro

SVN revision: 45853
This commit is contained in:
Vincent Torri 2010-02-03 20:57:36 +00:00
parent 519cb98847
commit c3915edab7
3 changed files with 33 additions and 16 deletions

View File

@ -255,11 +255,6 @@ fi
### Checks for header files
AC_HEADER_STDC
# fnmatch.h
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
@ -310,16 +305,7 @@ AC_SUBST(lt_enable_auto_import)
AC_FUNC_ALLOCA
# fnmatch
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
fi
EFL_CHECK_FNMATCH([], [AC_MSG_ERROR([Cannot find fnmatch()])])
# dlopen
dlopen_libs=""

View File

@ -8,5 +8,5 @@ Description: Evas canvas display library
@pkgconfig_requires_private@: @requirement_evas@
Version: @VERSION@
Libs: -L${libdir} -levas
Libs.private: @pthread_libs@
Libs.private: @EFL_FNMATCH_LIBS@ @pthread_libs@
Cflags: -I${includedir}

View File

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