@@ -2,59 +2,49 @@ import os
22import rtconfig
33import subprocess
44from building import *
5- Import ('RTT_ROOT' )
65
7- group = []
8-
9- cwd = GetCurrentDir ()
6+ group = []
7+ cwd = GetCurrentDir ()
108CPPPATH = [cwd , cwd + "/kernel" ]
9+ list = os .listdir (cwd )
10+ src = Glob ('kernel/*.c' ) + Glob ('kernel/*.S' )
1111
1212if not GetDepend (['RT_USING_VDSO' ]):
1313 Return ('group' )
1414
1515if rtconfig .ARCH != "aarch64" and rtconfig .ARCH != "risc-v" :
16- src = Glob ('*.c' )
17- group = DefineGroup ('VDSO' , src , depend = ['RT_USING_SMART' ,'RT_USING_VDSO' ], CPPPATH = CPPPATH )
18- Return ('group' )
19-
20- list = os .listdir (cwd )
21- src = Glob ('kernel/*.c' )
22- src += Glob ('kernel/*.S' )
23-
24-
25- if not hasattr (rtconfig , 'CPP' ) or rtconfig .CPP is None :
26- rtconfig .CPP = rtconfig .PREFIX + 'cpp'
27- if not hasattr (rtconfig , 'CPPFLAGS' ) or rtconfig .CPPFLAGS is None :
28- rtconfig .CPPFLAGS = ' -E -P -x assembler-with-cpp'
16+ # not supported arch
17+ src = []
18+ else :
19+ if not hasattr (rtconfig , 'CPP' ) or rtconfig .CPP is None :
20+ rtconfig .CPP = rtconfig .PREFIX + 'cpp'
21+ if not hasattr (rtconfig , 'CPPFLAGS' ) or rtconfig .CPPFLAGS is None :
22+ rtconfig .CPPFLAGS = ' -E -P -x assembler-with-cpp'
2923
30- if not os .path .exists (cwd + "/user" + "/arch" + "/" + rtconfig .ARCH + "/vdso.lds" ):
31- Preprocessing ("user/arch/" + rtconfig .ARCH + "/vdso.lds.S" , ".lds" , CPPPATH = [cwd ])
24+ if not os .path .exists (cwd + "/user" + "/arch" + "/" + rtconfig .ARCH + "/vdso.lds" ):
25+ Preprocessing ("user/arch/" + rtconfig .ARCH + "/vdso.lds.S" , ".lds" , CPPPATH = [cwd ])
3226
33- #aarch64 vdso xmake
34- # vdso_file = os.path.join(cwd, 'usr', 'xmake.lua')
35- # command = ["xmake", "-F", vdso_file]
36- # clean = ["xmake", "clean"]
27+ vdso_file = os .path .join (cwd , 'user' ,"arch" , rtconfig .ARCH , 'SConstruct' )
3728
38- vdso_file = os .path .join (cwd , 'user' ,"arch" , rtconfig .ARCH , 'SConstruct' )
29+ process_env = os .environ .copy ()
30+ if hasattr (rtconfig , 'EXEC_PATH' ) and rtconfig .EXEC_PATH is not None :
31+ process_env ['EXEC_PATH' ] = rtconfig .EXEC_PATH
32+ if hasattr (rtconfig , 'PREFIX' ) and rtconfig .PREFIX is not None :
33+ process_env ['CC_PREFIX' ] = rtconfig .PREFIX
3934
40- process_env = os .environ .copy ()
41- if hasattr (rtconfig , 'EXEC_PATH' ) and rtconfig .EXEC_PATH is not None :
42- process_env ['EXEC_PATH' ] = rtconfig .EXEC_PATH
43- if hasattr (rtconfig , 'PREFIX' ) and rtconfig .PREFIX is not None :
44- process_env ['CC_PREFIX' ] = rtconfig .PREFIX
45- command = ["scons" , "-f" , vdso_file ]
46- clean_command = ["scons" , "-f" , vdso_file , "--clean" ]
35+ command = ["scons" , "-f" , vdso_file ]
36+ clean_command = ["scons" , "-f" , vdso_file , "--clean" ]
4737
48- if not GetOption ('clean' ):
49- result = subprocess .run (command , env = process_env , check = True )
50- else :
51- result = subprocess .run (clean_command , env = process_env , check = True )
38+ if not GetOption ('clean' ):
39+ result = subprocess .run (command , env = process_env , check = True )
40+ else :
41+ result = subprocess .run (clean_command , env = process_env , check = True )
5242
53- if result .returncode == 0 :
54- print ("Command executed successfully" )
55- else :
56- print ("Command failed with exit code:" , result .returncode )
57- exit (1 )
43+ if result .returncode == 0 :
44+ print ("Command executed successfully" )
45+ else :
46+ print ("Command failed with exit code:" , result .returncode )
47+ exit (1 )
5848
59- group = DefineGroup ('VDSO ' , src , depend = ['RT_USING_SMART' ,'RT_USING_VDSO' ], CPPPATH = CPPPATH )
49+ group = DefineGroup ('vDSO ' , src , depend = ['RT_USING_SMART' ,'RT_USING_VDSO' ], CPPPATH = CPPPATH )
6050Return ('group' )
0 commit comments