- #
- # Assembly sources
- #
- if env['gcc'] and env['platform'] != 'windows':
- if env['machine'] == 'x86':
- env.Append(CPPDEFINES = [
- 'USE_X86_ASM',
- ])
- glapi_sources += [
- 'glapi_x86.S',
- ]
- elif env['machine'] == 'x86_64':
- env.Append(CPPDEFINES = [
- 'USE_X86_64_ASM',
- ])
- glapi_sources += [
- 'glapi_x86-64.S'
- ]
- elif env['machine'] == 'sparc':
- env.Append(CPPDEFINES = [
- 'USE_SPARC_ASM',
- ])
- glapi_sources += [
- 'glapi_sparc.S'
- ]
- else:
- pass
-
- if env['toolchain'] == 'crossmingw':
- # compile these files without -gstabs option
- glapi_sources = env.compile_without_gstabs(glapi_sources, "glapi_dispatch.c")
- glapi_sources = env.compile_without_gstabs(glapi_sources, "glapi_getproc.c")
+#
+# Assembly sources
+#
+if env['platform'] not in ('cygwin', 'darwin', 'windows'):
+ GLAPI = '#src/mapi/glapi/'
+ sources = [GLAPI + 'gen/gl_and_es_API.xml'] + env.Glob(GLAPI + 'gen/*.xml')
+
+ 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