From: Maarten Bosmans Date: Tue, 4 Jan 2011 15:48:06 +0000 (+0100) Subject: Use PCRE if POSIX regex.h is not available X-Git-Tag: submit/2.0-panda/20130828.192557~772^2~21 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=a951c779c6fe0705f75c1dfbe090deb78485b4e8;p=profile%2Fivi%2Fpulseaudio-panda.git Use PCRE if POSIX regex.h is not available --- diff --git a/configure.ac b/configure.ac index 42d9c3b..a2657c0 100644 --- a/configure.ac +++ b/configure.ac @@ -362,10 +362,7 @@ AC_CHECK_HEADERS([netinet/ip.h], [], [], # include #endif ]) -AC_CHECK_HEADERS([regex.h], [HAVE_REGEX=1], [HAVE_REGEX=0]) AC_CHECK_HEADERS([sys/un.h], [HAVE_AF_UNIX=1], [HAVE_AF_UNIX=0]) - -AM_CONDITIONAL(HAVE_REGEX, test "x$HAVE_REGEX" = "x1") AM_CONDITIONAL(HAVE_AF_UNIX, test "x$HAVE_AF_UNIX" = "x1") # Linux @@ -391,6 +388,7 @@ AC_CHECK_HEADERS_ONCE([sys/syscall.h]) AC_CHECK_HEADERS_ONCE([sys/eventfd.h]) AC_CHECK_HEADERS_ONCE([execinfo.h]) AC_CHECK_HEADERS_ONCE([langinfo.h]) +AC_CHECK_HEADERS_ONCE([regex.h pcreposix.h]) #### Typdefs, structures, etc. #### @@ -459,6 +457,8 @@ fi AC_SUBST(HAVE_BONJOUR) AM_CONDITIONAL([HAVE_BONJOUR], [test "x$HAVE_BONJOUR" = x1]) +AC_SEARCH_LIBS([regexec], [pcreposix]) + #### Check for functions #### # ISO @@ -518,6 +518,9 @@ AS_IF([test "$pulseaudio_cv_PTHREAD_PRIO_INHERIT" = "yes"], [ AC_DEFINE_UNQUOTED(PA_CFLAGS,"$CFLAGS", [The CFLAGS used during compilation]) +AC_CHECK_FUNCS([regexec], [HAVE_REGEX=1], [HAVE_REGEX=0]) +AM_CONDITIONAL(HAVE_REGEX, [test "x$HAVE_REGEX" = "x1"]) + #### Large File-Support (LFS) #### AC_SYS_LARGEFILE diff --git a/src/modules/module-match.c b/src/modules/module-match.c index d83c86c..f9f36fd 100644 --- a/src/modules/module-match.c +++ b/src/modules/module-match.c @@ -27,10 +27,15 @@ #include #include #include -#include #include #include +#if defined(HAVE_REGEX_H) +#include +#elif defined(HAVE_PCREPOSIX_H) +#include +#endif + #include #include diff --git a/src/pulsecore/core-util.c b/src/pulsecore/core-util.c index 4c4fbfe..ba9e820 100644 --- a/src/pulsecore/core-util.c +++ b/src/pulsecore/core-util.c @@ -40,7 +40,6 @@ #include #include #include -#include #ifdef HAVE_LANGINFO_H #include @@ -50,6 +49,12 @@ #include #endif +#if defined(HAVE_REGEX_H) +#include +#elif defined(HAVE_PCREPOSIX_H) +#include +#endif + #ifdef HAVE_STRTOF_L #include #endif