Skip to content

Commit

Permalink
build of board posix ascore done
Browse files Browse the repository at this point in the history
  • Loading branch information
parai committed Nov 7, 2020
1 parent 392ef2b commit aff6148
Show file tree
Hide file tree
Showing 30 changed files with 344 additions and 111 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@

build
*.pyd
*.done

release/aslinux/build
release/aslinux/kernel/drivers/remoteproc/rproc-asvirt
Expand Down
13 changes: 6 additions & 7 deletions Console.bat
Original file line number Diff line number Diff line change
Expand Up @@ -39,16 +39,15 @@ cd %ASPATH%

:prepareEnv
set MSYS=winsymlinks:nativestrict
if EXIST "%ASPATH%\scons.bat" goto launchConsole
if EXIST "%ASPATH%\.setup.done" goto launchConsole
REM pacman -Syuu
pacman -S unzip wget git mingw-w64-x86_64-gcc mingw-w64-x86_64-glib2 mingw-w64-x86_64-gtk3
pacman -S mingw32/mingw-w64-i686-gcc mingw-w64-x86_64-diffutils
pacman -S ncurses-devel gperf scons curl make cmake automake-wrapper libtool
pacman -S unrar mingw-w64-x86_64-pkg-config mingw-w64-x86_64-binutils
pacman -S msys2-runtime-devel
conda install scons pyserial
echo @echo off > scons.bat
echo @echo !!!SCONS on MSYS2!!! >> scons.bat
echo %MSYS2%\usr\bin\python2.exe %MSYS2%\usr\bin\scons %%* >> scons.bat
echo 0 > .setup.done

:launchConsole
REM env.asc in format "tokens=value" such as "PACKET_LIB_ADAPTER_NR=2" to set some environment
Expand All @@ -64,9 +63,9 @@ if EXIST %CZ% goto launchCZ

:launchConEmu
start %ConEmu% -title aslua-ascore-asboot-asone ^
-runlist -new_console:d:"%ASPATH%\release\aslua":t:aslua ^
^|^|^| -new_console:d:"%ASPATH%\release\ascore":t:ascore ^
^|^|^| -new_console:d:"%ASPATH%\release\asboot":t:asboot ^
-runlist -new_console:d:"%ASPATH%":t:astool ^
^|^|^| -new_console:d:"%ASPATH%":t:ascore ^
^|^|^| -new_console:d:"%ASPATH%":t:asboot ^
^|^|^| -new_console:d:"%ASPATH%\com\as.tool\as.one.py":t:asone
exit 0

Expand Down
29 changes: 29 additions & 0 deletions Kconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
mainmenu "Automotive Software AS Configuration"

config BOARD
string
option env="BOARD"
default "posix"

config ANY
string
option env="ANY"
default "none"

config RELEASE
string
option env="RELEASE"
default "ascore"

config ASROOT
string
option env="ASROOT"
default "../.."

source "$ASROOT/com/as.application/Kconfig"
source "$ASROOT/com/as.infrastructure/Kconfig"
source "$ASROOT/com/as.tool/Kconfig"
if !IS_ASTOOL
source "$ASROOT/release/$RELEASE/Kconfig"
endif

6 changes: 6 additions & 0 deletions SConscript
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
from building import *

objs = SConscript('com/SConscript')
objs += SConscript('release/SConscript')

Return('objs')
17 changes: 4 additions & 13 deletions SConstruct
Original file line number Diff line number Diff line change
Expand Up @@ -6,19 +6,10 @@ sys.path.append(studio)
from building import *

asenv = PrepareEnv()
BOARD = asenv['BOARD']
ASROOT = asenv['ASROOT']
BDIR = asenv['BDIR']
target = asenv['target']

bdir = 'build/%s'%(BOARD)
if(BOARD == 'any'):
ANY = os.getenv('ANY')
bdir = '%s/%s'%(bdir, ANY)
TARGET = ANY
else:
TARGET = BOARD
objs = SConscript('%s/SConscript'%(ASROOT),variant_dir=BDIR, duplicate=0)

asenv['BDIR'] = os.path.abspath(bdir)

objs = SConscript('%s/com/SConscript'%(ASROOT),variant_dir=bdir, duplicate=0)

Building(TARGET,objs)
Building(target,objs)
7 changes: 6 additions & 1 deletion com/as.application/Kconfig
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
source "$ASROOT/com/as.application/board.$BOARD/Kconfig"

config IS_ASTOOL
bool
default n

if !IS_ASTOOL
menu "Run Time Environment"
config RTE
bool "Run Time Environment"
Expand Down Expand Up @@ -49,4 +54,4 @@ config DEM_TEST
default n

endmenu

endif
10 changes: 10 additions & 0 deletions com/as.application/board.any/aslib/Kconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@

config ARCH_ANY
bool
default y
select DEFAULT_ANYOS
select IS_ASTOOL

config ARCH
string
default "host"
32 changes: 32 additions & 0 deletions com/as.application/board.any/aslib/SConscript
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
from building import *

cwd = GetCurrentDir()

Import('asenv')
ASROOT = asenv['ASROOT']

