configure: Add checks for fnmatch support.

This commit is contained in:
Alexandre Julliard 2009-06-01 12:51:54 +02:00
parent 1e4b401a98
commit 7d5e565b5a
4 changed files with 18 additions and 0 deletions

4
configure vendored
View File

@ -5778,6 +5778,7 @@ done
for ac_header in \ for ac_header in \
@ -5799,6 +5800,7 @@ for ac_header in \
dlfcn.h \ dlfcn.h \
elf.h \ elf.h \
float.h \ float.h \
fnmatch.h \
fontconfig/fontconfig.h \ fontconfig/fontconfig.h \
getopt.h \ getopt.h \
grp.h \ grp.h \
@ -17986,6 +17988,7 @@ CFLAGS="$CFLAGS $BUILTINFLAG"
for ac_func in \ for ac_func in \
@ -18005,6 +18008,7 @@ for ac_func in \
epoll_create \ epoll_create \
ffs \ ffs \
finite \ finite \
fnmatch \
fork \ fork \
fpclass \ fpclass \
fstatfs \ fstatfs \

View File

@ -275,6 +275,7 @@ AC_CHECK_HEADERS(\
dlfcn.h \ dlfcn.h \
elf.h \ elf.h \
float.h \ float.h \
fnmatch.h \
fontconfig/fontconfig.h \ fontconfig/fontconfig.h \
getopt.h \ getopt.h \
grp.h \ grp.h \
@ -1476,6 +1477,7 @@ AC_CHECK_FUNCS(\
epoll_create \ epoll_create \
ffs \ ffs \
finite \ finite \
fnmatch \
fork \ fork \
fpclass \ fpclass \
fstatfs \ fstatfs \

View File

@ -93,6 +93,12 @@
/* Define to 1 if you have the <float.h> header file. */ /* Define to 1 if you have the <float.h> header file. */
#undef HAVE_FLOAT_H #undef HAVE_FLOAT_H
/* Define to 1 if you have the `fnmatch' function. */
#undef HAVE_FNMATCH
/* Define to 1 if you have the <fnmatch.h> header file. */
#undef HAVE_FNMATCH_H
/* Define to 1 if you have the <fontconfig/fontconfig.h> header file. */ /* Define to 1 if you have the <fontconfig/fontconfig.h> header file. */
#undef HAVE_FONTCONFIG_FONTCONFIG_H #undef HAVE_FONTCONFIG_FONTCONFIG_H

View File

@ -64,7 +64,9 @@
#endif #endif
#include <errno.h> #include <errno.h>
#include <stdarg.h> #include <stdarg.h>
#ifdef HAVE_FNMATCH_H
#include <fnmatch.h> #include <fnmatch.h>
#endif
#define COBJMACROS #define COBJMACROS
@ -1444,6 +1446,7 @@ static BOOL build_native_mime_types(const char *xdg_data_home, struct list **mim
static BOOL match_glob(struct list *native_mime_types, const char *extension, static BOOL match_glob(struct list *native_mime_types, const char *extension,
char **match) char **match)
{ {
#ifdef HAVE_FNMATCH
struct xdg_mime_type *mime_type_entry; struct xdg_mime_type *mime_type_entry;
int matchLength = 0; int matchLength = 0;
@ -1467,6 +1470,9 @@ static BOOL match_glob(struct list *native_mime_types, const char *extension,
if (*match == NULL) if (*match == NULL)
return FALSE; return FALSE;
} }
#else
*match = NULL;
#endif
return TRUE; return TRUE;
} }