linux下交叉编译licensecc

server/2024/9/23 19:24:04/

本文章只做个人笔记用

下载地址:

#https://github.com/open-license-manager/licensecc.git
#下面地址下不下来就是用第一个去官网下载git clone --recursive https://github.com/open-license-manager/licensecc.git

编译前准备3个库:openssl,lcc-license-generator ,zlib-1.3.1

这个库需要用到openssl的版本是1.0.0以上,因为版本太低里面的函数没有。编译这个库之前需要编译boost,之前写过编译boots。下载lcc-license-generator

https://github.com/open-license-manager/lcc-license-generator.git

1.默认openssl zlib库编译没问题。开始编译lcc-license-generator:指定安装路径;制定boost路径,指定交叉编译器路径

cd lcc-license-generator-develop/build
cmake .. -DCMAKE_INSTALL_PREFIX=../install -DCMAKE_TOOLCHAIN_FILE=/home/t113_tq.cmake -DBOOST_ROOT=/home/boost_1_78_0
make
make install

 编译结果如下,至此lcc-license-generator编译完成。

axx@axx:/home/code/axx/project_5g_unit/conference/thirdpart/lcc-license-generator-develop/build$ cmake .. -DCMAKE_INSTALL_PREFIX=../install -DCMAKE_TOOLCHAIN_FILE=/home/code/axx/project_5g_unit/conference/thirdpart/t113_tq.cmake -DBOOST_ROOT=/home/code/axx/project_5g_unit/conference/thirdpart/boost_1_78_0
-- Found openssl version 1.1.1 - generator
CMake Warning at /opt/cmake-3.18.0/share/cmake-3.18/Modules/FindBoost.cmake:1187 (message):New Boost version may have incorrect or missing dependencies and importedtargets
Call Stack (most recent call first):/opt/cmake-3.18.0/share/cmake-3.18/Modules/FindBoost.cmake:1311 (_Boost_COMPONENT_DEPENDENCIES)/opt/cmake-3.18.0/share/cmake-3.18/Modules/FindBoost.cmake:1919 (_Boost_MISSING_DEPENDENCIES)CMakeLists.txt:102 (find_package)CMake Warning at /opt/cmake-3.18.0/share/cmake-3.18/Modules/FindBoost.cmake:1187 (message):New Boost version may have incorrect or missing dependencies and importedtargets
Call Stack (most recent call first):/opt/cmake-3.18.0/share/cmake-3.18/Modules/FindBoost.cmake:1311 (_Boost_COMPONENT_DEPENDENCIES)/opt/cmake-3.18.0/share/cmake-3.18/Modules/FindBoost.cmake:1919 (_Boost_MISSING_DEPENDENCIES)CMakeLists.txt:102 (find_package)CMake Warning at /opt/cmake-3.18.0/share/cmake-3.18/Modules/FindBoost.cmake:1187 (message):New Boost version may have incorrect or missing dependencies and importedtargets
Call Stack (most recent call first):/opt/cmake-3.18.0/share/cmake-3.18/Modules/FindBoost.cmake:1311 (_Boost_COMPONENT_DEPENDENCIES)/opt/cmake-3.18.0/share/cmake-3.18/Modules/FindBoost.cmake:1919 (_Boost_MISSING_DEPENDENCIES)CMakeLists.txt:102 (find_package)CMake Warning at /opt/cmake-3.18.0/share/cmake-3.18/Modules/FindBoost.cmake:1187 (message):New Boost version may have incorrect or missing dependencies and importedtargets
Call Stack (most recent call first):/opt/cmake-3.18.0/share/cmake-3.18/Modules/FindBoost.cmake:1311 (_Boost_COMPONENT_DEPENDENCIES)/opt/cmake-3.18.0/share/cmake-3.18/Modules/FindBoost.cmake:1919 (_Boost_MISSING_DEPENDENCIES)CMakeLists.txt:102 (find_package)CMake Warning at /opt/cmake-3.18.0/share/cmake-3.18/Modules/FindBoost.cmake:1187 (message):New Boost version may have incorrect or missing dependencies and importedtargets
Call Stack (most recent call first):/opt/cmake-3.18.0/share/cmake-3.18/Modules/FindBoost.cmake:1311 (_Boost_COMPONENT_DEPENDENCIES)/opt/cmake-3.18.0/share/cmake-3.18/Modules/FindBoost.cmake:1919 (_Boost_MISSING_DEPENDENCIES)CMakeLists.txt:102 (find_package)-- CXX compiler              : /usr/bin/c++
-- CXX compiler flags        : 
-- CXX compiler flags debug  : -g
-- CXX compiler flags release: -O3 -DNDEBUG
-- Install prefix            : /home/code/lixd/project_5g_unit/conference/thirdpart/lcc-license-generator-develop/install
-- External libs             : -lpthread
-- Exporting current build directory
CMake Warning at src/license_generator/CMakeLists.txt:36 (export):Cannot create package registry file:/home/swan/.cmake/packages/lccgen/0a279ca82ac3ae27827040e8592103adNo such file or directory-- Configuring done
-- Generating done
-- Build files have been written to: /home/code/axx/project_5g_unit/conference/thirdpart/lcc-license-generator-develop/build

 2.编译licensecc

