diff options
author | Rainer Jung <rjung@apache.org> | 2014-07-23 19:53:22 +0000 |
---|---|---|
committer | Rainer Jung <rjung@apache.org> | 2014-07-23 19:53:22 +0000 |
commit | 8e18f1a5e9a75e1cc88abf93cb51bdcdb5717f34 (patch) | |
tree | d38cff1320acf39efd7ca7532a16d7cd73694d28 /server | |
parent | 165f9ffcdd09426da19a57e1d8566452e8731462 (diff) | |
download | httpd-8e18f1a5e9a75e1cc88abf93cb51bdcdb5717f34.tar.gz |
Add compiled and loaded PCRE version numbers
to "httpd -V" output and to mod_info page.
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1612934 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'server')
-rw-r--r-- | server/main.c | 16 | ||||
-rw-r--r-- | server/util_pcre.c | 12 |
2 files changed, 22 insertions, 6 deletions
diff --git a/server/main.c b/server/main.c index fc2d22c8e9..1acf64534e 100644 --- a/server/main.c +++ b/server/main.c @@ -107,13 +107,17 @@ static void show_compile_settings(void) printf("Server's Module Magic Number: %u:%u\n", MODULE_MAGIC_NUMBER_MAJOR, MODULE_MAGIC_NUMBER_MINOR); #if APR_MAJOR_VERSION >= 2 - printf("Server loaded: APR %s\n", apr_version_string()); - printf("Compiled using: APR %s\n", APR_VERSION_STRING); + printf("Server loaded: APR %s, PCRE %s\n", + apr_version_string(), ap_pcre_version_string(AP_REG_PCRE_LOADED)); + printf("Compiled using: APR %s, PCRE %s\n", + APR_VERSION_STRING, ap_pcre_version_string(AP_REG_PCRE_COMPILED)); #else - printf("Server loaded: APR %s, APR-UTIL %s\n", - apr_version_string(), apu_version_string()); - printf("Compiled using: APR %s, APR-UTIL %s\n", - APR_VERSION_STRING, APU_VERSION_STRING); + printf("Server loaded: APR %s, APR-UTIL %s, PCRE %s\n", + apr_version_string(), apu_version_string(), + ap_pcre_version_string(AP_REG_PCRE_LOADED)); + printf("Compiled using: APR %s, APR-UTIL %s, PCRE %s\n", + APR_VERSION_STRING, APU_VERSION_STRING, + ap_pcre_version_string(AP_REG_PCRE_COMPILED)); #endif /* sizeof(foo) is long on some platforms so we might as well * make it long everywhere to keep the printf format diff --git a/server/util_pcre.c b/server/util_pcre.c index 4d2adef25b..22eb33cf66 100644 --- a/server/util_pcre.c +++ b/server/util_pcre.c @@ -67,6 +67,18 @@ static const char *const pstring[] = { "match failed" /* AP_REG_NOMATCH */ }; +AP_DECLARE(const char *) ap_pcre_version_string(int which) +{ + switch (which) { + case AP_REG_PCRE_COMPILED: + return APR_STRINGIFY(PCRE_MAJOR) "." APR_STRINGIFY(PCRE_MINOR) " " APR_STRINGIFY(PCRE_DATE); + case AP_REG_PCRE_LOADED: + return pcre_version(); + default: + return "Unknown"; + } +} + AP_DECLARE(apr_size_t) ap_regerror(int errcode, const ap_regex_t *preg, char *errbuf, apr_size_t errbuf_size) { |