Skip to content

Commit

Permalink
basic openavb build ok, modify insall next step
Browse files Browse the repository at this point in the history
  • Loading branch information
frankie-zeng committed Jun 22, 2022
1 parent b5f0690 commit a2f135f
Show file tree
Hide file tree
Showing 7 changed files with 544 additions and 1 deletion.
347 changes: 347 additions & 0 deletions recipes-avbtsn/openavb/files/GPLv2.patch

Large diffs are not rendered by default.

19 changes: 19 additions & 0 deletions recipes-avbtsn/openavb/files/cmake.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
Upstream-Status: Inappropriate [cmake]

diff --git a/CMakeLists.txt b/CMakeLists.txt
index 88de84bf..99ecc195 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -13,9 +13,9 @@ else()
message(STATUS "The compiler ${CMAKE_CXX_COMPILER} has no C++11 support. Please use a different C++ compiler.")
endif()

-add_subdirectory("thirdparty/cpputest")
-add_subdirectory("daemons/common/tests")
-add_subdirectory("daemons/mrpd")
+# add_subdirectory("thirdparty/cpputest")
+# add_subdirectory("daemons/common/tests")
+# add_subdirectory("daemons/mrpd")
add_subdirectory("daemons/maap")

message("
47 changes: 47 additions & 0 deletions recipes-avbtsn/openavb/files/i210_linux.cmake
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@

set ( AVB_FEATURE_AVDECC 0)
set ( AVB_FEATURE_PCAP 1 )
set ( AVB_FEATURE_IGB 1 )
set ( AVB_FEATURE_ATL 0 )
set ( IGB_LAUNCHTIME_ENABLED 1)
set ( AVB_FEATURE_ENDPOINT 1)
set ( GSTREAMER_1_0 1 )


# and another kernel sources
#set ( LINUX_KERNEL_DIR "/usr/src/kernel" )

# build configuration
set ( OPENAVB_HAL "x86_i210" )
set ( OPENAVB_OSAL "Linux" )
set ( OPENAVB_TCAL "GNU" )
set ( OPENAVB_PLATFORM "${OPENAVB_HAL}-${OPENAVB_OSAL}" )

# Platform Additions
set ( PLATFORM_INCLUDE_DIRECTORIES
${CMAKE_SOURCE_DIR}/platform/x86_i210/include
if (AVB_FEATURE_IGB)
${CMAKE_SOURCE_DIR}/../igb_avb/lib
endif ()
${CMAKE_SOURCE_DIR}/openavb_common
${CMAKE_SOURCE_DIR}/../../daemons/common
${CMAKE_SOURCE_DIR}/../../daemons/mrpd
${CMAKE_SOURCE_DIR}/../../daemons/maap/common
)

if (AVB_FEATURE_IGB)
set ( PLATFORM_LINK_DIRECTORIES
${CMAKE_SOURCE_DIR}/../igb_avb/lib
)
endif ()

if (AVB_FEATURE_IGB)
set ( PLATFORM_LINK_LIBRARIES
igb
pci
)
endif ()

# TODO_OPENAVB : need this?
# Set platform specific define
#set ( PLATFORM_DEFINE "AVB_DELAY_TWEAK_USEC=15" )
46 changes: 46 additions & 0 deletions recipes-avbtsn/openavb/files/i210_linux_avdecc.cmake
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
set (AVB_FEATURE_AVDECC 1)
set ( AVB_FEATURE_GSTREAMER 0 )
set ( AVB_FEATURE_PCAP 0 )
set ( AVB_FEATURE_IGB 0 )
set ( AVB_FEATURE_ATL 0 )




# and another kernel sources
#set ( LINUX_KERNEL_DIR "/usr/src/kernel" )

# build configuration
set ( OPENAVB_HAL "x86_i210" )
set ( OPENAVB_OSAL "Linux" )
set ( OPENAVB_TCAL "GNU" )
set ( OPENAVB_PLATFORM "${OPENAVB_HAL}-${OPENAVB_OSAL}" )

# Platform Additions
set ( PLATFORM_INCLUDE_DIRECTORIES
${CMAKE_SOURCE_DIR}/platform/x86_i210/include
if (AVB_FEATURE_IGB)
${CMAKE_SOURCE_DIR}/../igb_avb/lib
endif ()
${CMAKE_SOURCE_DIR}/openavb_common
${CMAKE_SOURCE_DIR}/../../daemons/common
${CMAKE_SOURCE_DIR}/../../daemons/mrpd
${CMAKE_SOURCE_DIR}/../../daemons/maap/common
)

if (AVB_FEATURE_IGB)
set ( PLATFORM_LINK_DIRECTORIES
${CMAKE_SOURCE_DIR}/../igb_avb/lib
)
endif ()

if (AVB_FEATURE_IGB)
set ( PLATFORM_LINK_LIBRARIES
igb
pci
)
endif ()

# TODO_OPENAVB : need this?
# Set platform specific define
#set ( PLATFORM_DEFINE "AVB_DELAY_TWEAK_USEC=15" )
79 changes: 79 additions & 0 deletions recipes-avbtsn/openavb/openavb_1.1.bb
Original file line number Diff line number Diff line change
@@ -0,0 +1,79 @@
SUMMARY = "The OpenAvnu project is sponsored by the Avnu Alliance."
HOMEPAGE = "https://github.com/Avnu/OpenAvnu"
LICENSE = "GPLv2"
LIC_FILES_CHKSUM = "file://COPYING;md5=751419260aa954499f7abaabaa882bbe"

DEPENDS = "igb-avb libpcap cpputest pciutils alsa-lib gstreamer1.0 gstreamer1.0-plugins-base"

SRCREV_machine = "ff076e83234d2207f33447b9bd6d1646d9245566"

SRC_URI = "git://github.com/Avnu/OpenAvnu.git;name=machine;branch=master;protocol=https \
file://GPLv2.patch \
file://cmake.patch \
file://i210_linux.cmake \
file://i210_linux_avdecc.cmake \
"
S = "${WORKDIR}/git"

# SRC_URI[md5sum] = "96d9ea1578162929c30b48e6813227ff"


inherit cmake


do_configure:append() {
cmake \
${OECMAKE_GENERATOR_ARGS} \
$oecmake_sitefile \
${S}/lib/avtp_pipeline \
-B "${WORKDIR}/build_avtp_pipe" \
-DPCAPDIR="${STAGING_DIR_HOST}${prefix}" \
-DLIB_SUFFIX=${@d.getVar('baselib').replace('lib', '')} \
-DCMAKE_INSTALL_SO_NO_EXE=0 \
-DCMAKE_TOOLCHAIN_FILE=${WORKDIR}/i210_linux.cmake \
-DCMAKE_NO_SYSTEM_FROM_IMPORTED=1 \
-DCMAKE_EXPORT_NO_PACKAGE_REGISTRY=ON \
${EXTRA_OECMAKE} \
-Wno-dev

cmake \
${OECMAKE_GENERATOR_ARGS} \
$oecmake_sitefile \
${S}/lib/avtp_pipeline \
-B "${WORKDIR}/build_avdecc" \
-DPCAPDIR="${STAGING_DIR_HOST}${prefix}" \
-DLIB_SUFFIX=${@d.getVar('baselib').replace('lib', '')} \
-DCMAKE_INSTALL_SO_NO_EXE=0 \
-DCMAKE_TOOLCHAIN_FILE=${WORKDIR}/i210_linux_avdecc.cmake \
-DCMAKE_NO_SYSTEM_FROM_IMPORTED=1 \
-DCMAKE_EXPORT_NO_PACKAGE_REGISTRY=ON \
${EXTRA_OECMAKE} \
-Wno-dev

}


do_compile:append() {
cd ${S}/daemons/shaper
oe_runmake CC="${CC}" CPPFLAGS="${CPPFLAGS}" LDFLAGS="${LDFLAGS}"

cd ${S}/lib/common
oe_runmake CC="${CC}" CPPFLAGS="${CPPFLAGS}" LDFLAGS="${LDFLAGS}" AVB_FEATURE_IGB=1 AVB_FEATURE_ATL=0

${CMAKE_VERBOSE} cmake --build "${WORKDIR}/build_avtp_pipe" --target all

${CMAKE_VERBOSE} cmake --build "${WORKDIR}/build_avdecc" --target all


}

do_install() {
${CMAKE_VERBOSE} cmake --build "${WORKDIR}/build_avtp_pipe" --target install

${CMAKE_VERBOSE} cmake --build "${WORKDIR}/build_avdecc" --target install
}


# MAKE_TARGETS = "kmod"

# EXTRA_OEMAKE = "--include-dir=${WORKDIR}/kmod"
2 changes: 1 addition & 1 deletion recipes-core/images/autoeth.bb
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ IMAGE_INSTALL = "\
python3-pip \
lan867x \
usbutils \
libusb \
libusb1 \
capicxx-someip-runtime \
${CORE_IMAGE_EXTRA_INSTALL} \
"
Expand Down
5 changes: 5 additions & 0 deletions recipes-test/cpputest/cpputest_%.bbappend
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
EXTRA_OECMAKE = "-DLONGLONG=ON \
-DC++11=ON \
-DTESTS=OFF \
-DEXTENSIONS=ON \
"

0 comments on commit a2f135f

Please sign in to comment.