cd licensecc
rm -rf ./build
mkdir build
cd buildMyDIR="/home/code/axx/lib"echo "Enter a number between 1 and 2 to select Compilation toolchain"
echo " 1 :gcc "
case $num in1) echo "You entered 1"  cmake \.. \-DCMAKE_TOOLCHAIN_FILE=../t113_tq.cmake \-DCMAKE_INSTALL_PREFIX=$MyDIR/build_t113 \-DBOOST_ROOT=/home/code/axx/project_5g_unit/conference/thirdpart/boost_1_78_0 \;; *)echo "Invalid number";;
esac 
make 
make install

 在使用 CMake 配置 Licensecc 时,可以通过 -DLCC_PROJECT_NAME=<YourProjectName> 指定你的项目名称。这将创建一个以项目名称命名的文件夹,在 licensecc/projects/ 目录下,并包含项目的私钥和公钥

 

 t113_tq.cmake 内容如下:

set (CMAKE_CXX_STANDARD 11)
set (CMAKE_CXX_STANDARD_REQUIRED True)
SET (CMAKE_SYSTEM_NAME Linux)
SET (CMAKE_SYSTEM_PROCESSOR arm)
SET (CMAKE_SYSTEM_VERSION 1)  
SET (CMAKE_C_FLAGS "-I/home/sdk/t113_tq/TQT113_linux_V2.0/out/toolchain/gcc-linaro-5.3.1-2016.05-x86_64_arm-linux-gnueabi/arm-linux-gnueabi/libc/usr/include")
SET (CMAKE_C_COMPILER /home/sdk/t113_tq/TQT113_linux_V2.0/out/toolchain/gcc-linaro-5.3.1-2016.05-x86_64_arm-linux-gnueabi/bin/arm-linux-gnueabi-gcc)
SET (CMAKE_CXX_COMPILER /home/sdk/t113_tq/TQT113_linux_V2.0/out/toolchain/gcc-linaro-5.3.1-2016.05-x86_64_arm-linux-gnueabi/bin/arm-linux-gnueabi-g++)
SET (CMAKE_FIND_ROOT_PATH /home/sdk/t113_tq/TQT113_linux_V2.0/out/toolchain/gcc-linaro-5.3.1-2016.05-x86_64_arm-linux-gnueabi)
SET (STAGING_DIR /home/sdk/t113_tq/TQT113_linux_V2.0/out/toolchain/gcc-linaro-5.3.1-2016.05-x86_64_arm-linux-gnueabi/bin)SET (OPENSSL_ROOT_DIR /home/code/axx/project_5g_unit/conference/lib/build_t113)
SET (OPENSSL_CRYPTO_LIBRARY /home/code/axx/project_5g_unit/conference/lib/build_t113/lib)
SET (OPENSSL_INCLUDE_DIR /home/code/axx/project_5g_unit/conference/lib/build_t113/include)
SET (OPENSSL_SSL_LIBRARY /home/code/axx/project_5g_unit/conference/lib/build_t113/lib)#using for licensecc
include_directories(/home/sdk/t113_tq/TQT113_linux_V2.0/out/t113/evb1_auto/buildroot/buildroot/host/arm-buildroot-linux-gnueabi/sysroot/usr/include)
SET (ZLIB_LIBRARY /home/code/axx/project_5g_unit/conference/lib/build_t113/lib)
SET (ZLIB_INCLUDE_DIR /home/code/axx/project_5g_unit/conference/lib/build_t113/include)SET (lccgen_DIR /home/code/axx/project_5g_unit/conference/thirdpart/lcc-license-generator-develop/build)
SET (Boost_INCLUDE_DIR /home/code/axx/project_5g_unit/conference/thirdpart/boost_1_78_0/install/include)
SET (Boost_LIBRARY /home/code/axx/project_5g_unit/conference/thirdpart/boost_1_78_0/install/lib)#using for licensecc

