--- gsoap-2.8/configure.ac
+++ gsoap-2.8/configure.ac
@@ -196,15 +196,15 @@
 AC_ARG_ENABLE(xlocale,
               [AC_HELP_STRING([--enable-xlocale],
                               [compile library with forced inclusion of xlocale.h])],
-              [with_xlocale="$enable_xl"],
+              [with_xlocale="$enableval"],
               [with_xlocale="no"])
 
 AC_MSG_CHECKING(for enable xlocale usage in library)
 if test "x$with_xlocale" = "xyes"; then
   AC_MSG_RESULT(yes)
+  SOAPCPP2_INCLUDE_XLOCALE="-DWITH_INCLUDE_XLOCALE_H"
 else
   AC_MSG_RESULT(no)
-  SOAPCPP2_INCLUDE_XLOCALE="-DWITH_INCLUDE_XLOCALE_H"
 fi
 AC_SUBST(SOAPCPP2_INCLUDE_XLOCALE)
 
