Skip to content
View CROSS2OH's full-sized avatar

Block or report CROSS2OH

Block user

Prevent this user from interacting with your repositories and sending you notifications. Learn more about blocking users.

You must be logged in to block users.

Maximum 250 characters. Please don’t include any personal information such as legal names or email addresses. Markdown is supported. This note will only be visible to you.
Report abuse

Contact GitHub support about this user’s behavior. Learn more about reporting abuse.

Report abuse
CROSS2OH/README.md

CROSS2OH

CROSS2OH,an automated technique for porting Linux-based software to OpenHarmony.

Run CROSS2OH

  • Step 1

This tool runs in a Linux environment and requires prior configuration of the OHOS SDK and downloading the Lycium cross-compilation tool.

git clone https://gitcode.com/openharmony-sig/tpc_c_cplusplus.git
  • Step 2

Download and configure CROSS2OH's dependencies

//The list of dependencies for CROSS2OH
mysql
CTags
curl
cmake
gcc, cmake, make, pkg-config, autoconf, autoreconf, automake
...(toolchains)
//eg:
sudo apt install cmake

Note: The installation path of CTags must be explicitly recorded, as CROSS2OH requires this path to be configured for proper functionality during tool execution.

  • Step 3

We provided a config.yaml template file.Define the values of the following variables in config.yaml,then place the config.yaml file in the same directory as the jar.

    // The output path for detected CPI issues.
    RESULTPATH : "aa/bb/cc";
    // The tpc_c_cplusplus/thirdparty directory serves as the execution path for the cross-compilation process.
    THIRDPARTY_PATH : "aa/bb/cc/tpc_c_cplusplus/thirdparty";
    // The installation directory of the Lycium repository.
    PATH : "aa/bb/cc/tpc_c_cplusplus";
    // OHOS_SDK_PATH
    OHOS_SDK_PATH : "aa/bb/cc/ohos_sdk_your_version/linux";
    // The path to Lycium’s core execution script build.sh.
    SCRIPT_PATH : "aa/bb/cc/tpc_c_cplusplus/lycium/build.sh";
    // The path of CTags
    CTAGS_PATH : "aa/bb/cc/ctags-your_version/ctags";
    // The output path to generate CTags tag file.
    CTAGS_OUTPUTFILEPATH : "aa/bb/cc/dd";
    // The path for copying source files during patch generation.
    TEMPDIRECTORYPATH : "aa/bb/cc/ee";
  • Step 4

Provide one or more download links to GitHub-hosted C/C++ libraries with specified version tags.

//example
//https://github.com/zsummer/log4z/archive/refs/tags/v3.4.0.zip
  • Step 5

Run.
Note : At least two parameters need to be specified when running: The first parameter is the path to the config.yaml file, which sets up some necessary addresses. The second and subsequent arguments are the github download link for the c/ C ++ project to be ported.

java -jar CROSS2OH-SNAPSHOT-obfuscated.jar  /your/path/config.yaml  https://github.com/zsummer/log4z/archive/refs/tags/v3.4.0.zip

Finally, CROSS2OH downloads the provided compressed package, completes the detection of CPI issues, applies fixes to the identified problems, and generates corresponding *.patch files, which are stored in the configured THIRDPARTY_PATH.

Popular repositories Loading

  1. CROSS2OH CROSS2OH Public

    CROSS2OH,an automated technique for porting Linux-based software to OpenHarmony.

    1

  2. CROSS2OH.github.io CROSS2OH.github.io Public

    Introduce the CROSS2OH tool and how to use it

    HTML