执行2的编译脚本即可完成编译。


http://www.ppmy.cn/server/94094.html

相关文章

QT多媒体编程(一)——音频编程知识详解及MP3音频播放器Demo

目录 引言 一、QtMultimedia模块简介 主要类和功能 二、QtMultimedia相关类及函数解析 QAudioInput QAudioOutput QAudioFormat QMediaPlayer QMediaPlaylist QCamera 三、音频项目实战Demo UI界面 核心代码 运行结果 四、结论 引言 在数字时代&#xff0c;音频…

普元Devops学习笔记-devops对接jenkins提示crumb不可用问题

前言 普元devops需要对接jenkins&#xff0c;对接jenkins后&#xff0c;devops会调用jenkins的提供的API。 问题 新版本的jenkins提供跨域保护&#xff0c;即大名鼎鼎的CSRF问题。 因此&#xff0c;普元devops调用jenkins的时候&#xff0c;会出现跨域问题。 后台报错信息如…

学会这个Python库,接口测试so easy

前言 我们在做接口测试时&#xff0c;大多数返回的都是json属性&#xff0c;我们需要通过接口返回的json提取出来对应的值&#xff0c;然后进行做断言或者提取想要的值供下一个接口进行使用。 但是如果返回的json数据嵌套了很多层&#xff0c;通过查找需要的词&#xff0c;就…

精选3款国内wordpress 主题,建站首选

WordPress作为一款功能强大且易于使用的建站平台&#xff0c;已经成为了许多企业和个人搭建网站的首选。为了帮助大家更好地选择适合自己的WordPress主题&#xff0c;小编将为大家推荐三款国内优秀的WordPress主题&#xff1a;子比主题、OneNav主题和RiTheme主题。 1.子比主题…

VUE框架面试整理-组件

在Vue.js中,组件是构建应用的基本单元。组件可以复用、嵌套和管理自己的状态,使得开发大型应用变得更加简单和结构化。以下是关于Vue组件的一些核心概念和用法: 创建和注册组件 全局注册 全局注册的组件可以在任何地方使用。 Vue.component(

最新小猫咪PHP加密系统源码V1.4_本地API接口_带后台

简介&#xff1a; 最新小猫咪PHP加密系统源码V1.4_完全本地化加密API接口_带后台 小猫咪PHP加密系统历时半年&#xff0c;它再一次迎来更新&#xff0c;更新加密算法&#xff08;这应该是最后一次更新加密算法了&#xff0c;以后主要更新都在框架功能上面了&#xff09;&…

C语言 ——— 学习、使用 strcat函数 并模拟实现

目录 学习strcat函数​编辑 使用strcat函数​编辑 模拟实现strcat函数 学习strcat函数 strcat函数所需要的头文件&#xff1a; #include<string.h> strcat函数的参数解析&#xff1a; 将 source 字符串追加到 destination 字符串。destination 中的字符串结束标志…

【环境】Rocky8使用gvm配置Go多版本管理的微服务开发环境(go-zero)

【环境】Rocky8使用gvm配置Go多版本管理的微服务开发环境&#xff08;go-zero&#xff09; 文章目录 1、Rocky8介绍2、Go与GoLand安装3、Go多版本管理&#xff08;gvm&#xff09;4、go微服务框架介绍&#xff08;含rpc测试工具&#xff0c;proto协议介绍&#xff09;5、go-zer…