Home | History | Annotate | Download | only in glx
      1 Import('*')
      2 
      3 if not env['x11'] or not env['xcb'] or not env['drm']:
      4     Return()
      5 
      6 from sys import executable as python_cmd
      7 
      8 env = env.Clone()
      9 
     10 env.Prepend(CPPPATH = [
     11 	'.',           # the build/<platform>/glx/ directory
     12 	'#include',
     13 	'#include/GL/internal',
     14 	'#src/',
     15 	'#src/loader',
     16 	'#src/mesa',
     17 	'#src/mapi',
     18 	'#src/mapi/glapi',
     19 	#$(LIBDRM_CFLAGS)
     20 	#$(DRI2PROTO_CFLAGS)
     21 	#$(GLPROTO_CFLAGS)
     22 	#$(X11_INCLUDES)
     23 ])
     24 
     25 env.Append(CPPDEFINES = [
     26     '_REENTRANT',
     27     #('DEFAULT_DRIVER_DIR', 'DRI_DRIVER_SEARCH_DIR')
     28 ])
     29 
     30 env.Prepend(LIBS = [
     31     libloader,
     32     mesautil,
     33     glapi
     34 ])
     35 
     36 env.PkgUseModules('X11')
     37 env.PkgUseModules('XCB')
     38 env.PkgUseModules('DRM')
     39 
     40 if env['HAVE_XF86VIDMODE']:
     41     env.Append(CPPDEFINES = ['XF86VIDMODE'])
     42     env.PkgUseModules('XF86VIDMODE')
     43 
     44 sources = [
     45     'clientattrib.c',
     46     'clientinfo.c',
     47     'create_context.c',
     48     'compsize.c',
     49     'eval.c',
     50     'glx_error.c',
     51     'glxconfig.c',
     52     'glxcmds.c',
     53     'glxcurrent.c',
     54     'glxext.c',
     55     'glxextensions.c',
     56     'indirect_glx.c',
     57     'indirect.c',
     58     'indirect_init.c',
     59     'indirect_size.c',
     60     'indirect_window_pos.c',
     61     'indirect_texture_compression.c',
     62     'indirect_transpose_matrix.c',
     63     'indirect_vertex_array.c',
     64     'indirect_vertex_program.c',
     65     'pixel.c',
     66     'pixelstore.c',
     67     'query_renderer.c',
     68     'render2.c',
     69     'renderpix.c',
     70     'single2.c',
     71     'singlepix.c',
     72     'vertarr.c',
     73     'xfont.c',
     74     'glx_pbuffer.c',
     75     'glx_query.c',
     76     'drisw_glx.c',
     77     'dri_common.c',
     78     'dri_glx.c',
     79     'XF86dri.c',
     80     'glxhash.c',
     81     'dri2_glx.c',
     82     'dri2.c',
     83     'dri_common_query_renderer.c',
     84     'dri_common_interop.c',
     85     #'dri3_glx.c',
     86     'applegl_glx.c',
     87 ]
     88 
     89 libgl = env.SharedLibrary(
     90     target ='GL',
     91     source = sources,
     92 )
     93 
     94 
     95 # Generate GLX-specific .c and .h files here.  Other GL API-related
     96 # files are used, but they're generated in mapi/glapi/gen/ since they're
     97 # used by other targets as well.
     98 
     99 GLAPI = '#src/mapi/glapi/'
    100 sources = [GLAPI + 'gen/gl_API.xml'] + env.Glob(GLAPI + 'gen/*.xml')
    101 
    102 env.CodeGenerate(
    103     target = 'indirect.c',
    104     script = GLAPI + 'gen/glX_proto_send.py',
    105     source = sources,
    106     command = python_cmd + ' $SCRIPT -f $SOURCE -m proto > $TARGET'
    107     )
    108 
    109 env.CodeGenerate(
    110     target = 'indirect_size.c',
    111     script = GLAPI + 'gen/glX_proto_size.py',
    112     source = sources,
    113     command = python_cmd + ' $SCRIPT -f $SOURCE -m size_c --only-set > $TARGET'
    114 )
    115 
    116 env.CodeGenerate(
    117     target = 'indirect_init.c',
    118     script = GLAPI + 'gen/glX_proto_send.py',
    119     source = sources,
    120     command = python_cmd + ' $SCRIPT -f $SOURCE -m init_c > $TARGET'
    121 )
    122 
    123 env.CodeGenerate(
    124     target = 'indirect_size.h',
    125     script = GLAPI + 'gen/glX_proto_size.py',
    126     source = sources,
    127     command = python_cmd + ' $SCRIPT -f $SOURCE -m size_h --only-set --header-tag _INDIRECT_SIZE_H > $TARGET'
    128 )
    129 
    130 env.CodeGenerate(
    131     target = 'indirect.h',
    132     script = GLAPI + 'gen/glX_proto_send.py',
    133     source = sources,
    134     command = python_cmd + ' $SCRIPT -m init_h -f $SOURCE > $TARGET',
    135     )
    136 
    137 
    138 libgl = env.InstallSharedLibrary(libgl, version=(1, 2))
    139 
    140 env.Alias('glx', libgl)
    141 env.Alias('libgl', libgl)
    142