diff --git a/configure.ac b/configure.ac
index 6719311b496b9837094f9133375093f57965143f..6bdf3a42d4f5a4ba2067402d2bc13787197e2b80 100644
--- a/configure.ac
+++ b/configure.ac
@@ -450,18 +450,21 @@ AS_IF([test "x$enable_ofi_pool_manager" = "xyes"], [
   SAVED_LDFLAGS="$LDFLAGS"
   SAVED_LIBS="$LIBS"
 
-  dnl If libfabric is installed in a nonstandard place but can be found by pkg-config, add whatever that tells us before trying to find it
-  dnl (notable example: Cray Shasta systems)
-  if pkg-config libfabric; then
-     AC_MSG_NOTICE([found libfabric via pkg-config])
-     CPPFLAGS="`pkg-config --cflags      libfabric` $CFLAGS"
-     LDFLAGS=" `pkg-config --libs-only-L libfabric` $LDFLAGS"
-     LIBS="    `pkg-config --libs-only-l libfabric` $LIBS"
-  else
-     AC_MSG_NOTICE([pkg-config does not know about a libfabric installation, fine])
-  fi
 
   AX_USE_LIBRARY([fabric])
+  AS_IF([test "${with_fabric+set}" = set -o "${with_fabric_lib+set}" = set -o "${with_fabric_include+set}" = set -o "${with_fabric_name+set}" = set],
+	[AC_MSG_NOTICE([-with-fabric related argument given, skipping pkg-config search for libfabric])], 
+	[
+	dnl If libfabric is installed in a nonstandard place but can be found by pkg-config, add whatever that tells us before trying to find it
+	dnl (notable example: Cray Shasta systems)
+	if pkg-config libfabric; then
+		AC_MSG_NOTICE([found libfabric via pkg-config])
+		CPPFLAGS="`pkg-config --cflags      libfabric` $CFLAGS"
+		LDFLAGS=" `pkg-config --libs-only-L libfabric` $LDFLAGS"
+		LIBS="    `pkg-config --libs-only-l libfabric` $LIBS"
+	else
+		AC_MSG_NOTICE([pkg-config does not know about a libfabric installation, fine])
+		fi])
 
   dnl Sanity check for libfabric library
   AC_SEARCH_LIBS(fi_getinfo, $fabric_library_name,