From 47733d7fa96f91d77a2e9025cc3a6df5252a86d3 Mon Sep 17 00:00:00 2001
From: Abhijeet Rastogi <abhijeet.1989@gmail.com>
Date: Wed, 7 Feb 2024 18:47:42 -0800
Subject: [PATCH] DOC: install: recommend pcre2

Makefile comments are also updated to recommend the PCRE2 related
options.
---
 INSTALL  | 14 +++++++-------
 Makefile |  8 ++++----
 2 files changed, 11 insertions(+), 11 deletions(-)

diff --git a/INSTALL b/INSTALL
index 8ebf8d298..ad0596b87 100644
--- a/INSTALL
+++ b/INSTALL
@@ -34,18 +34,18 @@ are a few build examples :
   - recent Linux system with all options, make and install :
     $ make clean
     $ make -j $(nproc) TARGET=linux-glibc \
-                USE_OPENSSL=1 USE_LUA=1 USE_PCRE=1 USE_SYSTEMD=1
+                USE_OPENSSL=1 USE_LUA=1 USE_PCRE2=1 USE_SYSTEMD=1
     $ sudo make install
 
   - FreeBSD and OpenBSD, build with all options :
-    $ gmake -j 4 TARGET=freebsd USE_OPENSSL=1 USE_LUA=1 USE_PCRE=1
+    $ gmake -j 4 TARGET=freebsd USE_OPENSSL=1 USE_LUA=1 USE_PCRE2=1
 
   - embedded Linux, build using a cross-compiler :
-    $ make -j $(nproc) TARGET=linux-glibc USE_OPENSSL=1 USE_PCRE=1 \
+    $ make -j $(nproc) TARGET=linux-glibc USE_OPENSSL=1 USE_PCRE2=1 \
                 CC=/opt/cross/gcc730-arm/bin/gcc ADDLIB=-latomic
 
   - Build with static PCRE on Solaris / UltraSPARC :
-    $ make TARGET=solaris CPU=ultrasparc USE_STATIC_PCRE=1
+    $ make TARGET=solaris CPU=ultrasparc USE_STATIC_PCRE2=1
 
 For more advanced build options or if a command above reports an error, please
 read the following sections.
@@ -181,9 +181,9 @@ regex engine which could be slow or even crash on certain patterns.
 
 If you plan on importing a particularly heavy configuration involving a lot of
 regex, you may benefit from using some alternative regex implementations such as
-PCRE. HAProxy natively supports PCRE and PCRE2, both in standard and JIT
-flavors (Just In Time). The following options are available depending on the
-library version provided on your system :
+PCRE. HAProxy natively supports PCRE and PCRE2 (recommended), both in standard
+and JIT flavors (Just In Time). The following options are available depending on
+the library version provided on your system :
 
   - "USE_PCRE=1"         : enable PCRE version 1, dynamic linking
   - "USE_STATIC_PCRE=1"  : enable PCRE version 1, static linking
diff --git a/Makefile b/Makefile
index f1b870b0e..207ae57ba 100644
--- a/Makefile
+++ b/Makefile
@@ -17,14 +17,14 @@
 #   USE_KQUEUE              : enable kqueue() on BSD. Automatic.
 #   USE_EVPORTS             : enable event ports on SunOS systems. Automatic.
 #   USE_NETFILTER           : enable netfilter on Linux. Automatic.
-#   USE_PCRE                : enable use of libpcre for regex. Recommended.
+#   USE_PCRE                : enable use of libpcre for regex.
 #   USE_PCRE_JIT            : enable JIT for faster regex on libpcre >= 8.32
-#   USE_PCRE2               : enable use of libpcre2 for regex.
+#   USE_PCRE2               : enable use of libpcre2 for regex. Recommended.
 #   USE_PCRE2_JIT           : enable JIT for faster regex on libpcre2
 #   USE_POLL                : enable poll(). Automatic.
 #   USE_THREAD              : enable threads support.
-#   USE_STATIC_PCRE         : enable static libpcre. Recommended.
-#   USE_STATIC_PCRE2        : enable static libpcre2.
+#   USE_STATIC_PCRE         : enable static libpcre.
+#   USE_STATIC_PCRE2        : enable static libpcre2. Recommended.
 #   USE_TPROXY              : enable transparent proxy. Automatic.
 #   USE_LINUX_TPROXY        : enable full transparent proxy. Automatic.
 #   USE_LINUX_SPLICE        : enable kernel 2.6 splicing. Automatic.
-- 
2.34.1

