correctly detect fnmathc in libevil
authorcaro <caro@7cbeb6ba-43b4-40fd-8cce-4c39aea84d33>
Wed, 29 Oct 2008 08:34:52 +0000 (08:34 +0000)
committercaro <caro@7cbeb6ba-43b4-40fd-8cce-4c39aea84d33>
Wed, 29 Oct 2008 08:34:52 +0000 (08:34 +0000)
git-svn-id: svn+ssh://svn.enlightenment.org/var/svn/e/trunk/evas@37296 7cbeb6ba-43b4-40fd-8cce-4c39aea84d33

configure.ac

index 5b0fe3d..bf883e8 100644 (file)
@@ -161,24 +161,21 @@ dnl nothing on mingw platform
 esac
 AC_SUBST(dlopen_libs)
 
-AC_CHECK_HEADER(fnmatch.h, , 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]))
+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])])
 
-fnmatch_libs=""
-AC_CHECK_FUNCS(fnmatch, res=yes, res=no)
+AC_CHECK_FUNCS([fnmatch], [res="yes"], [res="no"])
 if test "x$res" = "xno"; then
-  AC_CHECK_LIB(fnmatch, fnmatch, res=yes fnmatch_libs="-lfnmatch", res=no)
-  dnl Test for compilation with MinGW.
-  dnl fnmatch function is in the libiberty library
-  if test "x$res" = "xno"; then
-    AC_CHECK_LIB(iberty, fnmatch, res=yes fnmatch_libs="-liberty", res=no)
-  fi
-  if test "x$res" = "xno"; then
-    AC_MSG_ERROR([Cannot find fnmatch() in neither libc nor libfnmatch, nor libiberty])
-  fi
+   AC_SEARCH_LIBS([fnmatch],
+      [fnmatch iberty evil],
+      [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
 
-AC_SUBST(fnmatch_libs)
-
 #####################################################################
 ## Engines