From e3fab9c91f8ee9f702c65a8a30da98519457133f Mon Sep 17 00:00:00 2001
From: Adrien Destugues <pulkomandy@pulkomandy.tk>
Date: Sun, 6 Oct 2013 21:59:49 +0200
Subject: Merge previous patches for Caya and Caya protocols

 * The repos have been merged
 * The protocols can now use Caya files directly instead of liooking in
the system

diff --git a/Jamrules b/Jamrules
index bee60b3..d40d6f5 100644
--- a/Jamrules
+++ b/Jamrules
@@ -51,12 +51,6 @@ CheckGccPlatform ;
 #	Echo "** Caya needs Curl" ;
 #}
 
-CheckCaya ;
-if ! $(HAVE_CAYA) {
-	Echo "** Caya library is needed!" ;
-	Exit 1 ;
-}
-
 CheckOpenSSL ;
 if ! $(HAVE_OPENSSL) {
 	Echo "** MSN, Jabber, GoogleTalk and Facebook protocols are disabled for lack of OpenSSL" ;
diff --git a/build/jam/CheckRules b/build/jam/CheckRules
index a444159..173b67b 100644
--- a/build/jam/CheckRules
+++ b/build/jam/CheckRules
@@ -14,7 +14,7 @@ rule CheckGccPlatform
 		# /boot/develop/lib/x86 to judge whether this is a BeOS compatible and thus
 		# gcc 2 platform. This is not entirely correct, but should be good enough
 		# for the time being.
-		local haveLibStdC++.R4 = [ Glob /boot/develop/lib/x86 : libstdc++.r4.so ] ;
+		local haveLibStdC++.R4 = [ Glob /boot/system/develop/tools/lib : libstdc++.r4.so ] ;
 		if ! $(haveLibStdC++.R4) {
 			IS_GCC4_PLATFORM = 1 ;
 			Echo Using GCC4 platform ;
@@ -102,32 +102,3 @@ rule CheckLibYahoo2
 		HAVE_LIBYAHOO2 = $(haveLibs) ;
 	}
 }
-
-rule CheckCaya
-{
-	# CheckCaya
-	# Check for Caya and defined HAVE_CAYA according, it also defines
-	# CAYA_INCLUDE_DIR and CAYA_LIBRARY_DIR with location of respectively
-	# include and library files.
-
-	HAVE_CAYA = ;
-	CAYA_INCLUDE_DIR = ;
-	CAYA_LIBRARY_DIR = ;
-
-	local haveHeaders = [ Glob $(COMMON_INCLUDE_DIRECTORY)/caya : CayaProtocol.h ] ;
-	if $(haveHeaders) {
-		CAYA_INCLUDE_DIR = $(COMMON_INCLUDE_DIRECTORY)/caya ;
-
-#		local haveLibs = [ Glob $(COMMON_LIB_DIRECTORY) : libinfopopper.so ] ;
-#		if $(haveLibs) {
-#			CAYA_LIBRARY_DIR = $(COMMON_LIB_DIRECTORY) ;
-
-			Echo Caya Headers: $(CAYA_INCLUDE_DIR) ;
-#			Echo Caya Libs: $(CAYA_LIBRARY_DIR) ;
-#		}
-
-#		HAVE_CAYA = $(haveLibs) ;
-	}
-
-	HAVE_CAYA = $(haveHeaders) ;
-}
diff --git a/configure b/configure
index 6879cee..ca177ba 100755
--- a/configure
+++ b/configure
@@ -122,22 +122,21 @@ MIMESET = ${mimesetbin} ;
 SETVERSION = ${setversionbin} ;
 COPYATTR = ${copyattrbin} ;
 
-COMMON_DIRECTORY = $(finddir B_COMMON_DIRECTORY) ;
-COMMON_BIN_DIRECTORY = $(finddir B_COMMON_BIN_DIRECTORY) ;
-COMMON_INCLUDE_DIRECTORY = $(finddir B_COMMON_DIRECTORY)/include ;
-COMMON_LIB_DIRECTORY = $(finddir B_COMMON_LIB_DIRECTORY) ;
-COMMON_SERVERS_DIRECTORY = $(finddir B_COMMON_SERVERS_DIRECTORY) ;
-COMMON_ADDONS_DIRECTORY = $(finddir B_COMMON_ADDONS_DIRECTORY) ;
-COMMON_DEVELOP_DIRECTORY = $(finddir B_COMMON_DEVELOP_DIRECTORY) ;
+COMMON_BIN_DIRECTORY = $binDir ;
+COMMON_INCLUDE_DIRECTORY = $(finddir B_SYSTEM_HEADERS_DIRECTORY) ;
+COMMON_LIB_DIRECTORY = $(finddir B_SYSTEM_DEVELOP_DIRECTORY)/lib ;
+COMMON_SERVERS_DIRECTORY = $(finddir B_SYSTEM_SERVERS_DIRECTORY) ;
+COMMON_ADDONS_DIRECTORY = $(finddir B_SYSTEM_ADDONS_DIRECTORY) ;
+COMMON_DEVELOP_DIRECTORY = $(finddir B_SYSTEM_DEVELOP_DIRECTORY) ;
 USER_CONFIG_DIRECTORY = $(finddir B_USER_CONFIG_DIRECTORY) ;
-USER_INCLUDE_DIRECTORY = $(finddir B_USER_CONFIG_DIRECTORY)/include ;
+USER_INCLUDE_DIRECTORY = $includeDir ;
 SYSTEM_DIRECTORY = $(finddir B_SYSTEM_DIRECTORY) ;
-SYSTEM_LIB_DIRECTORY = $(finddir B_SYSTEM_LIB_DIRECTORY) ;
+SYSTEM_LIB_DIRECTORY = $libDir ;
 BEOS_PREFERENCES_DIRECTORY = $(finddir B_BEOS_PREFERENCES_DIRECTORY) ;
 PREFERENCES_DIRECTORY = $(finddir B_PREFERENCES_DIRECTORY) ;
 USER_PREFERENCES_DIRECTORY = $(finddir B_USER_CONFIG_DIRECTORY)/be/Preferences ;
-APPS_DIRECTORY = $(finddir B_APPS_DIRECTORY) ;
-CAYA_DIRECTORY = $(finddir B_APPS_DIRECTORY)/Caya ;
+APPS_DIRECTORY = $appsDir ;
+CAYA_DIRECTORY = $appsDir/Caya ;
 
 DEFINES += ${defines} ;
 EOF
diff --git a/protocols/Jamfile b/protocols/Jamfile
index 48298ae..95482a6 100644
--- a/protocols/Jamfile
+++ b/protocols/Jamfile
@@ -1,5 +1,7 @@
 SubDir TOP protocols ;
 
+CAYA_INCLUDE_DIR = $(TOP) application ;
+
 # Include all the components.
 SubInclude TOP protocols aim ;
 SubInclude TOP protocols xmpp ;
-- 
1.8.3.4

