SCP: Add PCRE version to SHOW VERSION output

This commit is contained in:
Mark Pizzolato 2018-04-08 17:13:54 -07:00
parent 1d22b488a9
commit 114a29bc2f
3 changed files with 6 additions and 5 deletions

View file

@ -453,11 +453,11 @@ ifeq ($(WIN32),) #*nix Environments (&& cygwin)
endif
endif
# Find available RegEx library. Prefer libpcreposix.
ifneq (,$(call find_include,pcreposix))
ifneq (,$(call find_lib,pcreposix))
ifneq (,$(and $(call find_include,pcreposix),$(call find_include,pcre)))
ifneq (,$(and $(call find_lib,pcreposix),$(call find_lib,pcre)))
OS_CCDEFS += -DHAVE_PCREPOSIX_H
OS_LDFLAGS += -lpcreposix
$(info using libpcreposix: $(call find_lib,pcreposix) $(call find_include,pcreposix))
OS_LDFLAGS += -lpcreposix -lpcre
$(info using libpcreposix: $(call find_lib,pcreposix) $(call find_lib,pcre) $(call find_include,pcreposix) $(call find_include,pcre))
ifeq ($(LD_SEARCH_NEEDED),$(call need_search,pcreposix))
OS_LDFLAGS += -L$(dir $(call find_lib,pcreposix))
endif

2
scp.c
View file

@ -5206,7 +5206,7 @@ if (flag) {
fprintf (st, "\n %s", sim_toffset_64 ? "Large File (>2GB) support" : "No Large File support");
fprintf (st, "\n SDL Video support: %s", vid_version());
#if defined (HAVE_PCREPOSIX_H)
fprintf (st, "\n PCRE RegEx support for EXPECT commands");
fprintf (st, "\n PCRE RegEx (Version %s) support for EXPECT commands", pcre_version());
#elif defined (HAVE_REGEX_H)
fprintf (st, "\n RegEx support for EXPECT commands");
#else

View file

@ -140,6 +140,7 @@ extern int sim_vax_snprintf(char *buf, size_t buf_size, const char *fmt, ...);
#endif
#if defined(HAVE_PCREPOSIX_H)
#include <pcreposix.h>
#include <pcre.h>
#define USE_REGEX 1
#elif defined(HAVE_REGEX_H)
#include <regex.h>