if(IsPlatformWindows()):
asenv.Append(CPPDEFINES=['__WINDOWS__'])
else:
asenv.Append(CPPDEFINES=['__LINUX__'])

asenv.Append(CPPDEFINES=['__AS_BY_PARAI__','__AS_CAN_BUS__'])

MODULES = ['LUA_CAN','LUA_SERIAL_CAN','LUA_PEAK_CAN',
'LUA_ZLG_CAN','LUA_VXL_CAN','LUA_SOCKET_CAN',
]

if(asenv['MODULES'] is None):
asenv['MODULES'] = MODULES
else:
MODULES = asenv['MODULES']

MODULES.append('ANYOS')

asenv['ARCH'] = 'host'

asenv['BUILD_TYPE'] = 'lib'

objs = []

Return('objs')
24 changes: 24 additions & 0 deletions com/as.application/board.any/lua/Kconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@

config ARCH_ANY
bool
default y
select DEFAULT_ANYOS
select IS_ASTOOL
select LUA

config ARCH
string
default "host"


config DET
bool
default y

config SHELL
bool
default y

config ANYOS
bool
default y
36 changes: 36 additions & 0 deletions com/as.application/board.any/lua/SConscript
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
from building import *

cwd = GetCurrentDir()

Import('asenv')
ASROOT = asenv['ASROOT']

if(IsPlatformWindows()):
asenv.Append(CPPDEFINES=['__WINDOWS__'])
else:
asenv.Append(CPPDEFINES=['__LINUX__'])

asenv.Append(CPPDEFINES=['__AS_BY_PARAI__', 'LUA_COMPAT_5_2', 'LUA_COMPAT_5_1'])

MODULES = ['LUA',
'LUA_ASLIB',
'LUA_DEV','LUA_DEV_RS232',
'LUA_CAN','LUA_SERIAL_CAN','LUA_PEAK_CAN',
'LUA_ZLG_CAN','LUA_VXL_CAN','LUA_SOCKET_CAN',
'DET','SHELL',
]

if(asenv['MODULES'] is None):
asenv['MODULES'] = MODULES
else:
MODULES = asenv['MODULES']

MODULES.append('ANYOS')

asenv['ARCH'] = 'host'

asenv.Append(LIBS=['pthread', 'm' , 'stdc++'])

objs = []

Return('objs')
14 changes: 14 additions & 0 deletions com/as.application/board.any/pyas/Kconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@

config ARCH_ANY
bool
default y
select DEFAULT_ANYOS
select IS_ASTOOL

config ARCH
string
default "host"

config PYAS
bool
default y
37 changes: 37 additions & 0 deletions com/as.application/board.any/pyas/SConscript
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
from building import *

cwd = GetCurrentDir()

Import('asenv')
ASROOT = asenv['ASROOT']

if(IsPlatformWindows()):
asenv.Append(CPPDEFINES=['__WINDOWS__'])
else:
asenv.Append(CPPDEFINES=['__LINUX__'])

asenv.Append(CPPDEFINES=['__AS_BY_PARAI__','__AS_PY_CAN__','__AS_PY_DEV__',
'NDEBUG','UNICODE','QT_LARGEFILE_SUPPORT'])

MODULES = ['LUA_CAN','LUA_SERIAL_CAN','LUA_PEAK_CAN',
'LUA_ZLG_CAN','LUA_VXL_CAN','LUA_SOCKET_CAN',
'ANYOS', 'PYAS',
'LUA_DEV','LUA_DEV_RS232',
]

if(asenv['MODULES'] is None):
asenv['MODULES'] = MODULES
else:
MODULES = asenv['MODULES']

MODULES.append('ANYOS')

asenv['ARCH'] = 'host'

asenv['BUILD_TYPE'] = 'dll'

AddPythonDev(asenv)

objs = []

Return('objs')
11 changes: 6 additions & 5 deletions com/as.application/board.posix/SConscript
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ Import('asenv')
ASROOT = asenv['ASROOT']

if('run' in COMMAND_LINE_TARGETS):
build = '%s/release/%s'%(ASROOT,asenv['RELEASE'])
build = asenv['BDIR']
python = asenv['python3']
if(IsPlatformWindows()):
python = 'start ' + python
Expand Down Expand Up @@ -36,7 +36,7 @@ if('run' in COMMAND_LINE_TARGETS):
else:
RunCommand('cd %s/com/as.tool/as.one.py && %s assg.py &'%(ASROOT,python))
time.sleep(1)
target = '%s/release/%s/posix'%(ASROOT,asenv['RELEASE'])
target = asenv['target']
if(not IsPlatformWindows()):
target = 'sudo ' + target
else:
Expand All @@ -59,13 +59,14 @@ MODULES = ['ECUM','SCHM','MCU',
'DCM','CANNM','CANSM','NM','OSEKNM','XCP',
'PORT','DIO','EEP','FLS','STMO',
'EA','FEE','MEMIF','NVM',
'LCD','FDT',
'LCD',
'TINYOS',
'J1939TP',
'TRACE',,'COMMONXML'
'LUA_CAN','LUA_SOCKET_CAN',
'TRACE','COMMONXML'
]

