parameters: (conf)
docstring: Check for jni headers and libraries. On success the conf.env variables xxx_JAVA are added for use in C/C++ targets::
  
  		def options(opt):
  			opt.load('compiler_c')
  
  		def configure(conf):
  			conf.load('compiler_c java')
  			conf.check_jni_headers()
  
  		def build(bld):
  			bld.shlib(source='a.c', target='app', use='JAVA')
docstring_summary: Check for jni headers and libraries. On success the conf.env variables xxx_JAVA are added for use in C/C++ targets::
docstring_tokens: Check for jni headers and libraries . On success the conf . env variables xxx_JAVA are added for use in C / C ++ targets ::
function: def check_jni_headers(conf):
  	"""
  	Check for jni headers and libraries. On success the conf.env variables xxx_JAVA are added for use in C/C++ targets::
  
  		def options(opt):
  			opt.load('compiler_c')
  
  		def configure(conf):
  			conf.load('compiler_c java')
  			conf.check_jni_headers()
  
  		def build(bld):
  			bld.shlib(source='a.c', target='app', use='JAVA')
  	"""
  
  	if not conf.env.CC_NAME and not conf.env.CXX_NAME:
  		conf.fatal('load a compiler first (gcc, g++, ..)')
  
  	if not conf.env.JAVA_HOME:
  		conf.fatal('set JAVA_HOME in the system environment')
  
  	# jni requires the jvm
  	javaHome = conf.env['JAVA_HOME'][0]
  
  	dir = conf.root.find_dir(conf.env.JAVA_HOME[0] + '/include')
  	if dir is None:
  		dir = conf.root.find_dir(conf.env.JAVA_HOME[0] + '/../Headers') # think different?!
  	if dir is None:
  		conf.fatal('JAVA_HOME does not seem to be set properly')
  
  	f = dir.ant_glob('**/(jni|jni_md).h')
  	incDirs = [x.parent.abspath() for x in f]
  
  	dir = conf.root.find_dir(conf.env.JAVA_HOME[0])
  	f = dir.ant_glob('**/*jvm.(so|dll|dylib)')
  	libDirs = [x.parent.abspath() for x in f] or [javaHome]
  
  	# On windows, we need both the .dll and .lib to link.  On my JDK, they are
  	# in different directories...
  	f = dir.ant_glob('**/*jvm.(lib)')
  	if f:
  		libDirs = [[x, y.parent.abspath()] for x in libDirs for y in f]
  
  	for d in libDirs:
  		try:
  			conf.check(header_name='jni.h', define_name='HAVE_JNI_H', lib='jvm',
  				libpath=d, includes=incDirs, uselib_store='JAVA', uselib='JAVA')
  		except Exception:
  			pass
  		else:
  			break
  	else:
  		conf.fatal('could not find lib jvm in %r (see config.log)' % libDirs)
function_tokens: def check_jni_headers ( conf ) : if not conf . env . CC_NAME and not conf . env . CXX_NAME : conf . fatal ( 'load a compiler first (gcc, g++, ..)' ) if not conf . env . JAVA_HOME : conf . fatal ( 'set JAVA_HOME in the system environment' ) # jni requires the jvm javaHome = conf . env [ 'JAVA_HOME' ] [ 0 ] dir = conf . root . find_dir ( conf . env . JAVA_HOME [ 0 ] + '/include' ) if dir is None : dir = conf . root . find_dir ( conf . env . JAVA_HOME [ 0 ] + '/../Headers' ) # think different?! if dir is None : conf . fatal ( 'JAVA_HOME does not seem to be set properly' ) f = dir . ant_glob ( '**/(jni|jni_md).h' ) incDirs = [ x . parent . abspath ( ) for x in f ] dir = conf . root . find_dir ( conf . env . JAVA_HOME [ 0 ] ) f = dir . ant_glob ( '**/*jvm.(so|dll|dylib)' ) libDirs = [ x . parent . abspath ( ) for x in f ] or [ javaHome ] # On windows, we need both the .dll and .lib to link.  On my JDK, they are # in different directories... f = dir . ant_glob ( '**/*jvm.(lib)' ) if f : libDirs = [ [ x , y . parent . abspath ( ) ] for x in libDirs for y in f ] for d in libDirs : try : conf . check ( header_name = 'jni.h' , define_name = 'HAVE_JNI_H' , lib = 'jvm' , libpath = d , includes = incDirs , uselib_store = 'JAVA' , uselib = 'JAVA' ) except Exception : pass else : break else : conf . fatal ( 'could not find lib jvm in %r (see config.log)' % libDirs )