Compare commits
5 Commits
2a7579fecc
...
c360568e6a
| Author | SHA1 | Date |
|---|---|---|
|
|
c360568e6a | |
|
|
e448d542e8 | |
|
|
71b2aec834 | |
|
|
a24bff8b08 | |
|
|
fe9ea67814 |
|
|
@ -30,7 +30,45 @@ jobs:
|
||||||
podman run --name stable -di --userns=keep-id:uid=1000,gid=1000 -v "$PWD":/home -w /home ${{ matrix.release }} bash
|
podman run --name stable -di --userns=keep-id:uid=1000,gid=1000 -v "$PWD":/home -w /home ${{ matrix.release }} bash
|
||||||
podman exec -i stable uname -a
|
podman exec -i stable uname -a
|
||||||
podman exec -i stable id
|
podman exec -i stable id
|
||||||
|
|
||||||
|
- name: Update APT Sources List (Ubuntu Only)
|
||||||
|
if:
|
||||||
|
startsWith(matrix.release, 'ubuntu:') && matrix.release != 'ubuntu:20.04'
|
||||||
|
run: |
|
||||||
podman exec -i -u root stable apt update
|
podman exec -i -u root stable apt update
|
||||||
|
podman exec -e DEBIAN_FRONTEND='noninteractive' -i -u root stable apt install -o APT::Install-Suggests=false -qy \
|
||||||
|
lsb-release
|
||||||
|
|
||||||
|
podman exec -i -u root stable \
|
||||||
|
test -e /etc/apt/sources.list &&
|
||||||
|
podman exec -i -u root stable \
|
||||||
|
sed -i -e 's|\(http.*:\)|[arch=amd64] \1|g' /etc/apt/sources.list
|
||||||
|
|
||||||
|
podman exec -i -u root stable \
|
||||||
|
test -e /etc/apt/sources.list.d/ubuntu.sources &&
|
||||||
|
podman exec -i -u root stable \
|
||||||
|
sed -i -e '/^Components:/a Architectures: amd64' /etc/apt/sources.list.d/ubuntu.sources
|
||||||
|
|
||||||
|
echo "deb [arch=armhf,arm64] http://ports.ubuntu.com/ubuntu-ports/ $(podman exec -i stable lsb_release -cs) main restricted universe multiverse" | \
|
||||||
|
podman exec -i -u root stable tee -a /etc/apt/sources.list.d/cross.list
|
||||||
|
echo "deb [arch=armhf,arm64] http://ports.ubuntu.com/ubuntu-ports/ $(podman exec -i stable lsb_release -cs)-updates main restricted universe multiverse" | \
|
||||||
|
podman exec -i -u root stable tee -a /etc/apt/sources.list.d/cross.list
|
||||||
|
echo "deb [arch=armhf,arm64] http://ports.ubuntu.com/ubuntu-ports/ $(podman exec -i stable lsb_release -cs)-backports main restricted universe multiverse" | \
|
||||||
|
podman exec -i -u root stable tee -a /etc/apt/sources.list.d/cross.list
|
||||||
|
|
||||||
|
- name: Add Architecture
|
||||||
|
if:
|
||||||
|
matrix.release != 'ubuntu:20.04'
|
||||||
|
run: |
|
||||||
|
podman exec -i -u root stable dpkg --add-architecture arm64
|
||||||
|
podman exec -i -u root stable dpkg --add-architecture armhf
|
||||||
|
|
||||||
|
- name: Install Development Packages
|
||||||
|
env:
|
||||||
|
release: ${{ matrix.release == 'debian:experimental' && '-t experimental' || '' }}
|
||||||
|
run: |
|
||||||
|
podman exec -i -u root stable apt update
|
||||||
|
podman exec -e DEBIAN_FRONTEND='noninteractive' -i -u root stable apt upgrade -o APT::Install-Suggests=false -qy
|
||||||
podman exec -e DEBIAN_FRONTEND='noninteractive' -i -u root stable apt install -o APT::Install-Suggests=false -qy ${release} \
|
podman exec -e DEBIAN_FRONTEND='noninteractive' -i -u root stable apt install -o APT::Install-Suggests=false -qy ${release} \
|
||||||
clang \
|
clang \
|
||||||
cmake \
|
cmake \
|
||||||
|
|
@ -38,52 +76,67 @@ jobs:
|
||||||
gcc-aarch64-linux-gnu \
|
gcc-aarch64-linux-gnu \
|
||||||
gcc-arm-linux-gnueabihf \
|
gcc-arm-linux-gnueabihf \
|
||||||
gcc-mips-linux-gnu \
|
gcc-mips-linux-gnu \
|
||||||
|
libgps-dev \
|
||||||
make
|
make
|
||||||
|
|
||||||
|
- name: Install Cross Libs
|
||||||
|
env:
|
||||||
|
release: ${{ matrix.release == 'debian:experimental' && '-t experimental' || '' }}
|
||||||
|
if:
|
||||||
|
matrix.release != 'ubuntu:20.04'
|
||||||
|
run: |
|
||||||
|
podman exec -e DEBIAN_FRONTEND='noninteractive' -i -u root stable apt install -o APT::Install-Suggests=false -qy ${release} \
|
||||||
|
libgps-dev:arm64 \
|
||||||
|
libgps-dev:armhf
|
||||||
|
|
||||||
- name: Configure & Build with gcc
|
- name: Configure & Build with gcc
|
||||||
env:
|
env:
|
||||||
cc: gcc
|
cc: gcc
|
||||||
run: |
|
run: |
|
||||||
podman exec -i stable cmake -DCMAKE_BUILD_TYPE=Debug -DCMAKE_C_COMPILER=${cc} -DENABLE_WERROR=ON -B build-${cc}
|
podman exec -i stable cmake -DCMAKE_BUILD_TYPE=Debug -DCMAKE_C_COMPILER=${cc} -DENABLE_WERROR=ON -DENABLE_GPS=ON -B build-${cc}
|
||||||
podman exec -i stable cmake --build build-${cc}
|
podman exec -i stable cmake --build build-${cc}
|
||||||
|
|
||||||
- name: Configure & Build with clang
|
- name: Configure & Build with clang
|
||||||
env:
|
env:
|
||||||
cc: clang
|
cc: clang
|
||||||
run: |
|
run: |
|
||||||
podman exec -i stable cmake -DCMAKE_BUILD_TYPE=Debug -DCMAKE_C_COMPILER=${cc} -DENABLE_WERROR=ON -B build-${cc}
|
podman exec -i stable cmake -DCMAKE_BUILD_TYPE=Debug -DCMAKE_C_COMPILER=${cc} -DENABLE_WERROR=ON -DENABLE_GPS=ON -B build-${cc}
|
||||||
podman exec -i stable cmake --build build-${cc}
|
podman exec -i stable cmake --build build-${cc}
|
||||||
|
|
||||||
- name: Configure & Build with arm-linux-gnueabihf-gcc
|
- name: Configure & Build with arm-linux-gnueabihf-gcc
|
||||||
env:
|
env:
|
||||||
toolchain: arm-linux-gnueabihf-gcc
|
toolchain: arm-linux-gnueabihf-gcc
|
||||||
|
gps: ${{ matrix.release == 'ubuntu:20.04' && 'OFF' || 'ON' }}
|
||||||
run: |
|
run: |
|
||||||
podman exec -i stable cmake -DCMAKE_BUILD_TYPE=Debug -DCMAKE_TOOLCHAIN_FILE=cmake/${toolchain}.cmake -DENABLE_WERROR=ON -B build-${toolchain}
|
podman exec -i stable cmake -DCMAKE_BUILD_TYPE=Debug -DCMAKE_TOOLCHAIN_FILE=cmake/${toolchain}.cmake -DENABLE_WERROR=ON -DENABLE_GPS=${gps} -B build-${toolchain}
|
||||||
podman exec -i stable cmake --build build-${toolchain}
|
podman exec -i stable cmake --build build-${toolchain}
|
||||||
|
|
||||||
- name: Configure & Build with arm-linux-gnueabihf-clang
|
- name: Configure & Build with arm-linux-gnueabihf-clang
|
||||||
if:
|
if:
|
||||||
${{ matrix.release != 'ubuntu:20.04' && matrix.release != 'debian:oldstable-slim' }}
|
matrix.release != 'ubuntu:20.04' && matrix.release != 'debian:oldstable-slim'
|
||||||
env:
|
env:
|
||||||
toolchain: arm-linux-gnueabihf-clang
|
toolchain: arm-linux-gnueabihf-clang
|
||||||
|
gps: ${{ matrix.release == 'ubuntu:20.04' && 'OFF' || 'ON' }}
|
||||||
run: |
|
run: |
|
||||||
podman exec -i stable cmake -DCMAKE_BUILD_TYPE=Debug -DCMAKE_TOOLCHAIN_FILE=cmake/${toolchain}.cmake -DENABLE_WERROR=ON -B build-${toolchain}
|
podman exec -i stable cmake -DCMAKE_BUILD_TYPE=Debug -DCMAKE_TOOLCHAIN_FILE=cmake/${toolchain}.cmake -DENABLE_WERROR=ON -DENABLE_GPS=${gps} -B build-${toolchain}
|
||||||
podman exec -i stable cmake --build build-${toolchain}
|
podman exec -i stable cmake --build build-${toolchain}
|
||||||
|
|
||||||
- name: Configure & Build with aarch64-linux-gnu-gcc
|
- name: Configure & Build with aarch64-linux-gnu-gcc
|
||||||
env:
|
env:
|
||||||
toolchain: aarch64-linux-gnu-gcc
|
toolchain: aarch64-linux-gnu-gcc
|
||||||
|
gps: ${{ matrix.release == 'ubuntu:20.04' && 'OFF' || 'ON' }}
|
||||||
run: |
|
run: |
|
||||||
podman exec -i stable cmake -DCMAKE_BUILD_TYPE=Debug -DCMAKE_TOOLCHAIN_FILE=cmake/${toolchain}.cmake -DENABLE_WERROR=ON -B build-${toolchain}
|
podman exec -i stable cmake -DCMAKE_BUILD_TYPE=Debug -DCMAKE_TOOLCHAIN_FILE=cmake/${toolchain}.cmake -DENABLE_WERROR=ON -DENABLE_GPS=${gps} -B build-${toolchain}
|
||||||
podman exec -i stable cmake --build build-${toolchain}
|
podman exec -i stable cmake --build build-${toolchain}
|
||||||
|
|
||||||
- name: Configure & Build with aarch64-linux-gnu-clang
|
- name: Configure & Build with aarch64-linux-gnu-clang
|
||||||
if:
|
if:
|
||||||
${{ matrix.release != 'ubuntu:20.04' && matrix.release != 'debian:oldstable-slim' }}
|
matrix.release != 'ubuntu:20.04' && matrix.release != 'debian:oldstable-slim'
|
||||||
env:
|
env:
|
||||||
toolchain: aarch64-linux-gnu-clang
|
toolchain: aarch64-linux-gnu-clang
|
||||||
|
gps: ${{ matrix.release == 'ubuntu:20.04' && 'OFF' || 'ON' }}
|
||||||
run: |
|
run: |
|
||||||
podman exec -i stable cmake -DCMAKE_BUILD_TYPE=Debug -DCMAKE_TOOLCHAIN_FILE=cmake/${toolchain}.cmake -DENABLE_WERROR=ON -B build-${toolchain}
|
podman exec -i stable cmake -DCMAKE_BUILD_TYPE=Debug -DCMAKE_TOOLCHAIN_FILE=cmake/${toolchain}.cmake -DENABLE_WERROR=ON -DENABLE_GPS=${gps} -B build-${toolchain}
|
||||||
podman exec -i stable cmake --build build-${toolchain}
|
podman exec -i stable cmake --build build-${toolchain}
|
||||||
|
|
||||||
- name: Configure & Build with mips-linux-gnu-gcc
|
- name: Configure & Build with mips-linux-gnu-gcc
|
||||||
|
|
|
||||||
|
|
@ -12,8 +12,18 @@ if(NOT CMAKE_BUILD_TYPE)
|
||||||
set(CMAKE_BUILD_TYPE Release)
|
set(CMAKE_BUILD_TYPE Release)
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
|
if(CMAKE_EXPORT_COMPILE_COMMANDS STREQUAL "")
|
||||||
|
set(CMAKE_EXPORT_COMPILE_COMMANDS ON CACHE BOOL "project default" FORCE)
|
||||||
|
endif()
|
||||||
|
|
||||||
# Add an option to enable treating warnings as errors
|
# Add an option to enable treating warnings as errors
|
||||||
option(ENABLE_WERROR "Treat all compiler warnings as errors" OFF)
|
option(ENABLE_WERROR "Treat all compiler warnings as errors" OFF)
|
||||||
|
option(ENABLE_GPS "Enable GPS support" OFF)
|
||||||
|
|
||||||
|
find_package(PkgConfig REQUIRED)
|
||||||
|
if(ENABLE_GPS)
|
||||||
|
pkg_check_modules(GPS REQUIRED libgps)
|
||||||
|
endif()
|
||||||
|
|
||||||
if(ENABLE_WERROR)
|
if(ENABLE_WERROR)
|
||||||
add_compile_options(-Werror)
|
add_compile_options(-Werror)
|
||||||
|
|
@ -67,6 +77,10 @@ set(PROGRAMS_J1939_TIMEDATE
|
||||||
j1939-timedate-cli
|
j1939-timedate-cli
|
||||||
)
|
)
|
||||||
|
|
||||||
|
set(PROGRAMS_J1939_VEHICLE_POSITION
|
||||||
|
j1939-vehicle-position-srv
|
||||||
|
)
|
||||||
|
|
||||||
set(PROGRAMS_ISOBUSFS
|
set(PROGRAMS_ISOBUSFS
|
||||||
isobusfs-srv
|
isobusfs-srv
|
||||||
isobusfs-cli
|
isobusfs-cli
|
||||||
|
|
@ -191,6 +205,24 @@ if(NOT ANDROID)
|
||||||
j1939-timedate-srv
|
j1939-timedate-srv
|
||||||
DESTINATION ${CMAKE_INSTALL_BINDIR})
|
DESTINATION ${CMAKE_INSTALL_BINDIR})
|
||||||
|
|
||||||
|
if(ENABLE_GPS)
|
||||||
|
set(PUBLIC_HEADER_J1939_VEHICLE_POSITION
|
||||||
|
j1939_vehicle_position/j1939_vehicle_position_cmn.h
|
||||||
|
)
|
||||||
|
|
||||||
|
add_executable(j1939-vehicle-position-srv
|
||||||
|
j1939_vehicle_position/j1939_vehicle_position_srv.c
|
||||||
|
)
|
||||||
|
|
||||||
|
target_link_libraries(j1939-vehicle-position-srv
|
||||||
|
PRIVATE can j1939 ${GPS_LIBRARIES}
|
||||||
|
)
|
||||||
|
|
||||||
|
install(TARGETS
|
||||||
|
j1939-vehicle-position-srv
|
||||||
|
DESTINATION ${CMAKE_INSTALL_BINDIR})
|
||||||
|
endif()
|
||||||
|
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
add_library(can STATIC
|
add_library(can STATIC
|
||||||
|
|
|
||||||
15
Makefile
15
Makefile
|
|
@ -67,6 +67,9 @@ PROGRAMS_J1939_TIMEDATE := \
|
||||||
j1939-timedate-srv \
|
j1939-timedate-srv \
|
||||||
j1939-timedate-cli
|
j1939-timedate-cli
|
||||||
|
|
||||||
|
PROGRAMS_J1939_VEHICLE_POSITION := \
|
||||||
|
j1939-vehicle-position-srv
|
||||||
|
|
||||||
PROGRAMS_ISOBUSFS := \
|
PROGRAMS_ISOBUSFS := \
|
||||||
isobusfs-srv \
|
isobusfs-srv \
|
||||||
isobusfs-cli
|
isobusfs-cli
|
||||||
|
|
@ -98,6 +101,7 @@ PROGRAMS_SLCAN := \
|
||||||
PROGRAMS := \
|
PROGRAMS := \
|
||||||
$(PROGRAMS_CANGW) \
|
$(PROGRAMS_CANGW) \
|
||||||
$(PROGRAMS_J1939_TIMEDATE) \
|
$(PROGRAMS_J1939_TIMEDATE) \
|
||||||
|
$(PROGRAMS_J1939_VEHICLE_POSITION) \
|
||||||
$(PROGRAMS_ISOBUSFS) \
|
$(PROGRAMS_ISOBUSFS) \
|
||||||
$(PROGRAMS_ISOTP) \
|
$(PROGRAMS_ISOTP) \
|
||||||
$(PROGRAMS_J1939) \
|
$(PROGRAMS_J1939) \
|
||||||
|
|
@ -126,7 +130,8 @@ endif
|
||||||
all: $(PROGRAMS)
|
all: $(PROGRAMS)
|
||||||
|
|
||||||
clean:
|
clean:
|
||||||
rm -f $(PROGRAMS) *.o mcp251xfd/*.o isobusfs/*.o j1939_timedate/*.o
|
rm -f $(PROGRAMS) *.o mcp251xfd/*.o isobusfs/*.o j1939_timedate/*.o \
|
||||||
|
j1939_vehicle_position/*.o
|
||||||
|
|
||||||
install:
|
install:
|
||||||
mkdir -p $(DESTDIR)$(PREFIX)/bin
|
mkdir -p $(DESTDIR)$(PREFIX)/bin
|
||||||
|
|
@ -153,6 +158,8 @@ isobusfs_srv.o: lib.h libj1939.h
|
||||||
isobusfs_c.o: lib.h libj1939.h
|
isobusfs_c.o: lib.h libj1939.h
|
||||||
j1939_timedate_srv.o: lib.h libj1939.h
|
j1939_timedate_srv.o: lib.h libj1939.h
|
||||||
j1939_timedate_cli.o: lib.h libj1939.h
|
j1939_timedate_cli.o: lib.h libj1939.h
|
||||||
|
j1939_vehicle_position_srv.o: lib.h libj1939.h
|
||||||
|
|
||||||
canframelen.o: canframelen.h
|
canframelen.o: canframelen.h
|
||||||
|
|
||||||
asc2log: asc2log.o lib.o
|
asc2log: asc2log.o lib.o
|
||||||
|
|
@ -182,6 +189,12 @@ j1939-timedate-cli: lib.o \
|
||||||
j1939_timedate/j1939_timedate_cli.o
|
j1939_timedate/j1939_timedate_cli.o
|
||||||
$(CC) $(LDFLAGS) $^ $(LDLIBS) -o $@
|
$(CC) $(LDFLAGS) $^ $(LDLIBS) -o $@
|
||||||
|
|
||||||
|
j1939-vehicle-position-srv: \
|
||||||
|
lib.o \
|
||||||
|
libj1939.o \
|
||||||
|
j1939_vehicle_position/j1939_vehicle_position_srv.o \
|
||||||
|
$(CC) $(LDFLAGS) $^ $(LDLIBS) -lgps -o $@
|
||||||
|
|
||||||
isobusfs-srv: lib.o \
|
isobusfs-srv: lib.o \
|
||||||
libj1939.o \
|
libj1939.o \
|
||||||
isobusfs/isobusfs_cmn.o \
|
isobusfs/isobusfs_cmn.o \
|
||||||
|
|
|
||||||
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
Loading…
Reference in New Issue