#NEWLINE# @ conf #NEWLINE# def find_libxml2( ctx , **kwargs ) : #NEWLINE# #INDENT# if ( not ctx . env . HWAF_FOUND_C_COMPILER ) : #NEWLINE# #INDENT# ctx . fatal ( 'load a C compiler first' ) #NEWLINE# pass #NEWLINE# #UNINDENT# if ( not ctx . env . HWAF_FOUND_CXX_COMPILER ) : #NEWLINE# #INDENT# ctx . fatal ( 'load a C++ compiler first' ) #NEWLINE# pass #NEWLINE# #UNINDENT# xml_cfg = 'xml2-config' #NEWLINE# path_list = waflib . Utils . to_list ( kwargs . get ( 'path_list' , [ ] ) ) #NEWLINE# if getattr ( ctx . options , 'with_libxml2' , None ) : #NEWLINE# #INDENT# topdir = ctx . options . with_libxml2 #NEWLINE# topdir = ctx . hwaf_subst_vars ( topdir ) #NEWLINE# path_list . append ( osp . abspath ( osp . join ( topdir , 'bin' ) ) ) #NEWLINE# pass #NEWLINE# #UNINDENT# kwargs [ 'path_list' ] = path_list #NEWLINE# ctx . find_program ( xml_cfg , var = 'LIBXML2-CONFIG' , ** kwargs ) #NEWLINE# ctx . check_with ( ctx . check_cfg , 'xml2' , path = xml_cfg , package = '' , uselib_store = 'libxml2' , args = '--cflags --libs' , ** kwargs ) #NEWLINE# version = ctx . check_cxx ( msg = 'Checking xml2 version' , okmsg = 'ok' , fragment = '        #include "libxml/xmlversion.h"\n        #include <iostream>\n\n        int main(int argc, char* argv[]) {\n          std::cout << LIBXML_DOTTED_VERSION;\n          return 0;\n        }\n        ' , use = 'libxml2' , define_name = 'HWAF_LIBXML2_VERSION' , define_ret = True , execute = True , mandatory = True ) #NEWLINE# ctx . start_msg ( 'libxml2 version' ) #NEWLINE# ctx . end_msg ( version ) #NEWLINE# ctx . env . LIBXML2_VERSION = version #NEWLINE# ctx . env . HWAF_FOUND_LIBXML2 = 1 #NEWLINE# return