From 007d2bda0a1e35d52806d3f387545f35ac658c19 Mon Sep 17 00:00:00 2001 From: barrett17 Date: Sat, 12 Oct 2013 17:59:00 +0000 Subject: [PATCH] Initial rework of the build system to support the latest Haiku changes. Patch from Adrien Destgues included, Thanks! --- Jamrules | 20 ++++----- application/Jamfile | 2 + build/jam/CheckRules | 95 +++++++---------------------------------- configure | 24 ++++++----- libs/libgloox/Jamfile | 7 ++- libs/librunview/Jamfile | 6 ++- libs/libyahoo2/Jamfile | 4 +- protocols/Jamfile | 2 + 8 files changed, 54 insertions(+), 106 deletions(-) diff --git a/Jamrules b/Jamrules index bee60b3..907bd11 100644 --- a/Jamrules +++ b/Jamrules @@ -46,20 +46,16 @@ LOCATE on $(HCACHEFILE) $(JCACHEFILE) = $(GENERATED_DIR) ; include [ FDirName $(JAM_DIR) CheckRules ] ; CheckGccPlatform ; -#CheckCurl ; -#if ! $(HAVE_CURL) { -# 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" ; + Echo "Warning OpenSSL is missing!" ; + exit 0 ; +} + +CheckExpat ; +if ! $(HAVE_EXPAT) { + Echo "Warning Expat is missing!" ; + exit 1 ; } # Include jam scripts diff --git a/application/Jamfile b/application/Jamfile index 6c1365b..c81bb84 100644 --- a/application/Jamfile +++ b/application/Jamfile @@ -68,6 +68,8 @@ Depends Caya : libinterface.a ; Depends Caya : librunview.a ; Depends Caya : libsupport.a ; +LINKFLAGS on Caya += -L$(EXPAT_LIBRARY_DIR) ; + InstallBin $(CAYA_DIRECTORY) : Caya ; InstallFile $(COMMON_INCLUDE_DIRECTORY)/caya : CayaConstants.h ; diff --git a/build/jam/CheckRules b/build/jam/CheckRules index a444159..bc3acea 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 ; @@ -33,101 +33,38 @@ rule CheckOpenSSL OPENSSL_INCLUDE_DIR = ; OPENSSL_LIBRARY_DIR = ; - local haveHeaders = [ Glob $(COMMON_INCLUDE_DIRECTORY)/openssl : ssl.h ] ; + local haveHeaders = [ Glob $(USER_INCLUDE_DIRECTORY)/openssl : ssl.h ] ; if $(haveHeaders) { - OPENSSL_INCLUDE_DIR = $(COMMON_INCLUDE_DIRECTORY)/openssl ; + OPENSSL_INCLUDE_DIR = $(USER_INCLUDE_DIRECTORY) ; - local haveLibs = [ Glob $(COMMON_LIB_DIRECTORY) : libssl.so ] ; + local haveLibs = [ Glob $(USER_LIB_DIRECTORY) : libssl.so ] ; if $(haveLibs) { - OPENSSL_LIBRARY_DIR = $(COMMON_LIB_DIRECTORY) ; + OPENSSL_LIBRARY_DIR = $(USER_LIB_DIRECTORY) ; Echo OpenSSL Headers: $(OPENSSL_INCLUDE_DIR) ; Echo OpenSSL Libs: $(OPENSSL_LIBRARY_DIR) ; } - HAVE_OPENSSL = $(haveLibs) ; } } -rule CheckCurl +rule CheckExpat { - # CheckCurl ; - # Check for Curl and defined HAVE_CURL according, it also defines - # CURL_INCLUDE_DIR and CURL_LIBRARY_DIR with location of respectively - # include and library files. + HAVE_EXPAT = ; + EXPAT_INCLUDE_DIR = ; + EXPAT_LIBRARY_DIR = ; - HAVE_CURL = ; - CURL_INCLUDE_DIR = ; - CURL_LIBRARY_DIR = ; - - local haveHeaders = [ Glob $(COMMON_INCLUDE_DIRECTORY)/curl : curl.h ] ; + local haveHeaders = [ Glob $(USER_INCLUDE_DIRECTORY)/ : expat.h ] ; if $(haveHeaders) { - CURL_INCLUDE_DIR = $(COMMON_INCLUDE_DIRECTORY)/curl ; + EXPAT_INCLUDE_DIR = $(USER_INCLUDE_DIRECTORY)/ ; - local haveLibs = [ Glob $(COMMON_LIB_DIRECTORY) : libcurl.so ] ; + local haveLibs = [ Glob $(USER_LIB_DIRECTORY) : libexpat.so ] ; if $(haveLibs) { - CURL_LIBRARY_DIR = $(COMMON_LIB_DIRECTORY) ; + EXPAT_LIBRARY_DIR = $(USER_LIB_DIRECTORY) ; - Echo Curl Headers: $(CURL_INCLUDE_DIR) ; - Echo Curl Libs: $(CURL_LIBRARY_DIR) ; + Echo Expat Headers: $(EXPAT_INCLUDE_DIR) ; + Echo Expat Libs: $(EXPAT_LIBRARY_DIR) ; } - - HAVE_CURL = $(haveLibs) ; + HAVE_EXPAT = $(haveLibs) ; } } - -rule CheckLibYahoo2 -{ - # CheckLibYahoo2 - # Check for LibYahoo2 and defined HAVE_LIBYAHOO2 according, it also defines - # LIBYAHOO2_INCLUDE_DIR and LIBYAHOO2_LIBRARY_DIR with location of respectively - # include and library files. - - HAVE_LIBYAHOO2 = ; - LIBYAHOO2_INCLUDE_DIR = ; - LIBYAHOO2_LIBRARY_DIR = ; - - local haveHeaders = [ Glob $(COMMON_INCLUDE_DIRECTORY)/libyahoo2 : yahoo2.h ] ; - if $(haveHeaders) { - LIBYAHOO2_INCLUDE_DIR = $(COMMON_INCLUDE_DIRECTORY)/libyahoo2 ; - - local haveLibs = [ Glob $(COMMON_LIB_DIRECTORY) : libyahoo2.so ] ; - if $(haveLibs) { - LIBYAHOO2_LIBRARY_DIR = $(COMMON_LIB_DIRECTORY) ; - - Echo Yahoo Headers: $(LIBYAHOO2_INCLUDE_DIR) ; - Echo Yahoo Libs: $(LIBYAHOO2_LIBRARY_DIR) ; - } - - 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..dd8aa72 100755 --- a/configure +++ b/configure @@ -121,23 +121,27 @@ SETTYPE = ${settypebin} ; MIMESET = ${mimesetbin} ; SETVERSION = ${setversionbin} ; COPYATTR = ${copyattrbin} ; + +COMMON_BIN_DIRECTORY = $(finddir B_SYSTEM_BIN_DIRECTORY) ; +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) ; -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) ; USER_CONFIG_DIRECTORY = $(finddir B_USER_CONFIG_DIRECTORY) ; -USER_INCLUDE_DIRECTORY = $(finddir B_USER_CONFIG_DIRECTORY)/include ; +USER_INCLUDE_DIRECTORY = $(finddir B_USER_HEADERS_DIRECTORY) ; +USER_LIB_DIRECTORY = $(finddir B_USER_DEVELOP_DIRECTORY)/lib ; + SYSTEM_DIRECTORY = $(finddir B_SYSTEM_DIRECTORY) ; SYSTEM_LIB_DIRECTORY = $(finddir B_SYSTEM_LIB_DIRECTORY) ; + 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 = $(finddir B_USER_APPS_DIRECTORY) ; +CAYA_DIRECTORY = $(finddir B_USER_APPS_DIRECTORY)/Caya ; DEFINES += ${defines} ; EOF diff --git a/libs/libgloox/Jamfile b/libs/libgloox/Jamfile index 2e99205..18340e9 100644 --- a/libs/libgloox/Jamfile +++ b/libs/libgloox/Jamfile @@ -6,7 +6,7 @@ SubDirSysHdrs [ FDirName $(OPENSSL_INCLUDE_DIR) ] ; SEARCH_SOURCE += [ FDirName $(TOP) libs ] ; -StaticLibrary libgloox.a : +local sources = adhoc.cpp amp.cpp annotations.cpp @@ -104,3 +104,8 @@ StaticLibrary libgloox.a : vcardupdate.cpp xhtmlim.cpp ; + + +StaticLibrary libgloox.a : $(sources) ; + +Depends libssl.so ; diff --git a/libs/librunview/Jamfile b/libs/librunview/Jamfile index 8328ecb..99a8848 100644 --- a/libs/librunview/Jamfile +++ b/libs/librunview/Jamfile @@ -3,6 +3,8 @@ SubDir TOP libs librunview ; SubDirSysHdrs [ FDirName $(TOP) ] ; SubDirSysHdrs [ FDirName $(TOP) libs ] ; +SubDirSysHdrs [ FDirName $(EXPAT_INCLUDE_DIR) ] ; + SEARCH_SOURCE += [ FDirName $(TOP) libs ] ; local sources = @@ -15,7 +17,7 @@ local sources = Emoconfig.cpp ; - StaticLibrary librunview.a : $(sources) ; -Depends libjabber.a ; +LINKFLAGS on librunview.a += -L$(EXPAT_LIBRARY_DIR) ; + diff --git a/libs/libyahoo2/Jamfile b/libs/libyahoo2/Jamfile index 5bce65f..4b8e4c6 100644 --- a/libs/libyahoo2/Jamfile +++ b/libs/libyahoo2/Jamfile @@ -4,9 +4,9 @@ SubDirSysHdrs [ FDirName $(TOP) ] ; SubDirSysHdrs [ FDirName $(TOP) libs ] ; SubDirSysHdrs [ FDirName $(TOP) libs libyahoo2 ] ; -#SubDirSysHdrs [ FDirName $(OPENSSL_INCLUDE_DIR) ] ; +SubDirSysHdrs [ FDirName $(OPENSSL_INCLUDE_DIR) ] ; -#SEARCH_SOURCE += [ FDirName $(TOP) libs ] ; +SEARCH_SOURCE += [ FDirName $(TOP) libs ] ; local sources = # libyahoo 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 ;