Index: bp-loader.php
===================================================================
--- bp-loader.php
+++ bp-loader.php
@@ -30,6 +30,21 @@
 // Load from source if no build exists
 if ( ! file_exists( $bp_loader ) || defined( 'BP_LOAD_SOURCE' ) ) {
 	$bp_loader = __DIR__ . '/src/bp-loader.php';
+	$mode = 'src';
+} else {
+	$mode = 'build';
+}
+
+// Set load mode
+define( 'BP_LOAD_MODE', $mode );
+
+// Define overrides - only applicable to those running trunk
+if ( ! defined( 'BP_PLUGIN_DIR' ) ) {
+	define( 'BP_PLUGIN_DIR', plugin_dir_path( __FILE__ ) );
+}
+if ( ! defined( 'BP_PLUGIN_URL' ) ) {
+	// Be nice to symlinked directories
+	define( 'BP_PLUGIN_URL', plugins_url( trailingslashit( basename( constant( 'BP_PLUGIN_DIR' ) ) ) ) );
 }
 
 // Include BuddyPress
Index: src/bp-loader.php
===================================================================
--- src/bp-loader.php
+++ src/bp-loader.php
@@ -227,17 +227,15 @@
 
 		// Path and URL
 		if ( ! defined( 'BP_PLUGIN_DIR' ) ) {
-			define( 'BP_PLUGIN_DIR', trailingslashit( plugin_dir_path( __FILE__ ) ) );
+			define( 'BP_PLUGIN_DIR', plugin_dir_path( __FILE__ ) );
 		}
 
 		if ( ! defined( 'BP_PLUGIN_URL' ) ) {
-			$plugin_url = plugin_dir_url( __FILE__ );
-
-			// If we're using https, update the protocol. Workaround for WP13941, WP15928, WP19037.
-			if ( is_ssl() )
-				$plugin_url = str_replace( 'http://', 'https://', $plugin_url );
+			define( 'BP_PLUGIN_URL', plugin_dir_url( __FILE__ ) );
+		}
 
-			define( 'BP_PLUGIN_URL', $plugin_url );
+		if ( ! defined( 'BP_LOAD_MODE' ) ) {
+			define( 'BP_LOAD_MODE', '' );
 		}
 
 		// Define on which blog ID BuddyPress should run
@@ -260,7 +258,7 @@
 					$plugins = get_site_option( 'active_sitewide_plugins');
 
 					// basename
-					$basename = plugin_basename( constant( 'BP_PLUGIN_DIR' ) . 'bp-loader.php' );
+					$basename = basename( constant( 'BP_PLUGIN_DIR' ) ) . '/bp-loader.php';
 
 					// plugin is network-activated; use main site ID instead
 					if ( isset( $plugins[ $basename ] ) ) {
@@ -358,10 +356,10 @@
 		/** Paths******************************************************/
 
 		// BuddyPress root directory
-		$this->file           = __FILE__;
-		$this->basename       = str_replace( array( 'build/', 'src/' ), '', plugin_basename( $this->file ) );
-		$this->plugin_dir     = BP_PLUGIN_DIR;
-		$this->plugin_url     = BP_PLUGIN_URL;
+		$this->file           = constant( 'BP_PLUGIN_DIR' ) . 'bp-loader.php';
+		$this->basename       = basename( constant( 'BP_PLUGIN_DIR' ) ) . '/bp-loader.php';
+		$this->plugin_dir     = trailingslashit( constant( 'BP_PLUGIN_DIR' ) . constant( 'BP_LOAD_MODE' ) );
+		$this->plugin_url     = trailingslashit( constant( 'BP_PLUGIN_URL' ) . constant( 'BP_LOAD_MODE' ) );
 
 		// Languages
 		$this->lang_dir       = $this->plugin_dir . 'bp-languages';
