- env.Append(CPPPATH = [
- '#/src/mapi',
- '#/src/mesa',
- ])
-
- glapi_sources = [
- 'glapi_dispatch.c',
- 'glapi_entrypoint.c',
- 'glapi_getproc.c',
- 'glapi_nop.c',
- 'glthread.c',
- ]
-
- mapi_sources = [
- 'u_current.c',
- 'u_execmem.c',
- 'u_thread.c',
- ]
- for s in mapi_sources:
- o = env.Object(s[:-2], '../mapi/' + s)
- glapi_sources.append(o)
+ if env['machine'] == 'x86':
+ env.Append(CPPDEFINES = [
+ 'USE_X86_ASM',
+ ])
+ glapi_sources += [
+ 'glapi_x86.S',
+ ]
+ env.CodeGenerate(
+ target = 'glapi_x86.S',
+ script = GLAPI + 'gen/gl_x86_asm.py',
+ source = sources,
+ command = python_cmd + ' $SCRIPT -f $SOURCE > $TARGET'
+ )
+ elif env['machine'] == 'x86_64':
+ env.Append(CPPDEFINES = [
+ 'USE_X86_64_ASM',
+ ])
+ glapi_sources += [
+ 'glapi_x86-64.S'
+ ]
+ env.CodeGenerate(
+ target = 'glapi_x86-64.S',
+ script = GLAPI + 'gen/gl_x86-64_asm.py',
+ source = sources,
+ command = python_cmd + ' $SCRIPT -f $SOURCE > $TARGET'
+ )
+ elif env['machine'] == 'sparc':
+ env.Append(CPPDEFINES = [
+ 'USE_SPARC_ASM',
+ ])
+ glapi_sources += [
+ 'glapi_sparc.S'
+ ]
+ env.CodeGenerate(
+ target = 'glapi_sparc.S',
+ script = GLAPI + 'gen/gl_SPARC_asm.py',
+ source = sources,
+ command = python_cmd + ' $SCRIPT -f $SOURCE > $TARGET'
+ )
+ else:
+ pass