project = 'cpuinfo'

#Sources
sources = Split("""cpuinfo.c""")

#Import Flags
Import('env arch flags_unittest libutf')

if arch:
    if arch == 'X86':
	sources += Split("""x86/cpuinfo.c x86/cpuid.c""")
    elif arch == 'X64':
	sources += Split("""x86/cpuinfo.c x86/cpuid.c""")
    else:
	print "Error: cpuinfo: invalid arch specified"


obj = []
if flags_unittest == '1':
    sources += libutf
    obj = env.Program(sources)
else:
    obj = env.SharedObject(sources)
Return('obj')
