# CheckRules # # Common checks. rule CheckGccPlatform { # CheckGccPlatform ; # Detects if we are using gcc4 and set IS_GCC4_PLATFORM according. # First find out which gcc version the platform uses. IS_GCC4_PLATFORM = ; if $(OS) = HAIKU { # Only Haiku might use gcc 4. We use the existence of a libstdc++.r4.so in # /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/system/develop/tools/lib : libstdc++.r4.so ] ; if ! $(haveLibStdC++.R4) { IS_GCC4_PLATFORM = 1 ; Echo Using GCC4 platform ; } } } rule CheckOpenSSL { # CheckOpenSSL ; # Check for OpenSSL and defined HAVE_OPENSSL according, it also defines # OPENSSL_INCLUDE_DIR and OPENSSL_LIBRARY_DIR with location of respectively # include and library files. HAVE_OPENSSL = ; OPENSSL_INCLUDE_DIR = ; OPENSSL_LIBRARY_DIR = ; local haveHeaders = [ Glob $(USER_INCLUDE_DIRECTORY)/openssl : ssl.h ] ; if $(haveHeaders) { OPENSSL_INCLUDE_DIR = $(USER_INCLUDE_DIRECTORY) ; local haveLibs = [ Glob $(USER_LIB_DIRECTORY) : libssl.so ] ; if $(haveLibs) { OPENSSL_LIBRARY_DIR = $(USER_LIB_DIRECTORY) ; Echo OpenSSL Headers: $(OPENSSL_INCLUDE_DIR) ; Echo OpenSSL Libs: $(OPENSSL_LIBRARY_DIR) ; } HAVE_OPENSSL = $(haveLibs) ; } } rule CheckExpat { HAVE_EXPAT = ; EXPAT_INCLUDE_DIR = ; EXPAT_LIBRARY_DIR = ; local haveHeaders = [ Glob $(USER_INCLUDE_DIRECTORY)/ : expat.h ] ; if $(haveHeaders) { EXPAT_INCLUDE_DIR = $(USER_INCLUDE_DIRECTORY)/ ; local haveLibs = [ Glob $(USER_LIB_DIRECTORY) : libexpat.so ] ; if $(haveLibs) { EXPAT_LIBRARY_DIR = $(USER_LIB_DIRECTORY) ; Echo Expat Headers: $(EXPAT_INCLUDE_DIR) ; Echo Expat Libs: $(EXPAT_LIBRARY_DIR) ; } HAVE_EXPAT = $(haveLibs) ; } }