configure: detect redundant --with-libpcre & --with-libpcre1
[gitweb.git] / configure.ac
index 7f8415140f309e0522310fac3160b5a01cefc7cd..d1b3b143c4c379df7f13c48bc23625e9b4e47c32 100644 (file)
@@ -280,6 +280,10 @@ AS_HELP_STRING([--with-libpcre],[synonym for --with-libpcre1]),
 AC_ARG_WITH(libpcre1,
 AS_HELP_STRING([--with-libpcre1],[support Perl-compatible regexes via libpcre1 (default is NO)])
 AS_HELP_STRING([],           [ARG can be also prefix for libpcre library and headers]),
+    if test -n "$USE_LIBPCRE1"; then
+        AC_MSG_ERROR([Only supply one of --with-libpcre or its synonym --with-libpcre1!])
+    fi
+
     if test "$withval" = "no"; then
        USE_LIBPCRE1=
     elif test "$withval" = "yes"; then
@@ -549,8 +553,8 @@ if test -n "$USE_LIBPCRE1"; then
 GIT_STASH_FLAGS($LIBPCREDIR)
 
 AC_CHECK_LIB([pcre], [pcre_version],
-[USE_LIBPCRE=YesPlease],
-[USE_LIBPCRE=])
+[USE_LIBPCRE1=YesPlease],
+[USE_LIBPCRE1=])
 
 GIT_UNSTASH_FLAGS($LIBPCREDIR)