hardlink: use PRCE2 posix header file
Signed-off-by: Karel Zak <kzak@redhat.com>
This commit is contained in:
parent
cd6b8d3926
commit
43989bad9e
11
configure.ac
11
configure.ac
|
@ -1412,11 +1412,13 @@ UL_REQUIRES_HAVE([setpriv], [linux_capability_h], [linux/capability.h header fil
|
|||
UL_REQUIRES_HAVE([setpriv], [cap_ng], [libcap-ng library])
|
||||
AM_CONDITIONAL([BUILD_SETPRIV], [test "x$build_setpriv" = xyes])
|
||||
|
||||
PKG_CHECK_MODULES([PCRE], [libpcre2-8], [have_pcre=yes], [have_pcre=no])
|
||||
AS_IF([test "x$have_pcre" = xyes ], [
|
||||
AC_DEFINE([HAVE_PCRE], [1], [Define if libpcre2 is available])
|
||||
PKG_CHECK_MODULES([PCRE2_POSIX], [libpcre2-posix],
|
||||
[have_pcre2_posix=yes],
|
||||
[have_pcre2_posix=no])
|
||||
AS_IF([test "x$have_pcre2_posix" = xyes ], [
|
||||
AC_DEFINE([HAVE_PCRE2_POSIX], [1], [Define if libpcre2-posix is available])
|
||||
])
|
||||
AM_CONDITIONAL([HAVE_PCRE], [test "x$have_pcre" = xyes])
|
||||
AM_CONDITIONAL([HAVE_PCRE2_POSIX], [test "x$have_pcre2_posix" = xyes])
|
||||
|
||||
AC_ARG_ENABLE([hardlink],
|
||||
AS_HELP_STRING([--disable-hardlink], [do not build hardlink]),
|
||||
|
@ -1425,6 +1427,7 @@ AC_ARG_ENABLE([hardlink],
|
|||
UL_BUILD_INIT([hardlink])
|
||||
AM_CONDITIONAL([BUILD_HARDLINK], [test "x$build_hardlink" = xyes])
|
||||
|
||||
|
||||
AC_ARG_ENABLE([eject],
|
||||
AS_HELP_STRING([--disable-eject], [do not build eject]),
|
||||
[], [UL_DEFAULT_ENABLE([eject], [check])]
|
||||
|
|
|
@ -225,9 +225,9 @@ usrbin_exec_PROGRAMS += hardlink
|
|||
hardlink_SOURCES = misc-utils/hardlink.c
|
||||
hardlink_LDADD = $(LDADD) libcommon.la
|
||||
hardlink_CFLAGS = $(AM_CFLAGS)
|
||||
if HAVE_PCRE
|
||||
hardlink_LDADD += $(PCRE_LIBS)
|
||||
hardlink_CFLAGS += $(PCRE_CFLAGS)
|
||||
if HAVE_PCRE2_POSIX
|
||||
hardlink_LDADD += $(PCRE2_POSIX_LIBS)
|
||||
hardlink_CFLAGS += $(PCRE2_POSIX_CFLAGS)
|
||||
endif
|
||||
dist_man_MANS += misc-utils/hardlink.1
|
||||
endif
|
||||
|
|
|
@ -42,19 +42,13 @@
|
|||
#include "nls.h"
|
||||
#include "c.h"
|
||||
|
||||
|
||||
/* Use libpcreposix if it's available, it's cooler */
|
||||
#if defined(HAVE_libpcre2_posix)
|
||||
#warning hie
|
||||
#include <pcre2posix.h>
|
||||
#undef REG_NOSUB
|
||||
#define REG_NOSUB 0 /* we do want backreferences in PCRE mode */
|
||||
#elif defined(HAVE_libpcreposix)
|
||||
#include <pcreposix.h>
|
||||
#undef REG_NOSUB
|
||||
#define REG_NOSUB 0 /* we do want backreferences in PCRE mode */
|
||||
/* Use libpcre2posix if it's available */
|
||||
#ifdef HAVE_PCRE2_POSIX
|
||||
# include <pcre2posix.h>
|
||||
# undef REG_NOSUB
|
||||
# define REG_NOSUB 0 /* we do want backreferences in PCRE mode */
|
||||
#else
|
||||
#include <regex.h> /* regcomp(), regsearch() */
|
||||
# include <regex.h> /* regcomp(), regsearch() */
|
||||
#endif
|
||||
|
||||
#ifdef HAVE_XATTR
|
||||
|
|
Loading…
Reference in New Issue