diff --git a/auxdir/x_ac_bluegene.m4 b/auxdir/x_ac_bluegene.m4
index d5fae34fe36a70b04327167fb02c7552fa5189dc..c85e61d8d28b665fd686e8a4540f181dff0d668d 100644
--- a/auxdir/x_ac_bluegene.m4
+++ b/auxdir/x_ac_bluegene.m4
@@ -15,6 +15,7 @@
 
 AC_DEFUN([X_AC_BGL],
 [
+	ac_real_bluegene_loaded=no
 	ac_bluegene_loaded=no
 
    	AC_ARG_WITH(db2-dir, AS_HELP_STRING(--with-db2-dir=PATH,Specify path to parent directory of DB2 library), [ trydb2dir=$withval ])
@@ -109,6 +110,7 @@ AC_DEFUN([X_AC_BGL],
      		AC_DEFINE_UNQUOTED(BG_SERIAL, "$bg_serial", [Define the BG_SERIAL value])
  		#define ac_bluegene_loaded so we don't load another bluegene conf
 		ac_bluegene_loaded=yes
+		ac_real_bluegene_loaded=yes
   	fi
 
    	AC_SUBST(BG_INCLUDES)
@@ -193,7 +195,8 @@ AC_DEFUN([X_AC_BGP],
      		AC_DEFINE_UNQUOTED(BG_SERIAL, "$bg_serial", [Define the BG_SERIAL value])
  		#define ac_bluegene_loaded so we don't load another bluegene conf
 		ac_bluegene_loaded=yes
-   	fi
+		ac_real_bluegene_loaded=yes
+	fi
 
    	AC_SUBST(BG_INCLUDES)
 ])
@@ -297,8 +300,9 @@ AC_DEFUN([X_AC_BGQ],
      		# AC_DEFINE_UNQUOTED(BG_SERIAL, "$bg_serial", [Define the BG_SERIAL value])
  		#define ac_bluegene_loaded so we don't load another bluegene conf
 		ac_bluegene_loaded=yes
+		ac_real_bluegene_loaded=yes
 		ac_bgq_loaded=yes
-   	fi
+	fi
 
    	AC_SUBST(BG_INCLUDES)
    	AC_SUBST(BG_LDFLAGS)
diff --git a/configure.ac b/configure.ac
index fed68cfe464df26aa7717c57f7215b973bf1aba7..590ee3f4e59aaeca7d7dd066c5bbf16e26f2d11b 100644
--- a/configure.ac
+++ b/configure.ac
@@ -39,6 +39,11 @@ dnl so handle it later.
 AM_CONDITIONAL(BG_L_P_LOADED, test "x$ac_bluegene_loaded" = "xyes")
 AC_SUBST(BG_L_P_LOADED)
 
+dnl ok now check if We are on a real L or P system, (test if to build srun
+dnl or not.  If we are emulating things we should build it.
+AM_CONDITIONAL(REAL_BG_L_P_LOADED, test "x$ac_real_bluegene_loaded" = "xyes")
+AC_SUBST(REAL_BG_L_P_LOADED)
+
 X_AC_BGQ
 
 dnl We need to know if this is a Q system
diff --git a/src/Makefile.am b/src/Makefile.am
index 021e4d1902504456dfd5aeeea01a541f6c922817..f9c8dcc04b9651224158610792e7a0b8b13f5514 100644
--- a/src/Makefile.am
+++ b/src/Makefile.am
@@ -5,7 +5,7 @@ SUBDIRS = common api db_api database \
 	sshare sprio
 
 if !BUILD_SRUN2APRUN
-if !BG_L_P_LOADED
+if !REAL_BG_L_P_LOADED
 SUBDIRS += srun
 endif
 endif