]> code.delx.au - pulseaudio/commitdiff
Use PCRE if POSIX regex.h is not available
authorMaarten Bosmans <mkbosmans@gmail.com>
Tue, 4 Jan 2011 15:48:06 +0000 (16:48 +0100)
committerMaarten Bosmans <mkbosmans@gmail.com>
Thu, 17 Feb 2011 10:58:22 +0000 (11:58 +0100)
configure.ac
src/modules/module-match.c
src/pulsecore/core-util.c

index 42d9c3bfa5354ed88bae8f404141989c7187de6a..a2657c080b72facb3c6f912cbb04cbd98060a59a 100644 (file)
@@ -362,10 +362,7 @@ AC_CHECK_HEADERS([netinet/ip.h], [], [],
                   # include <netinet/in_systm.h>
                   #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
index d83c86c3dee946253f6dd2dd8d121e85bb46ff81..f9f36fdbd20cdc95ea5511f0a688b892223569aa 100644 (file)
 #include <string.h>
 #include <errno.h>
 #include <sys/types.h>
-#include <regex.h>
 #include <stdio.h>
 #include <stdlib.h>
 
+#if defined(HAVE_REGEX_H)
+#include <regex.h>
+#elif defined(HAVE_PCREPOSIX_H)
+#include <pcreposix.h>
+#endif
+
 #include <pulse/xmalloc.h>
 
 #include <pulsecore/core-error.h>
index 4c4fbfe04d2aff2e8118ca91318034d24f145ca7..ba9e820df9e7adf71349b9ac4ba0c8025d804f23 100644 (file)
@@ -40,7 +40,6 @@
 #include <sys/stat.h>
 #include <sys/time.h>
 #include <dirent.h>
-#include <regex.h>
 
 #ifdef HAVE_LANGINFO_H
 #include <langinfo.h>
 #include <sys/utsname.h>
 #endif
 
+#if defined(HAVE_REGEX_H)
+#include <regex.h>
+#elif defined(HAVE_PCREPOSIX_H)
+#include <pcreposix.h>
+#endif
+
 #ifdef HAVE_STRTOF_L
 #include <locale.h>
 #endif