--- pcre2-config.in
+++ pcre2-config.in
@@ -3,6 +3,8 @@
 prefix=@prefix@
 exec_prefix=@exec_prefix@
 exec_prefix_set=no
+includedir=@includedir@
+libdir=@libdir@
 
 cflags="[--cflags]"
 libs=
@@ -30,16 +32,16 @@
 libR=
 case `uname -s` in
   *SunOS*)
-  libR=" -R@libdir@"
+  libR=" -R${libdir}"
   ;;
   *BSD*)
-  libR=" -Wl,-R@libdir@"
+  libR=" -Wl,-R${libdir}"
   ;;
 esac
 
 libS=
-if test @libdir@ != /usr/lib ; then
-  libS=-L@libdir@
+if test ${libdir} != /usr/lib ; then
+  libS=-L${libdir}
 fi
 
 while test $# -gt 0; do
@@ -69,15 +71,15 @@
       echo @PACKAGE_VERSION@
       ;;
     --cflags)
-      if test @includedir@ != /usr/include ; then
-        includes=-I@includedir@
+      if test ${includedir} != /usr/include ; then
+        includes=-I${includedir}
       fi
       echo $includes @PCRE2_STATIC_CFLAG@
       ;;
     --cflags-posix)
       if test @enable_pcre2_8@ = yes ; then
-        if test @includedir@ != /usr/include ; then
-          includes=-I@includedir@
+        if test ${includedir} != /usr/include ; then
+          includes=-I${includedir}
         fi
         echo $includes @PCRE2_STATIC_CFLAG@
       else
