Merge pull request #3178 from DragonSA/freebsd

Fix support for FreeBSD.
This commit is contained in:
Akshay Arora 2015-05-15 16:35:06 +05:30
commit 692cebce61
1 changed files with 5 additions and 3 deletions

View File

@ -12,6 +12,7 @@ from os.path import join, dirname, sep, exists, basename, isdir, abspath
from os import walk, environ, makedirs, listdir
from distutils.version import LooseVersion
from collections import OrderedDict
from subprocess import check_output
from time import sleep
if environ.get('KIVY_USE_SETUPTOOLS'):
@ -318,7 +319,7 @@ else:
c_options['use_opengl_es2'] = False
else:
# auto detection of GLES headers
default_header_dirs = ['/usr/include', '/usr/local/include']
default_header_dirs = ['/usr/include', join(environ.get('LOCALBASE', '/usr/local'), 'include')]
c_options['use_opengl_es2'] = False
for hdir in default_header_dirs:
filename = join(hdir, 'GLES2', 'gl2.h')
@ -465,6 +466,9 @@ def determine_base_flags():
flags['include_dirs'] += [sysroot]
flags['extra_compile_args'] += ['-isysroot', sysroot]
flags['extra_link_args'] += ['-isysroot', sysroot]
elif platform.startswith('freebsd'):
flags['include_dirs'] += [join(environ.get('LOCALBASE', '/usr/local'), 'include')]
flags['extra_link_args'] += ['-L', join(environ.get('LOCALBASE', '/usr/local'), 'lib')]
elif platform == 'darwin':
v = os.uname()
if v[2] >= '13.0.0':
@ -498,8 +502,6 @@ def determine_gl_flags():
flags['extra_link_args'] = ['-framework', 'OpenGL', '-arch', osx_arch]
flags['extra_compile_args'] = ['-arch', osx_arch]
elif platform.startswith('freebsd'):
flags['include_dirs'] = ['/usr/local/include']
flags['extra_link_args'] = ['-L', '/usr/local/lib']
flags['libraries'] = ['GL']
elif platform.startswith('openbsd'):
flags['include_dirs'] = ['/usr/X11R6/include']