diff --git a/lustre/autoconf/lustre-core.m4 b/lustre/autoconf/lustre-core.m4
index ad4b617ed2ececbec8ae35738f9e28e0db6dc1d8..1a8116a5cde8736368b8bfe4289f4a1be635c54d 100644
--- a/lustre/autoconf/lustre-core.m4
+++ b/lustre/autoconf/lustre-core.m4
@@ -1399,11 +1399,8 @@ AC_ARG_ENABLE([liblustre-acl],
 	AC_HELP_STRING([--disable-liblustre-acl],
 			[disable ACL support for liblustre]),
 	[],[enable_liblustre_acl=yes])
-if test x$enable_liblustre != xyes ; then
-   enable_liblustre_acl='no'
-fi
 AC_MSG_RESULT([$enable_liblustre_acl])
-if test x$enable_liblustre_acl != xno ; then
+if test x$enable_liblustre_acl = xyes ; then
   AC_DEFINE(LIBLUSTRE_POSIX_ACL, 1, Liblustre Support ACL-enabled MDS)
 fi
 
diff --git a/lustre/utils/Makefile.am b/lustre/utils/Makefile.am
index 192b358fff5c97b333650818d21ebe17642fdee2..068894e7f23825b3023da74127e70b9572e4592b 100644
--- a/lustre/utils/Makefile.am
+++ b/lustre/utils/Makefile.am
@@ -10,7 +10,8 @@ sbin_scripts = lrun
 bin_scripts = llstat llobdstat plot-llstat
 
 if UTILS
-noinst_PROGRAMS = wirecheck obdio obdbarrier
+noinst_PROGRAMS = obdio obdbarrier
+EXTRA_PROGRAMS = wirecheck
 # mount only finds helpers in /sbin
 rootsbin_PROGRAMS = mount.lustre
 sbin_PROGRAMS = mkfs.lustre tunefs.lustre lctl wiretest \
diff --git a/lustre/utils/wirecheck.c b/lustre/utils/wirecheck.c
index 12b104f5a8a5907efe859b023bb3d2237b491dc0..9320c7cd6a4dc013226631079209a26560e1f853 100644
--- a/lustre/utils/wirecheck.c
+++ b/lustre/utils/wirecheck.c
@@ -1047,7 +1047,6 @@ check_lustre_disk_data(void)
         CHECK_MEMBER(lustre_disk_data, ldd_params);
 }
 
-#ifdef LIBLUSTRE_POSIX_ACL
 static void
 check_posix_acl_xattr_entry(void)
 {
@@ -1066,7 +1065,6 @@ check_posix_acl_xattr_header(void)
         CHECK_MEMBER_TYPEDEF(posix_acl_xattr_header, a_version);
         CHECK_MEMBER_TYPEDEF(posix_acl_xattr_header, a_entries);
 }
-#endif
 
 static void
 check_quota_adjust_qunit(void)
@@ -1333,6 +1331,9 @@ main(int argc, char **argv)
         check_mgs_target_info();
         check_lustre_disk_data();
         printf("#ifdef LIBLUSTRE_POSIX_ACL\n");
+#ifndef LIBLUSTRE_POSIX_ACL
+#error build generator without LIBLUSTRE_POSIX_ACL defined - produce wrong check code.
+#endif
         check_posix_acl_xattr_entry();
         check_posix_acl_xattr_header();
         printf("#endif\n");