MODULES.append('AWS')
#MODULES.append('AWS')

ARCH='posix'
arch='posix'
Expand Down
4 changes: 3 additions & 1 deletion com/as.infrastructure/Kconfig
Original file line number Diff line number Diff line change
@@ -1,8 +1,10 @@
if !IS_ASTOOL
source "$ASROOT/com/as.infrastructure/arch/Kconfig"
source "$ASROOT/com/as.infrastructure/communication/Kconfig"
source "$ASROOT/com/as.infrastructure/diagnostic/Kconfig"
source "$ASROOT/com/as.infrastructure/memory/Kconfig"
source "$ASROOT/com/as.infrastructure/system/Kconfig"
source "$ASROOT/com/as.infrastructure/clib/Kconfig"
source "$ASROOT/com/as.infrastructure/libraries/Kconfig"
source "$ASROOT/com/as.infrastructure/libraries/nn/Kconfig"
source "$ASROOT/com/as.infrastructure/libraries/nn/Kconfig"
endif
6 changes: 0 additions & 6 deletions com/as.infrastructure/arch/posix/SConscript
Original file line number Diff line number Diff line change
Expand Up @@ -65,8 +65,6 @@ if('LWIP' in MODULES):
else:
asenv.Append(LIBS=['packet','wpcap'])
asenv.Append(LIBPATH=['%s/WpdPack/Lib'%(cwd)])
if('-D_MSC_VER' not in asenv['CCFLAGS']):
asenv.Append(CPPDEFINES='_MSC_VER')

if('UIP' in MODULES):
uip=Package('contiki')
Expand All @@ -81,8 +79,6 @@ if('UIP' in MODULES):
asenv.Append(CPPDEFINES='__AS_CAN_BUS__')
asenv.Append(CPPPATH=['%s/com/as.infrastructure/communication/RPmsg'%(asenv['ASROOT'])])

objs += SConscript('%s/com/as.tool/lua/SConscript'%(asenv['ASROOT']))

if('GTK' in MODULES):
asenv.ParseConfig('%s --cflags gtk+-3.0'%(asenv['pkgconfig']))
asenv.ParseConfig('%s --libs gtk+-3.0 glib-2.0 gthread-2.0'%(asenv['pkgconfig']))
Expand Down Expand Up @@ -127,8 +123,6 @@ if(IsPlatformWindows()):
asenv.Append(CPPDEFINES='__WINDOWS__')
if(asenv['mingw64']):
asenv.Append(CPPDEFINES='__X86_64__')
print('WARNING: need modify the c:/msys64/mingw64/x86_64-w64-mingw32/include/ws2tcpip.h line 86-103, add WS2TCPIP_INLINE')
print('WARNING: need modify the c:/msys64/mingw64/x86_64-w64-mingw32/include/ws2ipdef.h line 127, add WS2TCPIP_INLINE')
else:
asenv.Append(CPPDEFINES='__LINUX__')

Expand Down
4 changes: 0 additions & 4 deletions com/as.infrastructure/arch/posix/mcal/Lcd.c
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,6 @@
#include <gtk/gtk.h>
#include <gdk/gdk.h>
#elif defined(USE_SDL)
#ifdef __WINDOWS__
#undef _MSC_VER
#endif
#include <SDL2/SDL.h>
#else
#include "VG/openvg.h"
Expand All @@ -32,7 +29,6 @@
#endif

#include <stdio.h>
#include <stdint.h>
#include <assert.h>
#include <sys/time.h>
#include <pthread.h>
Expand Down
2 changes: 1 addition & 1 deletion com/as.infrastructure/diagnostic/Det/asdebug.c
Original file line number Diff line number Diff line change
Expand Up @@ -175,7 +175,7 @@ void asAssertErrorHook(void)
}
ELF_EXPORT(asAssertErrorHook);

#if !defined(__HIWARE__)
#if !defined(__HIWARE__) && !defined(__WINDOWS__) && !defined(__LINUX__)
void _assert (const char *_Message, const char *_File, unsigned _Line)
{
printf("assert(%s) failed @ %s %u\n", _Message, _File, _Line);
Expand Down
3 changes: 2 additions & 1 deletion com/as.infrastructure/diagnostic/SConscript
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ if((BOARD=='posix') and IsPlatformWindows()):
cmd = '%s -O2 -shared -Wall -D__ASDEBUG_BACKTRACE__ -o %s' \
' %s/Det/backtrace.c -lbfd -lintl -liberty -limagehlp -lz -L%s'%(
gcc, target, cwd, binutils)
MKObject(Glob('Det/backtrace.c'), target, cmd, False)
if(not asenv['mingw64']):
MKObject(Glob('Det/backtrace.c'), target, cmd, False)

Return('objs')
3 changes: 3 additions & 0 deletions com/as.tool/Kconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
if IS_ASTOOL
source "$ASROOT/com/as.tool/lua/Kconfig"
endif
Loading

0 comments on commit aff6148

Please sign in to comment.