diff --git a/android/CMakeLists.txt b/android/CMakeLists.txt new file mode 100644 index 0000000..d7d7e0c --- /dev/null +++ b/android/CMakeLists.txt @@ -0,0 +1,58 @@ +cmake_minimum_required(VERSION 3.18.1) +project(gmssljni) + +# GmSSL paths - these will be set by the build script +# GMSSL_SOURCE_DIR: path to GmSSL source (for headers) +# GMSSL_LIB_DIR: path to the prebuilt libgmssl.a for current ABI + +if(NOT DEFINED GMSSL_SOURCE_DIR) + set(GMSSL_SOURCE_DIR "${CMAKE_CURRENT_SOURCE_DIR}/../../GmSSL") +endif() + +if(NOT DEFINED GMSSL_LIB_DIR) + if(ANDROID_ABI STREQUAL "arm64-v8a") + set(GMSSL_LIB_DIR "${GMSSL_SOURCE_DIR}/build-android-arm64/bin") + elseif(ANDROID_ABI STREQUAL "armeabi-v7a") + set(GMSSL_LIB_DIR "${GMSSL_SOURCE_DIR}/build-android-arm/bin") + else() + message(FATAL_ERROR "Unsupported ANDROID_ABI: ${ANDROID_ABI}") + endif() +endif() + +message(STATUS "GMSSL_SOURCE_DIR: ${GMSSL_SOURCE_DIR}") +message(STATUS "GMSSL_LIB_DIR: ${GMSSL_LIB_DIR}") +message(STATUS "ANDROID_ABI: ${ANDROID_ABI}") + +# Import GmSSL static library +add_library(gmssl STATIC IMPORTED) +set_target_properties(gmssl PROPERTIES + IMPORTED_LOCATION "${GMSSL_LIB_DIR}/libgmssl.a" +) + +# JNI source file +set(JNI_SOURCE_DIR "${CMAKE_CURRENT_SOURCE_DIR}/../src/main/c") + +# Create the shared library +add_library(gmssljni SHARED + ${JNI_SOURCE_DIR}/gmssljni.c +) + +# Include directories +target_include_directories(gmssljni PRIVATE + ${GMSSL_SOURCE_DIR}/include + ${JNI_SOURCE_DIR} +) + +# Link libraries +target_link_libraries(gmssljni + gmssl + log # Android log library +) + +# Compiler flags +target_compile_options(gmssljni PRIVATE + -Wall + -Wextra + -O2 + -fPIC +) diff --git a/android/build-jni-arm64-v8a/CMakeCache.txt b/android/build-jni-arm64-v8a/CMakeCache.txt new file mode 100644 index 0000000..9d0d73f --- /dev/null +++ b/android/build-jni-arm64-v8a/CMakeCache.txt @@ -0,0 +1,386 @@ +# This is the CMakeCache file. +# For build in directory: /Users/yichao.wu/deepctrl/GmSSL-Java/android/build-jni-arm64-v8a +# It was generated by CMake: /usr/local/Cellar/cmake/3.19.1/bin/cmake +# You can edit this file to change values found and used by cmake. +# If you do not want to change any of the values, simply exit the editor. +# If you do want to change a value, simply edit, save, and exit the editor. +# The syntax for the file is as follows: +# KEY:TYPE=VALUE +# KEY is the name of a variable in the cache. +# TYPE is a hint to GUIs for the type of VALUE, DO NOT EDIT TYPE!. +# VALUE is the current value for the KEY. + +######################## +# EXTERNAL cache entries +######################## + +//No help, variable specified on the command line. +ANDROID_ABI:UNINITIALIZED=arm64-v8a + +//No help, variable specified on the command line. +ANDROID_PLATFORM:UNINITIALIZED=android-21 + +//Path to a program. +CMAKE_ADDR2LINE:FILEPATH=/Users/yichao.wu/Library/Android/sdk/ndk/27.1.12297006/toolchains/llvm/prebuilt/darwin-x86_64/bin/llvm-addr2line + +//Archiver +CMAKE_AR:FILEPATH=/Users/yichao.wu/Library/Android/sdk/ndk/27.1.12297006/toolchains/llvm/prebuilt/darwin-x86_64/bin/llvm-ar + +//Flags used by the compiler during all build types. +CMAKE_ASM_FLAGS:STRING= + +//Flags used by the compiler during debug builds. +CMAKE_ASM_FLAGS_DEBUG:STRING= + +//Flags used by the compiler during release builds. +CMAKE_ASM_FLAGS_RELEASE:STRING= + +//Choose the type of build, options are: None Debug Release RelWithDebInfo +// MinSizeRel ... +CMAKE_BUILD_TYPE:STRING=Release + +//Enable/Disable color output during build. +CMAKE_COLOR_MAKEFILE:BOOL=ON + +//LLVM archiver +CMAKE_CXX_COMPILER_AR:FILEPATH=CMAKE_CXX_COMPILER_AR-NOTFOUND + +//Generate index for LLVM archive +CMAKE_CXX_COMPILER_RANLIB:FILEPATH=CMAKE_CXX_COMPILER_RANLIB-NOTFOUND + +//Flags used by the compiler during all build types. +CMAKE_CXX_FLAGS:STRING= + +//Flags used by the compiler during debug builds. +CMAKE_CXX_FLAGS_DEBUG:STRING= + +//Flags used by the CXX compiler during MINSIZEREL builds. +CMAKE_CXX_FLAGS_MINSIZEREL:STRING=-Os -DNDEBUG + +//Flags used by the compiler during release builds. +CMAKE_CXX_FLAGS_RELEASE:STRING= + +//Flags used by the CXX compiler during RELWITHDEBINFO builds. +CMAKE_CXX_FLAGS_RELWITHDEBINFO:STRING=-O2 -g -DNDEBUG + +//Libraries linked by default with all C++ applications. +CMAKE_CXX_STANDARD_LIBRARIES:STRING=-latomic -lm + +//LLVM archiver +CMAKE_C_COMPILER_AR:FILEPATH=CMAKE_C_COMPILER_AR-NOTFOUND + +//Generate index for LLVM archive +CMAKE_C_COMPILER_RANLIB:FILEPATH=CMAKE_C_COMPILER_RANLIB-NOTFOUND + +//Flags used by the compiler during all build types. +CMAKE_C_FLAGS:STRING= + +//Flags used by the compiler during debug builds. +CMAKE_C_FLAGS_DEBUG:STRING= + +//Flags used by the C compiler during MINSIZEREL builds. +CMAKE_C_FLAGS_MINSIZEREL:STRING=-Os -DNDEBUG + +//Flags used by the compiler during release builds. +CMAKE_C_FLAGS_RELEASE:STRING= + +//Flags used by the C compiler during RELWITHDEBINFO builds. +CMAKE_C_FLAGS_RELWITHDEBINFO:STRING=-O2 -g -DNDEBUG + +//Libraries linked by default with all C applications. +CMAKE_C_STANDARD_LIBRARIES:STRING=-latomic -lm + +//Path to a program. +CMAKE_DLLTOOL:FILEPATH=/Users/yichao.wu/Library/Android/sdk/ndk/27.1.12297006/toolchains/llvm/prebuilt/darwin-x86_64/bin/llvm-dlltool + +//Flags used by the linker. +CMAKE_EXE_LINKER_FLAGS:STRING= + +//Flags used by the linker during DEBUG builds. +CMAKE_EXE_LINKER_FLAGS_DEBUG:STRING= + +//Flags used by the linker during MINSIZEREL builds. +CMAKE_EXE_LINKER_FLAGS_MINSIZEREL:STRING= + +//Flags used by the linker during RELEASE builds. +CMAKE_EXE_LINKER_FLAGS_RELEASE:STRING= + +//Flags used by the linker during RELWITHDEBINFO builds. +CMAKE_EXE_LINKER_FLAGS_RELWITHDEBINFO:STRING= + +//Enable/Disable output of compile commands during generation. +CMAKE_EXPORT_COMPILE_COMMANDS:BOOL= + +//Install path prefix, prepended onto install directories. +CMAKE_INSTALL_PREFIX:PATH=/usr/local + +//Path to a program. +CMAKE_LINKER:FILEPATH=/Users/yichao.wu/Library/Android/sdk/ndk/27.1.12297006/toolchains/llvm/prebuilt/darwin-x86_64/bin/ld.lld + +//Path to a program. +CMAKE_MAKE_PROGRAM:FILEPATH=/usr/bin/make + +//Flags used by the linker during the creation of modules. +CMAKE_MODULE_LINKER_FLAGS:STRING= + +//Flags used by the linker during the creation of modules during +// DEBUG builds. +CMAKE_MODULE_LINKER_FLAGS_DEBUG:STRING= + +//Flags used by the linker during the creation of modules during +// MINSIZEREL builds. +CMAKE_MODULE_LINKER_FLAGS_MINSIZEREL:STRING= + +//Flags used by the linker during the creation of modules during +// RELEASE builds. +CMAKE_MODULE_LINKER_FLAGS_RELEASE:STRING= + +//Flags used by the linker during the creation of modules during +// RELWITHDEBINFO builds. +CMAKE_MODULE_LINKER_FLAGS_RELWITHDEBINFO:STRING= + +//Path to a program. +CMAKE_NM:FILEPATH=/Users/yichao.wu/Library/Android/sdk/ndk/27.1.12297006/toolchains/llvm/prebuilt/darwin-x86_64/bin/llvm-nm + +//Path to a program. +CMAKE_OBJCOPY:FILEPATH=/Users/yichao.wu/Library/Android/sdk/ndk/27.1.12297006/toolchains/llvm/prebuilt/darwin-x86_64/bin/llvm-objcopy + +//Path to a program. +CMAKE_OBJDUMP:FILEPATH=/Users/yichao.wu/Library/Android/sdk/ndk/27.1.12297006/toolchains/llvm/prebuilt/darwin-x86_64/bin/llvm-objdump + +//Value Computed by CMake +CMAKE_PROJECT_DESCRIPTION:STATIC= + +//Value Computed by CMake +CMAKE_PROJECT_HOMEPAGE_URL:STATIC= + +//Value Computed by CMake +CMAKE_PROJECT_NAME:STATIC=gmssljni + +//Ranlib +CMAKE_RANLIB:FILEPATH=/Users/yichao.wu/Library/Android/sdk/ndk/27.1.12297006/toolchains/llvm/prebuilt/darwin-x86_64/bin/llvm-ranlib + +//Path to a program. +CMAKE_READELF:FILEPATH=/Users/yichao.wu/Library/Android/sdk/ndk/27.1.12297006/toolchains/llvm/prebuilt/darwin-x86_64/bin/llvm-readelf + +//Flags used by the linker during the creation of dll's. +CMAKE_SHARED_LINKER_FLAGS:STRING= + +//Flags used by the linker during the creation of shared libraries +// during DEBUG builds. +CMAKE_SHARED_LINKER_FLAGS_DEBUG:STRING= + +//Flags used by the linker during the creation of shared libraries +// during MINSIZEREL builds. +CMAKE_SHARED_LINKER_FLAGS_MINSIZEREL:STRING= + +//Flags used by the linker during the creation of shared libraries +// during RELEASE builds. +CMAKE_SHARED_LINKER_FLAGS_RELEASE:STRING= + +//Flags used by the linker during the creation of shared libraries +// during RELWITHDEBINFO builds. +CMAKE_SHARED_LINKER_FLAGS_RELWITHDEBINFO:STRING= + +//If set, runtime paths are not added when installing shared libraries, +// but are added when building. +CMAKE_SKIP_INSTALL_RPATH:BOOL=NO + +//If set, runtime paths are not added when using shared libraries. +CMAKE_SKIP_RPATH:BOOL=NO + +//Flags used by the linker during the creation of static libraries +// during all build types. +CMAKE_STATIC_LINKER_FLAGS:STRING= + +//Flags used by the linker during the creation of static libraries +// during DEBUG builds. +CMAKE_STATIC_LINKER_FLAGS_DEBUG:STRING= + +//Flags used by the linker during the creation of static libraries +// during MINSIZEREL builds. +CMAKE_STATIC_LINKER_FLAGS_MINSIZEREL:STRING= + +//Flags used by the linker during the creation of static libraries +// during RELEASE builds. +CMAKE_STATIC_LINKER_FLAGS_RELEASE:STRING= + +//Flags used by the linker during the creation of static libraries +// during RELWITHDEBINFO builds. +CMAKE_STATIC_LINKER_FLAGS_RELWITHDEBINFO:STRING= + +//Strip +CMAKE_STRIP:FILEPATH=/Users/yichao.wu/Library/Android/sdk/ndk/27.1.12297006/toolchains/llvm/prebuilt/darwin-x86_64/bin/llvm-strip + +//The CMake toolchain file +CMAKE_TOOLCHAIN_FILE:FILEPATH=/Users/yichao.wu/Library/Android/sdk/ndk/27.1.12297006/build/cmake/android.toolchain.cmake + +//If this value is on, makefiles will be generated without the +// .SILENT directive, and all commands will be echoed to the console +// during the make. This is useful for debugging only. With Visual +// Studio IDE projects all commands are done without /nologo. +CMAKE_VERBOSE_MAKEFILE:BOOL=FALSE + +//No help, variable specified on the command line. +GMSSL_LIB_DIR:UNINITIALIZED=/Users/yichao.wu/deepctrl/GmSSL-Java/../GmSSL/build-android-arm64/bin + +//No help, variable specified on the command line. +GMSSL_SOURCE_DIR:UNINITIALIZED=/Users/yichao.wu/deepctrl/GmSSL-Java/../GmSSL + +//Value Computed by CMake +gmssljni_BINARY_DIR:STATIC=/Users/yichao.wu/deepctrl/GmSSL-Java/android/build-jni-arm64-v8a + +//Value Computed by CMake +gmssljni_SOURCE_DIR:STATIC=/Users/yichao.wu/deepctrl/GmSSL-Java/android + + +######################## +# INTERNAL cache entries +######################## + +//ADVANCED property for variable: CMAKE_ADDR2LINE +CMAKE_ADDR2LINE-ADVANCED:INTERNAL=1 +//ADVANCED property for variable: CMAKE_AR +CMAKE_AR-ADVANCED:INTERNAL=1 +//This is the directory where this CMakeCache.txt was created +CMAKE_CACHEFILE_DIR:INTERNAL=/Users/yichao.wu/deepctrl/GmSSL-Java/android/build-jni-arm64-v8a +//Major version of cmake used to create the current loaded cache +CMAKE_CACHE_MAJOR_VERSION:INTERNAL=3 +//Minor version of cmake used to create the current loaded cache +CMAKE_CACHE_MINOR_VERSION:INTERNAL=19 +//Patch version of cmake used to create the current loaded cache +CMAKE_CACHE_PATCH_VERSION:INTERNAL=1 +//ADVANCED property for variable: CMAKE_COLOR_MAKEFILE +CMAKE_COLOR_MAKEFILE-ADVANCED:INTERNAL=1 +//Path to CMake executable. +CMAKE_COMMAND:INTERNAL=/usr/local/Cellar/cmake/3.19.1/bin/cmake +//Path to cpack program executable. +CMAKE_CPACK_COMMAND:INTERNAL=/usr/local/Cellar/cmake/3.19.1/bin/cpack +//Path to ctest program executable. +CMAKE_CTEST_COMMAND:INTERNAL=/usr/local/Cellar/cmake/3.19.1/bin/ctest +//ADVANCED property for variable: CMAKE_CXX_COMPILER_AR +CMAKE_CXX_COMPILER_AR-ADVANCED:INTERNAL=1 +//ADVANCED property for variable: CMAKE_CXX_COMPILER_RANLIB +CMAKE_CXX_COMPILER_RANLIB-ADVANCED:INTERNAL=1 +//ADVANCED property for variable: CMAKE_CXX_FLAGS +CMAKE_CXX_FLAGS-ADVANCED:INTERNAL=1 +//ADVANCED property for variable: CMAKE_CXX_FLAGS_DEBUG +CMAKE_CXX_FLAGS_DEBUG-ADVANCED:INTERNAL=1 +//ADVANCED property for variable: CMAKE_CXX_FLAGS_MINSIZEREL +CMAKE_CXX_FLAGS_MINSIZEREL-ADVANCED:INTERNAL=1 +//ADVANCED property for variable: CMAKE_CXX_FLAGS_RELEASE +CMAKE_CXX_FLAGS_RELEASE-ADVANCED:INTERNAL=1 +//ADVANCED property for variable: CMAKE_CXX_FLAGS_RELWITHDEBINFO +CMAKE_CXX_FLAGS_RELWITHDEBINFO-ADVANCED:INTERNAL=1 +//ADVANCED property for variable: CMAKE_CXX_STANDARD_LIBRARIES +CMAKE_CXX_STANDARD_LIBRARIES-ADVANCED:INTERNAL=1 +//ADVANCED property for variable: CMAKE_C_COMPILER_AR +CMAKE_C_COMPILER_AR-ADVANCED:INTERNAL=1 +//ADVANCED property for variable: CMAKE_C_COMPILER_RANLIB +CMAKE_C_COMPILER_RANLIB-ADVANCED:INTERNAL=1 +//ADVANCED property for variable: CMAKE_C_FLAGS +CMAKE_C_FLAGS-ADVANCED:INTERNAL=1 +//ADVANCED property for variable: CMAKE_C_FLAGS_DEBUG +CMAKE_C_FLAGS_DEBUG-ADVANCED:INTERNAL=1 +//ADVANCED property for variable: CMAKE_C_FLAGS_MINSIZEREL +CMAKE_C_FLAGS_MINSIZEREL-ADVANCED:INTERNAL=1 +//ADVANCED property for variable: CMAKE_C_FLAGS_RELEASE +CMAKE_C_FLAGS_RELEASE-ADVANCED:INTERNAL=1 +//ADVANCED property for variable: CMAKE_C_FLAGS_RELWITHDEBINFO +CMAKE_C_FLAGS_RELWITHDEBINFO-ADVANCED:INTERNAL=1 +//ADVANCED property for variable: CMAKE_C_STANDARD_LIBRARIES +CMAKE_C_STANDARD_LIBRARIES-ADVANCED:INTERNAL=1 +//ADVANCED property for variable: CMAKE_DLLTOOL +CMAKE_DLLTOOL-ADVANCED:INTERNAL=1 +//Path to cache edit program executable. +CMAKE_EDIT_COMMAND:INTERNAL=/usr/local/Cellar/cmake/3.19.1/bin/ccmake +//Executable file format +CMAKE_EXECUTABLE_FORMAT:INTERNAL=ELF +//ADVANCED property for variable: CMAKE_EXE_LINKER_FLAGS +CMAKE_EXE_LINKER_FLAGS-ADVANCED:INTERNAL=1 +//ADVANCED property for variable: CMAKE_EXE_LINKER_FLAGS_DEBUG +CMAKE_EXE_LINKER_FLAGS_DEBUG-ADVANCED:INTERNAL=1 +//ADVANCED property for variable: CMAKE_EXE_LINKER_FLAGS_MINSIZEREL +CMAKE_EXE_LINKER_FLAGS_MINSIZEREL-ADVANCED:INTERNAL=1 +//ADVANCED property for variable: CMAKE_EXE_LINKER_FLAGS_RELEASE +CMAKE_EXE_LINKER_FLAGS_RELEASE-ADVANCED:INTERNAL=1 +//ADVANCED property for variable: CMAKE_EXE_LINKER_FLAGS_RELWITHDEBINFO +CMAKE_EXE_LINKER_FLAGS_RELWITHDEBINFO-ADVANCED:INTERNAL=1 +//ADVANCED property for variable: CMAKE_EXPORT_COMPILE_COMMANDS +CMAKE_EXPORT_COMPILE_COMMANDS-ADVANCED:INTERNAL=1 +//Name of external makefile project generator. +CMAKE_EXTRA_GENERATOR:INTERNAL= +//Name of generator. +CMAKE_GENERATOR:INTERNAL=Unix Makefiles +//Generator instance identifier. +CMAKE_GENERATOR_INSTANCE:INTERNAL= +//Name of generator platform. +CMAKE_GENERATOR_PLATFORM:INTERNAL= +//Name of generator toolset. +CMAKE_GENERATOR_TOOLSET:INTERNAL= +//Source directory with the top level CMakeLists.txt file for this +// project +CMAKE_HOME_DIRECTORY:INTERNAL=/Users/yichao.wu/deepctrl/GmSSL-Java/android +//Install .so files without execute permission. +CMAKE_INSTALL_SO_NO_EXE:INTERNAL=0 +//ADVANCED property for variable: CMAKE_LINKER +CMAKE_LINKER-ADVANCED:INTERNAL=1 +//ADVANCED property for variable: CMAKE_MAKE_PROGRAM +CMAKE_MAKE_PROGRAM-ADVANCED:INTERNAL=1 +//ADVANCED property for variable: CMAKE_MODULE_LINKER_FLAGS +CMAKE_MODULE_LINKER_FLAGS-ADVANCED:INTERNAL=1 +//ADVANCED property for variable: CMAKE_MODULE_LINKER_FLAGS_DEBUG +CMAKE_MODULE_LINKER_FLAGS_DEBUG-ADVANCED:INTERNAL=1 +//ADVANCED property for variable: CMAKE_MODULE_LINKER_FLAGS_MINSIZEREL +CMAKE_MODULE_LINKER_FLAGS_MINSIZEREL-ADVANCED:INTERNAL=1 +//ADVANCED property for variable: CMAKE_MODULE_LINKER_FLAGS_RELEASE +CMAKE_MODULE_LINKER_FLAGS_RELEASE-ADVANCED:INTERNAL=1 +//ADVANCED property for variable: CMAKE_MODULE_LINKER_FLAGS_RELWITHDEBINFO +CMAKE_MODULE_LINKER_FLAGS_RELWITHDEBINFO-ADVANCED:INTERNAL=1 +//ADVANCED property for variable: CMAKE_NM +CMAKE_NM-ADVANCED:INTERNAL=1 +//number of local generators +CMAKE_NUMBER_OF_MAKEFILES:INTERNAL=1 +//ADVANCED property for variable: CMAKE_OBJCOPY +CMAKE_OBJCOPY-ADVANCED:INTERNAL=1 +//ADVANCED property for variable: CMAKE_OBJDUMP +CMAKE_OBJDUMP-ADVANCED:INTERNAL=1 +//Platform information initialized +CMAKE_PLATFORM_INFO_INITIALIZED:INTERNAL=1 +//ADVANCED property for variable: CMAKE_RANLIB +CMAKE_RANLIB-ADVANCED:INTERNAL=1 +//ADVANCED property for variable: CMAKE_READELF +CMAKE_READELF-ADVANCED:INTERNAL=1 +//Path to CMake installation. +CMAKE_ROOT:INTERNAL=/usr/local/Cellar/cmake/3.19.1/share/cmake +//ADVANCED property for variable: CMAKE_SHARED_LINKER_FLAGS +CMAKE_SHARED_LINKER_FLAGS-ADVANCED:INTERNAL=1 +//ADVANCED property for variable: CMAKE_SHARED_LINKER_FLAGS_DEBUG +CMAKE_SHARED_LINKER_FLAGS_DEBUG-ADVANCED:INTERNAL=1 +//ADVANCED property for variable: CMAKE_SHARED_LINKER_FLAGS_MINSIZEREL +CMAKE_SHARED_LINKER_FLAGS_MINSIZEREL-ADVANCED:INTERNAL=1 +//ADVANCED property for variable: CMAKE_SHARED_LINKER_FLAGS_RELEASE +CMAKE_SHARED_LINKER_FLAGS_RELEASE-ADVANCED:INTERNAL=1 +//ADVANCED property for variable: CMAKE_SHARED_LINKER_FLAGS_RELWITHDEBINFO +CMAKE_SHARED_LINKER_FLAGS_RELWITHDEBINFO-ADVANCED:INTERNAL=1 +//ADVANCED property for variable: CMAKE_SKIP_INSTALL_RPATH +CMAKE_SKIP_INSTALL_RPATH-ADVANCED:INTERNAL=1 +//ADVANCED property for variable: CMAKE_SKIP_RPATH +CMAKE_SKIP_RPATH-ADVANCED:INTERNAL=1 +//ADVANCED property for variable: CMAKE_STATIC_LINKER_FLAGS +CMAKE_STATIC_LINKER_FLAGS-ADVANCED:INTERNAL=1 +//ADVANCED property for variable: CMAKE_STATIC_LINKER_FLAGS_DEBUG +CMAKE_STATIC_LINKER_FLAGS_DEBUG-ADVANCED:INTERNAL=1 +//ADVANCED property for variable: CMAKE_STATIC_LINKER_FLAGS_MINSIZEREL +CMAKE_STATIC_LINKER_FLAGS_MINSIZEREL-ADVANCED:INTERNAL=1 +//ADVANCED property for variable: CMAKE_STATIC_LINKER_FLAGS_RELEASE +CMAKE_STATIC_LINKER_FLAGS_RELEASE-ADVANCED:INTERNAL=1 +//ADVANCED property for variable: CMAKE_STATIC_LINKER_FLAGS_RELWITHDEBINFO +CMAKE_STATIC_LINKER_FLAGS_RELWITHDEBINFO-ADVANCED:INTERNAL=1 +//ADVANCED property for variable: CMAKE_STRIP +CMAKE_STRIP-ADVANCED:INTERNAL=1 +//uname command +CMAKE_UNAME:INTERNAL=/usr/bin/uname +//ADVANCED property for variable: CMAKE_VERBOSE_MAKEFILE +CMAKE_VERBOSE_MAKEFILE-ADVANCED:INTERNAL=1 + diff --git a/android/build-jni-arm64-v8a/CMakeFiles/3.19.1/CMakeCCompiler.cmake b/android/build-jni-arm64-v8a/CMakeFiles/3.19.1/CMakeCCompiler.cmake new file mode 100644 index 0000000..2552cba --- /dev/null +++ b/android/build-jni-arm64-v8a/CMakeFiles/3.19.1/CMakeCCompiler.cmake @@ -0,0 +1,77 @@ +set(CMAKE_C_COMPILER "/Users/yichao.wu/Library/Android/sdk/ndk/27.1.12297006/toolchains/llvm/prebuilt/darwin-x86_64/bin/clang") +set(CMAKE_C_COMPILER_ARG1 "") +set(CMAKE_C_COMPILER_ID "Clang") +set(CMAKE_C_COMPILER_VERSION "18.0.2") +set(CMAKE_C_COMPILER_VERSION_INTERNAL "") +set(CMAKE_C_COMPILER_WRAPPER "") +set(CMAKE_C_STANDARD_COMPUTED_DEFAULT "11") +set(CMAKE_C_COMPILE_FEATURES "c_std_90;c_function_prototypes;c_std_99;c_restrict;c_variadic_macros;c_std_11;c_static_assert") +set(CMAKE_C90_COMPILE_FEATURES "c_std_90;c_function_prototypes") +set(CMAKE_C99_COMPILE_FEATURES "c_std_99;c_restrict;c_variadic_macros") +set(CMAKE_C11_COMPILE_FEATURES "c_std_11;c_static_assert") + +set(CMAKE_C_PLATFORM_ID "Linux") +set(CMAKE_C_SIMULATE_ID "") +set(CMAKE_C_COMPILER_FRONTEND_VARIANT "GNU") +set(CMAKE_C_SIMULATE_VERSION "") + + + + +set(CMAKE_AR "/Users/yichao.wu/Library/Android/sdk/ndk/27.1.12297006/toolchains/llvm/prebuilt/darwin-x86_64/bin/llvm-ar") +set(CMAKE_C_COMPILER_AR "CMAKE_C_COMPILER_AR-NOTFOUND") +set(CMAKE_RANLIB "/Users/yichao.wu/Library/Android/sdk/ndk/27.1.12297006/toolchains/llvm/prebuilt/darwin-x86_64/bin/llvm-ranlib") +set(CMAKE_C_COMPILER_RANLIB "CMAKE_C_COMPILER_RANLIB-NOTFOUND") +set(CMAKE_LINKER "/Users/yichao.wu/Library/Android/sdk/ndk/27.1.12297006/toolchains/llvm/prebuilt/darwin-x86_64/bin/ld.lld") +set(CMAKE_MT "") +set(CMAKE_COMPILER_IS_GNUCC ) +set(CMAKE_C_COMPILER_LOADED 1) +set(CMAKE_C_COMPILER_WORKS TRUE) +set(CMAKE_C_ABI_COMPILED TRUE) +set(CMAKE_COMPILER_IS_MINGW ) +set(CMAKE_COMPILER_IS_CYGWIN ) +if(CMAKE_COMPILER_IS_CYGWIN) + set(CYGWIN 1) + set(UNIX 1) +endif() + +set(CMAKE_C_COMPILER_ENV_VAR "CC") + +if(CMAKE_COMPILER_IS_MINGW) + set(MINGW 1) +endif() +set(CMAKE_C_COMPILER_ID_RUN 1) +set(CMAKE_C_SOURCE_FILE_EXTENSIONS c;m) +set(CMAKE_C_IGNORE_EXTENSIONS h;H;o;O;obj;OBJ;def;DEF;rc;RC) +set(CMAKE_C_LINKER_PREFERENCE 10) + +# Save compiler ABI information. +set(CMAKE_C_SIZEOF_DATA_PTR "8") +set(CMAKE_C_COMPILER_ABI "ELF") +set(CMAKE_C_LIBRARY_ARCHITECTURE "") + +if(CMAKE_C_SIZEOF_DATA_PTR) + set(CMAKE_SIZEOF_VOID_P "${CMAKE_C_SIZEOF_DATA_PTR}") +endif() + +if(CMAKE_C_COMPILER_ABI) + set(CMAKE_INTERNAL_PLATFORM_ABI "${CMAKE_C_COMPILER_ABI}") +endif() + +if(CMAKE_C_LIBRARY_ARCHITECTURE) + set(CMAKE_LIBRARY_ARCHITECTURE "") +endif() + +set(CMAKE_C_CL_SHOWINCLUDES_PREFIX "") +if(CMAKE_C_CL_SHOWINCLUDES_PREFIX) + set(CMAKE_CL_SHOWINCLUDES_PREFIX "${CMAKE_C_CL_SHOWINCLUDES_PREFIX}") +endif() + + + + + +set(CMAKE_C_IMPLICIT_INCLUDE_DIRECTORIES "/Users/yichao.wu/Library/Android/sdk/ndk/27.1.12297006/toolchains/llvm/prebuilt/darwin-x86_64/lib/clang/18/include;/Users/yichao.wu/Library/Android/sdk/ndk/27.1.12297006/toolchains/llvm/prebuilt/darwin-x86_64/sysroot/usr/include/aarch64-linux-android;/Users/yichao.wu/Library/Android/sdk/ndk/27.1.12297006/toolchains/llvm/prebuilt/darwin-x86_64/sysroot/usr/include") +set(CMAKE_C_IMPLICIT_LINK_LIBRARIES "-l:libunwind.a;dl;c;-l:libunwind.a;dl") +set(CMAKE_C_IMPLICIT_LINK_DIRECTORIES "/Users/yichao.wu/Library/Android/sdk/ndk/27.1.12297006/toolchains/llvm/prebuilt/darwin-x86_64/lib/clang/18/lib/linux/aarch64;/Users/yichao.wu/Library/Android/sdk/ndk/27.1.12297006/toolchains/llvm/prebuilt/darwin-x86_64/sysroot/usr/lib/aarch64-linux-android/21;/Users/yichao.wu/Library/Android/sdk/ndk/27.1.12297006/toolchains/llvm/prebuilt/darwin-x86_64/sysroot/usr/lib/aarch64-linux-android;/Users/yichao.wu/Library/Android/sdk/ndk/27.1.12297006/toolchains/llvm/prebuilt/darwin-x86_64/sysroot/usr/lib") +set(CMAKE_C_IMPLICIT_LINK_FRAMEWORK_DIRECTORIES "") diff --git a/android/build-jni-arm64-v8a/CMakeFiles/3.19.1/CMakeCXXCompiler.cmake b/android/build-jni-arm64-v8a/CMakeFiles/3.19.1/CMakeCXXCompiler.cmake new file mode 100644 index 0000000..79a1bd6 --- /dev/null +++ b/android/build-jni-arm64-v8a/CMakeFiles/3.19.1/CMakeCXXCompiler.cmake @@ -0,0 +1,89 @@ +set(CMAKE_CXX_COMPILER "/Users/yichao.wu/Library/Android/sdk/ndk/27.1.12297006/toolchains/llvm/prebuilt/darwin-x86_64/bin/clang++") +set(CMAKE_CXX_COMPILER_ARG1 "") +set(CMAKE_CXX_COMPILER_ID "Clang") +set(CMAKE_CXX_COMPILER_VERSION "18.0.2") +set(CMAKE_CXX_COMPILER_VERSION_INTERNAL "") +set(CMAKE_CXX_COMPILER_WRAPPER "") +set(CMAKE_CXX_STANDARD_COMPUTED_DEFAULT "17") +set(CMAKE_CXX_COMPILE_FEATURES "cxx_std_98;cxx_template_template_parameters;cxx_std_11;cxx_alias_templates;cxx_alignas;cxx_alignof;cxx_attributes;cxx_auto_type;cxx_constexpr;cxx_decltype;cxx_decltype_incomplete_return_types;cxx_default_function_template_args;cxx_defaulted_functions;cxx_defaulted_move_initializers;cxx_delegating_constructors;cxx_deleted_functions;cxx_enum_forward_declarations;cxx_explicit_conversions;cxx_extended_friend_declarations;cxx_extern_templates;cxx_final;cxx_func_identifier;cxx_generalized_initializers;cxx_inheriting_constructors;cxx_inline_namespaces;cxx_lambdas;cxx_local_type_template_args;cxx_long_long_type;cxx_noexcept;cxx_nonstatic_member_init;cxx_nullptr;cxx_override;cxx_range_for;cxx_raw_string_literals;cxx_reference_qualified_functions;cxx_right_angle_brackets;cxx_rvalue_references;cxx_sizeof_member;cxx_static_assert;cxx_strong_enums;cxx_thread_local;cxx_trailing_return_types;cxx_unicode_literals;cxx_uniform_initialization;cxx_unrestricted_unions;cxx_user_literals;cxx_variadic_macros;cxx_variadic_templates;cxx_std_14;cxx_aggregate_default_initializers;cxx_attribute_deprecated;cxx_binary_literals;cxx_contextual_conversions;cxx_decltype_auto;cxx_digit_separators;cxx_generic_lambdas;cxx_lambda_init_captures;cxx_relaxed_constexpr;cxx_return_type_deduction;cxx_variable_templates;cxx_std_17;cxx_std_20") +set(CMAKE_CXX98_COMPILE_FEATURES "cxx_std_98;cxx_template_template_parameters") +set(CMAKE_CXX11_COMPILE_FEATURES "cxx_std_11;cxx_alias_templates;cxx_alignas;cxx_alignof;cxx_attributes;cxx_auto_type;cxx_constexpr;cxx_decltype;cxx_decltype_incomplete_return_types;cxx_default_function_template_args;cxx_defaulted_functions;cxx_defaulted_move_initializers;cxx_delegating_constructors;cxx_deleted_functions;cxx_enum_forward_declarations;cxx_explicit_conversions;cxx_extended_friend_declarations;cxx_extern_templates;cxx_final;cxx_func_identifier;cxx_generalized_initializers;cxx_inheriting_constructors;cxx_inline_namespaces;cxx_lambdas;cxx_local_type_template_args;cxx_long_long_type;cxx_noexcept;cxx_nonstatic_member_init;cxx_nullptr;cxx_override;cxx_range_for;cxx_raw_string_literals;cxx_reference_qualified_functions;cxx_right_angle_brackets;cxx_rvalue_references;cxx_sizeof_member;cxx_static_assert;cxx_strong_enums;cxx_thread_local;cxx_trailing_return_types;cxx_unicode_literals;cxx_uniform_initialization;cxx_unrestricted_unions;cxx_user_literals;cxx_variadic_macros;cxx_variadic_templates") +set(CMAKE_CXX14_COMPILE_FEATURES "cxx_std_14;cxx_aggregate_default_initializers;cxx_attribute_deprecated;cxx_binary_literals;cxx_contextual_conversions;cxx_decltype_auto;cxx_digit_separators;cxx_generic_lambdas;cxx_lambda_init_captures;cxx_relaxed_constexpr;cxx_return_type_deduction;cxx_variable_templates") +set(CMAKE_CXX17_COMPILE_FEATURES "cxx_std_17") +set(CMAKE_CXX20_COMPILE_FEATURES "cxx_std_20") + +set(CMAKE_CXX_PLATFORM_ID "Linux") +set(CMAKE_CXX_SIMULATE_ID "") +set(CMAKE_CXX_COMPILER_FRONTEND_VARIANT "GNU") +set(CMAKE_CXX_SIMULATE_VERSION "") + + + + +set(CMAKE_AR "/Users/yichao.wu/Library/Android/sdk/ndk/27.1.12297006/toolchains/llvm/prebuilt/darwin-x86_64/bin/llvm-ar") +set(CMAKE_CXX_COMPILER_AR "CMAKE_CXX_COMPILER_AR-NOTFOUND") +set(CMAKE_RANLIB "/Users/yichao.wu/Library/Android/sdk/ndk/27.1.12297006/toolchains/llvm/prebuilt/darwin-x86_64/bin/llvm-ranlib") +set(CMAKE_CXX_COMPILER_RANLIB "CMAKE_CXX_COMPILER_RANLIB-NOTFOUND") +set(CMAKE_LINKER "/Users/yichao.wu/Library/Android/sdk/ndk/27.1.12297006/toolchains/llvm/prebuilt/darwin-x86_64/bin/ld.lld") +set(CMAKE_MT "") +set(CMAKE_COMPILER_IS_GNUCXX ) +set(CMAKE_CXX_COMPILER_LOADED 1) +set(CMAKE_CXX_COMPILER_WORKS TRUE) +set(CMAKE_CXX_ABI_COMPILED TRUE) +set(CMAKE_COMPILER_IS_MINGW ) +set(CMAKE_COMPILER_IS_CYGWIN ) +if(CMAKE_COMPILER_IS_CYGWIN) + set(CYGWIN 1) + set(UNIX 1) +endif() + +set(CMAKE_CXX_COMPILER_ENV_VAR "CXX") + +if(CMAKE_COMPILER_IS_MINGW) + set(MINGW 1) +endif() +set(CMAKE_CXX_COMPILER_ID_RUN 1) +set(CMAKE_CXX_SOURCE_FILE_EXTENSIONS C;M;c++;cc;cpp;cxx;m;mm;CPP) +set(CMAKE_CXX_IGNORE_EXTENSIONS inl;h;hpp;HPP;H;o;O;obj;OBJ;def;DEF;rc;RC) + +foreach (lang C OBJC OBJCXX) + if (CMAKE_${lang}_COMPILER_ID_RUN) + foreach(extension IN LISTS CMAKE_${lang}_SOURCE_FILE_EXTENSIONS) + list(REMOVE_ITEM CMAKE_CXX_SOURCE_FILE_EXTENSIONS ${extension}) + endforeach() + endif() +endforeach() + +set(CMAKE_CXX_LINKER_PREFERENCE 30) +set(CMAKE_CXX_LINKER_PREFERENCE_PROPAGATES 1) + +# Save compiler ABI information. +set(CMAKE_CXX_SIZEOF_DATA_PTR "8") +set(CMAKE_CXX_COMPILER_ABI "ELF") +set(CMAKE_CXX_LIBRARY_ARCHITECTURE "") + +if(CMAKE_CXX_SIZEOF_DATA_PTR) + set(CMAKE_SIZEOF_VOID_P "${CMAKE_CXX_SIZEOF_DATA_PTR}") +endif() + +if(CMAKE_CXX_COMPILER_ABI) + set(CMAKE_INTERNAL_PLATFORM_ABI "${CMAKE_CXX_COMPILER_ABI}") +endif() + +if(CMAKE_CXX_LIBRARY_ARCHITECTURE) + set(CMAKE_LIBRARY_ARCHITECTURE "") +endif() + +set(CMAKE_CXX_CL_SHOWINCLUDES_PREFIX "") +if(CMAKE_CXX_CL_SHOWINCLUDES_PREFIX) + set(CMAKE_CL_SHOWINCLUDES_PREFIX "${CMAKE_CXX_CL_SHOWINCLUDES_PREFIX}") +endif() + + + + + +set(CMAKE_CXX_IMPLICIT_INCLUDE_DIRECTORIES "/Users/yichao.wu/Library/Android/sdk/ndk/27.1.12297006/toolchains/llvm/prebuilt/darwin-x86_64/sysroot/usr/include/c++/v1;/Users/yichao.wu/Library/Android/sdk/ndk/27.1.12297006/toolchains/llvm/prebuilt/darwin-x86_64/lib/clang/18/include;/Users/yichao.wu/Library/Android/sdk/ndk/27.1.12297006/toolchains/llvm/prebuilt/darwin-x86_64/sysroot/usr/include/aarch64-linux-android;/Users/yichao.wu/Library/Android/sdk/ndk/27.1.12297006/toolchains/llvm/prebuilt/darwin-x86_64/sysroot/usr/include") +set(CMAKE_CXX_IMPLICIT_LINK_LIBRARIES "c++;m;-l:libunwind.a;dl;c;-l:libunwind.a;dl") +set(CMAKE_CXX_IMPLICIT_LINK_DIRECTORIES "/Users/yichao.wu/Library/Android/sdk/ndk/27.1.12297006/toolchains/llvm/prebuilt/darwin-x86_64/lib/clang/18/lib/linux/aarch64;/Users/yichao.wu/Library/Android/sdk/ndk/27.1.12297006/toolchains/llvm/prebuilt/darwin-x86_64/sysroot/usr/lib/aarch64-linux-android/21;/Users/yichao.wu/Library/Android/sdk/ndk/27.1.12297006/toolchains/llvm/prebuilt/darwin-x86_64/sysroot/usr/lib/aarch64-linux-android;/Users/yichao.wu/Library/Android/sdk/ndk/27.1.12297006/toolchains/llvm/prebuilt/darwin-x86_64/sysroot/usr/lib") +set(CMAKE_CXX_IMPLICIT_LINK_FRAMEWORK_DIRECTORIES "") diff --git a/android/build-jni-arm64-v8a/CMakeFiles/3.19.1/CMakeDetermineCompilerABI_C.bin b/android/build-jni-arm64-v8a/CMakeFiles/3.19.1/CMakeDetermineCompilerABI_C.bin new file mode 100755 index 0000000..5121f13 Binary files /dev/null and b/android/build-jni-arm64-v8a/CMakeFiles/3.19.1/CMakeDetermineCompilerABI_C.bin differ diff --git a/android/build-jni-arm64-v8a/CMakeFiles/3.19.1/CMakeDetermineCompilerABI_CXX.bin b/android/build-jni-arm64-v8a/CMakeFiles/3.19.1/CMakeDetermineCompilerABI_CXX.bin new file mode 100755 index 0000000..7392fcd Binary files /dev/null and b/android/build-jni-arm64-v8a/CMakeFiles/3.19.1/CMakeDetermineCompilerABI_CXX.bin differ diff --git a/android/build-jni-arm64-v8a/CMakeFiles/3.19.1/CMakeSystem.cmake b/android/build-jni-arm64-v8a/CMakeFiles/3.19.1/CMakeSystem.cmake new file mode 100644 index 0000000..4bd3e62 --- /dev/null +++ b/android/build-jni-arm64-v8a/CMakeFiles/3.19.1/CMakeSystem.cmake @@ -0,0 +1,15 @@ +set(CMAKE_HOST_SYSTEM "Darwin-24.2.0") +set(CMAKE_HOST_SYSTEM_NAME "Darwin") +set(CMAKE_HOST_SYSTEM_VERSION "24.2.0") +set(CMAKE_HOST_SYSTEM_PROCESSOR "arm64") + +include("/Users/yichao.wu/Library/Android/sdk/ndk/27.1.12297006/build/cmake/android.toolchain.cmake") + +set(CMAKE_SYSTEM "Android-1") +set(CMAKE_SYSTEM_NAME "Android") +set(CMAKE_SYSTEM_VERSION "1") +set(CMAKE_SYSTEM_PROCESSOR "aarch64") + +set(CMAKE_CROSSCOMPILING "TRUE") + +set(CMAKE_SYSTEM_LOADED 1) diff --git a/android/build-jni-arm64-v8a/CMakeFiles/3.19.1/CompilerIdC/CMakeCCompilerId.c b/android/build-jni-arm64-v8a/CMakeFiles/3.19.1/CompilerIdC/CMakeCCompilerId.c new file mode 100644 index 0000000..b532cf7 --- /dev/null +++ b/android/build-jni-arm64-v8a/CMakeFiles/3.19.1/CompilerIdC/CMakeCCompilerId.c @@ -0,0 +1,721 @@ +#ifdef __cplusplus +# error "A C++ compiler has been selected for C." +#endif + +#if defined(__18CXX) +# define ID_VOID_MAIN +#endif +#if defined(__CLASSIC_C__) +/* cv-qualifiers did not exist in K&R C */ +# define const +# define volatile +#endif + + +/* Version number components: V=Version, R=Revision, P=Patch + Version date components: YYYY=Year, MM=Month, DD=Day */ + +#if defined(__INTEL_COMPILER) || defined(__ICC) +# define COMPILER_ID "Intel" +# if defined(_MSC_VER) +# define SIMULATE_ID "MSVC" +# endif +# if defined(__GNUC__) +# define SIMULATE_ID "GNU" +# endif + /* __INTEL_COMPILER = VRP */ +# define COMPILER_VERSION_MAJOR DEC(__INTEL_COMPILER/100) +# define COMPILER_VERSION_MINOR DEC(__INTEL_COMPILER/10 % 10) +# if defined(__INTEL_COMPILER_UPDATE) +# define COMPILER_VERSION_PATCH DEC(__INTEL_COMPILER_UPDATE) +# else +# define COMPILER_VERSION_PATCH DEC(__INTEL_COMPILER % 10) +# endif +# if defined(__INTEL_COMPILER_BUILD_DATE) + /* __INTEL_COMPILER_BUILD_DATE = YYYYMMDD */ +# define COMPILER_VERSION_TWEAK DEC(__INTEL_COMPILER_BUILD_DATE) +# endif +# if defined(_MSC_VER) + /* _MSC_VER = VVRR */ +# define SIMULATE_VERSION_MAJOR DEC(_MSC_VER / 100) +# define SIMULATE_VERSION_MINOR DEC(_MSC_VER % 100) +# endif +# if defined(__GNUC__) +# define SIMULATE_VERSION_MAJOR DEC(__GNUC__) +# elif defined(__GNUG__) +# define SIMULATE_VERSION_MAJOR DEC(__GNUG__) +# endif +# if defined(__GNUC_MINOR__) +# define SIMULATE_VERSION_MINOR DEC(__GNUC_MINOR__) +# endif +# if defined(__GNUC_PATCHLEVEL__) +# define SIMULATE_VERSION_PATCH DEC(__GNUC_PATCHLEVEL__) +# endif + +#elif defined(__PATHCC__) +# define COMPILER_ID "PathScale" +# define COMPILER_VERSION_MAJOR DEC(__PATHCC__) +# define COMPILER_VERSION_MINOR DEC(__PATHCC_MINOR__) +# if defined(__PATHCC_PATCHLEVEL__) +# define COMPILER_VERSION_PATCH DEC(__PATHCC_PATCHLEVEL__) +# endif + +#elif defined(__BORLANDC__) && defined(__CODEGEARC_VERSION__) +# define COMPILER_ID "Embarcadero" +# define COMPILER_VERSION_MAJOR HEX(__CODEGEARC_VERSION__>>24 & 0x00FF) +# define COMPILER_VERSION_MINOR HEX(__CODEGEARC_VERSION__>>16 & 0x00FF) +# define COMPILER_VERSION_PATCH DEC(__CODEGEARC_VERSION__ & 0xFFFF) + +#elif defined(__BORLANDC__) +# define COMPILER_ID "Borland" + /* __BORLANDC__ = 0xVRR */ +# define COMPILER_VERSION_MAJOR HEX(__BORLANDC__>>8) +# define COMPILER_VERSION_MINOR HEX(__BORLANDC__ & 0xFF) + +#elif defined(__WATCOMC__) && __WATCOMC__ < 1200 +# define COMPILER_ID "Watcom" + /* __WATCOMC__ = VVRR */ +# define COMPILER_VERSION_MAJOR DEC(__WATCOMC__ / 100) +# define COMPILER_VERSION_MINOR DEC((__WATCOMC__ / 10) % 10) +# if (__WATCOMC__ % 10) > 0 +# define COMPILER_VERSION_PATCH DEC(__WATCOMC__ % 10) +# endif + +#elif defined(__WATCOMC__) +# define COMPILER_ID "OpenWatcom" + /* __WATCOMC__ = VVRP + 1100 */ +# define COMPILER_VERSION_MAJOR DEC((__WATCOMC__ - 1100) / 100) +# define COMPILER_VERSION_MINOR DEC((__WATCOMC__ / 10) % 10) +# if (__WATCOMC__ % 10) > 0 +# define COMPILER_VERSION_PATCH DEC(__WATCOMC__ % 10) +# endif + +#elif defined(__SUNPRO_C) +# define COMPILER_ID "SunPro" +# if __SUNPRO_C >= 0x5100 + /* __SUNPRO_C = 0xVRRP */ +# define COMPILER_VERSION_MAJOR HEX(__SUNPRO_C>>12) +# define COMPILER_VERSION_MINOR HEX(__SUNPRO_C>>4 & 0xFF) +# define COMPILER_VERSION_PATCH HEX(__SUNPRO_C & 0xF) +# else + /* __SUNPRO_CC = 0xVRP */ +# define COMPILER_VERSION_MAJOR HEX(__SUNPRO_C>>8) +# define COMPILER_VERSION_MINOR HEX(__SUNPRO_C>>4 & 0xF) +# define COMPILER_VERSION_PATCH HEX(__SUNPRO_C & 0xF) +# endif + +#elif defined(__HP_cc) +# define COMPILER_ID "HP" + /* __HP_cc = VVRRPP */ +# define COMPILER_VERSION_MAJOR DEC(__HP_cc/10000) +# define COMPILER_VERSION_MINOR DEC(__HP_cc/100 % 100) +# define COMPILER_VERSION_PATCH DEC(__HP_cc % 100) + +#elif defined(__DECC) +# define COMPILER_ID "Compaq" + /* __DECC_VER = VVRRTPPPP */ +# define COMPILER_VERSION_MAJOR DEC(__DECC_VER/10000000) +# define COMPILER_VERSION_MINOR DEC(__DECC_VER/100000 % 100) +# define COMPILER_VERSION_PATCH DEC(__DECC_VER % 10000) + +#elif defined(__IBMC__) && defined(__COMPILER_VER__) +# define COMPILER_ID "zOS" + /* __IBMC__ = VRP */ +# define COMPILER_VERSION_MAJOR DEC(__IBMC__/100) +# define COMPILER_VERSION_MINOR DEC(__IBMC__/10 % 10) +# define COMPILER_VERSION_PATCH DEC(__IBMC__ % 10) + +#elif defined(__ibmxl__) && defined(__clang__) +# define COMPILER_ID "XLClang" +# define COMPILER_VERSION_MAJOR DEC(__ibmxl_version__) +# define COMPILER_VERSION_MINOR DEC(__ibmxl_release__) +# define COMPILER_VERSION_PATCH DEC(__ibmxl_modification__) +# define COMPILER_VERSION_TWEAK DEC(__ibmxl_ptf_fix_level__) + + +#elif defined(__IBMC__) && !defined(__COMPILER_VER__) && __IBMC__ >= 800 +# define COMPILER_ID "XL" + /* __IBMC__ = VRP */ +# define COMPILER_VERSION_MAJOR DEC(__IBMC__/100) +# define COMPILER_VERSION_MINOR DEC(__IBMC__/10 % 10) +# define COMPILER_VERSION_PATCH DEC(__IBMC__ % 10) + +#elif defined(__IBMC__) && !defined(__COMPILER_VER__) && __IBMC__ < 800 +# define COMPILER_ID "VisualAge" + /* __IBMC__ = VRP */ +# define COMPILER_VERSION_MAJOR DEC(__IBMC__/100) +# define COMPILER_VERSION_MINOR DEC(__IBMC__/10 % 10) +# define COMPILER_VERSION_PATCH DEC(__IBMC__ % 10) + +#elif defined(__PGI) +# define COMPILER_ID "PGI" +# define COMPILER_VERSION_MAJOR DEC(__PGIC__) +# define COMPILER_VERSION_MINOR DEC(__PGIC_MINOR__) +# if defined(__PGIC_PATCHLEVEL__) +# define COMPILER_VERSION_PATCH DEC(__PGIC_PATCHLEVEL__) +# endif + +#elif defined(_CRAYC) +# define COMPILER_ID "Cray" +# define COMPILER_VERSION_MAJOR DEC(_RELEASE_MAJOR) +# define COMPILER_VERSION_MINOR DEC(_RELEASE_MINOR) + +#elif defined(__TI_COMPILER_VERSION__) +# define COMPILER_ID "TI" + /* __TI_COMPILER_VERSION__ = VVVRRRPPP */ +# define COMPILER_VERSION_MAJOR DEC(__TI_COMPILER_VERSION__/1000000) +# define COMPILER_VERSION_MINOR DEC(__TI_COMPILER_VERSION__/1000 % 1000) +# define COMPILER_VERSION_PATCH DEC(__TI_COMPILER_VERSION__ % 1000) + +#elif defined(__FUJITSU) || defined(__FCC_VERSION) || defined(__fcc_version) +# define COMPILER_ID "Fujitsu" + +#elif defined(__ghs__) +# define COMPILER_ID "GHS" +/* __GHS_VERSION_NUMBER = VVVVRP */ +# ifdef __GHS_VERSION_NUMBER +# define COMPILER_VERSION_MAJOR DEC(__GHS_VERSION_NUMBER / 100) +# define COMPILER_VERSION_MINOR DEC(__GHS_VERSION_NUMBER / 10 % 10) +# define COMPILER_VERSION_PATCH DEC(__GHS_VERSION_NUMBER % 10) +# endif + +#elif defined(__TINYC__) +# define COMPILER_ID "TinyCC" + +#elif defined(__BCC__) +# define COMPILER_ID "Bruce" + +#elif defined(__SCO_VERSION__) +# define COMPILER_ID "SCO" + +#elif defined(__ARMCC_VERSION) && !defined(__clang__) +# define COMPILER_ID "ARMCC" +#if __ARMCC_VERSION >= 1000000 + /* __ARMCC_VERSION = VRRPPPP */ + # define COMPILER_VERSION_MAJOR DEC(__ARMCC_VERSION/1000000) + # define COMPILER_VERSION_MINOR DEC(__ARMCC_VERSION/10000 % 100) + # define COMPILER_VERSION_PATCH DEC(__ARMCC_VERSION % 10000) +#else + /* __ARMCC_VERSION = VRPPPP */ + # define COMPILER_VERSION_MAJOR DEC(__ARMCC_VERSION/100000) + # define COMPILER_VERSION_MINOR DEC(__ARMCC_VERSION/10000 % 10) + # define COMPILER_VERSION_PATCH DEC(__ARMCC_VERSION % 10000) +#endif + + +#elif defined(__clang__) && defined(__apple_build_version__) +# define COMPILER_ID "AppleClang" +# if defined(_MSC_VER) +# define SIMULATE_ID "MSVC" +# endif +# define COMPILER_VERSION_MAJOR DEC(__clang_major__) +# define COMPILER_VERSION_MINOR DEC(__clang_minor__) +# define COMPILER_VERSION_PATCH DEC(__clang_patchlevel__) +# if defined(_MSC_VER) + /* _MSC_VER = VVRR */ +# define SIMULATE_VERSION_MAJOR DEC(_MSC_VER / 100) +# define SIMULATE_VERSION_MINOR DEC(_MSC_VER % 100) +# endif +# define COMPILER_VERSION_TWEAK DEC(__apple_build_version__) + +#elif defined(__clang__) && defined(__ARMCOMPILER_VERSION) +# define COMPILER_ID "ARMClang" + # define COMPILER_VERSION_MAJOR DEC(__ARMCOMPILER_VERSION/1000000) + # define COMPILER_VERSION_MINOR DEC(__ARMCOMPILER_VERSION/10000 % 100) + # define COMPILER_VERSION_PATCH DEC(__ARMCOMPILER_VERSION % 10000) +# define COMPILER_VERSION_INTERNAL DEC(__ARMCOMPILER_VERSION) + +#elif defined(__clang__) && defined(__INTEL_DPCPP_COMPILER__) +# define COMPILER_ID "IntelDPCPP" +# if defined(_MSC_VER) +# define SIMULATE_ID "MSVC" +# endif +# define COMPILER_VERSION_MAJOR DEC(__clang_major__) +# define COMPILER_VERSION_MINOR DEC(__clang_minor__) +# define COMPILER_VERSION_PATCH DEC(__clang_patchlevel__) +# if defined(_MSC_VER) + /* _MSC_VER = VVRR */ +# define SIMULATE_VERSION_MAJOR DEC(_MSC_VER / 100) +# define SIMULATE_VERSION_MINOR DEC(_MSC_VER % 100) +# endif +# define COMPILER_VERSION_TWEAK DEC(__INTEL_DPCPP_COMPILER__) + +#elif defined(__clang__) && defined(__INTEL_CLANG_COMPILER) +# define COMPILER_ID "IntelClang" +# if defined(_MSC_VER) +# define SIMULATE_ID "MSVC" +# endif +# define COMPILER_VERSION_MAJOR DEC(__clang_major__) +# define COMPILER_VERSION_MINOR DEC(__clang_minor__) +# define COMPILER_VERSION_PATCH DEC(__clang_patchlevel__) +# if defined(_MSC_VER) + /* _MSC_VER = VVRR */ +# define SIMULATE_VERSION_MAJOR DEC(_MSC_VER / 100) +# define SIMULATE_VERSION_MINOR DEC(_MSC_VER % 100) +# endif +# define COMPILER_VERSION_TWEAK DEC(__INTEL_CLANG_COMPILER) + +#elif defined(__clang__) +# define COMPILER_ID "Clang" +# if defined(_MSC_VER) +# define SIMULATE_ID "MSVC" +# endif +# define COMPILER_VERSION_MAJOR DEC(__clang_major__) +# define COMPILER_VERSION_MINOR DEC(__clang_minor__) +# define COMPILER_VERSION_PATCH DEC(__clang_patchlevel__) +# if defined(_MSC_VER) + /* _MSC_VER = VVRR */ +# define SIMULATE_VERSION_MAJOR DEC(_MSC_VER / 100) +# define SIMULATE_VERSION_MINOR DEC(_MSC_VER % 100) +# endif + +#elif defined(__GNUC__) +# define COMPILER_ID "GNU" +# define COMPILER_VERSION_MAJOR DEC(__GNUC__) +# if defined(__GNUC_MINOR__) +# define COMPILER_VERSION_MINOR DEC(__GNUC_MINOR__) +# endif +# if defined(__GNUC_PATCHLEVEL__) +# define COMPILER_VERSION_PATCH DEC(__GNUC_PATCHLEVEL__) +# endif + +#elif defined(_MSC_VER) +# define COMPILER_ID "MSVC" + /* _MSC_VER = VVRR */ +# define COMPILER_VERSION_MAJOR DEC(_MSC_VER / 100) +# define COMPILER_VERSION_MINOR DEC(_MSC_VER % 100) +# if defined(_MSC_FULL_VER) +# if _MSC_VER >= 1400 + /* _MSC_FULL_VER = VVRRPPPPP */ +# define COMPILER_VERSION_PATCH DEC(_MSC_FULL_VER % 100000) +# else + /* _MSC_FULL_VER = VVRRPPPP */ +# define COMPILER_VERSION_PATCH DEC(_MSC_FULL_VER % 10000) +# endif +# endif +# if defined(_MSC_BUILD) +# define COMPILER_VERSION_TWEAK DEC(_MSC_BUILD) +# endif + +#elif defined(__VISUALDSPVERSION__) || defined(__ADSPBLACKFIN__) || defined(__ADSPTS__) || defined(__ADSP21000__) +# define COMPILER_ID "ADSP" +#if defined(__VISUALDSPVERSION__) + /* __VISUALDSPVERSION__ = 0xVVRRPP00 */ +# define COMPILER_VERSION_MAJOR HEX(__VISUALDSPVERSION__>>24) +# define COMPILER_VERSION_MINOR HEX(__VISUALDSPVERSION__>>16 & 0xFF) +# define COMPILER_VERSION_PATCH HEX(__VISUALDSPVERSION__>>8 & 0xFF) +#endif + +#elif defined(__IAR_SYSTEMS_ICC__) || defined(__IAR_SYSTEMS_ICC) +# define COMPILER_ID "IAR" +# if defined(__VER__) && defined(__ICCARM__) +# define COMPILER_VERSION_MAJOR DEC((__VER__) / 1000000) +# define COMPILER_VERSION_MINOR DEC(((__VER__) / 1000) % 1000) +# define COMPILER_VERSION_PATCH DEC((__VER__) % 1000) +# define COMPILER_VERSION_INTERNAL DEC(__IAR_SYSTEMS_ICC__) +# elif defined(__VER__) && (defined(__ICCAVR__) || defined(__ICCRX__) || defined(__ICCRH850__) || defined(__ICCRL78__) || defined(__ICC430__) || defined(__ICCRISCV__) || defined(__ICCV850__) || defined(__ICC8051__)) +# define COMPILER_VERSION_MAJOR DEC((__VER__) / 100) +# define COMPILER_VERSION_MINOR DEC((__VER__) - (((__VER__) / 100)*100)) +# define COMPILER_VERSION_PATCH DEC(__SUBVERSION__) +# define COMPILER_VERSION_INTERNAL DEC(__IAR_SYSTEMS_ICC__) +# endif + +#elif defined(__SDCC_VERSION_MAJOR) || defined(SDCC) +# define COMPILER_ID "SDCC" +# if defined(__SDCC_VERSION_MAJOR) +# define COMPILER_VERSION_MAJOR DEC(__SDCC_VERSION_MAJOR) +# define COMPILER_VERSION_MINOR DEC(__SDCC_VERSION_MINOR) +# define COMPILER_VERSION_PATCH DEC(__SDCC_VERSION_PATCH) +# else + /* SDCC = VRP */ +# define COMPILER_VERSION_MAJOR DEC(SDCC/100) +# define COMPILER_VERSION_MINOR DEC(SDCC/10 % 10) +# define COMPILER_VERSION_PATCH DEC(SDCC % 10) +# endif + + +/* These compilers are either not known or too old to define an + identification macro. Try to identify the platform and guess that + it is the native compiler. */ +#elif defined(__hpux) || defined(__hpua) +# define COMPILER_ID "HP" + +#else /* unknown compiler */ +# define COMPILER_ID "" +#endif + +/* Construct the string literal in pieces to prevent the source from + getting matched. Store it in a pointer rather than an array + because some compilers will just produce instructions to fill the + array rather than assigning a pointer to a static array. */ +char const* info_compiler = "INFO" ":" "compiler[" COMPILER_ID "]"; +#ifdef SIMULATE_ID +char const* info_simulate = "INFO" ":" "simulate[" SIMULATE_ID "]"; +#endif + +#ifdef __QNXNTO__ +char const* qnxnto = "INFO" ":" "qnxnto[]"; +#endif + +#if defined(__CRAYXE) || defined(__CRAYXC) +char const *info_cray = "INFO" ":" "compiler_wrapper[CrayPrgEnv]"; +#endif + +#define STRINGIFY_HELPER(X) #X +#define STRINGIFY(X) STRINGIFY_HELPER(X) + +/* Identify known platforms by name. */ +#if defined(__linux) || defined(__linux__) || defined(linux) +# define PLATFORM_ID "Linux" + +#elif defined(__CYGWIN__) +# define PLATFORM_ID "Cygwin" + +#elif defined(__MINGW32__) +# define PLATFORM_ID "MinGW" + +#elif defined(__APPLE__) +# define PLATFORM_ID "Darwin" + +#elif defined(_WIN32) || defined(__WIN32__) || defined(WIN32) +# define PLATFORM_ID "Windows" + +#elif defined(__FreeBSD__) || defined(__FreeBSD) +# define PLATFORM_ID "FreeBSD" + +#elif defined(__NetBSD__) || defined(__NetBSD) +# define PLATFORM_ID "NetBSD" + +#elif defined(__OpenBSD__) || defined(__OPENBSD) +# define PLATFORM_ID "OpenBSD" + +#elif defined(__sun) || defined(sun) +# define PLATFORM_ID "SunOS" + +#elif defined(_AIX) || defined(__AIX) || defined(__AIX__) || defined(__aix) || defined(__aix__) +# define PLATFORM_ID "AIX" + +#elif defined(__hpux) || defined(__hpux__) +# define PLATFORM_ID "HP-UX" + +#elif defined(__HAIKU__) +# define PLATFORM_ID "Haiku" + +#elif defined(__BeOS) || defined(__BEOS__) || defined(_BEOS) +# define PLATFORM_ID "BeOS" + +#elif defined(__QNX__) || defined(__QNXNTO__) +# define PLATFORM_ID "QNX" + +#elif defined(__tru64) || defined(_tru64) || defined(__TRU64__) +# define PLATFORM_ID "Tru64" + +#elif defined(__riscos) || defined(__riscos__) +# define PLATFORM_ID "RISCos" + +#elif defined(__sinix) || defined(__sinix__) || defined(__SINIX__) +# define PLATFORM_ID "SINIX" + +#elif defined(__UNIX_SV__) +# define PLATFORM_ID "UNIX_SV" + +#elif defined(__bsdos__) +# define PLATFORM_ID "BSDOS" + +#elif defined(_MPRAS) || defined(MPRAS) +# define PLATFORM_ID "MP-RAS" + +#elif defined(__osf) || defined(__osf__) +# define PLATFORM_ID "OSF1" + +#elif defined(_SCO_SV) || defined(SCO_SV) || defined(sco_sv) +# define PLATFORM_ID "SCO_SV" + +#elif defined(__ultrix) || defined(__ultrix__) || defined(_ULTRIX) +# define PLATFORM_ID "ULTRIX" + +#elif defined(__XENIX__) || defined(_XENIX) || defined(XENIX) +# define PLATFORM_ID "Xenix" + +#elif defined(__WATCOMC__) +# if defined(__LINUX__) +# define PLATFORM_ID "Linux" + +# elif defined(__DOS__) +# define PLATFORM_ID "DOS" + +# elif defined(__OS2__) +# define PLATFORM_ID "OS2" + +# elif defined(__WINDOWS__) +# define PLATFORM_ID "Windows3x" + +# elif defined(__VXWORKS__) +# define PLATFORM_ID "VxWorks" + +# else /* unknown platform */ +# define PLATFORM_ID +# endif + +#elif defined(__INTEGRITY) +# if defined(INT_178B) +# define PLATFORM_ID "Integrity178" + +# else /* regular Integrity */ +# define PLATFORM_ID "Integrity" +# endif + +#else /* unknown platform */ +# define PLATFORM_ID + +#endif + +/* For windows compilers MSVC and Intel we can determine + the architecture of the compiler being used. This is because + the compilers do not have flags that can change the architecture, + but rather depend on which compiler is being used +*/ +#if defined(_WIN32) && defined(_MSC_VER) +# if defined(_M_IA64) +# define ARCHITECTURE_ID "IA64" + +# elif defined(_M_X64) || defined(_M_AMD64) +# define ARCHITECTURE_ID "x64" + +# elif defined(_M_IX86) +# define ARCHITECTURE_ID "X86" + +# elif defined(_M_ARM64) +# define ARCHITECTURE_ID "ARM64" + +# elif defined(_M_ARM) +# if _M_ARM == 4 +# define ARCHITECTURE_ID "ARMV4I" +# elif _M_ARM == 5 +# define ARCHITECTURE_ID "ARMV5I" +# else +# define ARCHITECTURE_ID "ARMV" STRINGIFY(_M_ARM) +# endif + +# elif defined(_M_MIPS) +# define ARCHITECTURE_ID "MIPS" + +# elif defined(_M_SH) +# define ARCHITECTURE_ID "SHx" + +# else /* unknown architecture */ +# define ARCHITECTURE_ID "" +# endif + +#elif defined(__WATCOMC__) +# if defined(_M_I86) +# define ARCHITECTURE_ID "I86" + +# elif defined(_M_IX86) +# define ARCHITECTURE_ID "X86" + +# else /* unknown architecture */ +# define ARCHITECTURE_ID "" +# endif + +#elif defined(__IAR_SYSTEMS_ICC__) || defined(__IAR_SYSTEMS_ICC) +# if defined(__ICCARM__) +# define ARCHITECTURE_ID "ARM" + +# elif defined(__ICCRX__) +# define ARCHITECTURE_ID "RX" + +# elif defined(__ICCRH850__) +# define ARCHITECTURE_ID "RH850" + +# elif defined(__ICCRL78__) +# define ARCHITECTURE_ID "RL78" + +# elif defined(__ICCRISCV__) +# define ARCHITECTURE_ID "RISCV" + +# elif defined(__ICCAVR__) +# define ARCHITECTURE_ID "AVR" + +# elif defined(__ICC430__) +# define ARCHITECTURE_ID "MSP430" + +# elif defined(__ICCV850__) +# define ARCHITECTURE_ID "V850" + +# elif defined(__ICC8051__) +# define ARCHITECTURE_ID "8051" + +# else /* unknown architecture */ +# define ARCHITECTURE_ID "" +# endif + +#elif defined(__ghs__) +# if defined(__PPC64__) +# define ARCHITECTURE_ID "PPC64" + +# elif defined(__ppc__) +# define ARCHITECTURE_ID "PPC" + +# elif defined(__ARM__) +# define ARCHITECTURE_ID "ARM" + +# elif defined(__x86_64__) +# define ARCHITECTURE_ID "x64" + +# elif defined(__i386__) +# define ARCHITECTURE_ID "X86" + +# else /* unknown architecture */ +# define ARCHITECTURE_ID "" +# endif + +#elif defined(__TI_COMPILER_VERSION__) +# if defined(__TI_ARM__) +# define ARCHITECTURE_ID "ARM" + +# elif defined(__MSP430__) +# define ARCHITECTURE_ID "MSP430" + +# elif defined(__TMS320C28XX__) +# define ARCHITECTURE_ID "TMS320C28x" + +# elif defined(__TMS320C6X__) || defined(_TMS320C6X) +# define ARCHITECTURE_ID "TMS320C6x" + +# else /* unknown architecture */ +# define ARCHITECTURE_ID "" +# endif + +#else +# define ARCHITECTURE_ID +#endif + +/* Convert integer to decimal digit literals. */ +#define DEC(n) \ + ('0' + (((n) / 10000000)%10)), \ + ('0' + (((n) / 1000000)%10)), \ + ('0' + (((n) / 100000)%10)), \ + ('0' + (((n) / 10000)%10)), \ + ('0' + (((n) / 1000)%10)), \ + ('0' + (((n) / 100)%10)), \ + ('0' + (((n) / 10)%10)), \ + ('0' + ((n) % 10)) + +/* Convert integer to hex digit literals. */ +#define HEX(n) \ + ('0' + ((n)>>28 & 0xF)), \ + ('0' + ((n)>>24 & 0xF)), \ + ('0' + ((n)>>20 & 0xF)), \ + ('0' + ((n)>>16 & 0xF)), \ + ('0' + ((n)>>12 & 0xF)), \ + ('0' + ((n)>>8 & 0xF)), \ + ('0' + ((n)>>4 & 0xF)), \ + ('0' + ((n) & 0xF)) + +/* Construct a string literal encoding the version number components. */ +#ifdef COMPILER_VERSION_MAJOR +char const info_version[] = { + 'I', 'N', 'F', 'O', ':', + 'c','o','m','p','i','l','e','r','_','v','e','r','s','i','o','n','[', + COMPILER_VERSION_MAJOR, +# ifdef COMPILER_VERSION_MINOR + '.', COMPILER_VERSION_MINOR, +# ifdef COMPILER_VERSION_PATCH + '.', COMPILER_VERSION_PATCH, +# ifdef COMPILER_VERSION_TWEAK + '.', COMPILER_VERSION_TWEAK, +# endif +# endif +# endif + ']','\0'}; +#endif + +/* Construct a string literal encoding the internal version number. */ +#ifdef COMPILER_VERSION_INTERNAL +char const info_version_internal[] = { + 'I', 'N', 'F', 'O', ':', + 'c','o','m','p','i','l','e','r','_','v','e','r','s','i','o','n','_', + 'i','n','t','e','r','n','a','l','[', + COMPILER_VERSION_INTERNAL,']','\0'}; +#endif + +/* Construct a string literal encoding the version number components. */ +#ifdef SIMULATE_VERSION_MAJOR +char const info_simulate_version[] = { + 'I', 'N', 'F', 'O', ':', + 's','i','m','u','l','a','t','e','_','v','e','r','s','i','o','n','[', + SIMULATE_VERSION_MAJOR, +# ifdef SIMULATE_VERSION_MINOR + '.', SIMULATE_VERSION_MINOR, +# ifdef SIMULATE_VERSION_PATCH + '.', SIMULATE_VERSION_PATCH, +# ifdef SIMULATE_VERSION_TWEAK + '.', SIMULATE_VERSION_TWEAK, +# endif +# endif +# endif + ']','\0'}; +#endif + +/* Construct the string literal in pieces to prevent the source from + getting matched. Store it in a pointer rather than an array + because some compilers will just produce instructions to fill the + array rather than assigning a pointer to a static array. */ +char const* info_platform = "INFO" ":" "platform[" PLATFORM_ID "]"; +char const* info_arch = "INFO" ":" "arch[" ARCHITECTURE_ID "]"; + + + +#if !defined(__STDC__) +# if (defined(_MSC_VER) && !defined(__clang__)) \ + || (defined(__ibmxl__) || defined(__IBMC__)) +# define C_DIALECT "90" +# else +# define C_DIALECT +# endif +#elif __STDC_VERSION__ >= 201000L +# define C_DIALECT "11" +#elif __STDC_VERSION__ >= 199901L +# define C_DIALECT "99" +#else +# define C_DIALECT "90" +#endif +const char* info_language_dialect_default = + "INFO" ":" "dialect_default[" C_DIALECT "]"; + +/*--------------------------------------------------------------------------*/ + +#ifdef ID_VOID_MAIN +void main() {} +#else +# if defined(__CLASSIC_C__) +int main(argc, argv) int argc; char *argv[]; +# else +int main(int argc, char* argv[]) +# endif +{ + int require = 0; + require += info_compiler[argc]; + require += info_platform[argc]; + require += info_arch[argc]; +#ifdef COMPILER_VERSION_MAJOR + require += info_version[argc]; +#endif +#ifdef COMPILER_VERSION_INTERNAL + require += info_version_internal[argc]; +#endif +#ifdef SIMULATE_ID + require += info_simulate[argc]; +#endif +#ifdef SIMULATE_VERSION_MAJOR + require += info_simulate_version[argc]; +#endif +#if defined(__CRAYXE) || defined(__CRAYXC) + require += info_cray[argc]; +#endif + require += info_language_dialect_default[argc]; + (void)argv; + return require; +} +#endif diff --git a/android/build-jni-arm64-v8a/CMakeFiles/3.19.1/CompilerIdC/CMakeCCompilerId.o b/android/build-jni-arm64-v8a/CMakeFiles/3.19.1/CompilerIdC/CMakeCCompilerId.o new file mode 100644 index 0000000..0c40a3b Binary files /dev/null and b/android/build-jni-arm64-v8a/CMakeFiles/3.19.1/CompilerIdC/CMakeCCompilerId.o differ diff --git a/android/build-jni-arm64-v8a/CMakeFiles/3.19.1/CompilerIdCXX/CMakeCXXCompilerId.cpp b/android/build-jni-arm64-v8a/CMakeFiles/3.19.1/CompilerIdCXX/CMakeCXXCompilerId.cpp new file mode 100644 index 0000000..63067f5 --- /dev/null +++ b/android/build-jni-arm64-v8a/CMakeFiles/3.19.1/CompilerIdCXX/CMakeCXXCompilerId.cpp @@ -0,0 +1,710 @@ +/* This source file must have a .cpp extension so that all C++ compilers + recognize the extension without flags. Borland does not know .cxx for + example. */ +#ifndef __cplusplus +# error "A C compiler has been selected for C++." +#endif + + +/* Version number components: V=Version, R=Revision, P=Patch + Version date components: YYYY=Year, MM=Month, DD=Day */ + +#if defined(__COMO__) +# define COMPILER_ID "Comeau" + /* __COMO_VERSION__ = VRR */ +# define COMPILER_VERSION_MAJOR DEC(__COMO_VERSION__ / 100) +# define COMPILER_VERSION_MINOR DEC(__COMO_VERSION__ % 100) + +#elif defined(__INTEL_COMPILER) || defined(__ICC) +# define COMPILER_ID "Intel" +# if defined(_MSC_VER) +# define SIMULATE_ID "MSVC" +# endif +# if defined(__GNUC__) +# define SIMULATE_ID "GNU" +# endif + /* __INTEL_COMPILER = VRP */ +# define COMPILER_VERSION_MAJOR DEC(__INTEL_COMPILER/100) +# define COMPILER_VERSION_MINOR DEC(__INTEL_COMPILER/10 % 10) +# if defined(__INTEL_COMPILER_UPDATE) +# define COMPILER_VERSION_PATCH DEC(__INTEL_COMPILER_UPDATE) +# else +# define COMPILER_VERSION_PATCH DEC(__INTEL_COMPILER % 10) +# endif +# if defined(__INTEL_COMPILER_BUILD_DATE) + /* __INTEL_COMPILER_BUILD_DATE = YYYYMMDD */ +# define COMPILER_VERSION_TWEAK DEC(__INTEL_COMPILER_BUILD_DATE) +# endif +# if defined(_MSC_VER) + /* _MSC_VER = VVRR */ +# define SIMULATE_VERSION_MAJOR DEC(_MSC_VER / 100) +# define SIMULATE_VERSION_MINOR DEC(_MSC_VER % 100) +# endif +# if defined(__GNUC__) +# define SIMULATE_VERSION_MAJOR DEC(__GNUC__) +# elif defined(__GNUG__) +# define SIMULATE_VERSION_MAJOR DEC(__GNUG__) +# endif +# if defined(__GNUC_MINOR__) +# define SIMULATE_VERSION_MINOR DEC(__GNUC_MINOR__) +# endif +# if defined(__GNUC_PATCHLEVEL__) +# define SIMULATE_VERSION_PATCH DEC(__GNUC_PATCHLEVEL__) +# endif + +#elif defined(__PATHCC__) +# define COMPILER_ID "PathScale" +# define COMPILER_VERSION_MAJOR DEC(__PATHCC__) +# define COMPILER_VERSION_MINOR DEC(__PATHCC_MINOR__) +# if defined(__PATHCC_PATCHLEVEL__) +# define COMPILER_VERSION_PATCH DEC(__PATHCC_PATCHLEVEL__) +# endif + +#elif defined(__BORLANDC__) && defined(__CODEGEARC_VERSION__) +# define COMPILER_ID "Embarcadero" +# define COMPILER_VERSION_MAJOR HEX(__CODEGEARC_VERSION__>>24 & 0x00FF) +# define COMPILER_VERSION_MINOR HEX(__CODEGEARC_VERSION__>>16 & 0x00FF) +# define COMPILER_VERSION_PATCH DEC(__CODEGEARC_VERSION__ & 0xFFFF) + +#elif defined(__BORLANDC__) +# define COMPILER_ID "Borland" + /* __BORLANDC__ = 0xVRR */ +# define COMPILER_VERSION_MAJOR HEX(__BORLANDC__>>8) +# define COMPILER_VERSION_MINOR HEX(__BORLANDC__ & 0xFF) + +#elif defined(__WATCOMC__) && __WATCOMC__ < 1200 +# define COMPILER_ID "Watcom" + /* __WATCOMC__ = VVRR */ +# define COMPILER_VERSION_MAJOR DEC(__WATCOMC__ / 100) +# define COMPILER_VERSION_MINOR DEC((__WATCOMC__ / 10) % 10) +# if (__WATCOMC__ % 10) > 0 +# define COMPILER_VERSION_PATCH DEC(__WATCOMC__ % 10) +# endif + +#elif defined(__WATCOMC__) +# define COMPILER_ID "OpenWatcom" + /* __WATCOMC__ = VVRP + 1100 */ +# define COMPILER_VERSION_MAJOR DEC((__WATCOMC__ - 1100) / 100) +# define COMPILER_VERSION_MINOR DEC((__WATCOMC__ / 10) % 10) +# if (__WATCOMC__ % 10) > 0 +# define COMPILER_VERSION_PATCH DEC(__WATCOMC__ % 10) +# endif + +#elif defined(__SUNPRO_CC) +# define COMPILER_ID "SunPro" +# if __SUNPRO_CC >= 0x5100 + /* __SUNPRO_CC = 0xVRRP */ +# define COMPILER_VERSION_MAJOR HEX(__SUNPRO_CC>>12) +# define COMPILER_VERSION_MINOR HEX(__SUNPRO_CC>>4 & 0xFF) +# define COMPILER_VERSION_PATCH HEX(__SUNPRO_CC & 0xF) +# else + /* __SUNPRO_CC = 0xVRP */ +# define COMPILER_VERSION_MAJOR HEX(__SUNPRO_CC>>8) +# define COMPILER_VERSION_MINOR HEX(__SUNPRO_CC>>4 & 0xF) +# define COMPILER_VERSION_PATCH HEX(__SUNPRO_CC & 0xF) +# endif + +#elif defined(__HP_aCC) +# define COMPILER_ID "HP" + /* __HP_aCC = VVRRPP */ +# define COMPILER_VERSION_MAJOR DEC(__HP_aCC/10000) +# define COMPILER_VERSION_MINOR DEC(__HP_aCC/100 % 100) +# define COMPILER_VERSION_PATCH DEC(__HP_aCC % 100) + +#elif defined(__DECCXX) +# define COMPILER_ID "Compaq" + /* __DECCXX_VER = VVRRTPPPP */ +# define COMPILER_VERSION_MAJOR DEC(__DECCXX_VER/10000000) +# define COMPILER_VERSION_MINOR DEC(__DECCXX_VER/100000 % 100) +# define COMPILER_VERSION_PATCH DEC(__DECCXX_VER % 10000) + +#elif defined(__IBMCPP__) && defined(__COMPILER_VER__) +# define COMPILER_ID "zOS" + /* __IBMCPP__ = VRP */ +# define COMPILER_VERSION_MAJOR DEC(__IBMCPP__/100) +# define COMPILER_VERSION_MINOR DEC(__IBMCPP__/10 % 10) +# define COMPILER_VERSION_PATCH DEC(__IBMCPP__ % 10) + +#elif defined(__ibmxl__) && defined(__clang__) +# define COMPILER_ID "XLClang" +# define COMPILER_VERSION_MAJOR DEC(__ibmxl_version__) +# define COMPILER_VERSION_MINOR DEC(__ibmxl_release__) +# define COMPILER_VERSION_PATCH DEC(__ibmxl_modification__) +# define COMPILER_VERSION_TWEAK DEC(__ibmxl_ptf_fix_level__) + + +#elif defined(__IBMCPP__) && !defined(__COMPILER_VER__) && __IBMCPP__ >= 800 +# define COMPILER_ID "XL" + /* __IBMCPP__ = VRP */ +# define COMPILER_VERSION_MAJOR DEC(__IBMCPP__/100) +# define COMPILER_VERSION_MINOR DEC(__IBMCPP__/10 % 10) +# define COMPILER_VERSION_PATCH DEC(__IBMCPP__ % 10) + +#elif defined(__IBMCPP__) && !defined(__COMPILER_VER__) && __IBMCPP__ < 800 +# define COMPILER_ID "VisualAge" + /* __IBMCPP__ = VRP */ +# define COMPILER_VERSION_MAJOR DEC(__IBMCPP__/100) +# define COMPILER_VERSION_MINOR DEC(__IBMCPP__/10 % 10) +# define COMPILER_VERSION_PATCH DEC(__IBMCPP__ % 10) + +#elif defined(__PGI) +# define COMPILER_ID "PGI" +# define COMPILER_VERSION_MAJOR DEC(__PGIC__) +# define COMPILER_VERSION_MINOR DEC(__PGIC_MINOR__) +# if defined(__PGIC_PATCHLEVEL__) +# define COMPILER_VERSION_PATCH DEC(__PGIC_PATCHLEVEL__) +# endif + +#elif defined(_CRAYC) +# define COMPILER_ID "Cray" +# define COMPILER_VERSION_MAJOR DEC(_RELEASE_MAJOR) +# define COMPILER_VERSION_MINOR DEC(_RELEASE_MINOR) + +#elif defined(__TI_COMPILER_VERSION__) +# define COMPILER_ID "TI" + /* __TI_COMPILER_VERSION__ = VVVRRRPPP */ +# define COMPILER_VERSION_MAJOR DEC(__TI_COMPILER_VERSION__/1000000) +# define COMPILER_VERSION_MINOR DEC(__TI_COMPILER_VERSION__/1000 % 1000) +# define COMPILER_VERSION_PATCH DEC(__TI_COMPILER_VERSION__ % 1000) + +#elif defined(__FUJITSU) || defined(__FCC_VERSION) || defined(__fcc_version) +# define COMPILER_ID "Fujitsu" + +#elif defined(__ghs__) +# define COMPILER_ID "GHS" +/* __GHS_VERSION_NUMBER = VVVVRP */ +# ifdef __GHS_VERSION_NUMBER +# define COMPILER_VERSION_MAJOR DEC(__GHS_VERSION_NUMBER / 100) +# define COMPILER_VERSION_MINOR DEC(__GHS_VERSION_NUMBER / 10 % 10) +# define COMPILER_VERSION_PATCH DEC(__GHS_VERSION_NUMBER % 10) +# endif + +#elif defined(__SCO_VERSION__) +# define COMPILER_ID "SCO" + +#elif defined(__ARMCC_VERSION) && !defined(__clang__) +# define COMPILER_ID "ARMCC" +#if __ARMCC_VERSION >= 1000000 + /* __ARMCC_VERSION = VRRPPPP */ + # define COMPILER_VERSION_MAJOR DEC(__ARMCC_VERSION/1000000) + # define COMPILER_VERSION_MINOR DEC(__ARMCC_VERSION/10000 % 100) + # define COMPILER_VERSION_PATCH DEC(__ARMCC_VERSION % 10000) +#else + /* __ARMCC_VERSION = VRPPPP */ + # define COMPILER_VERSION_MAJOR DEC(__ARMCC_VERSION/100000) + # define COMPILER_VERSION_MINOR DEC(__ARMCC_VERSION/10000 % 10) + # define COMPILER_VERSION_PATCH DEC(__ARMCC_VERSION % 10000) +#endif + + +#elif defined(__clang__) && defined(__apple_build_version__) +# define COMPILER_ID "AppleClang" +# if defined(_MSC_VER) +# define SIMULATE_ID "MSVC" +# endif +# define COMPILER_VERSION_MAJOR DEC(__clang_major__) +# define COMPILER_VERSION_MINOR DEC(__clang_minor__) +# define COMPILER_VERSION_PATCH DEC(__clang_patchlevel__) +# if defined(_MSC_VER) + /* _MSC_VER = VVRR */ +# define SIMULATE_VERSION_MAJOR DEC(_MSC_VER / 100) +# define SIMULATE_VERSION_MINOR DEC(_MSC_VER % 100) +# endif +# define COMPILER_VERSION_TWEAK DEC(__apple_build_version__) + +#elif defined(__clang__) && defined(__ARMCOMPILER_VERSION) +# define COMPILER_ID "ARMClang" + # define COMPILER_VERSION_MAJOR DEC(__ARMCOMPILER_VERSION/1000000) + # define COMPILER_VERSION_MINOR DEC(__ARMCOMPILER_VERSION/10000 % 100) + # define COMPILER_VERSION_PATCH DEC(__ARMCOMPILER_VERSION % 10000) +# define COMPILER_VERSION_INTERNAL DEC(__ARMCOMPILER_VERSION) + +#elif defined(__clang__) && defined(__INTEL_DPCPP_COMPILER__) +# define COMPILER_ID "IntelDPCPP" +# if defined(_MSC_VER) +# define SIMULATE_ID "MSVC" +# endif +# define COMPILER_VERSION_MAJOR DEC(__clang_major__) +# define COMPILER_VERSION_MINOR DEC(__clang_minor__) +# define COMPILER_VERSION_PATCH DEC(__clang_patchlevel__) +# if defined(_MSC_VER) + /* _MSC_VER = VVRR */ +# define SIMULATE_VERSION_MAJOR DEC(_MSC_VER / 100) +# define SIMULATE_VERSION_MINOR DEC(_MSC_VER % 100) +# endif +# define COMPILER_VERSION_TWEAK DEC(__INTEL_DPCPP_COMPILER__) + +#elif defined(__clang__) && defined(__INTEL_CLANG_COMPILER) +# define COMPILER_ID "IntelClang" +# if defined(_MSC_VER) +# define SIMULATE_ID "MSVC" +# endif +# define COMPILER_VERSION_MAJOR DEC(__clang_major__) +# define COMPILER_VERSION_MINOR DEC(__clang_minor__) +# define COMPILER_VERSION_PATCH DEC(__clang_patchlevel__) +# if defined(_MSC_VER) + /* _MSC_VER = VVRR */ +# define SIMULATE_VERSION_MAJOR DEC(_MSC_VER / 100) +# define SIMULATE_VERSION_MINOR DEC(_MSC_VER % 100) +# endif +# define COMPILER_VERSION_TWEAK DEC(__INTEL_CLANG_COMPILER) + +#elif defined(__clang__) +# define COMPILER_ID "Clang" +# if defined(_MSC_VER) +# define SIMULATE_ID "MSVC" +# endif +# define COMPILER_VERSION_MAJOR DEC(__clang_major__) +# define COMPILER_VERSION_MINOR DEC(__clang_minor__) +# define COMPILER_VERSION_PATCH DEC(__clang_patchlevel__) +# if defined(_MSC_VER) + /* _MSC_VER = VVRR */ +# define SIMULATE_VERSION_MAJOR DEC(_MSC_VER / 100) +# define SIMULATE_VERSION_MINOR DEC(_MSC_VER % 100) +# endif + +#elif defined(__GNUC__) || defined(__GNUG__) +# define COMPILER_ID "GNU" +# if defined(__GNUC__) +# define COMPILER_VERSION_MAJOR DEC(__GNUC__) +# else +# define COMPILER_VERSION_MAJOR DEC(__GNUG__) +# endif +# if defined(__GNUC_MINOR__) +# define COMPILER_VERSION_MINOR DEC(__GNUC_MINOR__) +# endif +# if defined(__GNUC_PATCHLEVEL__) +# define COMPILER_VERSION_PATCH DEC(__GNUC_PATCHLEVEL__) +# endif + +#elif defined(_MSC_VER) +# define COMPILER_ID "MSVC" + /* _MSC_VER = VVRR */ +# define COMPILER_VERSION_MAJOR DEC(_MSC_VER / 100) +# define COMPILER_VERSION_MINOR DEC(_MSC_VER % 100) +# if defined(_MSC_FULL_VER) +# if _MSC_VER >= 1400 + /* _MSC_FULL_VER = VVRRPPPPP */ +# define COMPILER_VERSION_PATCH DEC(_MSC_FULL_VER % 100000) +# else + /* _MSC_FULL_VER = VVRRPPPP */ +# define COMPILER_VERSION_PATCH DEC(_MSC_FULL_VER % 10000) +# endif +# endif +# if defined(_MSC_BUILD) +# define COMPILER_VERSION_TWEAK DEC(_MSC_BUILD) +# endif + +#elif defined(__VISUALDSPVERSION__) || defined(__ADSPBLACKFIN__) || defined(__ADSPTS__) || defined(__ADSP21000__) +# define COMPILER_ID "ADSP" +#if defined(__VISUALDSPVERSION__) + /* __VISUALDSPVERSION__ = 0xVVRRPP00 */ +# define COMPILER_VERSION_MAJOR HEX(__VISUALDSPVERSION__>>24) +# define COMPILER_VERSION_MINOR HEX(__VISUALDSPVERSION__>>16 & 0xFF) +# define COMPILER_VERSION_PATCH HEX(__VISUALDSPVERSION__>>8 & 0xFF) +#endif + +#elif defined(__IAR_SYSTEMS_ICC__) || defined(__IAR_SYSTEMS_ICC) +# define COMPILER_ID "IAR" +# if defined(__VER__) && defined(__ICCARM__) +# define COMPILER_VERSION_MAJOR DEC((__VER__) / 1000000) +# define COMPILER_VERSION_MINOR DEC(((__VER__) / 1000) % 1000) +# define COMPILER_VERSION_PATCH DEC((__VER__) % 1000) +# define COMPILER_VERSION_INTERNAL DEC(__IAR_SYSTEMS_ICC__) +# elif defined(__VER__) && (defined(__ICCAVR__) || defined(__ICCRX__) || defined(__ICCRH850__) || defined(__ICCRL78__) || defined(__ICC430__) || defined(__ICCRISCV__) || defined(__ICCV850__) || defined(__ICC8051__)) +# define COMPILER_VERSION_MAJOR DEC((__VER__) / 100) +# define COMPILER_VERSION_MINOR DEC((__VER__) - (((__VER__) / 100)*100)) +# define COMPILER_VERSION_PATCH DEC(__SUBVERSION__) +# define COMPILER_VERSION_INTERNAL DEC(__IAR_SYSTEMS_ICC__) +# endif + + +/* These compilers are either not known or too old to define an + identification macro. Try to identify the platform and guess that + it is the native compiler. */ +#elif defined(__hpux) || defined(__hpua) +# define COMPILER_ID "HP" + +#else /* unknown compiler */ +# define COMPILER_ID "" +#endif + +/* Construct the string literal in pieces to prevent the source from + getting matched. Store it in a pointer rather than an array + because some compilers will just produce instructions to fill the + array rather than assigning a pointer to a static array. */ +char const* info_compiler = "INFO" ":" "compiler[" COMPILER_ID "]"; +#ifdef SIMULATE_ID +char const* info_simulate = "INFO" ":" "simulate[" SIMULATE_ID "]"; +#endif + +#ifdef __QNXNTO__ +char const* qnxnto = "INFO" ":" "qnxnto[]"; +#endif + +#if defined(__CRAYXE) || defined(__CRAYXC) +char const *info_cray = "INFO" ":" "compiler_wrapper[CrayPrgEnv]"; +#endif + +#define STRINGIFY_HELPER(X) #X +#define STRINGIFY(X) STRINGIFY_HELPER(X) + +/* Identify known platforms by name. */ +#if defined(__linux) || defined(__linux__) || defined(linux) +# define PLATFORM_ID "Linux" + +#elif defined(__CYGWIN__) +# define PLATFORM_ID "Cygwin" + +#elif defined(__MINGW32__) +# define PLATFORM_ID "MinGW" + +#elif defined(__APPLE__) +# define PLATFORM_ID "Darwin" + +#elif defined(_WIN32) || defined(__WIN32__) || defined(WIN32) +# define PLATFORM_ID "Windows" + +#elif defined(__FreeBSD__) || defined(__FreeBSD) +# define PLATFORM_ID "FreeBSD" + +#elif defined(__NetBSD__) || defined(__NetBSD) +# define PLATFORM_ID "NetBSD" + +#elif defined(__OpenBSD__) || defined(__OPENBSD) +# define PLATFORM_ID "OpenBSD" + +#elif defined(__sun) || defined(sun) +# define PLATFORM_ID "SunOS" + +#elif defined(_AIX) || defined(__AIX) || defined(__AIX__) || defined(__aix) || defined(__aix__) +# define PLATFORM_ID "AIX" + +#elif defined(__hpux) || defined(__hpux__) +# define PLATFORM_ID "HP-UX" + +#elif defined(__HAIKU__) +# define PLATFORM_ID "Haiku" + +#elif defined(__BeOS) || defined(__BEOS__) || defined(_BEOS) +# define PLATFORM_ID "BeOS" + +#elif defined(__QNX__) || defined(__QNXNTO__) +# define PLATFORM_ID "QNX" + +#elif defined(__tru64) || defined(_tru64) || defined(__TRU64__) +# define PLATFORM_ID "Tru64" + +#elif defined(__riscos) || defined(__riscos__) +# define PLATFORM_ID "RISCos" + +#elif defined(__sinix) || defined(__sinix__) || defined(__SINIX__) +# define PLATFORM_ID "SINIX" + +#elif defined(__UNIX_SV__) +# define PLATFORM_ID "UNIX_SV" + +#elif defined(__bsdos__) +# define PLATFORM_ID "BSDOS" + +#elif defined(_MPRAS) || defined(MPRAS) +# define PLATFORM_ID "MP-RAS" + +#elif defined(__osf) || defined(__osf__) +# define PLATFORM_ID "OSF1" + +#elif defined(_SCO_SV) || defined(SCO_SV) || defined(sco_sv) +# define PLATFORM_ID "SCO_SV" + +#elif defined(__ultrix) || defined(__ultrix__) || defined(_ULTRIX) +# define PLATFORM_ID "ULTRIX" + +#elif defined(__XENIX__) || defined(_XENIX) || defined(XENIX) +# define PLATFORM_ID "Xenix" + +#elif defined(__WATCOMC__) +# if defined(__LINUX__) +# define PLATFORM_ID "Linux" + +# elif defined(__DOS__) +# define PLATFORM_ID "DOS" + +# elif defined(__OS2__) +# define PLATFORM_ID "OS2" + +# elif defined(__WINDOWS__) +# define PLATFORM_ID "Windows3x" + +# elif defined(__VXWORKS__) +# define PLATFORM_ID "VxWorks" + +# else /* unknown platform */ +# define PLATFORM_ID +# endif + +#elif defined(__INTEGRITY) +# if defined(INT_178B) +# define PLATFORM_ID "Integrity178" + +# else /* regular Integrity */ +# define PLATFORM_ID "Integrity" +# endif + +#else /* unknown platform */ +# define PLATFORM_ID + +#endif + +/* For windows compilers MSVC and Intel we can determine + the architecture of the compiler being used. This is because + the compilers do not have flags that can change the architecture, + but rather depend on which compiler is being used +*/ +#if defined(_WIN32) && defined(_MSC_VER) +# if defined(_M_IA64) +# define ARCHITECTURE_ID "IA64" + +# elif defined(_M_X64) || defined(_M_AMD64) +# define ARCHITECTURE_ID "x64" + +# elif defined(_M_IX86) +# define ARCHITECTURE_ID "X86" + +# elif defined(_M_ARM64) +# define ARCHITECTURE_ID "ARM64" + +# elif defined(_M_ARM) +# if _M_ARM == 4 +# define ARCHITECTURE_ID "ARMV4I" +# elif _M_ARM == 5 +# define ARCHITECTURE_ID "ARMV5I" +# else +# define ARCHITECTURE_ID "ARMV" STRINGIFY(_M_ARM) +# endif + +# elif defined(_M_MIPS) +# define ARCHITECTURE_ID "MIPS" + +# elif defined(_M_SH) +# define ARCHITECTURE_ID "SHx" + +# else /* unknown architecture */ +# define ARCHITECTURE_ID "" +# endif + +#elif defined(__WATCOMC__) +# if defined(_M_I86) +# define ARCHITECTURE_ID "I86" + +# elif defined(_M_IX86) +# define ARCHITECTURE_ID "X86" + +# else /* unknown architecture */ +# define ARCHITECTURE_ID "" +# endif + +#elif defined(__IAR_SYSTEMS_ICC__) || defined(__IAR_SYSTEMS_ICC) +# if defined(__ICCARM__) +# define ARCHITECTURE_ID "ARM" + +# elif defined(__ICCRX__) +# define ARCHITECTURE_ID "RX" + +# elif defined(__ICCRH850__) +# define ARCHITECTURE_ID "RH850" + +# elif defined(__ICCRL78__) +# define ARCHITECTURE_ID "RL78" + +# elif defined(__ICCRISCV__) +# define ARCHITECTURE_ID "RISCV" + +# elif defined(__ICCAVR__) +# define ARCHITECTURE_ID "AVR" + +# elif defined(__ICC430__) +# define ARCHITECTURE_ID "MSP430" + +# elif defined(__ICCV850__) +# define ARCHITECTURE_ID "V850" + +# elif defined(__ICC8051__) +# define ARCHITECTURE_ID "8051" + +# else /* unknown architecture */ +# define ARCHITECTURE_ID "" +# endif + +#elif defined(__ghs__) +# if defined(__PPC64__) +# define ARCHITECTURE_ID "PPC64" + +# elif defined(__ppc__) +# define ARCHITECTURE_ID "PPC" + +# elif defined(__ARM__) +# define ARCHITECTURE_ID "ARM" + +# elif defined(__x86_64__) +# define ARCHITECTURE_ID "x64" + +# elif defined(__i386__) +# define ARCHITECTURE_ID "X86" + +# else /* unknown architecture */ +# define ARCHITECTURE_ID "" +# endif + +#elif defined(__TI_COMPILER_VERSION__) +# if defined(__TI_ARM__) +# define ARCHITECTURE_ID "ARM" + +# elif defined(__MSP430__) +# define ARCHITECTURE_ID "MSP430" + +# elif defined(__TMS320C28XX__) +# define ARCHITECTURE_ID "TMS320C28x" + +# elif defined(__TMS320C6X__) || defined(_TMS320C6X) +# define ARCHITECTURE_ID "TMS320C6x" + +# else /* unknown architecture */ +# define ARCHITECTURE_ID "" +# endif + +#else +# define ARCHITECTURE_ID +#endif + +/* Convert integer to decimal digit literals. */ +#define DEC(n) \ + ('0' + (((n) / 10000000)%10)), \ + ('0' + (((n) / 1000000)%10)), \ + ('0' + (((n) / 100000)%10)), \ + ('0' + (((n) / 10000)%10)), \ + ('0' + (((n) / 1000)%10)), \ + ('0' + (((n) / 100)%10)), \ + ('0' + (((n) / 10)%10)), \ + ('0' + ((n) % 10)) + +/* Convert integer to hex digit literals. */ +#define HEX(n) \ + ('0' + ((n)>>28 & 0xF)), \ + ('0' + ((n)>>24 & 0xF)), \ + ('0' + ((n)>>20 & 0xF)), \ + ('0' + ((n)>>16 & 0xF)), \ + ('0' + ((n)>>12 & 0xF)), \ + ('0' + ((n)>>8 & 0xF)), \ + ('0' + ((n)>>4 & 0xF)), \ + ('0' + ((n) & 0xF)) + +/* Construct a string literal encoding the version number components. */ +#ifdef COMPILER_VERSION_MAJOR +char const info_version[] = { + 'I', 'N', 'F', 'O', ':', + 'c','o','m','p','i','l','e','r','_','v','e','r','s','i','o','n','[', + COMPILER_VERSION_MAJOR, +# ifdef COMPILER_VERSION_MINOR + '.', COMPILER_VERSION_MINOR, +# ifdef COMPILER_VERSION_PATCH + '.', COMPILER_VERSION_PATCH, +# ifdef COMPILER_VERSION_TWEAK + '.', COMPILER_VERSION_TWEAK, +# endif +# endif +# endif + ']','\0'}; +#endif + +/* Construct a string literal encoding the internal version number. */ +#ifdef COMPILER_VERSION_INTERNAL +char const info_version_internal[] = { + 'I', 'N', 'F', 'O', ':', + 'c','o','m','p','i','l','e','r','_','v','e','r','s','i','o','n','_', + 'i','n','t','e','r','n','a','l','[', + COMPILER_VERSION_INTERNAL,']','\0'}; +#endif + +/* Construct a string literal encoding the version number components. */ +#ifdef SIMULATE_VERSION_MAJOR +char const info_simulate_version[] = { + 'I', 'N', 'F', 'O', ':', + 's','i','m','u','l','a','t','e','_','v','e','r','s','i','o','n','[', + SIMULATE_VERSION_MAJOR, +# ifdef SIMULATE_VERSION_MINOR + '.', SIMULATE_VERSION_MINOR, +# ifdef SIMULATE_VERSION_PATCH + '.', SIMULATE_VERSION_PATCH, +# ifdef SIMULATE_VERSION_TWEAK + '.', SIMULATE_VERSION_TWEAK, +# endif +# endif +# endif + ']','\0'}; +#endif + +/* Construct the string literal in pieces to prevent the source from + getting matched. Store it in a pointer rather than an array + because some compilers will just produce instructions to fill the + array rather than assigning a pointer to a static array. */ +char const* info_platform = "INFO" ":" "platform[" PLATFORM_ID "]"; +char const* info_arch = "INFO" ":" "arch[" ARCHITECTURE_ID "]"; + + + +#if defined(__INTEL_COMPILER) && defined(_MSVC_LANG) && _MSVC_LANG < 201403L +# if defined(__INTEL_CXX11_MODE__) +# if defined(__cpp_aggregate_nsdmi) +# define CXX_STD 201402L +# else +# define CXX_STD 201103L +# endif +# else +# define CXX_STD 199711L +# endif +#elif defined(_MSC_VER) && defined(_MSVC_LANG) +# define CXX_STD _MSVC_LANG +#else +# define CXX_STD __cplusplus +#endif + +const char* info_language_dialect_default = "INFO" ":" "dialect_default[" +#if CXX_STD > 201703L + "20" +#elif CXX_STD >= 201703L + "17" +#elif CXX_STD >= 201402L + "14" +#elif CXX_STD >= 201103L + "11" +#else + "98" +#endif +"]"; + +/*--------------------------------------------------------------------------*/ + +int main(int argc, char* argv[]) +{ + int require = 0; + require += info_compiler[argc]; + require += info_platform[argc]; +#ifdef COMPILER_VERSION_MAJOR + require += info_version[argc]; +#endif +#ifdef COMPILER_VERSION_INTERNAL + require += info_version_internal[argc]; +#endif +#ifdef SIMULATE_ID + require += info_simulate[argc]; +#endif +#ifdef SIMULATE_VERSION_MAJOR + require += info_simulate_version[argc]; +#endif +#if defined(__CRAYXE) || defined(__CRAYXC) + require += info_cray[argc]; +#endif + require += info_language_dialect_default[argc]; + (void)argv; + return require; +} diff --git a/android/build-jni-arm64-v8a/CMakeFiles/3.19.1/CompilerIdCXX/CMakeCXXCompilerId.o b/android/build-jni-arm64-v8a/CMakeFiles/3.19.1/CompilerIdCXX/CMakeCXXCompilerId.o new file mode 100644 index 0000000..c988e18 Binary files /dev/null and b/android/build-jni-arm64-v8a/CMakeFiles/3.19.1/CompilerIdCXX/CMakeCXXCompilerId.o differ diff --git a/android/build-jni-arm64-v8a/CMakeFiles/CMakeDirectoryInformation.cmake b/android/build-jni-arm64-v8a/CMakeFiles/CMakeDirectoryInformation.cmake new file mode 100644 index 0000000..e701769 --- /dev/null +++ b/android/build-jni-arm64-v8a/CMakeFiles/CMakeDirectoryInformation.cmake @@ -0,0 +1,16 @@ +# CMAKE generated file: DO NOT EDIT! +# Generated by "Unix Makefiles" Generator, CMake Version 3.19 + +# Relative path conversion top directories. +set(CMAKE_RELATIVE_PATH_TOP_SOURCE "/Users/yichao.wu/deepctrl/GmSSL-Java/android") +set(CMAKE_RELATIVE_PATH_TOP_BINARY "/Users/yichao.wu/deepctrl/GmSSL-Java/android/build-jni-arm64-v8a") + +# Force unix paths in dependencies. +set(CMAKE_FORCE_UNIX_PATHS 1) + + +# The C and CXX include file regular expressions for this directory. +set(CMAKE_C_INCLUDE_REGEX_SCAN "^.*$") +set(CMAKE_C_INCLUDE_REGEX_COMPLAIN "^$") +set(CMAKE_CXX_INCLUDE_REGEX_SCAN ${CMAKE_C_INCLUDE_REGEX_SCAN}) +set(CMAKE_CXX_INCLUDE_REGEX_COMPLAIN ${CMAKE_C_INCLUDE_REGEX_COMPLAIN}) diff --git a/android/build-jni-arm64-v8a/CMakeFiles/Makefile.cmake b/android/build-jni-arm64-v8a/CMakeFiles/Makefile.cmake new file mode 100644 index 0000000..7fbef0d --- /dev/null +++ b/android/build-jni-arm64-v8a/CMakeFiles/Makefile.cmake @@ -0,0 +1,132 @@ +# CMAKE generated file: DO NOT EDIT! +# Generated by "Unix Makefiles" Generator, CMake Version 3.19 + +# The generator used is: +set(CMAKE_DEPENDS_GENERATOR "Unix Makefiles") + +# The top level Makefile was generated from the following files: +set(CMAKE_MAKEFILE_DEPENDS + "CMakeCache.txt" + "/Users/yichao.wu/Library/Android/sdk/ndk/27.1.12297006/build/cmake/abis.cmake" + "/Users/yichao.wu/Library/Android/sdk/ndk/27.1.12297006/build/cmake/android-legacy.toolchain.cmake" + "/Users/yichao.wu/Library/Android/sdk/ndk/27.1.12297006/build/cmake/android.toolchain.cmake" + "/Users/yichao.wu/Library/Android/sdk/ndk/27.1.12297006/build/cmake/platforms.cmake" + "../CMakeLists.txt" + "CMakeFiles/3.19.1/CMakeCCompiler.cmake" + "CMakeFiles/3.19.1/CMakeCXXCompiler.cmake" + "CMakeFiles/3.19.1/CMakeSystem.cmake" + "/usr/local/Cellar/cmake/3.19.1/share/cmake/Modules/CMakeCCompiler.cmake.in" + "/usr/local/Cellar/cmake/3.19.1/share/cmake/Modules/CMakeCCompilerABI.c" + "/usr/local/Cellar/cmake/3.19.1/share/cmake/Modules/CMakeCInformation.cmake" + "/usr/local/Cellar/cmake/3.19.1/share/cmake/Modules/CMakeCXXCompiler.cmake.in" + "/usr/local/Cellar/cmake/3.19.1/share/cmake/Modules/CMakeCXXCompilerABI.cpp" + "/usr/local/Cellar/cmake/3.19.1/share/cmake/Modules/CMakeCXXInformation.cmake" + "/usr/local/Cellar/cmake/3.19.1/share/cmake/Modules/CMakeCheckCompilerFlagCommonPatterns.cmake" + "/usr/local/Cellar/cmake/3.19.1/share/cmake/Modules/CMakeCommonLanguageInclude.cmake" + "/usr/local/Cellar/cmake/3.19.1/share/cmake/Modules/CMakeCompilerIdDetection.cmake" + "/usr/local/Cellar/cmake/3.19.1/share/cmake/Modules/CMakeDetermineCCompiler.cmake" + "/usr/local/Cellar/cmake/3.19.1/share/cmake/Modules/CMakeDetermineCXXCompiler.cmake" + "/usr/local/Cellar/cmake/3.19.1/share/cmake/Modules/CMakeDetermineCompileFeatures.cmake" + "/usr/local/Cellar/cmake/3.19.1/share/cmake/Modules/CMakeDetermineCompiler.cmake" + "/usr/local/Cellar/cmake/3.19.1/share/cmake/Modules/CMakeDetermineCompilerABI.cmake" + "/usr/local/Cellar/cmake/3.19.1/share/cmake/Modules/CMakeDetermineCompilerId.cmake" + "/usr/local/Cellar/cmake/3.19.1/share/cmake/Modules/CMakeDetermineSystem.cmake" + "/usr/local/Cellar/cmake/3.19.1/share/cmake/Modules/CMakeFindBinUtils.cmake" + "/usr/local/Cellar/cmake/3.19.1/share/cmake/Modules/CMakeGenericSystem.cmake" + "/usr/local/Cellar/cmake/3.19.1/share/cmake/Modules/CMakeInitializeConfigs.cmake" + "/usr/local/Cellar/cmake/3.19.1/share/cmake/Modules/CMakeLanguageInformation.cmake" + "/usr/local/Cellar/cmake/3.19.1/share/cmake/Modules/CMakeParseImplicitIncludeInfo.cmake" + "/usr/local/Cellar/cmake/3.19.1/share/cmake/Modules/CMakeParseImplicitLinkInfo.cmake" + "/usr/local/Cellar/cmake/3.19.1/share/cmake/Modules/CMakeSystem.cmake.in" + "/usr/local/Cellar/cmake/3.19.1/share/cmake/Modules/CMakeSystemSpecificInformation.cmake" + "/usr/local/Cellar/cmake/3.19.1/share/cmake/Modules/CMakeSystemSpecificInitialize.cmake" + "/usr/local/Cellar/cmake/3.19.1/share/cmake/Modules/CMakeTestCCompiler.cmake" + "/usr/local/Cellar/cmake/3.19.1/share/cmake/Modules/CMakeTestCXXCompiler.cmake" + "/usr/local/Cellar/cmake/3.19.1/share/cmake/Modules/CMakeTestCompilerCommon.cmake" + "/usr/local/Cellar/cmake/3.19.1/share/cmake/Modules/CMakeUnixFindMake.cmake" + "/usr/local/Cellar/cmake/3.19.1/share/cmake/Modules/Compiler/ADSP-DetermineCompiler.cmake" + "/usr/local/Cellar/cmake/3.19.1/share/cmake/Modules/Compiler/ARMCC-DetermineCompiler.cmake" + "/usr/local/Cellar/cmake/3.19.1/share/cmake/Modules/Compiler/ARMClang-DetermineCompiler.cmake" + "/usr/local/Cellar/cmake/3.19.1/share/cmake/Modules/Compiler/AppleClang-DetermineCompiler.cmake" + "/usr/local/Cellar/cmake/3.19.1/share/cmake/Modules/Compiler/Borland-DetermineCompiler.cmake" + "/usr/local/Cellar/cmake/3.19.1/share/cmake/Modules/Compiler/Bruce-C-DetermineCompiler.cmake" + "/usr/local/Cellar/cmake/3.19.1/share/cmake/Modules/Compiler/CMakeCommonCompilerMacros.cmake" + "/usr/local/Cellar/cmake/3.19.1/share/cmake/Modules/Compiler/Clang-C.cmake" + "/usr/local/Cellar/cmake/3.19.1/share/cmake/Modules/Compiler/Clang-CXX.cmake" + "/usr/local/Cellar/cmake/3.19.1/share/cmake/Modules/Compiler/Clang-DetermineCompiler.cmake" + "/usr/local/Cellar/cmake/3.19.1/share/cmake/Modules/Compiler/Clang-DetermineCompilerInternal.cmake" + "/usr/local/Cellar/cmake/3.19.1/share/cmake/Modules/Compiler/Clang-FindBinUtils.cmake" + "/usr/local/Cellar/cmake/3.19.1/share/cmake/Modules/Compiler/Clang.cmake" + "/usr/local/Cellar/cmake/3.19.1/share/cmake/Modules/Compiler/Comeau-CXX-DetermineCompiler.cmake" + "/usr/local/Cellar/cmake/3.19.1/share/cmake/Modules/Compiler/Compaq-C-DetermineCompiler.cmake" + "/usr/local/Cellar/cmake/3.19.1/share/cmake/Modules/Compiler/Compaq-CXX-DetermineCompiler.cmake" + "/usr/local/Cellar/cmake/3.19.1/share/cmake/Modules/Compiler/Cray-DetermineCompiler.cmake" + "/usr/local/Cellar/cmake/3.19.1/share/cmake/Modules/Compiler/Embarcadero-DetermineCompiler.cmake" + "/usr/local/Cellar/cmake/3.19.1/share/cmake/Modules/Compiler/Fujitsu-DetermineCompiler.cmake" + "/usr/local/Cellar/cmake/3.19.1/share/cmake/Modules/Compiler/GHS-DetermineCompiler.cmake" + "/usr/local/Cellar/cmake/3.19.1/share/cmake/Modules/Compiler/GNU-C-DetermineCompiler.cmake" + "/usr/local/Cellar/cmake/3.19.1/share/cmake/Modules/Compiler/GNU-CXX-DetermineCompiler.cmake" + "/usr/local/Cellar/cmake/3.19.1/share/cmake/Modules/Compiler/GNU.cmake" + "/usr/local/Cellar/cmake/3.19.1/share/cmake/Modules/Compiler/HP-C-DetermineCompiler.cmake" + "/usr/local/Cellar/cmake/3.19.1/share/cmake/Modules/Compiler/HP-CXX-DetermineCompiler.cmake" + "/usr/local/Cellar/cmake/3.19.1/share/cmake/Modules/Compiler/IAR-DetermineCompiler.cmake" + "/usr/local/Cellar/cmake/3.19.1/share/cmake/Modules/Compiler/IBMCPP-C-DetermineVersionInternal.cmake" + "/usr/local/Cellar/cmake/3.19.1/share/cmake/Modules/Compiler/IBMCPP-CXX-DetermineVersionInternal.cmake" + "/usr/local/Cellar/cmake/3.19.1/share/cmake/Modules/Compiler/Intel-DetermineCompiler.cmake" + "/usr/local/Cellar/cmake/3.19.1/share/cmake/Modules/Compiler/IntelClang-DetermineCompiler.cmake" + "/usr/local/Cellar/cmake/3.19.1/share/cmake/Modules/Compiler/IntelDPCPP-DetermineCompiler.cmake" + "/usr/local/Cellar/cmake/3.19.1/share/cmake/Modules/Compiler/MSVC-DetermineCompiler.cmake" + "/usr/local/Cellar/cmake/3.19.1/share/cmake/Modules/Compiler/NVIDIA-DetermineCompiler.cmake" + "/usr/local/Cellar/cmake/3.19.1/share/cmake/Modules/Compiler/OpenWatcom-DetermineCompiler.cmake" + "/usr/local/Cellar/cmake/3.19.1/share/cmake/Modules/Compiler/PGI-DetermineCompiler.cmake" + "/usr/local/Cellar/cmake/3.19.1/share/cmake/Modules/Compiler/PathScale-DetermineCompiler.cmake" + "/usr/local/Cellar/cmake/3.19.1/share/cmake/Modules/Compiler/SCO-DetermineCompiler.cmake" + "/usr/local/Cellar/cmake/3.19.1/share/cmake/Modules/Compiler/SDCC-C-DetermineCompiler.cmake" + "/usr/local/Cellar/cmake/3.19.1/share/cmake/Modules/Compiler/SunPro-C-DetermineCompiler.cmake" + "/usr/local/Cellar/cmake/3.19.1/share/cmake/Modules/Compiler/SunPro-CXX-DetermineCompiler.cmake" + "/usr/local/Cellar/cmake/3.19.1/share/cmake/Modules/Compiler/TI-DetermineCompiler.cmake" + "/usr/local/Cellar/cmake/3.19.1/share/cmake/Modules/Compiler/TinyCC-C-DetermineCompiler.cmake" + "/usr/local/Cellar/cmake/3.19.1/share/cmake/Modules/Compiler/VisualAge-C-DetermineCompiler.cmake" + "/usr/local/Cellar/cmake/3.19.1/share/cmake/Modules/Compiler/VisualAge-CXX-DetermineCompiler.cmake" + "/usr/local/Cellar/cmake/3.19.1/share/cmake/Modules/Compiler/Watcom-DetermineCompiler.cmake" + "/usr/local/Cellar/cmake/3.19.1/share/cmake/Modules/Compiler/XL-C-DetermineCompiler.cmake" + "/usr/local/Cellar/cmake/3.19.1/share/cmake/Modules/Compiler/XL-CXX-DetermineCompiler.cmake" + "/usr/local/Cellar/cmake/3.19.1/share/cmake/Modules/Compiler/XLClang-C-DetermineCompiler.cmake" + "/usr/local/Cellar/cmake/3.19.1/share/cmake/Modules/Compiler/XLClang-CXX-DetermineCompiler.cmake" + "/usr/local/Cellar/cmake/3.19.1/share/cmake/Modules/Compiler/zOS-C-DetermineCompiler.cmake" + "/usr/local/Cellar/cmake/3.19.1/share/cmake/Modules/Compiler/zOS-CXX-DetermineCompiler.cmake" + "/usr/local/Cellar/cmake/3.19.1/share/cmake/Modules/Internal/CMakeCheckCompilerFlag.cmake" + "/usr/local/Cellar/cmake/3.19.1/share/cmake/Modules/Internal/FeatureTesting.cmake" + "/usr/local/Cellar/cmake/3.19.1/share/cmake/Modules/Platform/Android-Clang-C.cmake" + "/usr/local/Cellar/cmake/3.19.1/share/cmake/Modules/Platform/Android-Clang-CXX.cmake" + "/usr/local/Cellar/cmake/3.19.1/share/cmake/Modules/Platform/Android-Clang.cmake" + "/usr/local/Cellar/cmake/3.19.1/share/cmake/Modules/Platform/Android-Determine-C.cmake" + "/usr/local/Cellar/cmake/3.19.1/share/cmake/Modules/Platform/Android-Determine-CXX.cmake" + "/usr/local/Cellar/cmake/3.19.1/share/cmake/Modules/Platform/Android-Determine.cmake" + "/usr/local/Cellar/cmake/3.19.1/share/cmake/Modules/Platform/Android-Initialize.cmake" + "/usr/local/Cellar/cmake/3.19.1/share/cmake/Modules/Platform/Android.cmake" + "/usr/local/Cellar/cmake/3.19.1/share/cmake/Modules/Platform/Android/Determine-Compiler.cmake" + "/usr/local/Cellar/cmake/3.19.1/share/cmake/Modules/Platform/Linux.cmake" + "/usr/local/Cellar/cmake/3.19.1/share/cmake/Modules/Platform/UnixPaths.cmake" + ) + +# The corresponding makefile is: +set(CMAKE_MAKEFILE_OUTPUTS + "Makefile" + "CMakeFiles/cmake.check_cache" + ) + +# Byproducts of CMake generate step: +set(CMAKE_MAKEFILE_PRODUCTS + "CMakeFiles/3.19.1/CMakeSystem.cmake" + "CMakeFiles/3.19.1/CMakeCCompiler.cmake" + "CMakeFiles/3.19.1/CMakeCXXCompiler.cmake" + "CMakeFiles/3.19.1/CMakeCCompiler.cmake" + "CMakeFiles/3.19.1/CMakeCXXCompiler.cmake" + "CMakeFiles/CMakeDirectoryInformation.cmake" + ) + +# Dependency information for all targets: +set(CMAKE_DEPEND_INFO_FILES + "CMakeFiles/gmssljni.dir/DependInfo.cmake" + ) diff --git a/android/build-jni-arm64-v8a/CMakeFiles/Makefile2 b/android/build-jni-arm64-v8a/CMakeFiles/Makefile2 new file mode 100644 index 0000000..9d5db5e --- /dev/null +++ b/android/build-jni-arm64-v8a/CMakeFiles/Makefile2 @@ -0,0 +1,125 @@ +# CMAKE generated file: DO NOT EDIT! +# Generated by "Unix Makefiles" Generator, CMake Version 3.19 + +# Default target executed when no arguments are given to make. +default_target: all + +.PHONY : default_target + +#============================================================================= +# Special targets provided by cmake. + +# Disable implicit rules so canonical targets will work. +.SUFFIXES: + + +# Disable VCS-based implicit rules. +% : %,v + + +# Disable VCS-based implicit rules. +% : RCS/% + + +# Disable VCS-based implicit rules. +% : RCS/%,v + + +# Disable VCS-based implicit rules. +% : SCCS/s.% + + +# Disable VCS-based implicit rules. +% : s.% + + +.SUFFIXES: .hpux_make_needs_suffix_list + + +# Command-line flag to silence nested $(MAKE). +$(VERBOSE)MAKESILENT = -s + +#Suppress display of executed commands. +$(VERBOSE).SILENT: + +# A target that is always out of date. +cmake_force: + +.PHONY : cmake_force + +#============================================================================= +# Set environment variables for the build. + +# The shell in which to execute make rules. +SHELL = /bin/sh + +# The CMake executable. +CMAKE_COMMAND = /usr/local/Cellar/cmake/3.19.1/bin/cmake + +# The command to remove a file. +RM = /usr/local/Cellar/cmake/3.19.1/bin/cmake -E rm -f + +# Escaping for special characters. +EQUALS = = + +# The top-level source directory on which CMake was run. +CMAKE_SOURCE_DIR = /Users/yichao.wu/deepctrl/GmSSL-Java/android + +# The top-level build directory on which CMake was run. +CMAKE_BINARY_DIR = /Users/yichao.wu/deepctrl/GmSSL-Java/android/build-jni-arm64-v8a + +#============================================================================= +# Directory level rules for the build root directory + +# The main recursive "all" target. +all: CMakeFiles/gmssljni.dir/all + +.PHONY : all + +# The main recursive "preinstall" target. +preinstall: + +.PHONY : preinstall + +# The main recursive "clean" target. +clean: CMakeFiles/gmssljni.dir/clean + +.PHONY : clean + +#============================================================================= +# Target rules for target CMakeFiles/gmssljni.dir + +# All Build rule for target. +CMakeFiles/gmssljni.dir/all: + $(MAKE) $(MAKESILENT) -f CMakeFiles/gmssljni.dir/build.make CMakeFiles/gmssljni.dir/depend + $(MAKE) $(MAKESILENT) -f CMakeFiles/gmssljni.dir/build.make CMakeFiles/gmssljni.dir/build + @$(CMAKE_COMMAND) -E cmake_echo_color --switch=$(COLOR) --progress-dir=/Users/yichao.wu/deepctrl/GmSSL-Java/android/build-jni-arm64-v8a/CMakeFiles --progress-num=1,2 "Built target gmssljni" +.PHONY : CMakeFiles/gmssljni.dir/all + +# Build rule for subdir invocation for target. +CMakeFiles/gmssljni.dir/rule: cmake_check_build_system + $(CMAKE_COMMAND) -E cmake_progress_start /Users/yichao.wu/deepctrl/GmSSL-Java/android/build-jni-arm64-v8a/CMakeFiles 2 + $(MAKE) $(MAKESILENT) -f CMakeFiles/Makefile2 CMakeFiles/gmssljni.dir/all + $(CMAKE_COMMAND) -E cmake_progress_start /Users/yichao.wu/deepctrl/GmSSL-Java/android/build-jni-arm64-v8a/CMakeFiles 0 +.PHONY : CMakeFiles/gmssljni.dir/rule + +# Convenience name for target. +gmssljni: CMakeFiles/gmssljni.dir/rule + +.PHONY : gmssljni + +# clean rule for target. +CMakeFiles/gmssljni.dir/clean: + $(MAKE) $(MAKESILENT) -f CMakeFiles/gmssljni.dir/build.make CMakeFiles/gmssljni.dir/clean +.PHONY : CMakeFiles/gmssljni.dir/clean + +#============================================================================= +# Special targets to cleanup operation of make. + +# Special rule to run CMake to check the build system integrity. +# No rule that depends on this can have commands that come from listfiles +# because they might be regenerated. +cmake_check_build_system: + $(CMAKE_COMMAND) -S$(CMAKE_SOURCE_DIR) -B$(CMAKE_BINARY_DIR) --check-build-system CMakeFiles/Makefile.cmake 0 +.PHONY : cmake_check_build_system + diff --git a/android/build-jni-arm64-v8a/CMakeFiles/TargetDirectories.txt b/android/build-jni-arm64-v8a/CMakeFiles/TargetDirectories.txt new file mode 100644 index 0000000..8175c9b --- /dev/null +++ b/android/build-jni-arm64-v8a/CMakeFiles/TargetDirectories.txt @@ -0,0 +1,3 @@ +/Users/yichao.wu/deepctrl/GmSSL-Java/android/build-jni-arm64-v8a/CMakeFiles/rebuild_cache.dir +/Users/yichao.wu/deepctrl/GmSSL-Java/android/build-jni-arm64-v8a/CMakeFiles/edit_cache.dir +/Users/yichao.wu/deepctrl/GmSSL-Java/android/build-jni-arm64-v8a/CMakeFiles/gmssljni.dir diff --git a/android/build-jni-arm64-v8a/CMakeFiles/cmake.check_cache b/android/build-jni-arm64-v8a/CMakeFiles/cmake.check_cache new file mode 100644 index 0000000..3dccd73 --- /dev/null +++ b/android/build-jni-arm64-v8a/CMakeFiles/cmake.check_cache @@ -0,0 +1 @@ +# This file is generated by cmake for dependency checking of the CMakeCache.txt file diff --git a/android/build-jni-arm64-v8a/CMakeFiles/gmssljni.dir/C.includecache b/android/build-jni-arm64-v8a/CMakeFiles/gmssljni.dir/C.includecache new file mode 100644 index 0000000..ccd37d8 --- /dev/null +++ b/android/build-jni-arm64-v8a/CMakeFiles/gmssljni.dir/C.includecache @@ -0,0 +1,258 @@ +#IncludeRegexLine: ^[ ]*[#%][ ]*(include|import)[ ]*[<"]([^">]+)([">]) + +#IncludeRegexScan: ^.*$ + +#IncludeRegexComplain: ^$ + +#IncludeRegexTransform: + +/Users/yichao.wu/deepctrl/GmSSL-Java/src/main/c/gmssljni.c +stdio.h +- +stdlib.h +- +string.h +- +limits.h +- +gmssl/sm2.h +- +gmssl/sm3.h +- +gmssl/sm4.h +- +gmssl/sm9.h +- +gmssl/zuc.h +- +gmssl/mem.h +- +gmssl/rand.h +- +gmssl/x509.h +- +gmssl/x509_req.h +- +gmssl/error.h +- +gmssl/pbkdf2.h +- +gmssl/version.h +- +gmssljni.h +/Users/yichao.wu/deepctrl/GmSSL-Java/src/main/c/gmssljni.h + +/Users/yichao.wu/deepctrl/GmSSL-Java/src/main/c/gmssljni.h +jni.h +- + +/Users/yichao.wu/deepctrl/GmSSL/include/gmssl/asn1.h +time.h +- +stdlib.h +- +stdint.h +- + +/Users/yichao.wu/deepctrl/GmSSL/include/gmssl/digest.h +stdint.h +- +stdlib.h +- +gmssl/sm3.h +- +gmssl/sha1.h +- +gmssl/sha2.h +- + +/Users/yichao.wu/deepctrl/GmSSL/include/gmssl/error.h +stdio.h +- +stdarg.h +- +string.h +- +stdint.h +- + +/Users/yichao.wu/deepctrl/GmSSL/include/gmssl/gf128.h +stdio.h +- +stdlib.h +- +string.h +- +stdint.h +- + +/Users/yichao.wu/deepctrl/GmSSL/include/gmssl/ghash.h +stdlib.h +- +stdint.h +- +string.h +- +gmssl/gf128.h +- + +/Users/yichao.wu/deepctrl/GmSSL/include/gmssl/hmac.h +string.h +- +gmssl/digest.h +- + +/Users/yichao.wu/deepctrl/GmSSL/include/gmssl/mem.h +stdint.h +- +stddef.h +- + +/Users/yichao.wu/deepctrl/GmSSL/include/gmssl/oid.h +stdint.h +- + +/Users/yichao.wu/deepctrl/GmSSL/include/gmssl/pbkdf2.h +stdio.h +- +stdlib.h +- +string.h +- +stdint.h +- +limits.h +- +gmssl/hmac.h +- + +/Users/yichao.wu/deepctrl/GmSSL/include/gmssl/rand.h +stdint.h +- +stdlib.h +- + +/Users/yichao.wu/deepctrl/GmSSL/include/gmssl/sha1.h +string.h +- +stdint.h +- + +/Users/yichao.wu/deepctrl/GmSSL/include/gmssl/sha2.h +string.h +- +stdint.h +- +sys/types.h +- + +/Users/yichao.wu/deepctrl/GmSSL/include/gmssl/sm2.h +stdio.h +- +stdint.h +- +stdlib.h +- +gmssl/sm3.h +- +gmssl/sm2_z256.h +- + +/Users/yichao.wu/deepctrl/GmSSL/include/gmssl/sm2_z256.h +stdio.h +- +stdint.h +- +stdlib.h +- + +/Users/yichao.wu/deepctrl/GmSSL/include/gmssl/sm3.h +string.h +- +stdint.h +- + +/Users/yichao.wu/deepctrl/GmSSL/include/gmssl/sm4.h +stdint.h +- +string.h +- +gmssl/ghash.h +- + +/Users/yichao.wu/deepctrl/GmSSL/include/gmssl/sm9.h +stdio.h +- +string.h +- +stdlib.h +- +stdint.h +- +gmssl/sm3.h +- +gmssl/sm2.h +- +gmssl/sm9_z256.h +- + +/Users/yichao.wu/deepctrl/GmSSL/include/gmssl/sm9_z256.h +stdio.h +- +string.h +- +stdlib.h +- +stdint.h +- +gmssl/sm3.h +- +gmssl/sm2.h +- + +/Users/yichao.wu/deepctrl/GmSSL/include/gmssl/version.h + +/Users/yichao.wu/deepctrl/GmSSL/include/gmssl/x509.h +gmssl/x509_cer.h +- + +/Users/yichao.wu/deepctrl/GmSSL/include/gmssl/x509_cer.h +time.h +- +string.h +- +stdint.h +- +stdlib.h +- +gmssl/sm2.h +- +gmssl/oid.h +- +gmssl/asn1.h +- + +/Users/yichao.wu/deepctrl/GmSSL/include/gmssl/x509_req.h +time.h +- +string.h +- +stdint.h +- +stdlib.h +- +gmssl/sm2.h +- +gmssl/oid.h +- +gmssl/asn1.h +- +gmssl/x509.h +- + +/Users/yichao.wu/deepctrl/GmSSL/include/gmssl/zuc.h +stdlib.h +- +stdint.h +- + diff --git a/android/build-jni-arm64-v8a/CMakeFiles/gmssljni.dir/DependInfo.cmake b/android/build-jni-arm64-v8a/CMakeFiles/gmssljni.dir/DependInfo.cmake new file mode 100644 index 0000000..795d006 --- /dev/null +++ b/android/build-jni-arm64-v8a/CMakeFiles/gmssljni.dir/DependInfo.cmake @@ -0,0 +1,27 @@ +# The set of languages for which implicit dependencies are needed: +set(CMAKE_DEPENDS_LANGUAGES + "C" + ) +# The set of files for implicit dependencies of each language: +set(CMAKE_DEPENDS_CHECK_C + "/Users/yichao.wu/deepctrl/GmSSL-Java/src/main/c/gmssljni.c" "/Users/yichao.wu/deepctrl/GmSSL-Java/android/build-jni-arm64-v8a/CMakeFiles/gmssljni.dir/Users/yichao.wu/deepctrl/GmSSL-Java/src/main/c/gmssljni.c.o" + ) +set(CMAKE_C_COMPILER_ID "Clang") + +# Preprocessor definitions for this target. +set(CMAKE_TARGET_DEFINITIONS_C + "gmssljni_EXPORTS" + ) + +# The include file search paths: +set(CMAKE_C_TARGET_INCLUDE_PATH + "/Users/yichao.wu/deepctrl/GmSSL-Java/../GmSSL/include" + "../../src/main/c" + ) + +# Targets to which this target links. +set(CMAKE_TARGET_LINKED_INFO_FILES + ) + +# Fortran module output directory. +set(CMAKE_Fortran_TARGET_MODULE_DIR "") diff --git a/android/build-jni-arm64-v8a/CMakeFiles/gmssljni.dir/Users/yichao.wu/deepctrl/GmSSL-Java/src/main/c/gmssljni.c.o b/android/build-jni-arm64-v8a/CMakeFiles/gmssljni.dir/Users/yichao.wu/deepctrl/GmSSL-Java/src/main/c/gmssljni.c.o new file mode 100644 index 0000000..92ecc7e Binary files /dev/null and b/android/build-jni-arm64-v8a/CMakeFiles/gmssljni.dir/Users/yichao.wu/deepctrl/GmSSL-Java/src/main/c/gmssljni.c.o differ diff --git a/android/build-jni-arm64-v8a/CMakeFiles/gmssljni.dir/build.make b/android/build-jni-arm64-v8a/CMakeFiles/gmssljni.dir/build.make new file mode 100644 index 0000000..16294a8 --- /dev/null +++ b/android/build-jni-arm64-v8a/CMakeFiles/gmssljni.dir/build.make @@ -0,0 +1,118 @@ +# CMAKE generated file: DO NOT EDIT! +# Generated by "Unix Makefiles" Generator, CMake Version 3.19 + +# Delete rule output on recipe failure. +.DELETE_ON_ERROR: + + +#============================================================================= +# Special targets provided by cmake. + +# Disable implicit rules so canonical targets will work. +.SUFFIXES: + + +# Disable VCS-based implicit rules. +% : %,v + + +# Disable VCS-based implicit rules. +% : RCS/% + + +# Disable VCS-based implicit rules. +% : RCS/%,v + + +# Disable VCS-based implicit rules. +% : SCCS/s.% + + +# Disable VCS-based implicit rules. +% : s.% + + +.SUFFIXES: .hpux_make_needs_suffix_list + + +# Command-line flag to silence nested $(MAKE). +$(VERBOSE)MAKESILENT = -s + +#Suppress display of executed commands. +$(VERBOSE).SILENT: + +# A target that is always out of date. +cmake_force: + +.PHONY : cmake_force + +#============================================================================= +# Set environment variables for the build. + +# The shell in which to execute make rules. +SHELL = /bin/sh + +# The CMake executable. +CMAKE_COMMAND = /usr/local/Cellar/cmake/3.19.1/bin/cmake + +# The command to remove a file. +RM = /usr/local/Cellar/cmake/3.19.1/bin/cmake -E rm -f + +# Escaping for special characters. +EQUALS = = + +# The top-level source directory on which CMake was run. +CMAKE_SOURCE_DIR = /Users/yichao.wu/deepctrl/GmSSL-Java/android + +# The top-level build directory on which CMake was run. +CMAKE_BINARY_DIR = /Users/yichao.wu/deepctrl/GmSSL-Java/android/build-jni-arm64-v8a + +# Include any dependencies generated for this target. +include CMakeFiles/gmssljni.dir/depend.make + +# Include the progress variables for this target. +include CMakeFiles/gmssljni.dir/progress.make + +# Include the compile flags for this target's objects. +include CMakeFiles/gmssljni.dir/flags.make + +CMakeFiles/gmssljni.dir/Users/yichao.wu/deepctrl/GmSSL-Java/src/main/c/gmssljni.c.o: CMakeFiles/gmssljni.dir/flags.make +CMakeFiles/gmssljni.dir/Users/yichao.wu/deepctrl/GmSSL-Java/src/main/c/gmssljni.c.o: /Users/yichao.wu/deepctrl/GmSSL-Java/src/main/c/gmssljni.c + @$(CMAKE_COMMAND) -E cmake_echo_color --switch=$(COLOR) --green --progress-dir=/Users/yichao.wu/deepctrl/GmSSL-Java/android/build-jni-arm64-v8a/CMakeFiles --progress-num=$(CMAKE_PROGRESS_1) "Building C object CMakeFiles/gmssljni.dir/Users/yichao.wu/deepctrl/GmSSL-Java/src/main/c/gmssljni.c.o" + /Users/yichao.wu/Library/Android/sdk/ndk/27.1.12297006/toolchains/llvm/prebuilt/darwin-x86_64/bin/clang --target=aarch64-none-linux-android21 --sysroot=/Users/yichao.wu/Library/Android/sdk/ndk/27.1.12297006/toolchains/llvm/prebuilt/darwin-x86_64/sysroot $(C_DEFINES) $(C_INCLUDES) $(C_FLAGS) -o CMakeFiles/gmssljni.dir/Users/yichao.wu/deepctrl/GmSSL-Java/src/main/c/gmssljni.c.o -c /Users/yichao.wu/deepctrl/GmSSL-Java/src/main/c/gmssljni.c + +CMakeFiles/gmssljni.dir/Users/yichao.wu/deepctrl/GmSSL-Java/src/main/c/gmssljni.c.i: cmake_force + @$(CMAKE_COMMAND) -E cmake_echo_color --switch=$(COLOR) --green "Preprocessing C source to CMakeFiles/gmssljni.dir/Users/yichao.wu/deepctrl/GmSSL-Java/src/main/c/gmssljni.c.i" + /Users/yichao.wu/Library/Android/sdk/ndk/27.1.12297006/toolchains/llvm/prebuilt/darwin-x86_64/bin/clang --target=aarch64-none-linux-android21 --sysroot=/Users/yichao.wu/Library/Android/sdk/ndk/27.1.12297006/toolchains/llvm/prebuilt/darwin-x86_64/sysroot $(C_DEFINES) $(C_INCLUDES) $(C_FLAGS) -E /Users/yichao.wu/deepctrl/GmSSL-Java/src/main/c/gmssljni.c > CMakeFiles/gmssljni.dir/Users/yichao.wu/deepctrl/GmSSL-Java/src/main/c/gmssljni.c.i + +CMakeFiles/gmssljni.dir/Users/yichao.wu/deepctrl/GmSSL-Java/src/main/c/gmssljni.c.s: cmake_force + @$(CMAKE_COMMAND) -E cmake_echo_color --switch=$(COLOR) --green "Compiling C source to assembly CMakeFiles/gmssljni.dir/Users/yichao.wu/deepctrl/GmSSL-Java/src/main/c/gmssljni.c.s" + /Users/yichao.wu/Library/Android/sdk/ndk/27.1.12297006/toolchains/llvm/prebuilt/darwin-x86_64/bin/clang --target=aarch64-none-linux-android21 --sysroot=/Users/yichao.wu/Library/Android/sdk/ndk/27.1.12297006/toolchains/llvm/prebuilt/darwin-x86_64/sysroot $(C_DEFINES) $(C_INCLUDES) $(C_FLAGS) -S /Users/yichao.wu/deepctrl/GmSSL-Java/src/main/c/gmssljni.c -o CMakeFiles/gmssljni.dir/Users/yichao.wu/deepctrl/GmSSL-Java/src/main/c/gmssljni.c.s + +# Object files for target gmssljni +gmssljni_OBJECTS = \ +"CMakeFiles/gmssljni.dir/Users/yichao.wu/deepctrl/GmSSL-Java/src/main/c/gmssljni.c.o" + +# External object files for target gmssljni +gmssljni_EXTERNAL_OBJECTS = + +libgmssljni.so: CMakeFiles/gmssljni.dir/Users/yichao.wu/deepctrl/GmSSL-Java/src/main/c/gmssljni.c.o +libgmssljni.so: CMakeFiles/gmssljni.dir/build.make +libgmssljni.so: /Users/yichao.wu/deepctrl/GmSSL-Java/../GmSSL/build-android-arm64/bin/libgmssl.a +libgmssljni.so: CMakeFiles/gmssljni.dir/link.txt + @$(CMAKE_COMMAND) -E cmake_echo_color --switch=$(COLOR) --green --bold --progress-dir=/Users/yichao.wu/deepctrl/GmSSL-Java/android/build-jni-arm64-v8a/CMakeFiles --progress-num=$(CMAKE_PROGRESS_2) "Linking C shared library libgmssljni.so" + $(CMAKE_COMMAND) -E cmake_link_script CMakeFiles/gmssljni.dir/link.txt --verbose=$(VERBOSE) + +# Rule to build all files generated by this target. +CMakeFiles/gmssljni.dir/build: libgmssljni.so + +.PHONY : CMakeFiles/gmssljni.dir/build + +CMakeFiles/gmssljni.dir/clean: + $(CMAKE_COMMAND) -P CMakeFiles/gmssljni.dir/cmake_clean.cmake +.PHONY : CMakeFiles/gmssljni.dir/clean + +CMakeFiles/gmssljni.dir/depend: + cd /Users/yichao.wu/deepctrl/GmSSL-Java/android/build-jni-arm64-v8a && $(CMAKE_COMMAND) -E cmake_depends "Unix Makefiles" /Users/yichao.wu/deepctrl/GmSSL-Java/android /Users/yichao.wu/deepctrl/GmSSL-Java/android /Users/yichao.wu/deepctrl/GmSSL-Java/android/build-jni-arm64-v8a /Users/yichao.wu/deepctrl/GmSSL-Java/android/build-jni-arm64-v8a /Users/yichao.wu/deepctrl/GmSSL-Java/android/build-jni-arm64-v8a/CMakeFiles/gmssljni.dir/DependInfo.cmake --color=$(COLOR) +.PHONY : CMakeFiles/gmssljni.dir/depend + diff --git a/android/build-jni-arm64-v8a/CMakeFiles/gmssljni.dir/cmake_clean.cmake b/android/build-jni-arm64-v8a/CMakeFiles/gmssljni.dir/cmake_clean.cmake new file mode 100644 index 0000000..b14f9fe --- /dev/null +++ b/android/build-jni-arm64-v8a/CMakeFiles/gmssljni.dir/cmake_clean.cmake @@ -0,0 +1,10 @@ +file(REMOVE_RECURSE + "CMakeFiles/gmssljni.dir/Users/yichao.wu/deepctrl/GmSSL-Java/src/main/c/gmssljni.c.o" + "libgmssljni.pdb" + "libgmssljni.so" +) + +# Per-language clean rules from dependency scanning. +foreach(lang C) + include(CMakeFiles/gmssljni.dir/cmake_clean_${lang}.cmake OPTIONAL) +endforeach() diff --git a/android/build-jni-arm64-v8a/CMakeFiles/gmssljni.dir/depend.internal b/android/build-jni-arm64-v8a/CMakeFiles/gmssljni.dir/depend.internal new file mode 100644 index 0000000..f8f5d95 --- /dev/null +++ b/android/build-jni-arm64-v8a/CMakeFiles/gmssljni.dir/depend.internal @@ -0,0 +1,29 @@ +# CMAKE generated file: DO NOT EDIT! +# Generated by "Unix Makefiles" Generator, CMake Version 3.19 + +CMakeFiles/gmssljni.dir/Users/yichao.wu/deepctrl/GmSSL-Java/src/main/c/gmssljni.c.o + /Users/yichao.wu/deepctrl/GmSSL-Java/src/main/c/gmssljni.c + /Users/yichao.wu/deepctrl/GmSSL-Java/src/main/c/gmssljni.h + /Users/yichao.wu/deepctrl/GmSSL/include/gmssl/asn1.h + /Users/yichao.wu/deepctrl/GmSSL/include/gmssl/digest.h + /Users/yichao.wu/deepctrl/GmSSL/include/gmssl/error.h + /Users/yichao.wu/deepctrl/GmSSL/include/gmssl/gf128.h + /Users/yichao.wu/deepctrl/GmSSL/include/gmssl/ghash.h + /Users/yichao.wu/deepctrl/GmSSL/include/gmssl/hmac.h + /Users/yichao.wu/deepctrl/GmSSL/include/gmssl/mem.h + /Users/yichao.wu/deepctrl/GmSSL/include/gmssl/oid.h + /Users/yichao.wu/deepctrl/GmSSL/include/gmssl/pbkdf2.h + /Users/yichao.wu/deepctrl/GmSSL/include/gmssl/rand.h + /Users/yichao.wu/deepctrl/GmSSL/include/gmssl/sha1.h + /Users/yichao.wu/deepctrl/GmSSL/include/gmssl/sha2.h + /Users/yichao.wu/deepctrl/GmSSL/include/gmssl/sm2.h + /Users/yichao.wu/deepctrl/GmSSL/include/gmssl/sm2_z256.h + /Users/yichao.wu/deepctrl/GmSSL/include/gmssl/sm3.h + /Users/yichao.wu/deepctrl/GmSSL/include/gmssl/sm4.h + /Users/yichao.wu/deepctrl/GmSSL/include/gmssl/sm9.h + /Users/yichao.wu/deepctrl/GmSSL/include/gmssl/sm9_z256.h + /Users/yichao.wu/deepctrl/GmSSL/include/gmssl/version.h + /Users/yichao.wu/deepctrl/GmSSL/include/gmssl/x509.h + /Users/yichao.wu/deepctrl/GmSSL/include/gmssl/x509_cer.h + /Users/yichao.wu/deepctrl/GmSSL/include/gmssl/x509_req.h + /Users/yichao.wu/deepctrl/GmSSL/include/gmssl/zuc.h diff --git a/android/build-jni-arm64-v8a/CMakeFiles/gmssljni.dir/depend.make b/android/build-jni-arm64-v8a/CMakeFiles/gmssljni.dir/depend.make new file mode 100644 index 0000000..11a7d55 --- /dev/null +++ b/android/build-jni-arm64-v8a/CMakeFiles/gmssljni.dir/depend.make @@ -0,0 +1,29 @@ +# CMAKE generated file: DO NOT EDIT! +# Generated by "Unix Makefiles" Generator, CMake Version 3.19 + +CMakeFiles/gmssljni.dir/Users/yichao.wu/deepctrl/GmSSL-Java/src/main/c/gmssljni.c.o: /Users/yichao.wu/deepctrl/GmSSL-Java/src/main/c/gmssljni.c +CMakeFiles/gmssljni.dir/Users/yichao.wu/deepctrl/GmSSL-Java/src/main/c/gmssljni.c.o: /Users/yichao.wu/deepctrl/GmSSL-Java/src/main/c/gmssljni.h +CMakeFiles/gmssljni.dir/Users/yichao.wu/deepctrl/GmSSL-Java/src/main/c/gmssljni.c.o: /Users/yichao.wu/deepctrl/GmSSL/include/gmssl/asn1.h +CMakeFiles/gmssljni.dir/Users/yichao.wu/deepctrl/GmSSL-Java/src/main/c/gmssljni.c.o: /Users/yichao.wu/deepctrl/GmSSL/include/gmssl/digest.h +CMakeFiles/gmssljni.dir/Users/yichao.wu/deepctrl/GmSSL-Java/src/main/c/gmssljni.c.o: /Users/yichao.wu/deepctrl/GmSSL/include/gmssl/error.h +CMakeFiles/gmssljni.dir/Users/yichao.wu/deepctrl/GmSSL-Java/src/main/c/gmssljni.c.o: /Users/yichao.wu/deepctrl/GmSSL/include/gmssl/gf128.h +CMakeFiles/gmssljni.dir/Users/yichao.wu/deepctrl/GmSSL-Java/src/main/c/gmssljni.c.o: /Users/yichao.wu/deepctrl/GmSSL/include/gmssl/ghash.h +CMakeFiles/gmssljni.dir/Users/yichao.wu/deepctrl/GmSSL-Java/src/main/c/gmssljni.c.o: /Users/yichao.wu/deepctrl/GmSSL/include/gmssl/hmac.h +CMakeFiles/gmssljni.dir/Users/yichao.wu/deepctrl/GmSSL-Java/src/main/c/gmssljni.c.o: /Users/yichao.wu/deepctrl/GmSSL/include/gmssl/mem.h +CMakeFiles/gmssljni.dir/Users/yichao.wu/deepctrl/GmSSL-Java/src/main/c/gmssljni.c.o: /Users/yichao.wu/deepctrl/GmSSL/include/gmssl/oid.h +CMakeFiles/gmssljni.dir/Users/yichao.wu/deepctrl/GmSSL-Java/src/main/c/gmssljni.c.o: /Users/yichao.wu/deepctrl/GmSSL/include/gmssl/pbkdf2.h +CMakeFiles/gmssljni.dir/Users/yichao.wu/deepctrl/GmSSL-Java/src/main/c/gmssljni.c.o: /Users/yichao.wu/deepctrl/GmSSL/include/gmssl/rand.h +CMakeFiles/gmssljni.dir/Users/yichao.wu/deepctrl/GmSSL-Java/src/main/c/gmssljni.c.o: /Users/yichao.wu/deepctrl/GmSSL/include/gmssl/sha1.h +CMakeFiles/gmssljni.dir/Users/yichao.wu/deepctrl/GmSSL-Java/src/main/c/gmssljni.c.o: /Users/yichao.wu/deepctrl/GmSSL/include/gmssl/sha2.h +CMakeFiles/gmssljni.dir/Users/yichao.wu/deepctrl/GmSSL-Java/src/main/c/gmssljni.c.o: /Users/yichao.wu/deepctrl/GmSSL/include/gmssl/sm2.h +CMakeFiles/gmssljni.dir/Users/yichao.wu/deepctrl/GmSSL-Java/src/main/c/gmssljni.c.o: /Users/yichao.wu/deepctrl/GmSSL/include/gmssl/sm2_z256.h +CMakeFiles/gmssljni.dir/Users/yichao.wu/deepctrl/GmSSL-Java/src/main/c/gmssljni.c.o: /Users/yichao.wu/deepctrl/GmSSL/include/gmssl/sm3.h +CMakeFiles/gmssljni.dir/Users/yichao.wu/deepctrl/GmSSL-Java/src/main/c/gmssljni.c.o: /Users/yichao.wu/deepctrl/GmSSL/include/gmssl/sm4.h +CMakeFiles/gmssljni.dir/Users/yichao.wu/deepctrl/GmSSL-Java/src/main/c/gmssljni.c.o: /Users/yichao.wu/deepctrl/GmSSL/include/gmssl/sm9.h +CMakeFiles/gmssljni.dir/Users/yichao.wu/deepctrl/GmSSL-Java/src/main/c/gmssljni.c.o: /Users/yichao.wu/deepctrl/GmSSL/include/gmssl/sm9_z256.h +CMakeFiles/gmssljni.dir/Users/yichao.wu/deepctrl/GmSSL-Java/src/main/c/gmssljni.c.o: /Users/yichao.wu/deepctrl/GmSSL/include/gmssl/version.h +CMakeFiles/gmssljni.dir/Users/yichao.wu/deepctrl/GmSSL-Java/src/main/c/gmssljni.c.o: /Users/yichao.wu/deepctrl/GmSSL/include/gmssl/x509.h +CMakeFiles/gmssljni.dir/Users/yichao.wu/deepctrl/GmSSL-Java/src/main/c/gmssljni.c.o: /Users/yichao.wu/deepctrl/GmSSL/include/gmssl/x509_cer.h +CMakeFiles/gmssljni.dir/Users/yichao.wu/deepctrl/GmSSL-Java/src/main/c/gmssljni.c.o: /Users/yichao.wu/deepctrl/GmSSL/include/gmssl/x509_req.h +CMakeFiles/gmssljni.dir/Users/yichao.wu/deepctrl/GmSSL-Java/src/main/c/gmssljni.c.o: /Users/yichao.wu/deepctrl/GmSSL/include/gmssl/zuc.h + diff --git a/android/build-jni-arm64-v8a/CMakeFiles/gmssljni.dir/flags.make b/android/build-jni-arm64-v8a/CMakeFiles/gmssljni.dir/flags.make new file mode 100644 index 0000000..8e2250b --- /dev/null +++ b/android/build-jni-arm64-v8a/CMakeFiles/gmssljni.dir/flags.make @@ -0,0 +1,10 @@ +# CMAKE generated file: DO NOT EDIT! +# Generated by "Unix Makefiles" Generator, CMake Version 3.19 + +# compile C with /Users/yichao.wu/Library/Android/sdk/ndk/27.1.12297006/toolchains/llvm/prebuilt/darwin-x86_64/bin/clang +C_DEFINES = -Dgmssljni_EXPORTS + +C_INCLUDES = -I/Users/yichao.wu/deepctrl/GmSSL-Java/../GmSSL/include -I/Users/yichao.wu/deepctrl/GmSSL-Java/android/../src/main/c + +C_FLAGS = -g -DANDROID -fdata-sections -ffunction-sections -funwind-tables -fstack-protector-strong -no-canonical-prefixes -D_FORTIFY_SOURCE=2 -Wformat -Werror=format-security -O3 -DNDEBUG -fPIC -Wall -Wextra -O2 -fPIC + diff --git a/android/build-jni-arm64-v8a/CMakeFiles/gmssljni.dir/link.txt b/android/build-jni-arm64-v8a/CMakeFiles/gmssljni.dir/link.txt new file mode 100644 index 0000000..832fc3f --- /dev/null +++ b/android/build-jni-arm64-v8a/CMakeFiles/gmssljni.dir/link.txt @@ -0,0 +1 @@ +/Users/yichao.wu/Library/Android/sdk/ndk/27.1.12297006/toolchains/llvm/prebuilt/darwin-x86_64/bin/clang --target=aarch64-none-linux-android21 --sysroot=/Users/yichao.wu/Library/Android/sdk/ndk/27.1.12297006/toolchains/llvm/prebuilt/darwin-x86_64/sysroot -fPIC -g -DANDROID -fdata-sections -ffunction-sections -funwind-tables -fstack-protector-strong -no-canonical-prefixes -D_FORTIFY_SOURCE=2 -Wformat -Werror=format-security -O3 -DNDEBUG -static-libstdc++ -Wl,--build-id=sha1 -Wl,--no-rosegment -Wl,--no-undefined-version -Wl,--fatal-warnings -Wl,--no-undefined -Qunused-arguments -Wl,--gc-sections -shared -Wl,-soname,libgmssljni.so -o libgmssljni.so CMakeFiles/gmssljni.dir/Users/yichao.wu/deepctrl/GmSSL-Java/src/main/c/gmssljni.c.o /Users/yichao.wu/deepctrl/GmSSL-Java/../GmSSL/build-android-arm64/bin/libgmssl.a -llog -latomic -lm diff --git a/android/build-jni-arm64-v8a/CMakeFiles/gmssljni.dir/progress.make b/android/build-jni-arm64-v8a/CMakeFiles/gmssljni.dir/progress.make new file mode 100644 index 0000000..abadeb0 --- /dev/null +++ b/android/build-jni-arm64-v8a/CMakeFiles/gmssljni.dir/progress.make @@ -0,0 +1,3 @@ +CMAKE_PROGRESS_1 = 1 +CMAKE_PROGRESS_2 = 2 + diff --git a/android/build-jni-arm64-v8a/CMakeFiles/progress.marks b/android/build-jni-arm64-v8a/CMakeFiles/progress.marks new file mode 100644 index 0000000..0cfbf08 --- /dev/null +++ b/android/build-jni-arm64-v8a/CMakeFiles/progress.marks @@ -0,0 +1 @@ +2 diff --git a/android/build-jni-arm64-v8a/Makefile b/android/build-jni-arm64-v8a/Makefile new file mode 100644 index 0000000..f911341 --- /dev/null +++ b/android/build-jni-arm64-v8a/Makefile @@ -0,0 +1,197 @@ +# CMAKE generated file: DO NOT EDIT! +# Generated by "Unix Makefiles" Generator, CMake Version 3.19 + +# Default target executed when no arguments are given to make. +default_target: all + +.PHONY : default_target + +# Allow only one "make -f Makefile2" at a time, but pass parallelism. +.NOTPARALLEL: + + +#============================================================================= +# Special targets provided by cmake. + +# Disable implicit rules so canonical targets will work. +.SUFFIXES: + + +# Disable VCS-based implicit rules. +% : %,v + + +# Disable VCS-based implicit rules. +% : RCS/% + + +# Disable VCS-based implicit rules. +% : RCS/%,v + + +# Disable VCS-based implicit rules. +% : SCCS/s.% + + +# Disable VCS-based implicit rules. +% : s.% + + +.SUFFIXES: .hpux_make_needs_suffix_list + + +# Command-line flag to silence nested $(MAKE). +$(VERBOSE)MAKESILENT = -s + +#Suppress display of executed commands. +$(VERBOSE).SILENT: + +# A target that is always out of date. +cmake_force: + +.PHONY : cmake_force + +#============================================================================= +# Set environment variables for the build. + +# The shell in which to execute make rules. +SHELL = /bin/sh + +# The CMake executable. +CMAKE_COMMAND = /usr/local/Cellar/cmake/3.19.1/bin/cmake + +# The command to remove a file. +RM = /usr/local/Cellar/cmake/3.19.1/bin/cmake -E rm -f + +# Escaping for special characters. +EQUALS = = + +# The top-level source directory on which CMake was run. +CMAKE_SOURCE_DIR = /Users/yichao.wu/deepctrl/GmSSL-Java/android + +# The top-level build directory on which CMake was run. +CMAKE_BINARY_DIR = /Users/yichao.wu/deepctrl/GmSSL-Java/android/build-jni-arm64-v8a + +#============================================================================= +# Targets provided globally by CMake. + +# Special rule for the target rebuild_cache +rebuild_cache: + @$(CMAKE_COMMAND) -E cmake_echo_color --switch=$(COLOR) --cyan "Running CMake to regenerate build system..." + /usr/local/Cellar/cmake/3.19.1/bin/cmake --regenerate-during-build -S$(CMAKE_SOURCE_DIR) -B$(CMAKE_BINARY_DIR) +.PHONY : rebuild_cache + +# Special rule for the target rebuild_cache +rebuild_cache/fast: rebuild_cache + +.PHONY : rebuild_cache/fast + +# Special rule for the target edit_cache +edit_cache: + @$(CMAKE_COMMAND) -E cmake_echo_color --switch=$(COLOR) --cyan "Running CMake cache editor..." + /usr/local/Cellar/cmake/3.19.1/bin/ccmake -S$(CMAKE_SOURCE_DIR) -B$(CMAKE_BINARY_DIR) +.PHONY : edit_cache + +# Special rule for the target edit_cache +edit_cache/fast: edit_cache + +.PHONY : edit_cache/fast + +# The main all target +all: cmake_check_build_system + $(CMAKE_COMMAND) -E cmake_progress_start /Users/yichao.wu/deepctrl/GmSSL-Java/android/build-jni-arm64-v8a/CMakeFiles /Users/yichao.wu/deepctrl/GmSSL-Java/android/build-jni-arm64-v8a//CMakeFiles/progress.marks + $(MAKE) $(MAKESILENT) -f CMakeFiles/Makefile2 all + $(CMAKE_COMMAND) -E cmake_progress_start /Users/yichao.wu/deepctrl/GmSSL-Java/android/build-jni-arm64-v8a/CMakeFiles 0 +.PHONY : all + +# The main clean target +clean: + $(MAKE) $(MAKESILENT) -f CMakeFiles/Makefile2 clean +.PHONY : clean + +# The main clean target +clean/fast: clean + +.PHONY : clean/fast + +# Prepare targets for installation. +preinstall: all + $(MAKE) $(MAKESILENT) -f CMakeFiles/Makefile2 preinstall +.PHONY : preinstall + +# Prepare targets for installation. +preinstall/fast: + $(MAKE) $(MAKESILENT) -f CMakeFiles/Makefile2 preinstall +.PHONY : preinstall/fast + +# clear depends +depend: + $(CMAKE_COMMAND) -S$(CMAKE_SOURCE_DIR) -B$(CMAKE_BINARY_DIR) --check-build-system CMakeFiles/Makefile.cmake 1 +.PHONY : depend + +#============================================================================= +# Target rules for targets named gmssljni + +# Build rule for target. +gmssljni: cmake_check_build_system + $(MAKE) $(MAKESILENT) -f CMakeFiles/Makefile2 gmssljni +.PHONY : gmssljni + +# fast build rule for target. +gmssljni/fast: + $(MAKE) $(MAKESILENT) -f CMakeFiles/gmssljni.dir/build.make CMakeFiles/gmssljni.dir/build +.PHONY : gmssljni/fast + +Users/yichao.wu/deepctrl/GmSSL-Java/src/main/c/gmssljni.o: Users/yichao.wu/deepctrl/GmSSL-Java/src/main/c/gmssljni.c.o + +.PHONY : Users/yichao.wu/deepctrl/GmSSL-Java/src/main/c/gmssljni.o + +# target to build an object file +Users/yichao.wu/deepctrl/GmSSL-Java/src/main/c/gmssljni.c.o: + $(MAKE) $(MAKESILENT) -f CMakeFiles/gmssljni.dir/build.make CMakeFiles/gmssljni.dir/Users/yichao.wu/deepctrl/GmSSL-Java/src/main/c/gmssljni.c.o +.PHONY : Users/yichao.wu/deepctrl/GmSSL-Java/src/main/c/gmssljni.c.o + +Users/yichao.wu/deepctrl/GmSSL-Java/src/main/c/gmssljni.i: Users/yichao.wu/deepctrl/GmSSL-Java/src/main/c/gmssljni.c.i + +.PHONY : Users/yichao.wu/deepctrl/GmSSL-Java/src/main/c/gmssljni.i + +# target to preprocess a source file +Users/yichao.wu/deepctrl/GmSSL-Java/src/main/c/gmssljni.c.i: + $(MAKE) $(MAKESILENT) -f CMakeFiles/gmssljni.dir/build.make CMakeFiles/gmssljni.dir/Users/yichao.wu/deepctrl/GmSSL-Java/src/main/c/gmssljni.c.i +.PHONY : Users/yichao.wu/deepctrl/GmSSL-Java/src/main/c/gmssljni.c.i + +Users/yichao.wu/deepctrl/GmSSL-Java/src/main/c/gmssljni.s: Users/yichao.wu/deepctrl/GmSSL-Java/src/main/c/gmssljni.c.s + +.PHONY : Users/yichao.wu/deepctrl/GmSSL-Java/src/main/c/gmssljni.s + +# target to generate assembly for a file +Users/yichao.wu/deepctrl/GmSSL-Java/src/main/c/gmssljni.c.s: + $(MAKE) $(MAKESILENT) -f CMakeFiles/gmssljni.dir/build.make CMakeFiles/gmssljni.dir/Users/yichao.wu/deepctrl/GmSSL-Java/src/main/c/gmssljni.c.s +.PHONY : Users/yichao.wu/deepctrl/GmSSL-Java/src/main/c/gmssljni.c.s + +# Help Target +help: + @echo "The following are some of the valid targets for this Makefile:" + @echo "... all (the default if no target is provided)" + @echo "... clean" + @echo "... depend" + @echo "... edit_cache" + @echo "... rebuild_cache" + @echo "... gmssljni" + @echo "... Users/yichao.wu/deepctrl/GmSSL-Java/src/main/c/gmssljni.o" + @echo "... Users/yichao.wu/deepctrl/GmSSL-Java/src/main/c/gmssljni.i" + @echo "... Users/yichao.wu/deepctrl/GmSSL-Java/src/main/c/gmssljni.s" +.PHONY : help + + + +#============================================================================= +# Special targets to cleanup operation of make. + +# Special rule to run CMake to check the build system integrity. +# No rule that depends on this can have commands that come from listfiles +# because they might be regenerated. +cmake_check_build_system: + $(CMAKE_COMMAND) -S$(CMAKE_SOURCE_DIR) -B$(CMAKE_BINARY_DIR) --check-build-system CMakeFiles/Makefile.cmake 0 +.PHONY : cmake_check_build_system + diff --git a/android/build-jni-arm64-v8a/cmake_install.cmake b/android/build-jni-arm64-v8a/cmake_install.cmake new file mode 100644 index 0000000..af6df95 --- /dev/null +++ b/android/build-jni-arm64-v8a/cmake_install.cmake @@ -0,0 +1,54 @@ +# Install script for directory: /Users/yichao.wu/deepctrl/GmSSL-Java/android + +# Set the install prefix +if(NOT DEFINED CMAKE_INSTALL_PREFIX) + set(CMAKE_INSTALL_PREFIX "/usr/local") +endif() +string(REGEX REPLACE "/$" "" CMAKE_INSTALL_PREFIX "${CMAKE_INSTALL_PREFIX}") + +# Set the install configuration name. +if(NOT DEFINED CMAKE_INSTALL_CONFIG_NAME) + if(BUILD_TYPE) + string(REGEX REPLACE "^[^A-Za-z0-9_]+" "" + CMAKE_INSTALL_CONFIG_NAME "${BUILD_TYPE}") + else() + set(CMAKE_INSTALL_CONFIG_NAME "Release") + endif() + message(STATUS "Install configuration: \"${CMAKE_INSTALL_CONFIG_NAME}\"") +endif() + +# Set the component getting installed. +if(NOT CMAKE_INSTALL_COMPONENT) + if(COMPONENT) + message(STATUS "Install component: \"${COMPONENT}\"") + set(CMAKE_INSTALL_COMPONENT "${COMPONENT}") + else() + set(CMAKE_INSTALL_COMPONENT) + endif() +endif() + +# Install shared libraries without execute permission? +if(NOT DEFINED CMAKE_INSTALL_SO_NO_EXE) + set(CMAKE_INSTALL_SO_NO_EXE "0") +endif() + +# Is this installation the result of a crosscompile? +if(NOT DEFINED CMAKE_CROSSCOMPILING) + set(CMAKE_CROSSCOMPILING "TRUE") +endif() + +# Set default install directory permissions. +if(NOT DEFINED CMAKE_OBJDUMP) + set(CMAKE_OBJDUMP "/Users/yichao.wu/Library/Android/sdk/ndk/27.1.12297006/toolchains/llvm/prebuilt/darwin-x86_64/bin/llvm-objdump") +endif() + +if(CMAKE_INSTALL_COMPONENT) + set(CMAKE_INSTALL_MANIFEST "install_manifest_${CMAKE_INSTALL_COMPONENT}.txt") +else() + set(CMAKE_INSTALL_MANIFEST "install_manifest.txt") +endif() + +string(REPLACE ";" "\n" CMAKE_INSTALL_MANIFEST_CONTENT + "${CMAKE_INSTALL_MANIFEST_FILES}") +file(WRITE "/Users/yichao.wu/deepctrl/GmSSL-Java/android/build-jni-arm64-v8a/${CMAKE_INSTALL_MANIFEST}" + "${CMAKE_INSTALL_MANIFEST_CONTENT}") diff --git a/android/build-jni-arm64-v8a/libgmssljni.so b/android/build-jni-arm64-v8a/libgmssljni.so new file mode 100755 index 0000000..fcc4bca Binary files /dev/null and b/android/build-jni-arm64-v8a/libgmssljni.so differ diff --git a/android/build-jni-armeabi-v7a/CMakeCache.txt b/android/build-jni-armeabi-v7a/CMakeCache.txt new file mode 100644 index 0000000..781f3ff --- /dev/null +++ b/android/build-jni-armeabi-v7a/CMakeCache.txt @@ -0,0 +1,386 @@ +# This is the CMakeCache file. +# For build in directory: /Users/yichao.wu/deepctrl/GmSSL-Java/android/build-jni-armeabi-v7a +# It was generated by CMake: /usr/local/Cellar/cmake/3.19.1/bin/cmake +# You can edit this file to change values found and used by cmake. +# If you do not want to change any of the values, simply exit the editor. +# If you do want to change a value, simply edit, save, and exit the editor. +# The syntax for the file is as follows: +# KEY:TYPE=VALUE +# KEY is the name of a variable in the cache. +# TYPE is a hint to GUIs for the type of VALUE, DO NOT EDIT TYPE!. +# VALUE is the current value for the KEY. + +######################## +# EXTERNAL cache entries +######################## + +//No help, variable specified on the command line. +ANDROID_ABI:UNINITIALIZED=armeabi-v7a + +//No help, variable specified on the command line. +ANDROID_PLATFORM:UNINITIALIZED=android-21 + +//Path to a program. +CMAKE_ADDR2LINE:FILEPATH=/Users/yichao.wu/Library/Android/sdk/ndk/27.1.12297006/toolchains/llvm/prebuilt/darwin-x86_64/bin/llvm-addr2line + +//Archiver +CMAKE_AR:FILEPATH=/Users/yichao.wu/Library/Android/sdk/ndk/27.1.12297006/toolchains/llvm/prebuilt/darwin-x86_64/bin/llvm-ar + +//Flags used by the compiler during all build types. +CMAKE_ASM_FLAGS:STRING= + +//Flags used by the compiler during debug builds. +CMAKE_ASM_FLAGS_DEBUG:STRING= + +//Flags used by the compiler during release builds. +CMAKE_ASM_FLAGS_RELEASE:STRING= + +//Choose the type of build, options are: None Debug Release RelWithDebInfo +// MinSizeRel ... +CMAKE_BUILD_TYPE:STRING=Release + +//Enable/Disable color output during build. +CMAKE_COLOR_MAKEFILE:BOOL=ON + +//LLVM archiver +CMAKE_CXX_COMPILER_AR:FILEPATH=CMAKE_CXX_COMPILER_AR-NOTFOUND + +//Generate index for LLVM archive +CMAKE_CXX_COMPILER_RANLIB:FILEPATH=CMAKE_CXX_COMPILER_RANLIB-NOTFOUND + +//Flags used by the compiler during all build types. +CMAKE_CXX_FLAGS:STRING= + +//Flags used by the compiler during debug builds. +CMAKE_CXX_FLAGS_DEBUG:STRING= + +//Flags used by the CXX compiler during MINSIZEREL builds. +CMAKE_CXX_FLAGS_MINSIZEREL:STRING=-Os -DNDEBUG + +//Flags used by the compiler during release builds. +CMAKE_CXX_FLAGS_RELEASE:STRING= + +//Flags used by the CXX compiler during RELWITHDEBINFO builds. +CMAKE_CXX_FLAGS_RELWITHDEBINFO:STRING=-O2 -g -DNDEBUG + +//Libraries linked by default with all C++ applications. +CMAKE_CXX_STANDARD_LIBRARIES:STRING=-latomic -lm + +//LLVM archiver +CMAKE_C_COMPILER_AR:FILEPATH=CMAKE_C_COMPILER_AR-NOTFOUND + +//Generate index for LLVM archive +CMAKE_C_COMPILER_RANLIB:FILEPATH=CMAKE_C_COMPILER_RANLIB-NOTFOUND + +//Flags used by the compiler during all build types. +CMAKE_C_FLAGS:STRING= + +//Flags used by the compiler during debug builds. +CMAKE_C_FLAGS_DEBUG:STRING= + +//Flags used by the C compiler during MINSIZEREL builds. +CMAKE_C_FLAGS_MINSIZEREL:STRING=-Os -DNDEBUG + +//Flags used by the compiler during release builds. +CMAKE_C_FLAGS_RELEASE:STRING= + +//Flags used by the C compiler during RELWITHDEBINFO builds. +CMAKE_C_FLAGS_RELWITHDEBINFO:STRING=-O2 -g -DNDEBUG + +//Libraries linked by default with all C applications. +CMAKE_C_STANDARD_LIBRARIES:STRING=-latomic -lm + +//Path to a program. +CMAKE_DLLTOOL:FILEPATH=/Users/yichao.wu/Library/Android/sdk/ndk/27.1.12297006/toolchains/llvm/prebuilt/darwin-x86_64/bin/llvm-dlltool + +//Flags used by the linker. +CMAKE_EXE_LINKER_FLAGS:STRING= + +//Flags used by the linker during DEBUG builds. +CMAKE_EXE_LINKER_FLAGS_DEBUG:STRING= + +//Flags used by the linker during MINSIZEREL builds. +CMAKE_EXE_LINKER_FLAGS_MINSIZEREL:STRING= + +//Flags used by the linker during RELEASE builds. +CMAKE_EXE_LINKER_FLAGS_RELEASE:STRING= + +//Flags used by the linker during RELWITHDEBINFO builds. +CMAKE_EXE_LINKER_FLAGS_RELWITHDEBINFO:STRING= + +//Enable/Disable output of compile commands during generation. +CMAKE_EXPORT_COMPILE_COMMANDS:BOOL= + +//Install path prefix, prepended onto install directories. +CMAKE_INSTALL_PREFIX:PATH=/usr/local + +//Path to a program. +CMAKE_LINKER:FILEPATH=/Users/yichao.wu/Library/Android/sdk/ndk/27.1.12297006/toolchains/llvm/prebuilt/darwin-x86_64/bin/ld.lld + +//Path to a program. +CMAKE_MAKE_PROGRAM:FILEPATH=/usr/bin/make + +//Flags used by the linker during the creation of modules. +CMAKE_MODULE_LINKER_FLAGS:STRING= + +//Flags used by the linker during the creation of modules during +// DEBUG builds. +CMAKE_MODULE_LINKER_FLAGS_DEBUG:STRING= + +//Flags used by the linker during the creation of modules during +// MINSIZEREL builds. +CMAKE_MODULE_LINKER_FLAGS_MINSIZEREL:STRING= + +//Flags used by the linker during the creation of modules during +// RELEASE builds. +CMAKE_MODULE_LINKER_FLAGS_RELEASE:STRING= + +//Flags used by the linker during the creation of modules during +// RELWITHDEBINFO builds. +CMAKE_MODULE_LINKER_FLAGS_RELWITHDEBINFO:STRING= + +//Path to a program. +CMAKE_NM:FILEPATH=/Users/yichao.wu/Library/Android/sdk/ndk/27.1.12297006/toolchains/llvm/prebuilt/darwin-x86_64/bin/llvm-nm + +//Path to a program. +CMAKE_OBJCOPY:FILEPATH=/Users/yichao.wu/Library/Android/sdk/ndk/27.1.12297006/toolchains/llvm/prebuilt/darwin-x86_64/bin/llvm-objcopy + +//Path to a program. +CMAKE_OBJDUMP:FILEPATH=/Users/yichao.wu/Library/Android/sdk/ndk/27.1.12297006/toolchains/llvm/prebuilt/darwin-x86_64/bin/llvm-objdump + +//Value Computed by CMake +CMAKE_PROJECT_DESCRIPTION:STATIC= + +//Value Computed by CMake +CMAKE_PROJECT_HOMEPAGE_URL:STATIC= + +//Value Computed by CMake +CMAKE_PROJECT_NAME:STATIC=gmssljni + +//Ranlib +CMAKE_RANLIB:FILEPATH=/Users/yichao.wu/Library/Android/sdk/ndk/27.1.12297006/toolchains/llvm/prebuilt/darwin-x86_64/bin/llvm-ranlib + +//Path to a program. +CMAKE_READELF:FILEPATH=/Users/yichao.wu/Library/Android/sdk/ndk/27.1.12297006/toolchains/llvm/prebuilt/darwin-x86_64/bin/llvm-readelf + +//Flags used by the linker during the creation of dll's. +CMAKE_SHARED_LINKER_FLAGS:STRING= + +//Flags used by the linker during the creation of shared libraries +// during DEBUG builds. +CMAKE_SHARED_LINKER_FLAGS_DEBUG:STRING= + +//Flags used by the linker during the creation of shared libraries +// during MINSIZEREL builds. +CMAKE_SHARED_LINKER_FLAGS_MINSIZEREL:STRING= + +//Flags used by the linker during the creation of shared libraries +// during RELEASE builds. +CMAKE_SHARED_LINKER_FLAGS_RELEASE:STRING= + +//Flags used by the linker during the creation of shared libraries +// during RELWITHDEBINFO builds. +CMAKE_SHARED_LINKER_FLAGS_RELWITHDEBINFO:STRING= + +//If set, runtime paths are not added when installing shared libraries, +// but are added when building. +CMAKE_SKIP_INSTALL_RPATH:BOOL=NO + +//If set, runtime paths are not added when using shared libraries. +CMAKE_SKIP_RPATH:BOOL=NO + +//Flags used by the linker during the creation of static libraries +// during all build types. +CMAKE_STATIC_LINKER_FLAGS:STRING= + +//Flags used by the linker during the creation of static libraries +// during DEBUG builds. +CMAKE_STATIC_LINKER_FLAGS_DEBUG:STRING= + +//Flags used by the linker during the creation of static libraries +// during MINSIZEREL builds. +CMAKE_STATIC_LINKER_FLAGS_MINSIZEREL:STRING= + +//Flags used by the linker during the creation of static libraries +// during RELEASE builds. +CMAKE_STATIC_LINKER_FLAGS_RELEASE:STRING= + +//Flags used by the linker during the creation of static libraries +// during RELWITHDEBINFO builds. +CMAKE_STATIC_LINKER_FLAGS_RELWITHDEBINFO:STRING= + +//Strip +CMAKE_STRIP:FILEPATH=/Users/yichao.wu/Library/Android/sdk/ndk/27.1.12297006/toolchains/llvm/prebuilt/darwin-x86_64/bin/llvm-strip + +//The CMake toolchain file +CMAKE_TOOLCHAIN_FILE:FILEPATH=/Users/yichao.wu/Library/Android/sdk/ndk/27.1.12297006/build/cmake/android.toolchain.cmake + +//If this value is on, makefiles will be generated without the +// .SILENT directive, and all commands will be echoed to the console +// during the make. This is useful for debugging only. With Visual +// Studio IDE projects all commands are done without /nologo. +CMAKE_VERBOSE_MAKEFILE:BOOL=FALSE + +//No help, variable specified on the command line. +GMSSL_LIB_DIR:UNINITIALIZED=/Users/yichao.wu/deepctrl/GmSSL-Java/../GmSSL/build-android-arm/bin + +//No help, variable specified on the command line. +GMSSL_SOURCE_DIR:UNINITIALIZED=/Users/yichao.wu/deepctrl/GmSSL-Java/../GmSSL + +//Value Computed by CMake +gmssljni_BINARY_DIR:STATIC=/Users/yichao.wu/deepctrl/GmSSL-Java/android/build-jni-armeabi-v7a + +//Value Computed by CMake +gmssljni_SOURCE_DIR:STATIC=/Users/yichao.wu/deepctrl/GmSSL-Java/android + + +######################## +# INTERNAL cache entries +######################## + +//ADVANCED property for variable: CMAKE_ADDR2LINE +CMAKE_ADDR2LINE-ADVANCED:INTERNAL=1 +//ADVANCED property for variable: CMAKE_AR +CMAKE_AR-ADVANCED:INTERNAL=1 +//This is the directory where this CMakeCache.txt was created +CMAKE_CACHEFILE_DIR:INTERNAL=/Users/yichao.wu/deepctrl/GmSSL-Java/android/build-jni-armeabi-v7a +//Major version of cmake used to create the current loaded cache +CMAKE_CACHE_MAJOR_VERSION:INTERNAL=3 +//Minor version of cmake used to create the current loaded cache +CMAKE_CACHE_MINOR_VERSION:INTERNAL=19 +//Patch version of cmake used to create the current loaded cache +CMAKE_CACHE_PATCH_VERSION:INTERNAL=1 +//ADVANCED property for variable: CMAKE_COLOR_MAKEFILE +CMAKE_COLOR_MAKEFILE-ADVANCED:INTERNAL=1 +//Path to CMake executable. +CMAKE_COMMAND:INTERNAL=/usr/local/Cellar/cmake/3.19.1/bin/cmake +//Path to cpack program executable. +CMAKE_CPACK_COMMAND:INTERNAL=/usr/local/Cellar/cmake/3.19.1/bin/cpack +//Path to ctest program executable. +CMAKE_CTEST_COMMAND:INTERNAL=/usr/local/Cellar/cmake/3.19.1/bin/ctest +//ADVANCED property for variable: CMAKE_CXX_COMPILER_AR +CMAKE_CXX_COMPILER_AR-ADVANCED:INTERNAL=1 +//ADVANCED property for variable: CMAKE_CXX_COMPILER_RANLIB +CMAKE_CXX_COMPILER_RANLIB-ADVANCED:INTERNAL=1 +//ADVANCED property for variable: CMAKE_CXX_FLAGS +CMAKE_CXX_FLAGS-ADVANCED:INTERNAL=1 +//ADVANCED property for variable: CMAKE_CXX_FLAGS_DEBUG +CMAKE_CXX_FLAGS_DEBUG-ADVANCED:INTERNAL=1 +//ADVANCED property for variable: CMAKE_CXX_FLAGS_MINSIZEREL +CMAKE_CXX_FLAGS_MINSIZEREL-ADVANCED:INTERNAL=1 +//ADVANCED property for variable: CMAKE_CXX_FLAGS_RELEASE +CMAKE_CXX_FLAGS_RELEASE-ADVANCED:INTERNAL=1 +//ADVANCED property for variable: CMAKE_CXX_FLAGS_RELWITHDEBINFO +CMAKE_CXX_FLAGS_RELWITHDEBINFO-ADVANCED:INTERNAL=1 +//ADVANCED property for variable: CMAKE_CXX_STANDARD_LIBRARIES +CMAKE_CXX_STANDARD_LIBRARIES-ADVANCED:INTERNAL=1 +//ADVANCED property for variable: CMAKE_C_COMPILER_AR +CMAKE_C_COMPILER_AR-ADVANCED:INTERNAL=1 +//ADVANCED property for variable: CMAKE_C_COMPILER_RANLIB +CMAKE_C_COMPILER_RANLIB-ADVANCED:INTERNAL=1 +//ADVANCED property for variable: CMAKE_C_FLAGS +CMAKE_C_FLAGS-ADVANCED:INTERNAL=1 +//ADVANCED property for variable: CMAKE_C_FLAGS_DEBUG +CMAKE_C_FLAGS_DEBUG-ADVANCED:INTERNAL=1 +//ADVANCED property for variable: CMAKE_C_FLAGS_MINSIZEREL +CMAKE_C_FLAGS_MINSIZEREL-ADVANCED:INTERNAL=1 +//ADVANCED property for variable: CMAKE_C_FLAGS_RELEASE +CMAKE_C_FLAGS_RELEASE-ADVANCED:INTERNAL=1 +//ADVANCED property for variable: CMAKE_C_FLAGS_RELWITHDEBINFO +CMAKE_C_FLAGS_RELWITHDEBINFO-ADVANCED:INTERNAL=1 +//ADVANCED property for variable: CMAKE_C_STANDARD_LIBRARIES +CMAKE_C_STANDARD_LIBRARIES-ADVANCED:INTERNAL=1 +//ADVANCED property for variable: CMAKE_DLLTOOL +CMAKE_DLLTOOL-ADVANCED:INTERNAL=1 +//Path to cache edit program executable. +CMAKE_EDIT_COMMAND:INTERNAL=/usr/local/Cellar/cmake/3.19.1/bin/ccmake +//Executable file format +CMAKE_EXECUTABLE_FORMAT:INTERNAL=ELF +//ADVANCED property for variable: CMAKE_EXE_LINKER_FLAGS +CMAKE_EXE_LINKER_FLAGS-ADVANCED:INTERNAL=1 +//ADVANCED property for variable: CMAKE_EXE_LINKER_FLAGS_DEBUG +CMAKE_EXE_LINKER_FLAGS_DEBUG-ADVANCED:INTERNAL=1 +//ADVANCED property for variable: CMAKE_EXE_LINKER_FLAGS_MINSIZEREL +CMAKE_EXE_LINKER_FLAGS_MINSIZEREL-ADVANCED:INTERNAL=1 +//ADVANCED property for variable: CMAKE_EXE_LINKER_FLAGS_RELEASE +CMAKE_EXE_LINKER_FLAGS_RELEASE-ADVANCED:INTERNAL=1 +//ADVANCED property for variable: CMAKE_EXE_LINKER_FLAGS_RELWITHDEBINFO +CMAKE_EXE_LINKER_FLAGS_RELWITHDEBINFO-ADVANCED:INTERNAL=1 +//ADVANCED property for variable: CMAKE_EXPORT_COMPILE_COMMANDS +CMAKE_EXPORT_COMPILE_COMMANDS-ADVANCED:INTERNAL=1 +//Name of external makefile project generator. +CMAKE_EXTRA_GENERATOR:INTERNAL= +//Name of generator. +CMAKE_GENERATOR:INTERNAL=Unix Makefiles +//Generator instance identifier. +CMAKE_GENERATOR_INSTANCE:INTERNAL= +//Name of generator platform. +CMAKE_GENERATOR_PLATFORM:INTERNAL= +//Name of generator toolset. +CMAKE_GENERATOR_TOOLSET:INTERNAL= +//Source directory with the top level CMakeLists.txt file for this +// project +CMAKE_HOME_DIRECTORY:INTERNAL=/Users/yichao.wu/deepctrl/GmSSL-Java/android +//Install .so files without execute permission. +CMAKE_INSTALL_SO_NO_EXE:INTERNAL=0 +//ADVANCED property for variable: CMAKE_LINKER +CMAKE_LINKER-ADVANCED:INTERNAL=1 +//ADVANCED property for variable: CMAKE_MAKE_PROGRAM +CMAKE_MAKE_PROGRAM-ADVANCED:INTERNAL=1 +//ADVANCED property for variable: CMAKE_MODULE_LINKER_FLAGS +CMAKE_MODULE_LINKER_FLAGS-ADVANCED:INTERNAL=1 +//ADVANCED property for variable: CMAKE_MODULE_LINKER_FLAGS_DEBUG +CMAKE_MODULE_LINKER_FLAGS_DEBUG-ADVANCED:INTERNAL=1 +//ADVANCED property for variable: CMAKE_MODULE_LINKER_FLAGS_MINSIZEREL +CMAKE_MODULE_LINKER_FLAGS_MINSIZEREL-ADVANCED:INTERNAL=1 +//ADVANCED property for variable: CMAKE_MODULE_LINKER_FLAGS_RELEASE +CMAKE_MODULE_LINKER_FLAGS_RELEASE-ADVANCED:INTERNAL=1 +//ADVANCED property for variable: CMAKE_MODULE_LINKER_FLAGS_RELWITHDEBINFO +CMAKE_MODULE_LINKER_FLAGS_RELWITHDEBINFO-ADVANCED:INTERNAL=1 +//ADVANCED property for variable: CMAKE_NM +CMAKE_NM-ADVANCED:INTERNAL=1 +//number of local generators +CMAKE_NUMBER_OF_MAKEFILES:INTERNAL=1 +//ADVANCED property for variable: CMAKE_OBJCOPY +CMAKE_OBJCOPY-ADVANCED:INTERNAL=1 +//ADVANCED property for variable: CMAKE_OBJDUMP +CMAKE_OBJDUMP-ADVANCED:INTERNAL=1 +//Platform information initialized +CMAKE_PLATFORM_INFO_INITIALIZED:INTERNAL=1 +//ADVANCED property for variable: CMAKE_RANLIB +CMAKE_RANLIB-ADVANCED:INTERNAL=1 +//ADVANCED property for variable: CMAKE_READELF +CMAKE_READELF-ADVANCED:INTERNAL=1 +//Path to CMake installation. +CMAKE_ROOT:INTERNAL=/usr/local/Cellar/cmake/3.19.1/share/cmake +//ADVANCED property for variable: CMAKE_SHARED_LINKER_FLAGS +CMAKE_SHARED_LINKER_FLAGS-ADVANCED:INTERNAL=1 +//ADVANCED property for variable: CMAKE_SHARED_LINKER_FLAGS_DEBUG +CMAKE_SHARED_LINKER_FLAGS_DEBUG-ADVANCED:INTERNAL=1 +//ADVANCED property for variable: CMAKE_SHARED_LINKER_FLAGS_MINSIZEREL +CMAKE_SHARED_LINKER_FLAGS_MINSIZEREL-ADVANCED:INTERNAL=1 +//ADVANCED property for variable: CMAKE_SHARED_LINKER_FLAGS_RELEASE +CMAKE_SHARED_LINKER_FLAGS_RELEASE-ADVANCED:INTERNAL=1 +//ADVANCED property for variable: CMAKE_SHARED_LINKER_FLAGS_RELWITHDEBINFO +CMAKE_SHARED_LINKER_FLAGS_RELWITHDEBINFO-ADVANCED:INTERNAL=1 +//ADVANCED property for variable: CMAKE_SKIP_INSTALL_RPATH +CMAKE_SKIP_INSTALL_RPATH-ADVANCED:INTERNAL=1 +//ADVANCED property for variable: CMAKE_SKIP_RPATH +CMAKE_SKIP_RPATH-ADVANCED:INTERNAL=1 +//ADVANCED property for variable: CMAKE_STATIC_LINKER_FLAGS +CMAKE_STATIC_LINKER_FLAGS-ADVANCED:INTERNAL=1 +//ADVANCED property for variable: CMAKE_STATIC_LINKER_FLAGS_DEBUG +CMAKE_STATIC_LINKER_FLAGS_DEBUG-ADVANCED:INTERNAL=1 +//ADVANCED property for variable: CMAKE_STATIC_LINKER_FLAGS_MINSIZEREL +CMAKE_STATIC_LINKER_FLAGS_MINSIZEREL-ADVANCED:INTERNAL=1 +//ADVANCED property for variable: CMAKE_STATIC_LINKER_FLAGS_RELEASE +CMAKE_STATIC_LINKER_FLAGS_RELEASE-ADVANCED:INTERNAL=1 +//ADVANCED property for variable: CMAKE_STATIC_LINKER_FLAGS_RELWITHDEBINFO +CMAKE_STATIC_LINKER_FLAGS_RELWITHDEBINFO-ADVANCED:INTERNAL=1 +//ADVANCED property for variable: CMAKE_STRIP +CMAKE_STRIP-ADVANCED:INTERNAL=1 +//uname command +CMAKE_UNAME:INTERNAL=/usr/bin/uname +//ADVANCED property for variable: CMAKE_VERBOSE_MAKEFILE +CMAKE_VERBOSE_MAKEFILE-ADVANCED:INTERNAL=1 + diff --git a/android/build-jni-armeabi-v7a/CMakeFiles/3.19.1/CMakeCCompiler.cmake b/android/build-jni-armeabi-v7a/CMakeFiles/3.19.1/CMakeCCompiler.cmake new file mode 100644 index 0000000..4980a39 --- /dev/null +++ b/android/build-jni-armeabi-v7a/CMakeFiles/3.19.1/CMakeCCompiler.cmake @@ -0,0 +1,77 @@ +set(CMAKE_C_COMPILER "/Users/yichao.wu/Library/Android/sdk/ndk/27.1.12297006/toolchains/llvm/prebuilt/darwin-x86_64/bin/clang") +set(CMAKE_C_COMPILER_ARG1 "") +set(CMAKE_C_COMPILER_ID "Clang") +set(CMAKE_C_COMPILER_VERSION "18.0.2") +set(CMAKE_C_COMPILER_VERSION_INTERNAL "") +set(CMAKE_C_COMPILER_WRAPPER "") +set(CMAKE_C_STANDARD_COMPUTED_DEFAULT "11") +set(CMAKE_C_COMPILE_FEATURES "c_std_90;c_function_prototypes;c_std_99;c_restrict;c_variadic_macros;c_std_11;c_static_assert") +set(CMAKE_C90_COMPILE_FEATURES "c_std_90;c_function_prototypes") +set(CMAKE_C99_COMPILE_FEATURES "c_std_99;c_restrict;c_variadic_macros") +set(CMAKE_C11_COMPILE_FEATURES "c_std_11;c_static_assert") + +set(CMAKE_C_PLATFORM_ID "Linux") +set(CMAKE_C_SIMULATE_ID "") +set(CMAKE_C_COMPILER_FRONTEND_VARIANT "GNU") +set(CMAKE_C_SIMULATE_VERSION "") + + + + +set(CMAKE_AR "/Users/yichao.wu/Library/Android/sdk/ndk/27.1.12297006/toolchains/llvm/prebuilt/darwin-x86_64/bin/llvm-ar") +set(CMAKE_C_COMPILER_AR "CMAKE_C_COMPILER_AR-NOTFOUND") +set(CMAKE_RANLIB "/Users/yichao.wu/Library/Android/sdk/ndk/27.1.12297006/toolchains/llvm/prebuilt/darwin-x86_64/bin/llvm-ranlib") +set(CMAKE_C_COMPILER_RANLIB "CMAKE_C_COMPILER_RANLIB-NOTFOUND") +set(CMAKE_LINKER "/Users/yichao.wu/Library/Android/sdk/ndk/27.1.12297006/toolchains/llvm/prebuilt/darwin-x86_64/bin/ld.lld") +set(CMAKE_MT "") +set(CMAKE_COMPILER_IS_GNUCC ) +set(CMAKE_C_COMPILER_LOADED 1) +set(CMAKE_C_COMPILER_WORKS TRUE) +set(CMAKE_C_ABI_COMPILED TRUE) +set(CMAKE_COMPILER_IS_MINGW ) +set(CMAKE_COMPILER_IS_CYGWIN ) +if(CMAKE_COMPILER_IS_CYGWIN) + set(CYGWIN 1) + set(UNIX 1) +endif() + +set(CMAKE_C_COMPILER_ENV_VAR "CC") + +if(CMAKE_COMPILER_IS_MINGW) + set(MINGW 1) +endif() +set(CMAKE_C_COMPILER_ID_RUN 1) +set(CMAKE_C_SOURCE_FILE_EXTENSIONS c;m) +set(CMAKE_C_IGNORE_EXTENSIONS h;H;o;O;obj;OBJ;def;DEF;rc;RC) +set(CMAKE_C_LINKER_PREFERENCE 10) + +# Save compiler ABI information. +set(CMAKE_C_SIZEOF_DATA_PTR "4") +set(CMAKE_C_COMPILER_ABI "ELF") +set(CMAKE_C_LIBRARY_ARCHITECTURE "") + +if(CMAKE_C_SIZEOF_DATA_PTR) + set(CMAKE_SIZEOF_VOID_P "${CMAKE_C_SIZEOF_DATA_PTR}") +endif() + +if(CMAKE_C_COMPILER_ABI) + set(CMAKE_INTERNAL_PLATFORM_ABI "${CMAKE_C_COMPILER_ABI}") +endif() + +if(CMAKE_C_LIBRARY_ARCHITECTURE) + set(CMAKE_LIBRARY_ARCHITECTURE "") +endif() + +set(CMAKE_C_CL_SHOWINCLUDES_PREFIX "") +if(CMAKE_C_CL_SHOWINCLUDES_PREFIX) + set(CMAKE_CL_SHOWINCLUDES_PREFIX "${CMAKE_C_CL_SHOWINCLUDES_PREFIX}") +endif() + + + + + +set(CMAKE_C_IMPLICIT_INCLUDE_DIRECTORIES "/Users/yichao.wu/Library/Android/sdk/ndk/27.1.12297006/toolchains/llvm/prebuilt/darwin-x86_64/lib/clang/18/include;/Users/yichao.wu/Library/Android/sdk/ndk/27.1.12297006/toolchains/llvm/prebuilt/darwin-x86_64/sysroot/usr/include/arm-linux-androideabi;/Users/yichao.wu/Library/Android/sdk/ndk/27.1.12297006/toolchains/llvm/prebuilt/darwin-x86_64/sysroot/usr/include") +set(CMAKE_C_IMPLICIT_LINK_LIBRARIES "-l:libunwind.a;dl;c;-l:libunwind.a;dl") +set(CMAKE_C_IMPLICIT_LINK_DIRECTORIES "/Users/yichao.wu/Library/Android/sdk/ndk/27.1.12297006/toolchains/llvm/prebuilt/darwin-x86_64/lib/clang/18/lib/linux/arm;/Users/yichao.wu/Library/Android/sdk/ndk/27.1.12297006/toolchains/llvm/prebuilt/darwin-x86_64/sysroot/usr/lib/arm-linux-androideabi/21;/Users/yichao.wu/Library/Android/sdk/ndk/27.1.12297006/toolchains/llvm/prebuilt/darwin-x86_64/sysroot/usr/lib/arm-linux-androideabi;/Users/yichao.wu/Library/Android/sdk/ndk/27.1.12297006/toolchains/llvm/prebuilt/darwin-x86_64/sysroot/usr/lib") +set(CMAKE_C_IMPLICIT_LINK_FRAMEWORK_DIRECTORIES "") diff --git a/android/build-jni-armeabi-v7a/CMakeFiles/3.19.1/CMakeCXXCompiler.cmake b/android/build-jni-armeabi-v7a/CMakeFiles/3.19.1/CMakeCXXCompiler.cmake new file mode 100644 index 0000000..f06d9ff --- /dev/null +++ b/android/build-jni-armeabi-v7a/CMakeFiles/3.19.1/CMakeCXXCompiler.cmake @@ -0,0 +1,89 @@ +set(CMAKE_CXX_COMPILER "/Users/yichao.wu/Library/Android/sdk/ndk/27.1.12297006/toolchains/llvm/prebuilt/darwin-x86_64/bin/clang++") +set(CMAKE_CXX_COMPILER_ARG1 "") +set(CMAKE_CXX_COMPILER_ID "Clang") +set(CMAKE_CXX_COMPILER_VERSION "18.0.2") +set(CMAKE_CXX_COMPILER_VERSION_INTERNAL "") +set(CMAKE_CXX_COMPILER_WRAPPER "") +set(CMAKE_CXX_STANDARD_COMPUTED_DEFAULT "17") +set(CMAKE_CXX_COMPILE_FEATURES "cxx_std_98;cxx_template_template_parameters;cxx_std_11;cxx_alias_templates;cxx_alignas;cxx_alignof;cxx_attributes;cxx_auto_type;cxx_constexpr;cxx_decltype;cxx_decltype_incomplete_return_types;cxx_default_function_template_args;cxx_defaulted_functions;cxx_defaulted_move_initializers;cxx_delegating_constructors;cxx_deleted_functions;cxx_enum_forward_declarations;cxx_explicit_conversions;cxx_extended_friend_declarations;cxx_extern_templates;cxx_final;cxx_func_identifier;cxx_generalized_initializers;cxx_inheriting_constructors;cxx_inline_namespaces;cxx_lambdas;cxx_local_type_template_args;cxx_long_long_type;cxx_noexcept;cxx_nonstatic_member_init;cxx_nullptr;cxx_override;cxx_range_for;cxx_raw_string_literals;cxx_reference_qualified_functions;cxx_right_angle_brackets;cxx_rvalue_references;cxx_sizeof_member;cxx_static_assert;cxx_strong_enums;cxx_thread_local;cxx_trailing_return_types;cxx_unicode_literals;cxx_uniform_initialization;cxx_unrestricted_unions;cxx_user_literals;cxx_variadic_macros;cxx_variadic_templates;cxx_std_14;cxx_aggregate_default_initializers;cxx_attribute_deprecated;cxx_binary_literals;cxx_contextual_conversions;cxx_decltype_auto;cxx_digit_separators;cxx_generic_lambdas;cxx_lambda_init_captures;cxx_relaxed_constexpr;cxx_return_type_deduction;cxx_variable_templates;cxx_std_17;cxx_std_20") +set(CMAKE_CXX98_COMPILE_FEATURES "cxx_std_98;cxx_template_template_parameters") +set(CMAKE_CXX11_COMPILE_FEATURES "cxx_std_11;cxx_alias_templates;cxx_alignas;cxx_alignof;cxx_attributes;cxx_auto_type;cxx_constexpr;cxx_decltype;cxx_decltype_incomplete_return_types;cxx_default_function_template_args;cxx_defaulted_functions;cxx_defaulted_move_initializers;cxx_delegating_constructors;cxx_deleted_functions;cxx_enum_forward_declarations;cxx_explicit_conversions;cxx_extended_friend_declarations;cxx_extern_templates;cxx_final;cxx_func_identifier;cxx_generalized_initializers;cxx_inheriting_constructors;cxx_inline_namespaces;cxx_lambdas;cxx_local_type_template_args;cxx_long_long_type;cxx_noexcept;cxx_nonstatic_member_init;cxx_nullptr;cxx_override;cxx_range_for;cxx_raw_string_literals;cxx_reference_qualified_functions;cxx_right_angle_brackets;cxx_rvalue_references;cxx_sizeof_member;cxx_static_assert;cxx_strong_enums;cxx_thread_local;cxx_trailing_return_types;cxx_unicode_literals;cxx_uniform_initialization;cxx_unrestricted_unions;cxx_user_literals;cxx_variadic_macros;cxx_variadic_templates") +set(CMAKE_CXX14_COMPILE_FEATURES "cxx_std_14;cxx_aggregate_default_initializers;cxx_attribute_deprecated;cxx_binary_literals;cxx_contextual_conversions;cxx_decltype_auto;cxx_digit_separators;cxx_generic_lambdas;cxx_lambda_init_captures;cxx_relaxed_constexpr;cxx_return_type_deduction;cxx_variable_templates") +set(CMAKE_CXX17_COMPILE_FEATURES "cxx_std_17") +set(CMAKE_CXX20_COMPILE_FEATURES "cxx_std_20") + +set(CMAKE_CXX_PLATFORM_ID "Linux") +set(CMAKE_CXX_SIMULATE_ID "") +set(CMAKE_CXX_COMPILER_FRONTEND_VARIANT "GNU") +set(CMAKE_CXX_SIMULATE_VERSION "") + + + + +set(CMAKE_AR "/Users/yichao.wu/Library/Android/sdk/ndk/27.1.12297006/toolchains/llvm/prebuilt/darwin-x86_64/bin/llvm-ar") +set(CMAKE_CXX_COMPILER_AR "CMAKE_CXX_COMPILER_AR-NOTFOUND") +set(CMAKE_RANLIB "/Users/yichao.wu/Library/Android/sdk/ndk/27.1.12297006/toolchains/llvm/prebuilt/darwin-x86_64/bin/llvm-ranlib") +set(CMAKE_CXX_COMPILER_RANLIB "CMAKE_CXX_COMPILER_RANLIB-NOTFOUND") +set(CMAKE_LINKER "/Users/yichao.wu/Library/Android/sdk/ndk/27.1.12297006/toolchains/llvm/prebuilt/darwin-x86_64/bin/ld.lld") +set(CMAKE_MT "") +set(CMAKE_COMPILER_IS_GNUCXX ) +set(CMAKE_CXX_COMPILER_LOADED 1) +set(CMAKE_CXX_COMPILER_WORKS TRUE) +set(CMAKE_CXX_ABI_COMPILED TRUE) +set(CMAKE_COMPILER_IS_MINGW ) +set(CMAKE_COMPILER_IS_CYGWIN ) +if(CMAKE_COMPILER_IS_CYGWIN) + set(CYGWIN 1) + set(UNIX 1) +endif() + +set(CMAKE_CXX_COMPILER_ENV_VAR "CXX") + +if(CMAKE_COMPILER_IS_MINGW) + set(MINGW 1) +endif() +set(CMAKE_CXX_COMPILER_ID_RUN 1) +set(CMAKE_CXX_SOURCE_FILE_EXTENSIONS C;M;c++;cc;cpp;cxx;m;mm;CPP) +set(CMAKE_CXX_IGNORE_EXTENSIONS inl;h;hpp;HPP;H;o;O;obj;OBJ;def;DEF;rc;RC) + +foreach (lang C OBJC OBJCXX) + if (CMAKE_${lang}_COMPILER_ID_RUN) + foreach(extension IN LISTS CMAKE_${lang}_SOURCE_FILE_EXTENSIONS) + list(REMOVE_ITEM CMAKE_CXX_SOURCE_FILE_EXTENSIONS ${extension}) + endforeach() + endif() +endforeach() + +set(CMAKE_CXX_LINKER_PREFERENCE 30) +set(CMAKE_CXX_LINKER_PREFERENCE_PROPAGATES 1) + +# Save compiler ABI information. +set(CMAKE_CXX_SIZEOF_DATA_PTR "4") +set(CMAKE_CXX_COMPILER_ABI "ELF") +set(CMAKE_CXX_LIBRARY_ARCHITECTURE "") + +if(CMAKE_CXX_SIZEOF_DATA_PTR) + set(CMAKE_SIZEOF_VOID_P "${CMAKE_CXX_SIZEOF_DATA_PTR}") +endif() + +if(CMAKE_CXX_COMPILER_ABI) + set(CMAKE_INTERNAL_PLATFORM_ABI "${CMAKE_CXX_COMPILER_ABI}") +endif() + +if(CMAKE_CXX_LIBRARY_ARCHITECTURE) + set(CMAKE_LIBRARY_ARCHITECTURE "") +endif() + +set(CMAKE_CXX_CL_SHOWINCLUDES_PREFIX "") +if(CMAKE_CXX_CL_SHOWINCLUDES_PREFIX) + set(CMAKE_CL_SHOWINCLUDES_PREFIX "${CMAKE_CXX_CL_SHOWINCLUDES_PREFIX}") +endif() + + + + + +set(CMAKE_CXX_IMPLICIT_INCLUDE_DIRECTORIES "/Users/yichao.wu/Library/Android/sdk/ndk/27.1.12297006/toolchains/llvm/prebuilt/darwin-x86_64/sysroot/usr/include/c++/v1;/Users/yichao.wu/Library/Android/sdk/ndk/27.1.12297006/toolchains/llvm/prebuilt/darwin-x86_64/lib/clang/18/include;/Users/yichao.wu/Library/Android/sdk/ndk/27.1.12297006/toolchains/llvm/prebuilt/darwin-x86_64/sysroot/usr/include/arm-linux-androideabi;/Users/yichao.wu/Library/Android/sdk/ndk/27.1.12297006/toolchains/llvm/prebuilt/darwin-x86_64/sysroot/usr/include") +set(CMAKE_CXX_IMPLICIT_LINK_LIBRARIES "c++;m;-l:libunwind.a;dl;c;-l:libunwind.a;dl") +set(CMAKE_CXX_IMPLICIT_LINK_DIRECTORIES "/Users/yichao.wu/Library/Android/sdk/ndk/27.1.12297006/toolchains/llvm/prebuilt/darwin-x86_64/lib/clang/18/lib/linux/arm;/Users/yichao.wu/Library/Android/sdk/ndk/27.1.12297006/toolchains/llvm/prebuilt/darwin-x86_64/sysroot/usr/lib/arm-linux-androideabi/21;/Users/yichao.wu/Library/Android/sdk/ndk/27.1.12297006/toolchains/llvm/prebuilt/darwin-x86_64/sysroot/usr/lib/arm-linux-androideabi;/Users/yichao.wu/Library/Android/sdk/ndk/27.1.12297006/toolchains/llvm/prebuilt/darwin-x86_64/sysroot/usr/lib") +set(CMAKE_CXX_IMPLICIT_LINK_FRAMEWORK_DIRECTORIES "") diff --git a/android/build-jni-armeabi-v7a/CMakeFiles/3.19.1/CMakeDetermineCompilerABI_C.bin b/android/build-jni-armeabi-v7a/CMakeFiles/3.19.1/CMakeDetermineCompilerABI_C.bin new file mode 100755 index 0000000..6824430 Binary files /dev/null and b/android/build-jni-armeabi-v7a/CMakeFiles/3.19.1/CMakeDetermineCompilerABI_C.bin differ diff --git a/android/build-jni-armeabi-v7a/CMakeFiles/3.19.1/CMakeDetermineCompilerABI_CXX.bin b/android/build-jni-armeabi-v7a/CMakeFiles/3.19.1/CMakeDetermineCompilerABI_CXX.bin new file mode 100755 index 0000000..3cd985d Binary files /dev/null and b/android/build-jni-armeabi-v7a/CMakeFiles/3.19.1/CMakeDetermineCompilerABI_CXX.bin differ diff --git a/android/build-jni-armeabi-v7a/CMakeFiles/3.19.1/CMakeSystem.cmake b/android/build-jni-armeabi-v7a/CMakeFiles/3.19.1/CMakeSystem.cmake new file mode 100644 index 0000000..391cb00 --- /dev/null +++ b/android/build-jni-armeabi-v7a/CMakeFiles/3.19.1/CMakeSystem.cmake @@ -0,0 +1,15 @@ +set(CMAKE_HOST_SYSTEM "Darwin-24.2.0") +set(CMAKE_HOST_SYSTEM_NAME "Darwin") +set(CMAKE_HOST_SYSTEM_VERSION "24.2.0") +set(CMAKE_HOST_SYSTEM_PROCESSOR "arm64") + +include("/Users/yichao.wu/Library/Android/sdk/ndk/27.1.12297006/build/cmake/android.toolchain.cmake") + +set(CMAKE_SYSTEM "Android-1") +set(CMAKE_SYSTEM_NAME "Android") +set(CMAKE_SYSTEM_VERSION "1") +set(CMAKE_SYSTEM_PROCESSOR "armv7-a") + +set(CMAKE_CROSSCOMPILING "TRUE") + +set(CMAKE_SYSTEM_LOADED 1) diff --git a/android/build-jni-armeabi-v7a/CMakeFiles/3.19.1/CompilerIdC/CMakeCCompilerId.c b/android/build-jni-armeabi-v7a/CMakeFiles/3.19.1/CompilerIdC/CMakeCCompilerId.c new file mode 100644 index 0000000..b532cf7 --- /dev/null +++ b/android/build-jni-armeabi-v7a/CMakeFiles/3.19.1/CompilerIdC/CMakeCCompilerId.c @@ -0,0 +1,721 @@ +#ifdef __cplusplus +# error "A C++ compiler has been selected for C." +#endif + +#if defined(__18CXX) +# define ID_VOID_MAIN +#endif +#if defined(__CLASSIC_C__) +/* cv-qualifiers did not exist in K&R C */ +# define const +# define volatile +#endif + + +/* Version number components: V=Version, R=Revision, P=Patch + Version date components: YYYY=Year, MM=Month, DD=Day */ + +#if defined(__INTEL_COMPILER) || defined(__ICC) +# define COMPILER_ID "Intel" +# if defined(_MSC_VER) +# define SIMULATE_ID "MSVC" +# endif +# if defined(__GNUC__) +# define SIMULATE_ID "GNU" +# endif + /* __INTEL_COMPILER = VRP */ +# define COMPILER_VERSION_MAJOR DEC(__INTEL_COMPILER/100) +# define COMPILER_VERSION_MINOR DEC(__INTEL_COMPILER/10 % 10) +# if defined(__INTEL_COMPILER_UPDATE) +# define COMPILER_VERSION_PATCH DEC(__INTEL_COMPILER_UPDATE) +# else +# define COMPILER_VERSION_PATCH DEC(__INTEL_COMPILER % 10) +# endif +# if defined(__INTEL_COMPILER_BUILD_DATE) + /* __INTEL_COMPILER_BUILD_DATE = YYYYMMDD */ +# define COMPILER_VERSION_TWEAK DEC(__INTEL_COMPILER_BUILD_DATE) +# endif +# if defined(_MSC_VER) + /* _MSC_VER = VVRR */ +# define SIMULATE_VERSION_MAJOR DEC(_MSC_VER / 100) +# define SIMULATE_VERSION_MINOR DEC(_MSC_VER % 100) +# endif +# if defined(__GNUC__) +# define SIMULATE_VERSION_MAJOR DEC(__GNUC__) +# elif defined(__GNUG__) +# define SIMULATE_VERSION_MAJOR DEC(__GNUG__) +# endif +# if defined(__GNUC_MINOR__) +# define SIMULATE_VERSION_MINOR DEC(__GNUC_MINOR__) +# endif +# if defined(__GNUC_PATCHLEVEL__) +# define SIMULATE_VERSION_PATCH DEC(__GNUC_PATCHLEVEL__) +# endif + +#elif defined(__PATHCC__) +# define COMPILER_ID "PathScale" +# define COMPILER_VERSION_MAJOR DEC(__PATHCC__) +# define COMPILER_VERSION_MINOR DEC(__PATHCC_MINOR__) +# if defined(__PATHCC_PATCHLEVEL__) +# define COMPILER_VERSION_PATCH DEC(__PATHCC_PATCHLEVEL__) +# endif + +#elif defined(__BORLANDC__) && defined(__CODEGEARC_VERSION__) +# define COMPILER_ID "Embarcadero" +# define COMPILER_VERSION_MAJOR HEX(__CODEGEARC_VERSION__>>24 & 0x00FF) +# define COMPILER_VERSION_MINOR HEX(__CODEGEARC_VERSION__>>16 & 0x00FF) +# define COMPILER_VERSION_PATCH DEC(__CODEGEARC_VERSION__ & 0xFFFF) + +#elif defined(__BORLANDC__) +# define COMPILER_ID "Borland" + /* __BORLANDC__ = 0xVRR */ +# define COMPILER_VERSION_MAJOR HEX(__BORLANDC__>>8) +# define COMPILER_VERSION_MINOR HEX(__BORLANDC__ & 0xFF) + +#elif defined(__WATCOMC__) && __WATCOMC__ < 1200 +# define COMPILER_ID "Watcom" + /* __WATCOMC__ = VVRR */ +# define COMPILER_VERSION_MAJOR DEC(__WATCOMC__ / 100) +# define COMPILER_VERSION_MINOR DEC((__WATCOMC__ / 10) % 10) +# if (__WATCOMC__ % 10) > 0 +# define COMPILER_VERSION_PATCH DEC(__WATCOMC__ % 10) +# endif + +#elif defined(__WATCOMC__) +# define COMPILER_ID "OpenWatcom" + /* __WATCOMC__ = VVRP + 1100 */ +# define COMPILER_VERSION_MAJOR DEC((__WATCOMC__ - 1100) / 100) +# define COMPILER_VERSION_MINOR DEC((__WATCOMC__ / 10) % 10) +# if (__WATCOMC__ % 10) > 0 +# define COMPILER_VERSION_PATCH DEC(__WATCOMC__ % 10) +# endif + +#elif defined(__SUNPRO_C) +# define COMPILER_ID "SunPro" +# if __SUNPRO_C >= 0x5100 + /* __SUNPRO_C = 0xVRRP */ +# define COMPILER_VERSION_MAJOR HEX(__SUNPRO_C>>12) +# define COMPILER_VERSION_MINOR HEX(__SUNPRO_C>>4 & 0xFF) +# define COMPILER_VERSION_PATCH HEX(__SUNPRO_C & 0xF) +# else + /* __SUNPRO_CC = 0xVRP */ +# define COMPILER_VERSION_MAJOR HEX(__SUNPRO_C>>8) +# define COMPILER_VERSION_MINOR HEX(__SUNPRO_C>>4 & 0xF) +# define COMPILER_VERSION_PATCH HEX(__SUNPRO_C & 0xF) +# endif + +#elif defined(__HP_cc) +# define COMPILER_ID "HP" + /* __HP_cc = VVRRPP */ +# define COMPILER_VERSION_MAJOR DEC(__HP_cc/10000) +# define COMPILER_VERSION_MINOR DEC(__HP_cc/100 % 100) +# define COMPILER_VERSION_PATCH DEC(__HP_cc % 100) + +#elif defined(__DECC) +# define COMPILER_ID "Compaq" + /* __DECC_VER = VVRRTPPPP */ +# define COMPILER_VERSION_MAJOR DEC(__DECC_VER/10000000) +# define COMPILER_VERSION_MINOR DEC(__DECC_VER/100000 % 100) +# define COMPILER_VERSION_PATCH DEC(__DECC_VER % 10000) + +#elif defined(__IBMC__) && defined(__COMPILER_VER__) +# define COMPILER_ID "zOS" + /* __IBMC__ = VRP */ +# define COMPILER_VERSION_MAJOR DEC(__IBMC__/100) +# define COMPILER_VERSION_MINOR DEC(__IBMC__/10 % 10) +# define COMPILER_VERSION_PATCH DEC(__IBMC__ % 10) + +#elif defined(__ibmxl__) && defined(__clang__) +# define COMPILER_ID "XLClang" +# define COMPILER_VERSION_MAJOR DEC(__ibmxl_version__) +# define COMPILER_VERSION_MINOR DEC(__ibmxl_release__) +# define COMPILER_VERSION_PATCH DEC(__ibmxl_modification__) +# define COMPILER_VERSION_TWEAK DEC(__ibmxl_ptf_fix_level__) + + +#elif defined(__IBMC__) && !defined(__COMPILER_VER__) && __IBMC__ >= 800 +# define COMPILER_ID "XL" + /* __IBMC__ = VRP */ +# define COMPILER_VERSION_MAJOR DEC(__IBMC__/100) +# define COMPILER_VERSION_MINOR DEC(__IBMC__/10 % 10) +# define COMPILER_VERSION_PATCH DEC(__IBMC__ % 10) + +#elif defined(__IBMC__) && !defined(__COMPILER_VER__) && __IBMC__ < 800 +# define COMPILER_ID "VisualAge" + /* __IBMC__ = VRP */ +# define COMPILER_VERSION_MAJOR DEC(__IBMC__/100) +# define COMPILER_VERSION_MINOR DEC(__IBMC__/10 % 10) +# define COMPILER_VERSION_PATCH DEC(__IBMC__ % 10) + +#elif defined(__PGI) +# define COMPILER_ID "PGI" +# define COMPILER_VERSION_MAJOR DEC(__PGIC__) +# define COMPILER_VERSION_MINOR DEC(__PGIC_MINOR__) +# if defined(__PGIC_PATCHLEVEL__) +# define COMPILER_VERSION_PATCH DEC(__PGIC_PATCHLEVEL__) +# endif + +#elif defined(_CRAYC) +# define COMPILER_ID "Cray" +# define COMPILER_VERSION_MAJOR DEC(_RELEASE_MAJOR) +# define COMPILER_VERSION_MINOR DEC(_RELEASE_MINOR) + +#elif defined(__TI_COMPILER_VERSION__) +# define COMPILER_ID "TI" + /* __TI_COMPILER_VERSION__ = VVVRRRPPP */ +# define COMPILER_VERSION_MAJOR DEC(__TI_COMPILER_VERSION__/1000000) +# define COMPILER_VERSION_MINOR DEC(__TI_COMPILER_VERSION__/1000 % 1000) +# define COMPILER_VERSION_PATCH DEC(__TI_COMPILER_VERSION__ % 1000) + +#elif defined(__FUJITSU) || defined(__FCC_VERSION) || defined(__fcc_version) +# define COMPILER_ID "Fujitsu" + +#elif defined(__ghs__) +# define COMPILER_ID "GHS" +/* __GHS_VERSION_NUMBER = VVVVRP */ +# ifdef __GHS_VERSION_NUMBER +# define COMPILER_VERSION_MAJOR DEC(__GHS_VERSION_NUMBER / 100) +# define COMPILER_VERSION_MINOR DEC(__GHS_VERSION_NUMBER / 10 % 10) +# define COMPILER_VERSION_PATCH DEC(__GHS_VERSION_NUMBER % 10) +# endif + +#elif defined(__TINYC__) +# define COMPILER_ID "TinyCC" + +#elif defined(__BCC__) +# define COMPILER_ID "Bruce" + +#elif defined(__SCO_VERSION__) +# define COMPILER_ID "SCO" + +#elif defined(__ARMCC_VERSION) && !defined(__clang__) +# define COMPILER_ID "ARMCC" +#if __ARMCC_VERSION >= 1000000 + /* __ARMCC_VERSION = VRRPPPP */ + # define COMPILER_VERSION_MAJOR DEC(__ARMCC_VERSION/1000000) + # define COMPILER_VERSION_MINOR DEC(__ARMCC_VERSION/10000 % 100) + # define COMPILER_VERSION_PATCH DEC(__ARMCC_VERSION % 10000) +#else + /* __ARMCC_VERSION = VRPPPP */ + # define COMPILER_VERSION_MAJOR DEC(__ARMCC_VERSION/100000) + # define COMPILER_VERSION_MINOR DEC(__ARMCC_VERSION/10000 % 10) + # define COMPILER_VERSION_PATCH DEC(__ARMCC_VERSION % 10000) +#endif + + +#elif defined(__clang__) && defined(__apple_build_version__) +# define COMPILER_ID "AppleClang" +# if defined(_MSC_VER) +# define SIMULATE_ID "MSVC" +# endif +# define COMPILER_VERSION_MAJOR DEC(__clang_major__) +# define COMPILER_VERSION_MINOR DEC(__clang_minor__) +# define COMPILER_VERSION_PATCH DEC(__clang_patchlevel__) +# if defined(_MSC_VER) + /* _MSC_VER = VVRR */ +# define SIMULATE_VERSION_MAJOR DEC(_MSC_VER / 100) +# define SIMULATE_VERSION_MINOR DEC(_MSC_VER % 100) +# endif +# define COMPILER_VERSION_TWEAK DEC(__apple_build_version__) + +#elif defined(__clang__) && defined(__ARMCOMPILER_VERSION) +# define COMPILER_ID "ARMClang" + # define COMPILER_VERSION_MAJOR DEC(__ARMCOMPILER_VERSION/1000000) + # define COMPILER_VERSION_MINOR DEC(__ARMCOMPILER_VERSION/10000 % 100) + # define COMPILER_VERSION_PATCH DEC(__ARMCOMPILER_VERSION % 10000) +# define COMPILER_VERSION_INTERNAL DEC(__ARMCOMPILER_VERSION) + +#elif defined(__clang__) && defined(__INTEL_DPCPP_COMPILER__) +# define COMPILER_ID "IntelDPCPP" +# if defined(_MSC_VER) +# define SIMULATE_ID "MSVC" +# endif +# define COMPILER_VERSION_MAJOR DEC(__clang_major__) +# define COMPILER_VERSION_MINOR DEC(__clang_minor__) +# define COMPILER_VERSION_PATCH DEC(__clang_patchlevel__) +# if defined(_MSC_VER) + /* _MSC_VER = VVRR */ +# define SIMULATE_VERSION_MAJOR DEC(_MSC_VER / 100) +# define SIMULATE_VERSION_MINOR DEC(_MSC_VER % 100) +# endif +# define COMPILER_VERSION_TWEAK DEC(__INTEL_DPCPP_COMPILER__) + +#elif defined(__clang__) && defined(__INTEL_CLANG_COMPILER) +# define COMPILER_ID "IntelClang" +# if defined(_MSC_VER) +# define SIMULATE_ID "MSVC" +# endif +# define COMPILER_VERSION_MAJOR DEC(__clang_major__) +# define COMPILER_VERSION_MINOR DEC(__clang_minor__) +# define COMPILER_VERSION_PATCH DEC(__clang_patchlevel__) +# if defined(_MSC_VER) + /* _MSC_VER = VVRR */ +# define SIMULATE_VERSION_MAJOR DEC(_MSC_VER / 100) +# define SIMULATE_VERSION_MINOR DEC(_MSC_VER % 100) +# endif +# define COMPILER_VERSION_TWEAK DEC(__INTEL_CLANG_COMPILER) + +#elif defined(__clang__) +# define COMPILER_ID "Clang" +# if defined(_MSC_VER) +# define SIMULATE_ID "MSVC" +# endif +# define COMPILER_VERSION_MAJOR DEC(__clang_major__) +# define COMPILER_VERSION_MINOR DEC(__clang_minor__) +# define COMPILER_VERSION_PATCH DEC(__clang_patchlevel__) +# if defined(_MSC_VER) + /* _MSC_VER = VVRR */ +# define SIMULATE_VERSION_MAJOR DEC(_MSC_VER / 100) +# define SIMULATE_VERSION_MINOR DEC(_MSC_VER % 100) +# endif + +#elif defined(__GNUC__) +# define COMPILER_ID "GNU" +# define COMPILER_VERSION_MAJOR DEC(__GNUC__) +# if defined(__GNUC_MINOR__) +# define COMPILER_VERSION_MINOR DEC(__GNUC_MINOR__) +# endif +# if defined(__GNUC_PATCHLEVEL__) +# define COMPILER_VERSION_PATCH DEC(__GNUC_PATCHLEVEL__) +# endif + +#elif defined(_MSC_VER) +# define COMPILER_ID "MSVC" + /* _MSC_VER = VVRR */ +# define COMPILER_VERSION_MAJOR DEC(_MSC_VER / 100) +# define COMPILER_VERSION_MINOR DEC(_MSC_VER % 100) +# if defined(_MSC_FULL_VER) +# if _MSC_VER >= 1400 + /* _MSC_FULL_VER = VVRRPPPPP */ +# define COMPILER_VERSION_PATCH DEC(_MSC_FULL_VER % 100000) +# else + /* _MSC_FULL_VER = VVRRPPPP */ +# define COMPILER_VERSION_PATCH DEC(_MSC_FULL_VER % 10000) +# endif +# endif +# if defined(_MSC_BUILD) +# define COMPILER_VERSION_TWEAK DEC(_MSC_BUILD) +# endif + +#elif defined(__VISUALDSPVERSION__) || defined(__ADSPBLACKFIN__) || defined(__ADSPTS__) || defined(__ADSP21000__) +# define COMPILER_ID "ADSP" +#if defined(__VISUALDSPVERSION__) + /* __VISUALDSPVERSION__ = 0xVVRRPP00 */ +# define COMPILER_VERSION_MAJOR HEX(__VISUALDSPVERSION__>>24) +# define COMPILER_VERSION_MINOR HEX(__VISUALDSPVERSION__>>16 & 0xFF) +# define COMPILER_VERSION_PATCH HEX(__VISUALDSPVERSION__>>8 & 0xFF) +#endif + +#elif defined(__IAR_SYSTEMS_ICC__) || defined(__IAR_SYSTEMS_ICC) +# define COMPILER_ID "IAR" +# if defined(__VER__) && defined(__ICCARM__) +# define COMPILER_VERSION_MAJOR DEC((__VER__) / 1000000) +# define COMPILER_VERSION_MINOR DEC(((__VER__) / 1000) % 1000) +# define COMPILER_VERSION_PATCH DEC((__VER__) % 1000) +# define COMPILER_VERSION_INTERNAL DEC(__IAR_SYSTEMS_ICC__) +# elif defined(__VER__) && (defined(__ICCAVR__) || defined(__ICCRX__) || defined(__ICCRH850__) || defined(__ICCRL78__) || defined(__ICC430__) || defined(__ICCRISCV__) || defined(__ICCV850__) || defined(__ICC8051__)) +# define COMPILER_VERSION_MAJOR DEC((__VER__) / 100) +# define COMPILER_VERSION_MINOR DEC((__VER__) - (((__VER__) / 100)*100)) +# define COMPILER_VERSION_PATCH DEC(__SUBVERSION__) +# define COMPILER_VERSION_INTERNAL DEC(__IAR_SYSTEMS_ICC__) +# endif + +#elif defined(__SDCC_VERSION_MAJOR) || defined(SDCC) +# define COMPILER_ID "SDCC" +# if defined(__SDCC_VERSION_MAJOR) +# define COMPILER_VERSION_MAJOR DEC(__SDCC_VERSION_MAJOR) +# define COMPILER_VERSION_MINOR DEC(__SDCC_VERSION_MINOR) +# define COMPILER_VERSION_PATCH DEC(__SDCC_VERSION_PATCH) +# else + /* SDCC = VRP */ +# define COMPILER_VERSION_MAJOR DEC(SDCC/100) +# define COMPILER_VERSION_MINOR DEC(SDCC/10 % 10) +# define COMPILER_VERSION_PATCH DEC(SDCC % 10) +# endif + + +/* These compilers are either not known or too old to define an + identification macro. Try to identify the platform and guess that + it is the native compiler. */ +#elif defined(__hpux) || defined(__hpua) +# define COMPILER_ID "HP" + +#else /* unknown compiler */ +# define COMPILER_ID "" +#endif + +/* Construct the string literal in pieces to prevent the source from + getting matched. Store it in a pointer rather than an array + because some compilers will just produce instructions to fill the + array rather than assigning a pointer to a static array. */ +char const* info_compiler = "INFO" ":" "compiler[" COMPILER_ID "]"; +#ifdef SIMULATE_ID +char const* info_simulate = "INFO" ":" "simulate[" SIMULATE_ID "]"; +#endif + +#ifdef __QNXNTO__ +char const* qnxnto = "INFO" ":" "qnxnto[]"; +#endif + +#if defined(__CRAYXE) || defined(__CRAYXC) +char const *info_cray = "INFO" ":" "compiler_wrapper[CrayPrgEnv]"; +#endif + +#define STRINGIFY_HELPER(X) #X +#define STRINGIFY(X) STRINGIFY_HELPER(X) + +/* Identify known platforms by name. */ +#if defined(__linux) || defined(__linux__) || defined(linux) +# define PLATFORM_ID "Linux" + +#elif defined(__CYGWIN__) +# define PLATFORM_ID "Cygwin" + +#elif defined(__MINGW32__) +# define PLATFORM_ID "MinGW" + +#elif defined(__APPLE__) +# define PLATFORM_ID "Darwin" + +#elif defined(_WIN32) || defined(__WIN32__) || defined(WIN32) +# define PLATFORM_ID "Windows" + +#elif defined(__FreeBSD__) || defined(__FreeBSD) +# define PLATFORM_ID "FreeBSD" + +#elif defined(__NetBSD__) || defined(__NetBSD) +# define PLATFORM_ID "NetBSD" + +#elif defined(__OpenBSD__) || defined(__OPENBSD) +# define PLATFORM_ID "OpenBSD" + +#elif defined(__sun) || defined(sun) +# define PLATFORM_ID "SunOS" + +#elif defined(_AIX) || defined(__AIX) || defined(__AIX__) || defined(__aix) || defined(__aix__) +# define PLATFORM_ID "AIX" + +#elif defined(__hpux) || defined(__hpux__) +# define PLATFORM_ID "HP-UX" + +#elif defined(__HAIKU__) +# define PLATFORM_ID "Haiku" + +#elif defined(__BeOS) || defined(__BEOS__) || defined(_BEOS) +# define PLATFORM_ID "BeOS" + +#elif defined(__QNX__) || defined(__QNXNTO__) +# define PLATFORM_ID "QNX" + +#elif defined(__tru64) || defined(_tru64) || defined(__TRU64__) +# define PLATFORM_ID "Tru64" + +#elif defined(__riscos) || defined(__riscos__) +# define PLATFORM_ID "RISCos" + +#elif defined(__sinix) || defined(__sinix__) || defined(__SINIX__) +# define PLATFORM_ID "SINIX" + +#elif defined(__UNIX_SV__) +# define PLATFORM_ID "UNIX_SV" + +#elif defined(__bsdos__) +# define PLATFORM_ID "BSDOS" + +#elif defined(_MPRAS) || defined(MPRAS) +# define PLATFORM_ID "MP-RAS" + +#elif defined(__osf) || defined(__osf__) +# define PLATFORM_ID "OSF1" + +#elif defined(_SCO_SV) || defined(SCO_SV) || defined(sco_sv) +# define PLATFORM_ID "SCO_SV" + +#elif defined(__ultrix) || defined(__ultrix__) || defined(_ULTRIX) +# define PLATFORM_ID "ULTRIX" + +#elif defined(__XENIX__) || defined(_XENIX) || defined(XENIX) +# define PLATFORM_ID "Xenix" + +#elif defined(__WATCOMC__) +# if defined(__LINUX__) +# define PLATFORM_ID "Linux" + +# elif defined(__DOS__) +# define PLATFORM_ID "DOS" + +# elif defined(__OS2__) +# define PLATFORM_ID "OS2" + +# elif defined(__WINDOWS__) +# define PLATFORM_ID "Windows3x" + +# elif defined(__VXWORKS__) +# define PLATFORM_ID "VxWorks" + +# else /* unknown platform */ +# define PLATFORM_ID +# endif + +#elif defined(__INTEGRITY) +# if defined(INT_178B) +# define PLATFORM_ID "Integrity178" + +# else /* regular Integrity */ +# define PLATFORM_ID "Integrity" +# endif + +#else /* unknown platform */ +# define PLATFORM_ID + +#endif + +/* For windows compilers MSVC and Intel we can determine + the architecture of the compiler being used. This is because + the compilers do not have flags that can change the architecture, + but rather depend on which compiler is being used +*/ +#if defined(_WIN32) && defined(_MSC_VER) +# if defined(_M_IA64) +# define ARCHITECTURE_ID "IA64" + +# elif defined(_M_X64) || defined(_M_AMD64) +# define ARCHITECTURE_ID "x64" + +# elif defined(_M_IX86) +# define ARCHITECTURE_ID "X86" + +# elif defined(_M_ARM64) +# define ARCHITECTURE_ID "ARM64" + +# elif defined(_M_ARM) +# if _M_ARM == 4 +# define ARCHITECTURE_ID "ARMV4I" +# elif _M_ARM == 5 +# define ARCHITECTURE_ID "ARMV5I" +# else +# define ARCHITECTURE_ID "ARMV" STRINGIFY(_M_ARM) +# endif + +# elif defined(_M_MIPS) +# define ARCHITECTURE_ID "MIPS" + +# elif defined(_M_SH) +# define ARCHITECTURE_ID "SHx" + +# else /* unknown architecture */ +# define ARCHITECTURE_ID "" +# endif + +#elif defined(__WATCOMC__) +# if defined(_M_I86) +# define ARCHITECTURE_ID "I86" + +# elif defined(_M_IX86) +# define ARCHITECTURE_ID "X86" + +# else /* unknown architecture */ +# define ARCHITECTURE_ID "" +# endif + +#elif defined(__IAR_SYSTEMS_ICC__) || defined(__IAR_SYSTEMS_ICC) +# if defined(__ICCARM__) +# define ARCHITECTURE_ID "ARM" + +# elif defined(__ICCRX__) +# define ARCHITECTURE_ID "RX" + +# elif defined(__ICCRH850__) +# define ARCHITECTURE_ID "RH850" + +# elif defined(__ICCRL78__) +# define ARCHITECTURE_ID "RL78" + +# elif defined(__ICCRISCV__) +# define ARCHITECTURE_ID "RISCV" + +# elif defined(__ICCAVR__) +# define ARCHITECTURE_ID "AVR" + +# elif defined(__ICC430__) +# define ARCHITECTURE_ID "MSP430" + +# elif defined(__ICCV850__) +# define ARCHITECTURE_ID "V850" + +# elif defined(__ICC8051__) +# define ARCHITECTURE_ID "8051" + +# else /* unknown architecture */ +# define ARCHITECTURE_ID "" +# endif + +#elif defined(__ghs__) +# if defined(__PPC64__) +# define ARCHITECTURE_ID "PPC64" + +# elif defined(__ppc__) +# define ARCHITECTURE_ID "PPC" + +# elif defined(__ARM__) +# define ARCHITECTURE_ID "ARM" + +# elif defined(__x86_64__) +# define ARCHITECTURE_ID "x64" + +# elif defined(__i386__) +# define ARCHITECTURE_ID "X86" + +# else /* unknown architecture */ +# define ARCHITECTURE_ID "" +# endif + +#elif defined(__TI_COMPILER_VERSION__) +# if defined(__TI_ARM__) +# define ARCHITECTURE_ID "ARM" + +# elif defined(__MSP430__) +# define ARCHITECTURE_ID "MSP430" + +# elif defined(__TMS320C28XX__) +# define ARCHITECTURE_ID "TMS320C28x" + +# elif defined(__TMS320C6X__) || defined(_TMS320C6X) +# define ARCHITECTURE_ID "TMS320C6x" + +# else /* unknown architecture */ +# define ARCHITECTURE_ID "" +# endif + +#else +# define ARCHITECTURE_ID +#endif + +/* Convert integer to decimal digit literals. */ +#define DEC(n) \ + ('0' + (((n) / 10000000)%10)), \ + ('0' + (((n) / 1000000)%10)), \ + ('0' + (((n) / 100000)%10)), \ + ('0' + (((n) / 10000)%10)), \ + ('0' + (((n) / 1000)%10)), \ + ('0' + (((n) / 100)%10)), \ + ('0' + (((n) / 10)%10)), \ + ('0' + ((n) % 10)) + +/* Convert integer to hex digit literals. */ +#define HEX(n) \ + ('0' + ((n)>>28 & 0xF)), \ + ('0' + ((n)>>24 & 0xF)), \ + ('0' + ((n)>>20 & 0xF)), \ + ('0' + ((n)>>16 & 0xF)), \ + ('0' + ((n)>>12 & 0xF)), \ + ('0' + ((n)>>8 & 0xF)), \ + ('0' + ((n)>>4 & 0xF)), \ + ('0' + ((n) & 0xF)) + +/* Construct a string literal encoding the version number components. */ +#ifdef COMPILER_VERSION_MAJOR +char const info_version[] = { + 'I', 'N', 'F', 'O', ':', + 'c','o','m','p','i','l','e','r','_','v','e','r','s','i','o','n','[', + COMPILER_VERSION_MAJOR, +# ifdef COMPILER_VERSION_MINOR + '.', COMPILER_VERSION_MINOR, +# ifdef COMPILER_VERSION_PATCH + '.', COMPILER_VERSION_PATCH, +# ifdef COMPILER_VERSION_TWEAK + '.', COMPILER_VERSION_TWEAK, +# endif +# endif +# endif + ']','\0'}; +#endif + +/* Construct a string literal encoding the internal version number. */ +#ifdef COMPILER_VERSION_INTERNAL +char const info_version_internal[] = { + 'I', 'N', 'F', 'O', ':', + 'c','o','m','p','i','l','e','r','_','v','e','r','s','i','o','n','_', + 'i','n','t','e','r','n','a','l','[', + COMPILER_VERSION_INTERNAL,']','\0'}; +#endif + +/* Construct a string literal encoding the version number components. */ +#ifdef SIMULATE_VERSION_MAJOR +char const info_simulate_version[] = { + 'I', 'N', 'F', 'O', ':', + 's','i','m','u','l','a','t','e','_','v','e','r','s','i','o','n','[', + SIMULATE_VERSION_MAJOR, +# ifdef SIMULATE_VERSION_MINOR + '.', SIMULATE_VERSION_MINOR, +# ifdef SIMULATE_VERSION_PATCH + '.', SIMULATE_VERSION_PATCH, +# ifdef SIMULATE_VERSION_TWEAK + '.', SIMULATE_VERSION_TWEAK, +# endif +# endif +# endif + ']','\0'}; +#endif + +/* Construct the string literal in pieces to prevent the source from + getting matched. Store it in a pointer rather than an array + because some compilers will just produce instructions to fill the + array rather than assigning a pointer to a static array. */ +char const* info_platform = "INFO" ":" "platform[" PLATFORM_ID "]"; +char const* info_arch = "INFO" ":" "arch[" ARCHITECTURE_ID "]"; + + + +#if !defined(__STDC__) +# if (defined(_MSC_VER) && !defined(__clang__)) \ + || (defined(__ibmxl__) || defined(__IBMC__)) +# define C_DIALECT "90" +# else +# define C_DIALECT +# endif +#elif __STDC_VERSION__ >= 201000L +# define C_DIALECT "11" +#elif __STDC_VERSION__ >= 199901L +# define C_DIALECT "99" +#else +# define C_DIALECT "90" +#endif +const char* info_language_dialect_default = + "INFO" ":" "dialect_default[" C_DIALECT "]"; + +/*--------------------------------------------------------------------------*/ + +#ifdef ID_VOID_MAIN +void main() {} +#else +# if defined(__CLASSIC_C__) +int main(argc, argv) int argc; char *argv[]; +# else +int main(int argc, char* argv[]) +# endif +{ + int require = 0; + require += info_compiler[argc]; + require += info_platform[argc]; + require += info_arch[argc]; +#ifdef COMPILER_VERSION_MAJOR + require += info_version[argc]; +#endif +#ifdef COMPILER_VERSION_INTERNAL + require += info_version_internal[argc]; +#endif +#ifdef SIMULATE_ID + require += info_simulate[argc]; +#endif +#ifdef SIMULATE_VERSION_MAJOR + require += info_simulate_version[argc]; +#endif +#if defined(__CRAYXE) || defined(__CRAYXC) + require += info_cray[argc]; +#endif + require += info_language_dialect_default[argc]; + (void)argv; + return require; +} +#endif diff --git a/android/build-jni-armeabi-v7a/CMakeFiles/3.19.1/CompilerIdC/CMakeCCompilerId.o b/android/build-jni-armeabi-v7a/CMakeFiles/3.19.1/CompilerIdC/CMakeCCompilerId.o new file mode 100644 index 0000000..4e7bea8 Binary files /dev/null and b/android/build-jni-armeabi-v7a/CMakeFiles/3.19.1/CompilerIdC/CMakeCCompilerId.o differ diff --git a/android/build-jni-armeabi-v7a/CMakeFiles/3.19.1/CompilerIdCXX/CMakeCXXCompilerId.cpp b/android/build-jni-armeabi-v7a/CMakeFiles/3.19.1/CompilerIdCXX/CMakeCXXCompilerId.cpp new file mode 100644 index 0000000..63067f5 --- /dev/null +++ b/android/build-jni-armeabi-v7a/CMakeFiles/3.19.1/CompilerIdCXX/CMakeCXXCompilerId.cpp @@ -0,0 +1,710 @@ +/* This source file must have a .cpp extension so that all C++ compilers + recognize the extension without flags. Borland does not know .cxx for + example. */ +#ifndef __cplusplus +# error "A C compiler has been selected for C++." +#endif + + +/* Version number components: V=Version, R=Revision, P=Patch + Version date components: YYYY=Year, MM=Month, DD=Day */ + +#if defined(__COMO__) +# define COMPILER_ID "Comeau" + /* __COMO_VERSION__ = VRR */ +# define COMPILER_VERSION_MAJOR DEC(__COMO_VERSION__ / 100) +# define COMPILER_VERSION_MINOR DEC(__COMO_VERSION__ % 100) + +#elif defined(__INTEL_COMPILER) || defined(__ICC) +# define COMPILER_ID "Intel" +# if defined(_MSC_VER) +# define SIMULATE_ID "MSVC" +# endif +# if defined(__GNUC__) +# define SIMULATE_ID "GNU" +# endif + /* __INTEL_COMPILER = VRP */ +# define COMPILER_VERSION_MAJOR DEC(__INTEL_COMPILER/100) +# define COMPILER_VERSION_MINOR DEC(__INTEL_COMPILER/10 % 10) +# if defined(__INTEL_COMPILER_UPDATE) +# define COMPILER_VERSION_PATCH DEC(__INTEL_COMPILER_UPDATE) +# else +# define COMPILER_VERSION_PATCH DEC(__INTEL_COMPILER % 10) +# endif +# if defined(__INTEL_COMPILER_BUILD_DATE) + /* __INTEL_COMPILER_BUILD_DATE = YYYYMMDD */ +# define COMPILER_VERSION_TWEAK DEC(__INTEL_COMPILER_BUILD_DATE) +# endif +# if defined(_MSC_VER) + /* _MSC_VER = VVRR */ +# define SIMULATE_VERSION_MAJOR DEC(_MSC_VER / 100) +# define SIMULATE_VERSION_MINOR DEC(_MSC_VER % 100) +# endif +# if defined(__GNUC__) +# define SIMULATE_VERSION_MAJOR DEC(__GNUC__) +# elif defined(__GNUG__) +# define SIMULATE_VERSION_MAJOR DEC(__GNUG__) +# endif +# if defined(__GNUC_MINOR__) +# define SIMULATE_VERSION_MINOR DEC(__GNUC_MINOR__) +# endif +# if defined(__GNUC_PATCHLEVEL__) +# define SIMULATE_VERSION_PATCH DEC(__GNUC_PATCHLEVEL__) +# endif + +#elif defined(__PATHCC__) +# define COMPILER_ID "PathScale" +# define COMPILER_VERSION_MAJOR DEC(__PATHCC__) +# define COMPILER_VERSION_MINOR DEC(__PATHCC_MINOR__) +# if defined(__PATHCC_PATCHLEVEL__) +# define COMPILER_VERSION_PATCH DEC(__PATHCC_PATCHLEVEL__) +# endif + +#elif defined(__BORLANDC__) && defined(__CODEGEARC_VERSION__) +# define COMPILER_ID "Embarcadero" +# define COMPILER_VERSION_MAJOR HEX(__CODEGEARC_VERSION__>>24 & 0x00FF) +# define COMPILER_VERSION_MINOR HEX(__CODEGEARC_VERSION__>>16 & 0x00FF) +# define COMPILER_VERSION_PATCH DEC(__CODEGEARC_VERSION__ & 0xFFFF) + +#elif defined(__BORLANDC__) +# define COMPILER_ID "Borland" + /* __BORLANDC__ = 0xVRR */ +# define COMPILER_VERSION_MAJOR HEX(__BORLANDC__>>8) +# define COMPILER_VERSION_MINOR HEX(__BORLANDC__ & 0xFF) + +#elif defined(__WATCOMC__) && __WATCOMC__ < 1200 +# define COMPILER_ID "Watcom" + /* __WATCOMC__ = VVRR */ +# define COMPILER_VERSION_MAJOR DEC(__WATCOMC__ / 100) +# define COMPILER_VERSION_MINOR DEC((__WATCOMC__ / 10) % 10) +# if (__WATCOMC__ % 10) > 0 +# define COMPILER_VERSION_PATCH DEC(__WATCOMC__ % 10) +# endif + +#elif defined(__WATCOMC__) +# define COMPILER_ID "OpenWatcom" + /* __WATCOMC__ = VVRP + 1100 */ +# define COMPILER_VERSION_MAJOR DEC((__WATCOMC__ - 1100) / 100) +# define COMPILER_VERSION_MINOR DEC((__WATCOMC__ / 10) % 10) +# if (__WATCOMC__ % 10) > 0 +# define COMPILER_VERSION_PATCH DEC(__WATCOMC__ % 10) +# endif + +#elif defined(__SUNPRO_CC) +# define COMPILER_ID "SunPro" +# if __SUNPRO_CC >= 0x5100 + /* __SUNPRO_CC = 0xVRRP */ +# define COMPILER_VERSION_MAJOR HEX(__SUNPRO_CC>>12) +# define COMPILER_VERSION_MINOR HEX(__SUNPRO_CC>>4 & 0xFF) +# define COMPILER_VERSION_PATCH HEX(__SUNPRO_CC & 0xF) +# else + /* __SUNPRO_CC = 0xVRP */ +# define COMPILER_VERSION_MAJOR HEX(__SUNPRO_CC>>8) +# define COMPILER_VERSION_MINOR HEX(__SUNPRO_CC>>4 & 0xF) +# define COMPILER_VERSION_PATCH HEX(__SUNPRO_CC & 0xF) +# endif + +#elif defined(__HP_aCC) +# define COMPILER_ID "HP" + /* __HP_aCC = VVRRPP */ +# define COMPILER_VERSION_MAJOR DEC(__HP_aCC/10000) +# define COMPILER_VERSION_MINOR DEC(__HP_aCC/100 % 100) +# define COMPILER_VERSION_PATCH DEC(__HP_aCC % 100) + +#elif defined(__DECCXX) +# define COMPILER_ID "Compaq" + /* __DECCXX_VER = VVRRTPPPP */ +# define COMPILER_VERSION_MAJOR DEC(__DECCXX_VER/10000000) +# define COMPILER_VERSION_MINOR DEC(__DECCXX_VER/100000 % 100) +# define COMPILER_VERSION_PATCH DEC(__DECCXX_VER % 10000) + +#elif defined(__IBMCPP__) && defined(__COMPILER_VER__) +# define COMPILER_ID "zOS" + /* __IBMCPP__ = VRP */ +# define COMPILER_VERSION_MAJOR DEC(__IBMCPP__/100) +# define COMPILER_VERSION_MINOR DEC(__IBMCPP__/10 % 10) +# define COMPILER_VERSION_PATCH DEC(__IBMCPP__ % 10) + +#elif defined(__ibmxl__) && defined(__clang__) +# define COMPILER_ID "XLClang" +# define COMPILER_VERSION_MAJOR DEC(__ibmxl_version__) +# define COMPILER_VERSION_MINOR DEC(__ibmxl_release__) +# define COMPILER_VERSION_PATCH DEC(__ibmxl_modification__) +# define COMPILER_VERSION_TWEAK DEC(__ibmxl_ptf_fix_level__) + + +#elif defined(__IBMCPP__) && !defined(__COMPILER_VER__) && __IBMCPP__ >= 800 +# define COMPILER_ID "XL" + /* __IBMCPP__ = VRP */ +# define COMPILER_VERSION_MAJOR DEC(__IBMCPP__/100) +# define COMPILER_VERSION_MINOR DEC(__IBMCPP__/10 % 10) +# define COMPILER_VERSION_PATCH DEC(__IBMCPP__ % 10) + +#elif defined(__IBMCPP__) && !defined(__COMPILER_VER__) && __IBMCPP__ < 800 +# define COMPILER_ID "VisualAge" + /* __IBMCPP__ = VRP */ +# define COMPILER_VERSION_MAJOR DEC(__IBMCPP__/100) +# define COMPILER_VERSION_MINOR DEC(__IBMCPP__/10 % 10) +# define COMPILER_VERSION_PATCH DEC(__IBMCPP__ % 10) + +#elif defined(__PGI) +# define COMPILER_ID "PGI" +# define COMPILER_VERSION_MAJOR DEC(__PGIC__) +# define COMPILER_VERSION_MINOR DEC(__PGIC_MINOR__) +# if defined(__PGIC_PATCHLEVEL__) +# define COMPILER_VERSION_PATCH DEC(__PGIC_PATCHLEVEL__) +# endif + +#elif defined(_CRAYC) +# define COMPILER_ID "Cray" +# define COMPILER_VERSION_MAJOR DEC(_RELEASE_MAJOR) +# define COMPILER_VERSION_MINOR DEC(_RELEASE_MINOR) + +#elif defined(__TI_COMPILER_VERSION__) +# define COMPILER_ID "TI" + /* __TI_COMPILER_VERSION__ = VVVRRRPPP */ +# define COMPILER_VERSION_MAJOR DEC(__TI_COMPILER_VERSION__/1000000) +# define COMPILER_VERSION_MINOR DEC(__TI_COMPILER_VERSION__/1000 % 1000) +# define COMPILER_VERSION_PATCH DEC(__TI_COMPILER_VERSION__ % 1000) + +#elif defined(__FUJITSU) || defined(__FCC_VERSION) || defined(__fcc_version) +# define COMPILER_ID "Fujitsu" + +#elif defined(__ghs__) +# define COMPILER_ID "GHS" +/* __GHS_VERSION_NUMBER = VVVVRP */ +# ifdef __GHS_VERSION_NUMBER +# define COMPILER_VERSION_MAJOR DEC(__GHS_VERSION_NUMBER / 100) +# define COMPILER_VERSION_MINOR DEC(__GHS_VERSION_NUMBER / 10 % 10) +# define COMPILER_VERSION_PATCH DEC(__GHS_VERSION_NUMBER % 10) +# endif + +#elif defined(__SCO_VERSION__) +# define COMPILER_ID "SCO" + +#elif defined(__ARMCC_VERSION) && !defined(__clang__) +# define COMPILER_ID "ARMCC" +#if __ARMCC_VERSION >= 1000000 + /* __ARMCC_VERSION = VRRPPPP */ + # define COMPILER_VERSION_MAJOR DEC(__ARMCC_VERSION/1000000) + # define COMPILER_VERSION_MINOR DEC(__ARMCC_VERSION/10000 % 100) + # define COMPILER_VERSION_PATCH DEC(__ARMCC_VERSION % 10000) +#else + /* __ARMCC_VERSION = VRPPPP */ + # define COMPILER_VERSION_MAJOR DEC(__ARMCC_VERSION/100000) + # define COMPILER_VERSION_MINOR DEC(__ARMCC_VERSION/10000 % 10) + # define COMPILER_VERSION_PATCH DEC(__ARMCC_VERSION % 10000) +#endif + + +#elif defined(__clang__) && defined(__apple_build_version__) +# define COMPILER_ID "AppleClang" +# if defined(_MSC_VER) +# define SIMULATE_ID "MSVC" +# endif +# define COMPILER_VERSION_MAJOR DEC(__clang_major__) +# define COMPILER_VERSION_MINOR DEC(__clang_minor__) +# define COMPILER_VERSION_PATCH DEC(__clang_patchlevel__) +# if defined(_MSC_VER) + /* _MSC_VER = VVRR */ +# define SIMULATE_VERSION_MAJOR DEC(_MSC_VER / 100) +# define SIMULATE_VERSION_MINOR DEC(_MSC_VER % 100) +# endif +# define COMPILER_VERSION_TWEAK DEC(__apple_build_version__) + +#elif defined(__clang__) && defined(__ARMCOMPILER_VERSION) +# define COMPILER_ID "ARMClang" + # define COMPILER_VERSION_MAJOR DEC(__ARMCOMPILER_VERSION/1000000) + # define COMPILER_VERSION_MINOR DEC(__ARMCOMPILER_VERSION/10000 % 100) + # define COMPILER_VERSION_PATCH DEC(__ARMCOMPILER_VERSION % 10000) +# define COMPILER_VERSION_INTERNAL DEC(__ARMCOMPILER_VERSION) + +#elif defined(__clang__) && defined(__INTEL_DPCPP_COMPILER__) +# define COMPILER_ID "IntelDPCPP" +# if defined(_MSC_VER) +# define SIMULATE_ID "MSVC" +# endif +# define COMPILER_VERSION_MAJOR DEC(__clang_major__) +# define COMPILER_VERSION_MINOR DEC(__clang_minor__) +# define COMPILER_VERSION_PATCH DEC(__clang_patchlevel__) +# if defined(_MSC_VER) + /* _MSC_VER = VVRR */ +# define SIMULATE_VERSION_MAJOR DEC(_MSC_VER / 100) +# define SIMULATE_VERSION_MINOR DEC(_MSC_VER % 100) +# endif +# define COMPILER_VERSION_TWEAK DEC(__INTEL_DPCPP_COMPILER__) + +#elif defined(__clang__) && defined(__INTEL_CLANG_COMPILER) +# define COMPILER_ID "IntelClang" +# if defined(_MSC_VER) +# define SIMULATE_ID "MSVC" +# endif +# define COMPILER_VERSION_MAJOR DEC(__clang_major__) +# define COMPILER_VERSION_MINOR DEC(__clang_minor__) +# define COMPILER_VERSION_PATCH DEC(__clang_patchlevel__) +# if defined(_MSC_VER) + /* _MSC_VER = VVRR */ +# define SIMULATE_VERSION_MAJOR DEC(_MSC_VER / 100) +# define SIMULATE_VERSION_MINOR DEC(_MSC_VER % 100) +# endif +# define COMPILER_VERSION_TWEAK DEC(__INTEL_CLANG_COMPILER) + +#elif defined(__clang__) +# define COMPILER_ID "Clang" +# if defined(_MSC_VER) +# define SIMULATE_ID "MSVC" +# endif +# define COMPILER_VERSION_MAJOR DEC(__clang_major__) +# define COMPILER_VERSION_MINOR DEC(__clang_minor__) +# define COMPILER_VERSION_PATCH DEC(__clang_patchlevel__) +# if defined(_MSC_VER) + /* _MSC_VER = VVRR */ +# define SIMULATE_VERSION_MAJOR DEC(_MSC_VER / 100) +# define SIMULATE_VERSION_MINOR DEC(_MSC_VER % 100) +# endif + +#elif defined(__GNUC__) || defined(__GNUG__) +# define COMPILER_ID "GNU" +# if defined(__GNUC__) +# define COMPILER_VERSION_MAJOR DEC(__GNUC__) +# else +# define COMPILER_VERSION_MAJOR DEC(__GNUG__) +# endif +# if defined(__GNUC_MINOR__) +# define COMPILER_VERSION_MINOR DEC(__GNUC_MINOR__) +# endif +# if defined(__GNUC_PATCHLEVEL__) +# define COMPILER_VERSION_PATCH DEC(__GNUC_PATCHLEVEL__) +# endif + +#elif defined(_MSC_VER) +# define COMPILER_ID "MSVC" + /* _MSC_VER = VVRR */ +# define COMPILER_VERSION_MAJOR DEC(_MSC_VER / 100) +# define COMPILER_VERSION_MINOR DEC(_MSC_VER % 100) +# if defined(_MSC_FULL_VER) +# if _MSC_VER >= 1400 + /* _MSC_FULL_VER = VVRRPPPPP */ +# define COMPILER_VERSION_PATCH DEC(_MSC_FULL_VER % 100000) +# else + /* _MSC_FULL_VER = VVRRPPPP */ +# define COMPILER_VERSION_PATCH DEC(_MSC_FULL_VER % 10000) +# endif +# endif +# if defined(_MSC_BUILD) +# define COMPILER_VERSION_TWEAK DEC(_MSC_BUILD) +# endif + +#elif defined(__VISUALDSPVERSION__) || defined(__ADSPBLACKFIN__) || defined(__ADSPTS__) || defined(__ADSP21000__) +# define COMPILER_ID "ADSP" +#if defined(__VISUALDSPVERSION__) + /* __VISUALDSPVERSION__ = 0xVVRRPP00 */ +# define COMPILER_VERSION_MAJOR HEX(__VISUALDSPVERSION__>>24) +# define COMPILER_VERSION_MINOR HEX(__VISUALDSPVERSION__>>16 & 0xFF) +# define COMPILER_VERSION_PATCH HEX(__VISUALDSPVERSION__>>8 & 0xFF) +#endif + +#elif defined(__IAR_SYSTEMS_ICC__) || defined(__IAR_SYSTEMS_ICC) +# define COMPILER_ID "IAR" +# if defined(__VER__) && defined(__ICCARM__) +# define COMPILER_VERSION_MAJOR DEC((__VER__) / 1000000) +# define COMPILER_VERSION_MINOR DEC(((__VER__) / 1000) % 1000) +# define COMPILER_VERSION_PATCH DEC((__VER__) % 1000) +# define COMPILER_VERSION_INTERNAL DEC(__IAR_SYSTEMS_ICC__) +# elif defined(__VER__) && (defined(__ICCAVR__) || defined(__ICCRX__) || defined(__ICCRH850__) || defined(__ICCRL78__) || defined(__ICC430__) || defined(__ICCRISCV__) || defined(__ICCV850__) || defined(__ICC8051__)) +# define COMPILER_VERSION_MAJOR DEC((__VER__) / 100) +# define COMPILER_VERSION_MINOR DEC((__VER__) - (((__VER__) / 100)*100)) +# define COMPILER_VERSION_PATCH DEC(__SUBVERSION__) +# define COMPILER_VERSION_INTERNAL DEC(__IAR_SYSTEMS_ICC__) +# endif + + +/* These compilers are either not known or too old to define an + identification macro. Try to identify the platform and guess that + it is the native compiler. */ +#elif defined(__hpux) || defined(__hpua) +# define COMPILER_ID "HP" + +#else /* unknown compiler */ +# define COMPILER_ID "" +#endif + +/* Construct the string literal in pieces to prevent the source from + getting matched. Store it in a pointer rather than an array + because some compilers will just produce instructions to fill the + array rather than assigning a pointer to a static array. */ +char const* info_compiler = "INFO" ":" "compiler[" COMPILER_ID "]"; +#ifdef SIMULATE_ID +char const* info_simulate = "INFO" ":" "simulate[" SIMULATE_ID "]"; +#endif + +#ifdef __QNXNTO__ +char const* qnxnto = "INFO" ":" "qnxnto[]"; +#endif + +#if defined(__CRAYXE) || defined(__CRAYXC) +char const *info_cray = "INFO" ":" "compiler_wrapper[CrayPrgEnv]"; +#endif + +#define STRINGIFY_HELPER(X) #X +#define STRINGIFY(X) STRINGIFY_HELPER(X) + +/* Identify known platforms by name. */ +#if defined(__linux) || defined(__linux__) || defined(linux) +# define PLATFORM_ID "Linux" + +#elif defined(__CYGWIN__) +# define PLATFORM_ID "Cygwin" + +#elif defined(__MINGW32__) +# define PLATFORM_ID "MinGW" + +#elif defined(__APPLE__) +# define PLATFORM_ID "Darwin" + +#elif defined(_WIN32) || defined(__WIN32__) || defined(WIN32) +# define PLATFORM_ID "Windows" + +#elif defined(__FreeBSD__) || defined(__FreeBSD) +# define PLATFORM_ID "FreeBSD" + +#elif defined(__NetBSD__) || defined(__NetBSD) +# define PLATFORM_ID "NetBSD" + +#elif defined(__OpenBSD__) || defined(__OPENBSD) +# define PLATFORM_ID "OpenBSD" + +#elif defined(__sun) || defined(sun) +# define PLATFORM_ID "SunOS" + +#elif defined(_AIX) || defined(__AIX) || defined(__AIX__) || defined(__aix) || defined(__aix__) +# define PLATFORM_ID "AIX" + +#elif defined(__hpux) || defined(__hpux__) +# define PLATFORM_ID "HP-UX" + +#elif defined(__HAIKU__) +# define PLATFORM_ID "Haiku" + +#elif defined(__BeOS) || defined(__BEOS__) || defined(_BEOS) +# define PLATFORM_ID "BeOS" + +#elif defined(__QNX__) || defined(__QNXNTO__) +# define PLATFORM_ID "QNX" + +#elif defined(__tru64) || defined(_tru64) || defined(__TRU64__) +# define PLATFORM_ID "Tru64" + +#elif defined(__riscos) || defined(__riscos__) +# define PLATFORM_ID "RISCos" + +#elif defined(__sinix) || defined(__sinix__) || defined(__SINIX__) +# define PLATFORM_ID "SINIX" + +#elif defined(__UNIX_SV__) +# define PLATFORM_ID "UNIX_SV" + +#elif defined(__bsdos__) +# define PLATFORM_ID "BSDOS" + +#elif defined(_MPRAS) || defined(MPRAS) +# define PLATFORM_ID "MP-RAS" + +#elif defined(__osf) || defined(__osf__) +# define PLATFORM_ID "OSF1" + +#elif defined(_SCO_SV) || defined(SCO_SV) || defined(sco_sv) +# define PLATFORM_ID "SCO_SV" + +#elif defined(__ultrix) || defined(__ultrix__) || defined(_ULTRIX) +# define PLATFORM_ID "ULTRIX" + +#elif defined(__XENIX__) || defined(_XENIX) || defined(XENIX) +# define PLATFORM_ID "Xenix" + +#elif defined(__WATCOMC__) +# if defined(__LINUX__) +# define PLATFORM_ID "Linux" + +# elif defined(__DOS__) +# define PLATFORM_ID "DOS" + +# elif defined(__OS2__) +# define PLATFORM_ID "OS2" + +# elif defined(__WINDOWS__) +# define PLATFORM_ID "Windows3x" + +# elif defined(__VXWORKS__) +# define PLATFORM_ID "VxWorks" + +# else /* unknown platform */ +# define PLATFORM_ID +# endif + +#elif defined(__INTEGRITY) +# if defined(INT_178B) +# define PLATFORM_ID "Integrity178" + +# else /* regular Integrity */ +# define PLATFORM_ID "Integrity" +# endif + +#else /* unknown platform */ +# define PLATFORM_ID + +#endif + +/* For windows compilers MSVC and Intel we can determine + the architecture of the compiler being used. This is because + the compilers do not have flags that can change the architecture, + but rather depend on which compiler is being used +*/ +#if defined(_WIN32) && defined(_MSC_VER) +# if defined(_M_IA64) +# define ARCHITECTURE_ID "IA64" + +# elif defined(_M_X64) || defined(_M_AMD64) +# define ARCHITECTURE_ID "x64" + +# elif defined(_M_IX86) +# define ARCHITECTURE_ID "X86" + +# elif defined(_M_ARM64) +# define ARCHITECTURE_ID "ARM64" + +# elif defined(_M_ARM) +# if _M_ARM == 4 +# define ARCHITECTURE_ID "ARMV4I" +# elif _M_ARM == 5 +# define ARCHITECTURE_ID "ARMV5I" +# else +# define ARCHITECTURE_ID "ARMV" STRINGIFY(_M_ARM) +# endif + +# elif defined(_M_MIPS) +# define ARCHITECTURE_ID "MIPS" + +# elif defined(_M_SH) +# define ARCHITECTURE_ID "SHx" + +# else /* unknown architecture */ +# define ARCHITECTURE_ID "" +# endif + +#elif defined(__WATCOMC__) +# if defined(_M_I86) +# define ARCHITECTURE_ID "I86" + +# elif defined(_M_IX86) +# define ARCHITECTURE_ID "X86" + +# else /* unknown architecture */ +# define ARCHITECTURE_ID "" +# endif + +#elif defined(__IAR_SYSTEMS_ICC__) || defined(__IAR_SYSTEMS_ICC) +# if defined(__ICCARM__) +# define ARCHITECTURE_ID "ARM" + +# elif defined(__ICCRX__) +# define ARCHITECTURE_ID "RX" + +# elif defined(__ICCRH850__) +# define ARCHITECTURE_ID "RH850" + +# elif defined(__ICCRL78__) +# define ARCHITECTURE_ID "RL78" + +# elif defined(__ICCRISCV__) +# define ARCHITECTURE_ID "RISCV" + +# elif defined(__ICCAVR__) +# define ARCHITECTURE_ID "AVR" + +# elif defined(__ICC430__) +# define ARCHITECTURE_ID "MSP430" + +# elif defined(__ICCV850__) +# define ARCHITECTURE_ID "V850" + +# elif defined(__ICC8051__) +# define ARCHITECTURE_ID "8051" + +# else /* unknown architecture */ +# define ARCHITECTURE_ID "" +# endif + +#elif defined(__ghs__) +# if defined(__PPC64__) +# define ARCHITECTURE_ID "PPC64" + +# elif defined(__ppc__) +# define ARCHITECTURE_ID "PPC" + +# elif defined(__ARM__) +# define ARCHITECTURE_ID "ARM" + +# elif defined(__x86_64__) +# define ARCHITECTURE_ID "x64" + +# elif defined(__i386__) +# define ARCHITECTURE_ID "X86" + +# else /* unknown architecture */ +# define ARCHITECTURE_ID "" +# endif + +#elif defined(__TI_COMPILER_VERSION__) +# if defined(__TI_ARM__) +# define ARCHITECTURE_ID "ARM" + +# elif defined(__MSP430__) +# define ARCHITECTURE_ID "MSP430" + +# elif defined(__TMS320C28XX__) +# define ARCHITECTURE_ID "TMS320C28x" + +# elif defined(__TMS320C6X__) || defined(_TMS320C6X) +# define ARCHITECTURE_ID "TMS320C6x" + +# else /* unknown architecture */ +# define ARCHITECTURE_ID "" +# endif + +#else +# define ARCHITECTURE_ID +#endif + +/* Convert integer to decimal digit literals. */ +#define DEC(n) \ + ('0' + (((n) / 10000000)%10)), \ + ('0' + (((n) / 1000000)%10)), \ + ('0' + (((n) / 100000)%10)), \ + ('0' + (((n) / 10000)%10)), \ + ('0' + (((n) / 1000)%10)), \ + ('0' + (((n) / 100)%10)), \ + ('0' + (((n) / 10)%10)), \ + ('0' + ((n) % 10)) + +/* Convert integer to hex digit literals. */ +#define HEX(n) \ + ('0' + ((n)>>28 & 0xF)), \ + ('0' + ((n)>>24 & 0xF)), \ + ('0' + ((n)>>20 & 0xF)), \ + ('0' + ((n)>>16 & 0xF)), \ + ('0' + ((n)>>12 & 0xF)), \ + ('0' + ((n)>>8 & 0xF)), \ + ('0' + ((n)>>4 & 0xF)), \ + ('0' + ((n) & 0xF)) + +/* Construct a string literal encoding the version number components. */ +#ifdef COMPILER_VERSION_MAJOR +char const info_version[] = { + 'I', 'N', 'F', 'O', ':', + 'c','o','m','p','i','l','e','r','_','v','e','r','s','i','o','n','[', + COMPILER_VERSION_MAJOR, +# ifdef COMPILER_VERSION_MINOR + '.', COMPILER_VERSION_MINOR, +# ifdef COMPILER_VERSION_PATCH + '.', COMPILER_VERSION_PATCH, +# ifdef COMPILER_VERSION_TWEAK + '.', COMPILER_VERSION_TWEAK, +# endif +# endif +# endif + ']','\0'}; +#endif + +/* Construct a string literal encoding the internal version number. */ +#ifdef COMPILER_VERSION_INTERNAL +char const info_version_internal[] = { + 'I', 'N', 'F', 'O', ':', + 'c','o','m','p','i','l','e','r','_','v','e','r','s','i','o','n','_', + 'i','n','t','e','r','n','a','l','[', + COMPILER_VERSION_INTERNAL,']','\0'}; +#endif + +/* Construct a string literal encoding the version number components. */ +#ifdef SIMULATE_VERSION_MAJOR +char const info_simulate_version[] = { + 'I', 'N', 'F', 'O', ':', + 's','i','m','u','l','a','t','e','_','v','e','r','s','i','o','n','[', + SIMULATE_VERSION_MAJOR, +# ifdef SIMULATE_VERSION_MINOR + '.', SIMULATE_VERSION_MINOR, +# ifdef SIMULATE_VERSION_PATCH + '.', SIMULATE_VERSION_PATCH, +# ifdef SIMULATE_VERSION_TWEAK + '.', SIMULATE_VERSION_TWEAK, +# endif +# endif +# endif + ']','\0'}; +#endif + +/* Construct the string literal in pieces to prevent the source from + getting matched. Store it in a pointer rather than an array + because some compilers will just produce instructions to fill the + array rather than assigning a pointer to a static array. */ +char const* info_platform = "INFO" ":" "platform[" PLATFORM_ID "]"; +char const* info_arch = "INFO" ":" "arch[" ARCHITECTURE_ID "]"; + + + +#if defined(__INTEL_COMPILER) && defined(_MSVC_LANG) && _MSVC_LANG < 201403L +# if defined(__INTEL_CXX11_MODE__) +# if defined(__cpp_aggregate_nsdmi) +# define CXX_STD 201402L +# else +# define CXX_STD 201103L +# endif +# else +# define CXX_STD 199711L +# endif +#elif defined(_MSC_VER) && defined(_MSVC_LANG) +# define CXX_STD _MSVC_LANG +#else +# define CXX_STD __cplusplus +#endif + +const char* info_language_dialect_default = "INFO" ":" "dialect_default[" +#if CXX_STD > 201703L + "20" +#elif CXX_STD >= 201703L + "17" +#elif CXX_STD >= 201402L + "14" +#elif CXX_STD >= 201103L + "11" +#else + "98" +#endif +"]"; + +/*--------------------------------------------------------------------------*/ + +int main(int argc, char* argv[]) +{ + int require = 0; + require += info_compiler[argc]; + require += info_platform[argc]; +#ifdef COMPILER_VERSION_MAJOR + require += info_version[argc]; +#endif +#ifdef COMPILER_VERSION_INTERNAL + require += info_version_internal[argc]; +#endif +#ifdef SIMULATE_ID + require += info_simulate[argc]; +#endif +#ifdef SIMULATE_VERSION_MAJOR + require += info_simulate_version[argc]; +#endif +#if defined(__CRAYXE) || defined(__CRAYXC) + require += info_cray[argc]; +#endif + require += info_language_dialect_default[argc]; + (void)argv; + return require; +} diff --git a/android/build-jni-armeabi-v7a/CMakeFiles/3.19.1/CompilerIdCXX/CMakeCXXCompilerId.o b/android/build-jni-armeabi-v7a/CMakeFiles/3.19.1/CompilerIdCXX/CMakeCXXCompilerId.o new file mode 100644 index 0000000..237e350 Binary files /dev/null and b/android/build-jni-armeabi-v7a/CMakeFiles/3.19.1/CompilerIdCXX/CMakeCXXCompilerId.o differ diff --git a/android/build-jni-armeabi-v7a/CMakeFiles/CMakeDirectoryInformation.cmake b/android/build-jni-armeabi-v7a/CMakeFiles/CMakeDirectoryInformation.cmake new file mode 100644 index 0000000..6868b85 --- /dev/null +++ b/android/build-jni-armeabi-v7a/CMakeFiles/CMakeDirectoryInformation.cmake @@ -0,0 +1,16 @@ +# CMAKE generated file: DO NOT EDIT! +# Generated by "Unix Makefiles" Generator, CMake Version 3.19 + +# Relative path conversion top directories. +set(CMAKE_RELATIVE_PATH_TOP_SOURCE "/Users/yichao.wu/deepctrl/GmSSL-Java/android") +set(CMAKE_RELATIVE_PATH_TOP_BINARY "/Users/yichao.wu/deepctrl/GmSSL-Java/android/build-jni-armeabi-v7a") + +# Force unix paths in dependencies. +set(CMAKE_FORCE_UNIX_PATHS 1) + + +# The C and CXX include file regular expressions for this directory. +set(CMAKE_C_INCLUDE_REGEX_SCAN "^.*$") +set(CMAKE_C_INCLUDE_REGEX_COMPLAIN "^$") +set(CMAKE_CXX_INCLUDE_REGEX_SCAN ${CMAKE_C_INCLUDE_REGEX_SCAN}) +set(CMAKE_CXX_INCLUDE_REGEX_COMPLAIN ${CMAKE_C_INCLUDE_REGEX_COMPLAIN}) diff --git a/android/build-jni-armeabi-v7a/CMakeFiles/Makefile.cmake b/android/build-jni-armeabi-v7a/CMakeFiles/Makefile.cmake new file mode 100644 index 0000000..7fbef0d --- /dev/null +++ b/android/build-jni-armeabi-v7a/CMakeFiles/Makefile.cmake @@ -0,0 +1,132 @@ +# CMAKE generated file: DO NOT EDIT! +# Generated by "Unix Makefiles" Generator, CMake Version 3.19 + +# The generator used is: +set(CMAKE_DEPENDS_GENERATOR "Unix Makefiles") + +# The top level Makefile was generated from the following files: +set(CMAKE_MAKEFILE_DEPENDS + "CMakeCache.txt" + "/Users/yichao.wu/Library/Android/sdk/ndk/27.1.12297006/build/cmake/abis.cmake" + "/Users/yichao.wu/Library/Android/sdk/ndk/27.1.12297006/build/cmake/android-legacy.toolchain.cmake" + "/Users/yichao.wu/Library/Android/sdk/ndk/27.1.12297006/build/cmake/android.toolchain.cmake" + "/Users/yichao.wu/Library/Android/sdk/ndk/27.1.12297006/build/cmake/platforms.cmake" + "../CMakeLists.txt" + "CMakeFiles/3.19.1/CMakeCCompiler.cmake" + "CMakeFiles/3.19.1/CMakeCXXCompiler.cmake" + "CMakeFiles/3.19.1/CMakeSystem.cmake" + "/usr/local/Cellar/cmake/3.19.1/share/cmake/Modules/CMakeCCompiler.cmake.in" + "/usr/local/Cellar/cmake/3.19.1/share/cmake/Modules/CMakeCCompilerABI.c" + "/usr/local/Cellar/cmake/3.19.1/share/cmake/Modules/CMakeCInformation.cmake" + "/usr/local/Cellar/cmake/3.19.1/share/cmake/Modules/CMakeCXXCompiler.cmake.in" + "/usr/local/Cellar/cmake/3.19.1/share/cmake/Modules/CMakeCXXCompilerABI.cpp" + "/usr/local/Cellar/cmake/3.19.1/share/cmake/Modules/CMakeCXXInformation.cmake" + "/usr/local/Cellar/cmake/3.19.1/share/cmake/Modules/CMakeCheckCompilerFlagCommonPatterns.cmake" + "/usr/local/Cellar/cmake/3.19.1/share/cmake/Modules/CMakeCommonLanguageInclude.cmake" + "/usr/local/Cellar/cmake/3.19.1/share/cmake/Modules/CMakeCompilerIdDetection.cmake" + "/usr/local/Cellar/cmake/3.19.1/share/cmake/Modules/CMakeDetermineCCompiler.cmake" + "/usr/local/Cellar/cmake/3.19.1/share/cmake/Modules/CMakeDetermineCXXCompiler.cmake" + "/usr/local/Cellar/cmake/3.19.1/share/cmake/Modules/CMakeDetermineCompileFeatures.cmake" + "/usr/local/Cellar/cmake/3.19.1/share/cmake/Modules/CMakeDetermineCompiler.cmake" + "/usr/local/Cellar/cmake/3.19.1/share/cmake/Modules/CMakeDetermineCompilerABI.cmake" + "/usr/local/Cellar/cmake/3.19.1/share/cmake/Modules/CMakeDetermineCompilerId.cmake" + "/usr/local/Cellar/cmake/3.19.1/share/cmake/Modules/CMakeDetermineSystem.cmake" + "/usr/local/Cellar/cmake/3.19.1/share/cmake/Modules/CMakeFindBinUtils.cmake" + "/usr/local/Cellar/cmake/3.19.1/share/cmake/Modules/CMakeGenericSystem.cmake" + "/usr/local/Cellar/cmake/3.19.1/share/cmake/Modules/CMakeInitializeConfigs.cmake" + "/usr/local/Cellar/cmake/3.19.1/share/cmake/Modules/CMakeLanguageInformation.cmake" + "/usr/local/Cellar/cmake/3.19.1/share/cmake/Modules/CMakeParseImplicitIncludeInfo.cmake" + "/usr/local/Cellar/cmake/3.19.1/share/cmake/Modules/CMakeParseImplicitLinkInfo.cmake" + "/usr/local/Cellar/cmake/3.19.1/share/cmake/Modules/CMakeSystem.cmake.in" + "/usr/local/Cellar/cmake/3.19.1/share/cmake/Modules/CMakeSystemSpecificInformation.cmake" + "/usr/local/Cellar/cmake/3.19.1/share/cmake/Modules/CMakeSystemSpecificInitialize.cmake" + "/usr/local/Cellar/cmake/3.19.1/share/cmake/Modules/CMakeTestCCompiler.cmake" + "/usr/local/Cellar/cmake/3.19.1/share/cmake/Modules/CMakeTestCXXCompiler.cmake" + "/usr/local/Cellar/cmake/3.19.1/share/cmake/Modules/CMakeTestCompilerCommon.cmake" + "/usr/local/Cellar/cmake/3.19.1/share/cmake/Modules/CMakeUnixFindMake.cmake" + "/usr/local/Cellar/cmake/3.19.1/share/cmake/Modules/Compiler/ADSP-DetermineCompiler.cmake" + "/usr/local/Cellar/cmake/3.19.1/share/cmake/Modules/Compiler/ARMCC-DetermineCompiler.cmake" + "/usr/local/Cellar/cmake/3.19.1/share/cmake/Modules/Compiler/ARMClang-DetermineCompiler.cmake" + "/usr/local/Cellar/cmake/3.19.1/share/cmake/Modules/Compiler/AppleClang-DetermineCompiler.cmake" + "/usr/local/Cellar/cmake/3.19.1/share/cmake/Modules/Compiler/Borland-DetermineCompiler.cmake" + "/usr/local/Cellar/cmake/3.19.1/share/cmake/Modules/Compiler/Bruce-C-DetermineCompiler.cmake" + "/usr/local/Cellar/cmake/3.19.1/share/cmake/Modules/Compiler/CMakeCommonCompilerMacros.cmake" + "/usr/local/Cellar/cmake/3.19.1/share/cmake/Modules/Compiler/Clang-C.cmake" + "/usr/local/Cellar/cmake/3.19.1/share/cmake/Modules/Compiler/Clang-CXX.cmake" + "/usr/local/Cellar/cmake/3.19.1/share/cmake/Modules/Compiler/Clang-DetermineCompiler.cmake" + "/usr/local/Cellar/cmake/3.19.1/share/cmake/Modules/Compiler/Clang-DetermineCompilerInternal.cmake" + "/usr/local/Cellar/cmake/3.19.1/share/cmake/Modules/Compiler/Clang-FindBinUtils.cmake" + "/usr/local/Cellar/cmake/3.19.1/share/cmake/Modules/Compiler/Clang.cmake" + "/usr/local/Cellar/cmake/3.19.1/share/cmake/Modules/Compiler/Comeau-CXX-DetermineCompiler.cmake" + "/usr/local/Cellar/cmake/3.19.1/share/cmake/Modules/Compiler/Compaq-C-DetermineCompiler.cmake" + "/usr/local/Cellar/cmake/3.19.1/share/cmake/Modules/Compiler/Compaq-CXX-DetermineCompiler.cmake" + "/usr/local/Cellar/cmake/3.19.1/share/cmake/Modules/Compiler/Cray-DetermineCompiler.cmake" + "/usr/local/Cellar/cmake/3.19.1/share/cmake/Modules/Compiler/Embarcadero-DetermineCompiler.cmake" + "/usr/local/Cellar/cmake/3.19.1/share/cmake/Modules/Compiler/Fujitsu-DetermineCompiler.cmake" + "/usr/local/Cellar/cmake/3.19.1/share/cmake/Modules/Compiler/GHS-DetermineCompiler.cmake" + "/usr/local/Cellar/cmake/3.19.1/share/cmake/Modules/Compiler/GNU-C-DetermineCompiler.cmake" + "/usr/local/Cellar/cmake/3.19.1/share/cmake/Modules/Compiler/GNU-CXX-DetermineCompiler.cmake" + "/usr/local/Cellar/cmake/3.19.1/share/cmake/Modules/Compiler/GNU.cmake" + "/usr/local/Cellar/cmake/3.19.1/share/cmake/Modules/Compiler/HP-C-DetermineCompiler.cmake" + "/usr/local/Cellar/cmake/3.19.1/share/cmake/Modules/Compiler/HP-CXX-DetermineCompiler.cmake" + "/usr/local/Cellar/cmake/3.19.1/share/cmake/Modules/Compiler/IAR-DetermineCompiler.cmake" + "/usr/local/Cellar/cmake/3.19.1/share/cmake/Modules/Compiler/IBMCPP-C-DetermineVersionInternal.cmake" + "/usr/local/Cellar/cmake/3.19.1/share/cmake/Modules/Compiler/IBMCPP-CXX-DetermineVersionInternal.cmake" + "/usr/local/Cellar/cmake/3.19.1/share/cmake/Modules/Compiler/Intel-DetermineCompiler.cmake" + "/usr/local/Cellar/cmake/3.19.1/share/cmake/Modules/Compiler/IntelClang-DetermineCompiler.cmake" + "/usr/local/Cellar/cmake/3.19.1/share/cmake/Modules/Compiler/IntelDPCPP-DetermineCompiler.cmake" + "/usr/local/Cellar/cmake/3.19.1/share/cmake/Modules/Compiler/MSVC-DetermineCompiler.cmake" + "/usr/local/Cellar/cmake/3.19.1/share/cmake/Modules/Compiler/NVIDIA-DetermineCompiler.cmake" + "/usr/local/Cellar/cmake/3.19.1/share/cmake/Modules/Compiler/OpenWatcom-DetermineCompiler.cmake" + "/usr/local/Cellar/cmake/3.19.1/share/cmake/Modules/Compiler/PGI-DetermineCompiler.cmake" + "/usr/local/Cellar/cmake/3.19.1/share/cmake/Modules/Compiler/PathScale-DetermineCompiler.cmake" + "/usr/local/Cellar/cmake/3.19.1/share/cmake/Modules/Compiler/SCO-DetermineCompiler.cmake" + "/usr/local/Cellar/cmake/3.19.1/share/cmake/Modules/Compiler/SDCC-C-DetermineCompiler.cmake" + "/usr/local/Cellar/cmake/3.19.1/share/cmake/Modules/Compiler/SunPro-C-DetermineCompiler.cmake" + "/usr/local/Cellar/cmake/3.19.1/share/cmake/Modules/Compiler/SunPro-CXX-DetermineCompiler.cmake" + "/usr/local/Cellar/cmake/3.19.1/share/cmake/Modules/Compiler/TI-DetermineCompiler.cmake" + "/usr/local/Cellar/cmake/3.19.1/share/cmake/Modules/Compiler/TinyCC-C-DetermineCompiler.cmake" + "/usr/local/Cellar/cmake/3.19.1/share/cmake/Modules/Compiler/VisualAge-C-DetermineCompiler.cmake" + "/usr/local/Cellar/cmake/3.19.1/share/cmake/Modules/Compiler/VisualAge-CXX-DetermineCompiler.cmake" + "/usr/local/Cellar/cmake/3.19.1/share/cmake/Modules/Compiler/Watcom-DetermineCompiler.cmake" + "/usr/local/Cellar/cmake/3.19.1/share/cmake/Modules/Compiler/XL-C-DetermineCompiler.cmake" + "/usr/local/Cellar/cmake/3.19.1/share/cmake/Modules/Compiler/XL-CXX-DetermineCompiler.cmake" + "/usr/local/Cellar/cmake/3.19.1/share/cmake/Modules/Compiler/XLClang-C-DetermineCompiler.cmake" + "/usr/local/Cellar/cmake/3.19.1/share/cmake/Modules/Compiler/XLClang-CXX-DetermineCompiler.cmake" + "/usr/local/Cellar/cmake/3.19.1/share/cmake/Modules/Compiler/zOS-C-DetermineCompiler.cmake" + "/usr/local/Cellar/cmake/3.19.1/share/cmake/Modules/Compiler/zOS-CXX-DetermineCompiler.cmake" + "/usr/local/Cellar/cmake/3.19.1/share/cmake/Modules/Internal/CMakeCheckCompilerFlag.cmake" + "/usr/local/Cellar/cmake/3.19.1/share/cmake/Modules/Internal/FeatureTesting.cmake" + "/usr/local/Cellar/cmake/3.19.1/share/cmake/Modules/Platform/Android-Clang-C.cmake" + "/usr/local/Cellar/cmake/3.19.1/share/cmake/Modules/Platform/Android-Clang-CXX.cmake" + "/usr/local/Cellar/cmake/3.19.1/share/cmake/Modules/Platform/Android-Clang.cmake" + "/usr/local/Cellar/cmake/3.19.1/share/cmake/Modules/Platform/Android-Determine-C.cmake" + "/usr/local/Cellar/cmake/3.19.1/share/cmake/Modules/Platform/Android-Determine-CXX.cmake" + "/usr/local/Cellar/cmake/3.19.1/share/cmake/Modules/Platform/Android-Determine.cmake" + "/usr/local/Cellar/cmake/3.19.1/share/cmake/Modules/Platform/Android-Initialize.cmake" + "/usr/local/Cellar/cmake/3.19.1/share/cmake/Modules/Platform/Android.cmake" + "/usr/local/Cellar/cmake/3.19.1/share/cmake/Modules/Platform/Android/Determine-Compiler.cmake" + "/usr/local/Cellar/cmake/3.19.1/share/cmake/Modules/Platform/Linux.cmake" + "/usr/local/Cellar/cmake/3.19.1/share/cmake/Modules/Platform/UnixPaths.cmake" + ) + +# The corresponding makefile is: +set(CMAKE_MAKEFILE_OUTPUTS + "Makefile" + "CMakeFiles/cmake.check_cache" + ) + +# Byproducts of CMake generate step: +set(CMAKE_MAKEFILE_PRODUCTS + "CMakeFiles/3.19.1/CMakeSystem.cmake" + "CMakeFiles/3.19.1/CMakeCCompiler.cmake" + "CMakeFiles/3.19.1/CMakeCXXCompiler.cmake" + "CMakeFiles/3.19.1/CMakeCCompiler.cmake" + "CMakeFiles/3.19.1/CMakeCXXCompiler.cmake" + "CMakeFiles/CMakeDirectoryInformation.cmake" + ) + +# Dependency information for all targets: +set(CMAKE_DEPEND_INFO_FILES + "CMakeFiles/gmssljni.dir/DependInfo.cmake" + ) diff --git a/android/build-jni-armeabi-v7a/CMakeFiles/Makefile2 b/android/build-jni-armeabi-v7a/CMakeFiles/Makefile2 new file mode 100644 index 0000000..eeeb4d1 --- /dev/null +++ b/android/build-jni-armeabi-v7a/CMakeFiles/Makefile2 @@ -0,0 +1,125 @@ +# CMAKE generated file: DO NOT EDIT! +# Generated by "Unix Makefiles" Generator, CMake Version 3.19 + +# Default target executed when no arguments are given to make. +default_target: all + +.PHONY : default_target + +#============================================================================= +# Special targets provided by cmake. + +# Disable implicit rules so canonical targets will work. +.SUFFIXES: + + +# Disable VCS-based implicit rules. +% : %,v + + +# Disable VCS-based implicit rules. +% : RCS/% + + +# Disable VCS-based implicit rules. +% : RCS/%,v + + +# Disable VCS-based implicit rules. +% : SCCS/s.% + + +# Disable VCS-based implicit rules. +% : s.% + + +.SUFFIXES: .hpux_make_needs_suffix_list + + +# Command-line flag to silence nested $(MAKE). +$(VERBOSE)MAKESILENT = -s + +#Suppress display of executed commands. +$(VERBOSE).SILENT: + +# A target that is always out of date. +cmake_force: + +.PHONY : cmake_force + +#============================================================================= +# Set environment variables for the build. + +# The shell in which to execute make rules. +SHELL = /bin/sh + +# The CMake executable. +CMAKE_COMMAND = /usr/local/Cellar/cmake/3.19.1/bin/cmake + +# The command to remove a file. +RM = /usr/local/Cellar/cmake/3.19.1/bin/cmake -E rm -f + +# Escaping for special characters. +EQUALS = = + +# The top-level source directory on which CMake was run. +CMAKE_SOURCE_DIR = /Users/yichao.wu/deepctrl/GmSSL-Java/android + +# The top-level build directory on which CMake was run. +CMAKE_BINARY_DIR = /Users/yichao.wu/deepctrl/GmSSL-Java/android/build-jni-armeabi-v7a + +#============================================================================= +# Directory level rules for the build root directory + +# The main recursive "all" target. +all: CMakeFiles/gmssljni.dir/all + +.PHONY : all + +# The main recursive "preinstall" target. +preinstall: + +.PHONY : preinstall + +# The main recursive "clean" target. +clean: CMakeFiles/gmssljni.dir/clean + +.PHONY : clean + +#============================================================================= +# Target rules for target CMakeFiles/gmssljni.dir + +# All Build rule for target. +CMakeFiles/gmssljni.dir/all: + $(MAKE) $(MAKESILENT) -f CMakeFiles/gmssljni.dir/build.make CMakeFiles/gmssljni.dir/depend + $(MAKE) $(MAKESILENT) -f CMakeFiles/gmssljni.dir/build.make CMakeFiles/gmssljni.dir/build + @$(CMAKE_COMMAND) -E cmake_echo_color --switch=$(COLOR) --progress-dir=/Users/yichao.wu/deepctrl/GmSSL-Java/android/build-jni-armeabi-v7a/CMakeFiles --progress-num=1,2 "Built target gmssljni" +.PHONY : CMakeFiles/gmssljni.dir/all + +# Build rule for subdir invocation for target. +CMakeFiles/gmssljni.dir/rule: cmake_check_build_system + $(CMAKE_COMMAND) -E cmake_progress_start /Users/yichao.wu/deepctrl/GmSSL-Java/android/build-jni-armeabi-v7a/CMakeFiles 2 + $(MAKE) $(MAKESILENT) -f CMakeFiles/Makefile2 CMakeFiles/gmssljni.dir/all + $(CMAKE_COMMAND) -E cmake_progress_start /Users/yichao.wu/deepctrl/GmSSL-Java/android/build-jni-armeabi-v7a/CMakeFiles 0 +.PHONY : CMakeFiles/gmssljni.dir/rule + +# Convenience name for target. +gmssljni: CMakeFiles/gmssljni.dir/rule + +.PHONY : gmssljni + +# clean rule for target. +CMakeFiles/gmssljni.dir/clean: + $(MAKE) $(MAKESILENT) -f CMakeFiles/gmssljni.dir/build.make CMakeFiles/gmssljni.dir/clean +.PHONY : CMakeFiles/gmssljni.dir/clean + +#============================================================================= +# Special targets to cleanup operation of make. + +# Special rule to run CMake to check the build system integrity. +# No rule that depends on this can have commands that come from listfiles +# because they might be regenerated. +cmake_check_build_system: + $(CMAKE_COMMAND) -S$(CMAKE_SOURCE_DIR) -B$(CMAKE_BINARY_DIR) --check-build-system CMakeFiles/Makefile.cmake 0 +.PHONY : cmake_check_build_system + diff --git a/android/build-jni-armeabi-v7a/CMakeFiles/TargetDirectories.txt b/android/build-jni-armeabi-v7a/CMakeFiles/TargetDirectories.txt new file mode 100644 index 0000000..30d90fa --- /dev/null +++ b/android/build-jni-armeabi-v7a/CMakeFiles/TargetDirectories.txt @@ -0,0 +1,3 @@ +/Users/yichao.wu/deepctrl/GmSSL-Java/android/build-jni-armeabi-v7a/CMakeFiles/rebuild_cache.dir +/Users/yichao.wu/deepctrl/GmSSL-Java/android/build-jni-armeabi-v7a/CMakeFiles/edit_cache.dir +/Users/yichao.wu/deepctrl/GmSSL-Java/android/build-jni-armeabi-v7a/CMakeFiles/gmssljni.dir diff --git a/android/build-jni-armeabi-v7a/CMakeFiles/cmake.check_cache b/android/build-jni-armeabi-v7a/CMakeFiles/cmake.check_cache new file mode 100644 index 0000000..3dccd73 --- /dev/null +++ b/android/build-jni-armeabi-v7a/CMakeFiles/cmake.check_cache @@ -0,0 +1 @@ +# This file is generated by cmake for dependency checking of the CMakeCache.txt file diff --git a/android/build-jni-armeabi-v7a/CMakeFiles/gmssljni.dir/C.includecache b/android/build-jni-armeabi-v7a/CMakeFiles/gmssljni.dir/C.includecache new file mode 100644 index 0000000..ccd37d8 --- /dev/null +++ b/android/build-jni-armeabi-v7a/CMakeFiles/gmssljni.dir/C.includecache @@ -0,0 +1,258 @@ +#IncludeRegexLine: ^[ ]*[#%][ ]*(include|import)[ ]*[<"]([^">]+)([">]) + +#IncludeRegexScan: ^.*$ + +#IncludeRegexComplain: ^$ + +#IncludeRegexTransform: + +/Users/yichao.wu/deepctrl/GmSSL-Java/src/main/c/gmssljni.c +stdio.h +- +stdlib.h +- +string.h +- +limits.h +- +gmssl/sm2.h +- +gmssl/sm3.h +- +gmssl/sm4.h +- +gmssl/sm9.h +- +gmssl/zuc.h +- +gmssl/mem.h +- +gmssl/rand.h +- +gmssl/x509.h +- +gmssl/x509_req.h +- +gmssl/error.h +- +gmssl/pbkdf2.h +- +gmssl/version.h +- +gmssljni.h +/Users/yichao.wu/deepctrl/GmSSL-Java/src/main/c/gmssljni.h + +/Users/yichao.wu/deepctrl/GmSSL-Java/src/main/c/gmssljni.h +jni.h +- + +/Users/yichao.wu/deepctrl/GmSSL/include/gmssl/asn1.h +time.h +- +stdlib.h +- +stdint.h +- + +/Users/yichao.wu/deepctrl/GmSSL/include/gmssl/digest.h +stdint.h +- +stdlib.h +- +gmssl/sm3.h +- +gmssl/sha1.h +- +gmssl/sha2.h +- + +/Users/yichao.wu/deepctrl/GmSSL/include/gmssl/error.h +stdio.h +- +stdarg.h +- +string.h +- +stdint.h +- + +/Users/yichao.wu/deepctrl/GmSSL/include/gmssl/gf128.h +stdio.h +- +stdlib.h +- +string.h +- +stdint.h +- + +/Users/yichao.wu/deepctrl/GmSSL/include/gmssl/ghash.h +stdlib.h +- +stdint.h +- +string.h +- +gmssl/gf128.h +- + +/Users/yichao.wu/deepctrl/GmSSL/include/gmssl/hmac.h +string.h +- +gmssl/digest.h +- + +/Users/yichao.wu/deepctrl/GmSSL/include/gmssl/mem.h +stdint.h +- +stddef.h +- + +/Users/yichao.wu/deepctrl/GmSSL/include/gmssl/oid.h +stdint.h +- + +/Users/yichao.wu/deepctrl/GmSSL/include/gmssl/pbkdf2.h +stdio.h +- +stdlib.h +- +string.h +- +stdint.h +- +limits.h +- +gmssl/hmac.h +- + +/Users/yichao.wu/deepctrl/GmSSL/include/gmssl/rand.h +stdint.h +- +stdlib.h +- + +/Users/yichao.wu/deepctrl/GmSSL/include/gmssl/sha1.h +string.h +- +stdint.h +- + +/Users/yichao.wu/deepctrl/GmSSL/include/gmssl/sha2.h +string.h +- +stdint.h +- +sys/types.h +- + +/Users/yichao.wu/deepctrl/GmSSL/include/gmssl/sm2.h +stdio.h +- +stdint.h +- +stdlib.h +- +gmssl/sm3.h +- +gmssl/sm2_z256.h +- + +/Users/yichao.wu/deepctrl/GmSSL/include/gmssl/sm2_z256.h +stdio.h +- +stdint.h +- +stdlib.h +- + +/Users/yichao.wu/deepctrl/GmSSL/include/gmssl/sm3.h +string.h +- +stdint.h +- + +/Users/yichao.wu/deepctrl/GmSSL/include/gmssl/sm4.h +stdint.h +- +string.h +- +gmssl/ghash.h +- + +/Users/yichao.wu/deepctrl/GmSSL/include/gmssl/sm9.h +stdio.h +- +string.h +- +stdlib.h +- +stdint.h +- +gmssl/sm3.h +- +gmssl/sm2.h +- +gmssl/sm9_z256.h +- + +/Users/yichao.wu/deepctrl/GmSSL/include/gmssl/sm9_z256.h +stdio.h +- +string.h +- +stdlib.h +- +stdint.h +- +gmssl/sm3.h +- +gmssl/sm2.h +- + +/Users/yichao.wu/deepctrl/GmSSL/include/gmssl/version.h + +/Users/yichao.wu/deepctrl/GmSSL/include/gmssl/x509.h +gmssl/x509_cer.h +- + +/Users/yichao.wu/deepctrl/GmSSL/include/gmssl/x509_cer.h +time.h +- +string.h +- +stdint.h +- +stdlib.h +- +gmssl/sm2.h +- +gmssl/oid.h +- +gmssl/asn1.h +- + +/Users/yichao.wu/deepctrl/GmSSL/include/gmssl/x509_req.h +time.h +- +string.h +- +stdint.h +- +stdlib.h +- +gmssl/sm2.h +- +gmssl/oid.h +- +gmssl/asn1.h +- +gmssl/x509.h +- + +/Users/yichao.wu/deepctrl/GmSSL/include/gmssl/zuc.h +stdlib.h +- +stdint.h +- + diff --git a/android/build-jni-armeabi-v7a/CMakeFiles/gmssljni.dir/DependInfo.cmake b/android/build-jni-armeabi-v7a/CMakeFiles/gmssljni.dir/DependInfo.cmake new file mode 100644 index 0000000..e280a12 --- /dev/null +++ b/android/build-jni-armeabi-v7a/CMakeFiles/gmssljni.dir/DependInfo.cmake @@ -0,0 +1,27 @@ +# The set of languages for which implicit dependencies are needed: +set(CMAKE_DEPENDS_LANGUAGES + "C" + ) +# The set of files for implicit dependencies of each language: +set(CMAKE_DEPENDS_CHECK_C + "/Users/yichao.wu/deepctrl/GmSSL-Java/src/main/c/gmssljni.c" "/Users/yichao.wu/deepctrl/GmSSL-Java/android/build-jni-armeabi-v7a/CMakeFiles/gmssljni.dir/Users/yichao.wu/deepctrl/GmSSL-Java/src/main/c/gmssljni.c.o" + ) +set(CMAKE_C_COMPILER_ID "Clang") + +# Preprocessor definitions for this target. +set(CMAKE_TARGET_DEFINITIONS_C + "gmssljni_EXPORTS" + ) + +# The include file search paths: +set(CMAKE_C_TARGET_INCLUDE_PATH + "/Users/yichao.wu/deepctrl/GmSSL-Java/../GmSSL/include" + "../../src/main/c" + ) + +# Targets to which this target links. +set(CMAKE_TARGET_LINKED_INFO_FILES + ) + +# Fortran module output directory. +set(CMAKE_Fortran_TARGET_MODULE_DIR "") diff --git a/android/build-jni-armeabi-v7a/CMakeFiles/gmssljni.dir/Users/yichao.wu/deepctrl/GmSSL-Java/src/main/c/gmssljni.c.o b/android/build-jni-armeabi-v7a/CMakeFiles/gmssljni.dir/Users/yichao.wu/deepctrl/GmSSL-Java/src/main/c/gmssljni.c.o new file mode 100644 index 0000000..66dd73e Binary files /dev/null and b/android/build-jni-armeabi-v7a/CMakeFiles/gmssljni.dir/Users/yichao.wu/deepctrl/GmSSL-Java/src/main/c/gmssljni.c.o differ diff --git a/android/build-jni-armeabi-v7a/CMakeFiles/gmssljni.dir/build.make b/android/build-jni-armeabi-v7a/CMakeFiles/gmssljni.dir/build.make new file mode 100644 index 0000000..3144ec2 --- /dev/null +++ b/android/build-jni-armeabi-v7a/CMakeFiles/gmssljni.dir/build.make @@ -0,0 +1,118 @@ +# CMAKE generated file: DO NOT EDIT! +# Generated by "Unix Makefiles" Generator, CMake Version 3.19 + +# Delete rule output on recipe failure. +.DELETE_ON_ERROR: + + +#============================================================================= +# Special targets provided by cmake. + +# Disable implicit rules so canonical targets will work. +.SUFFIXES: + + +# Disable VCS-based implicit rules. +% : %,v + + +# Disable VCS-based implicit rules. +% : RCS/% + + +# Disable VCS-based implicit rules. +% : RCS/%,v + + +# Disable VCS-based implicit rules. +% : SCCS/s.% + + +# Disable VCS-based implicit rules. +% : s.% + + +.SUFFIXES: .hpux_make_needs_suffix_list + + +# Command-line flag to silence nested $(MAKE). +$(VERBOSE)MAKESILENT = -s + +#Suppress display of executed commands. +$(VERBOSE).SILENT: + +# A target that is always out of date. +cmake_force: + +.PHONY : cmake_force + +#============================================================================= +# Set environment variables for the build. + +# The shell in which to execute make rules. +SHELL = /bin/sh + +# The CMake executable. +CMAKE_COMMAND = /usr/local/Cellar/cmake/3.19.1/bin/cmake + +# The command to remove a file. +RM = /usr/local/Cellar/cmake/3.19.1/bin/cmake -E rm -f + +# Escaping for special characters. +EQUALS = = + +# The top-level source directory on which CMake was run. +CMAKE_SOURCE_DIR = /Users/yichao.wu/deepctrl/GmSSL-Java/android + +# The top-level build directory on which CMake was run. +CMAKE_BINARY_DIR = /Users/yichao.wu/deepctrl/GmSSL-Java/android/build-jni-armeabi-v7a + +# Include any dependencies generated for this target. +include CMakeFiles/gmssljni.dir/depend.make + +# Include the progress variables for this target. +include CMakeFiles/gmssljni.dir/progress.make + +# Include the compile flags for this target's objects. +include CMakeFiles/gmssljni.dir/flags.make + +CMakeFiles/gmssljni.dir/Users/yichao.wu/deepctrl/GmSSL-Java/src/main/c/gmssljni.c.o: CMakeFiles/gmssljni.dir/flags.make +CMakeFiles/gmssljni.dir/Users/yichao.wu/deepctrl/GmSSL-Java/src/main/c/gmssljni.c.o: /Users/yichao.wu/deepctrl/GmSSL-Java/src/main/c/gmssljni.c + @$(CMAKE_COMMAND) -E cmake_echo_color --switch=$(COLOR) --green --progress-dir=/Users/yichao.wu/deepctrl/GmSSL-Java/android/build-jni-armeabi-v7a/CMakeFiles --progress-num=$(CMAKE_PROGRESS_1) "Building C object CMakeFiles/gmssljni.dir/Users/yichao.wu/deepctrl/GmSSL-Java/src/main/c/gmssljni.c.o" + /Users/yichao.wu/Library/Android/sdk/ndk/27.1.12297006/toolchains/llvm/prebuilt/darwin-x86_64/bin/clang --target=armv7-none-linux-androideabi21 --sysroot=/Users/yichao.wu/Library/Android/sdk/ndk/27.1.12297006/toolchains/llvm/prebuilt/darwin-x86_64/sysroot $(C_DEFINES) $(C_INCLUDES) $(C_FLAGS) -o CMakeFiles/gmssljni.dir/Users/yichao.wu/deepctrl/GmSSL-Java/src/main/c/gmssljni.c.o -c /Users/yichao.wu/deepctrl/GmSSL-Java/src/main/c/gmssljni.c + +CMakeFiles/gmssljni.dir/Users/yichao.wu/deepctrl/GmSSL-Java/src/main/c/gmssljni.c.i: cmake_force + @$(CMAKE_COMMAND) -E cmake_echo_color --switch=$(COLOR) --green "Preprocessing C source to CMakeFiles/gmssljni.dir/Users/yichao.wu/deepctrl/GmSSL-Java/src/main/c/gmssljni.c.i" + /Users/yichao.wu/Library/Android/sdk/ndk/27.1.12297006/toolchains/llvm/prebuilt/darwin-x86_64/bin/clang --target=armv7-none-linux-androideabi21 --sysroot=/Users/yichao.wu/Library/Android/sdk/ndk/27.1.12297006/toolchains/llvm/prebuilt/darwin-x86_64/sysroot $(C_DEFINES) $(C_INCLUDES) $(C_FLAGS) -E /Users/yichao.wu/deepctrl/GmSSL-Java/src/main/c/gmssljni.c > CMakeFiles/gmssljni.dir/Users/yichao.wu/deepctrl/GmSSL-Java/src/main/c/gmssljni.c.i + +CMakeFiles/gmssljni.dir/Users/yichao.wu/deepctrl/GmSSL-Java/src/main/c/gmssljni.c.s: cmake_force + @$(CMAKE_COMMAND) -E cmake_echo_color --switch=$(COLOR) --green "Compiling C source to assembly CMakeFiles/gmssljni.dir/Users/yichao.wu/deepctrl/GmSSL-Java/src/main/c/gmssljni.c.s" + /Users/yichao.wu/Library/Android/sdk/ndk/27.1.12297006/toolchains/llvm/prebuilt/darwin-x86_64/bin/clang --target=armv7-none-linux-androideabi21 --sysroot=/Users/yichao.wu/Library/Android/sdk/ndk/27.1.12297006/toolchains/llvm/prebuilt/darwin-x86_64/sysroot $(C_DEFINES) $(C_INCLUDES) $(C_FLAGS) -S /Users/yichao.wu/deepctrl/GmSSL-Java/src/main/c/gmssljni.c -o CMakeFiles/gmssljni.dir/Users/yichao.wu/deepctrl/GmSSL-Java/src/main/c/gmssljni.c.s + +# Object files for target gmssljni +gmssljni_OBJECTS = \ +"CMakeFiles/gmssljni.dir/Users/yichao.wu/deepctrl/GmSSL-Java/src/main/c/gmssljni.c.o" + +# External object files for target gmssljni +gmssljni_EXTERNAL_OBJECTS = + +libgmssljni.so: CMakeFiles/gmssljni.dir/Users/yichao.wu/deepctrl/GmSSL-Java/src/main/c/gmssljni.c.o +libgmssljni.so: CMakeFiles/gmssljni.dir/build.make +libgmssljni.so: /Users/yichao.wu/deepctrl/GmSSL-Java/../GmSSL/build-android-arm/bin/libgmssl.a +libgmssljni.so: CMakeFiles/gmssljni.dir/link.txt + @$(CMAKE_COMMAND) -E cmake_echo_color --switch=$(COLOR) --green --bold --progress-dir=/Users/yichao.wu/deepctrl/GmSSL-Java/android/build-jni-armeabi-v7a/CMakeFiles --progress-num=$(CMAKE_PROGRESS_2) "Linking C shared library libgmssljni.so" + $(CMAKE_COMMAND) -E cmake_link_script CMakeFiles/gmssljni.dir/link.txt --verbose=$(VERBOSE) + +# Rule to build all files generated by this target. +CMakeFiles/gmssljni.dir/build: libgmssljni.so + +.PHONY : CMakeFiles/gmssljni.dir/build + +CMakeFiles/gmssljni.dir/clean: + $(CMAKE_COMMAND) -P CMakeFiles/gmssljni.dir/cmake_clean.cmake +.PHONY : CMakeFiles/gmssljni.dir/clean + +CMakeFiles/gmssljni.dir/depend: + cd /Users/yichao.wu/deepctrl/GmSSL-Java/android/build-jni-armeabi-v7a && $(CMAKE_COMMAND) -E cmake_depends "Unix Makefiles" /Users/yichao.wu/deepctrl/GmSSL-Java/android /Users/yichao.wu/deepctrl/GmSSL-Java/android /Users/yichao.wu/deepctrl/GmSSL-Java/android/build-jni-armeabi-v7a /Users/yichao.wu/deepctrl/GmSSL-Java/android/build-jni-armeabi-v7a /Users/yichao.wu/deepctrl/GmSSL-Java/android/build-jni-armeabi-v7a/CMakeFiles/gmssljni.dir/DependInfo.cmake --color=$(COLOR) +.PHONY : CMakeFiles/gmssljni.dir/depend + diff --git a/android/build-jni-armeabi-v7a/CMakeFiles/gmssljni.dir/cmake_clean.cmake b/android/build-jni-armeabi-v7a/CMakeFiles/gmssljni.dir/cmake_clean.cmake new file mode 100644 index 0000000..b14f9fe --- /dev/null +++ b/android/build-jni-armeabi-v7a/CMakeFiles/gmssljni.dir/cmake_clean.cmake @@ -0,0 +1,10 @@ +file(REMOVE_RECURSE + "CMakeFiles/gmssljni.dir/Users/yichao.wu/deepctrl/GmSSL-Java/src/main/c/gmssljni.c.o" + "libgmssljni.pdb" + "libgmssljni.so" +) + +# Per-language clean rules from dependency scanning. +foreach(lang C) + include(CMakeFiles/gmssljni.dir/cmake_clean_${lang}.cmake OPTIONAL) +endforeach() diff --git a/android/build-jni-armeabi-v7a/CMakeFiles/gmssljni.dir/depend.internal b/android/build-jni-armeabi-v7a/CMakeFiles/gmssljni.dir/depend.internal new file mode 100644 index 0000000..f8f5d95 --- /dev/null +++ b/android/build-jni-armeabi-v7a/CMakeFiles/gmssljni.dir/depend.internal @@ -0,0 +1,29 @@ +# CMAKE generated file: DO NOT EDIT! +# Generated by "Unix Makefiles" Generator, CMake Version 3.19 + +CMakeFiles/gmssljni.dir/Users/yichao.wu/deepctrl/GmSSL-Java/src/main/c/gmssljni.c.o + /Users/yichao.wu/deepctrl/GmSSL-Java/src/main/c/gmssljni.c + /Users/yichao.wu/deepctrl/GmSSL-Java/src/main/c/gmssljni.h + /Users/yichao.wu/deepctrl/GmSSL/include/gmssl/asn1.h + /Users/yichao.wu/deepctrl/GmSSL/include/gmssl/digest.h + /Users/yichao.wu/deepctrl/GmSSL/include/gmssl/error.h + /Users/yichao.wu/deepctrl/GmSSL/include/gmssl/gf128.h + /Users/yichao.wu/deepctrl/GmSSL/include/gmssl/ghash.h + /Users/yichao.wu/deepctrl/GmSSL/include/gmssl/hmac.h + /Users/yichao.wu/deepctrl/GmSSL/include/gmssl/mem.h + /Users/yichao.wu/deepctrl/GmSSL/include/gmssl/oid.h + /Users/yichao.wu/deepctrl/GmSSL/include/gmssl/pbkdf2.h + /Users/yichao.wu/deepctrl/GmSSL/include/gmssl/rand.h + /Users/yichao.wu/deepctrl/GmSSL/include/gmssl/sha1.h + /Users/yichao.wu/deepctrl/GmSSL/include/gmssl/sha2.h + /Users/yichao.wu/deepctrl/GmSSL/include/gmssl/sm2.h + /Users/yichao.wu/deepctrl/GmSSL/include/gmssl/sm2_z256.h + /Users/yichao.wu/deepctrl/GmSSL/include/gmssl/sm3.h + /Users/yichao.wu/deepctrl/GmSSL/include/gmssl/sm4.h + /Users/yichao.wu/deepctrl/GmSSL/include/gmssl/sm9.h + /Users/yichao.wu/deepctrl/GmSSL/include/gmssl/sm9_z256.h + /Users/yichao.wu/deepctrl/GmSSL/include/gmssl/version.h + /Users/yichao.wu/deepctrl/GmSSL/include/gmssl/x509.h + /Users/yichao.wu/deepctrl/GmSSL/include/gmssl/x509_cer.h + /Users/yichao.wu/deepctrl/GmSSL/include/gmssl/x509_req.h + /Users/yichao.wu/deepctrl/GmSSL/include/gmssl/zuc.h diff --git a/android/build-jni-armeabi-v7a/CMakeFiles/gmssljni.dir/depend.make b/android/build-jni-armeabi-v7a/CMakeFiles/gmssljni.dir/depend.make new file mode 100644 index 0000000..11a7d55 --- /dev/null +++ b/android/build-jni-armeabi-v7a/CMakeFiles/gmssljni.dir/depend.make @@ -0,0 +1,29 @@ +# CMAKE generated file: DO NOT EDIT! +# Generated by "Unix Makefiles" Generator, CMake Version 3.19 + +CMakeFiles/gmssljni.dir/Users/yichao.wu/deepctrl/GmSSL-Java/src/main/c/gmssljni.c.o: /Users/yichao.wu/deepctrl/GmSSL-Java/src/main/c/gmssljni.c +CMakeFiles/gmssljni.dir/Users/yichao.wu/deepctrl/GmSSL-Java/src/main/c/gmssljni.c.o: /Users/yichao.wu/deepctrl/GmSSL-Java/src/main/c/gmssljni.h +CMakeFiles/gmssljni.dir/Users/yichao.wu/deepctrl/GmSSL-Java/src/main/c/gmssljni.c.o: /Users/yichao.wu/deepctrl/GmSSL/include/gmssl/asn1.h +CMakeFiles/gmssljni.dir/Users/yichao.wu/deepctrl/GmSSL-Java/src/main/c/gmssljni.c.o: /Users/yichao.wu/deepctrl/GmSSL/include/gmssl/digest.h +CMakeFiles/gmssljni.dir/Users/yichao.wu/deepctrl/GmSSL-Java/src/main/c/gmssljni.c.o: /Users/yichao.wu/deepctrl/GmSSL/include/gmssl/error.h +CMakeFiles/gmssljni.dir/Users/yichao.wu/deepctrl/GmSSL-Java/src/main/c/gmssljni.c.o: /Users/yichao.wu/deepctrl/GmSSL/include/gmssl/gf128.h +CMakeFiles/gmssljni.dir/Users/yichao.wu/deepctrl/GmSSL-Java/src/main/c/gmssljni.c.o: /Users/yichao.wu/deepctrl/GmSSL/include/gmssl/ghash.h +CMakeFiles/gmssljni.dir/Users/yichao.wu/deepctrl/GmSSL-Java/src/main/c/gmssljni.c.o: /Users/yichao.wu/deepctrl/GmSSL/include/gmssl/hmac.h +CMakeFiles/gmssljni.dir/Users/yichao.wu/deepctrl/GmSSL-Java/src/main/c/gmssljni.c.o: /Users/yichao.wu/deepctrl/GmSSL/include/gmssl/mem.h +CMakeFiles/gmssljni.dir/Users/yichao.wu/deepctrl/GmSSL-Java/src/main/c/gmssljni.c.o: /Users/yichao.wu/deepctrl/GmSSL/include/gmssl/oid.h +CMakeFiles/gmssljni.dir/Users/yichao.wu/deepctrl/GmSSL-Java/src/main/c/gmssljni.c.o: /Users/yichao.wu/deepctrl/GmSSL/include/gmssl/pbkdf2.h +CMakeFiles/gmssljni.dir/Users/yichao.wu/deepctrl/GmSSL-Java/src/main/c/gmssljni.c.o: /Users/yichao.wu/deepctrl/GmSSL/include/gmssl/rand.h +CMakeFiles/gmssljni.dir/Users/yichao.wu/deepctrl/GmSSL-Java/src/main/c/gmssljni.c.o: /Users/yichao.wu/deepctrl/GmSSL/include/gmssl/sha1.h +CMakeFiles/gmssljni.dir/Users/yichao.wu/deepctrl/GmSSL-Java/src/main/c/gmssljni.c.o: /Users/yichao.wu/deepctrl/GmSSL/include/gmssl/sha2.h +CMakeFiles/gmssljni.dir/Users/yichao.wu/deepctrl/GmSSL-Java/src/main/c/gmssljni.c.o: /Users/yichao.wu/deepctrl/GmSSL/include/gmssl/sm2.h +CMakeFiles/gmssljni.dir/Users/yichao.wu/deepctrl/GmSSL-Java/src/main/c/gmssljni.c.o: /Users/yichao.wu/deepctrl/GmSSL/include/gmssl/sm2_z256.h +CMakeFiles/gmssljni.dir/Users/yichao.wu/deepctrl/GmSSL-Java/src/main/c/gmssljni.c.o: /Users/yichao.wu/deepctrl/GmSSL/include/gmssl/sm3.h +CMakeFiles/gmssljni.dir/Users/yichao.wu/deepctrl/GmSSL-Java/src/main/c/gmssljni.c.o: /Users/yichao.wu/deepctrl/GmSSL/include/gmssl/sm4.h +CMakeFiles/gmssljni.dir/Users/yichao.wu/deepctrl/GmSSL-Java/src/main/c/gmssljni.c.o: /Users/yichao.wu/deepctrl/GmSSL/include/gmssl/sm9.h +CMakeFiles/gmssljni.dir/Users/yichao.wu/deepctrl/GmSSL-Java/src/main/c/gmssljni.c.o: /Users/yichao.wu/deepctrl/GmSSL/include/gmssl/sm9_z256.h +CMakeFiles/gmssljni.dir/Users/yichao.wu/deepctrl/GmSSL-Java/src/main/c/gmssljni.c.o: /Users/yichao.wu/deepctrl/GmSSL/include/gmssl/version.h +CMakeFiles/gmssljni.dir/Users/yichao.wu/deepctrl/GmSSL-Java/src/main/c/gmssljni.c.o: /Users/yichao.wu/deepctrl/GmSSL/include/gmssl/x509.h +CMakeFiles/gmssljni.dir/Users/yichao.wu/deepctrl/GmSSL-Java/src/main/c/gmssljni.c.o: /Users/yichao.wu/deepctrl/GmSSL/include/gmssl/x509_cer.h +CMakeFiles/gmssljni.dir/Users/yichao.wu/deepctrl/GmSSL-Java/src/main/c/gmssljni.c.o: /Users/yichao.wu/deepctrl/GmSSL/include/gmssl/x509_req.h +CMakeFiles/gmssljni.dir/Users/yichao.wu/deepctrl/GmSSL-Java/src/main/c/gmssljni.c.o: /Users/yichao.wu/deepctrl/GmSSL/include/gmssl/zuc.h + diff --git a/android/build-jni-armeabi-v7a/CMakeFiles/gmssljni.dir/flags.make b/android/build-jni-armeabi-v7a/CMakeFiles/gmssljni.dir/flags.make new file mode 100644 index 0000000..fd2db0e --- /dev/null +++ b/android/build-jni-armeabi-v7a/CMakeFiles/gmssljni.dir/flags.make @@ -0,0 +1,10 @@ +# CMAKE generated file: DO NOT EDIT! +# Generated by "Unix Makefiles" Generator, CMake Version 3.19 + +# compile C with /Users/yichao.wu/Library/Android/sdk/ndk/27.1.12297006/toolchains/llvm/prebuilt/darwin-x86_64/bin/clang +C_DEFINES = -Dgmssljni_EXPORTS + +C_INCLUDES = -I/Users/yichao.wu/deepctrl/GmSSL-Java/../GmSSL/include -I/Users/yichao.wu/deepctrl/GmSSL-Java/android/../src/main/c + +C_FLAGS = -g -DANDROID -fdata-sections -ffunction-sections -funwind-tables -fstack-protector-strong -no-canonical-prefixes -D_FORTIFY_SOURCE=2 -march=armv7-a -mthumb -Wformat -Werror=format-security -O3 -DNDEBUG -fPIC -Wall -Wextra -O2 -fPIC + diff --git a/android/build-jni-armeabi-v7a/CMakeFiles/gmssljni.dir/link.txt b/android/build-jni-armeabi-v7a/CMakeFiles/gmssljni.dir/link.txt new file mode 100644 index 0000000..87fbbcb --- /dev/null +++ b/android/build-jni-armeabi-v7a/CMakeFiles/gmssljni.dir/link.txt @@ -0,0 +1 @@ +/Users/yichao.wu/Library/Android/sdk/ndk/27.1.12297006/toolchains/llvm/prebuilt/darwin-x86_64/bin/clang --target=armv7-none-linux-androideabi21 --sysroot=/Users/yichao.wu/Library/Android/sdk/ndk/27.1.12297006/toolchains/llvm/prebuilt/darwin-x86_64/sysroot -fPIC -g -DANDROID -fdata-sections -ffunction-sections -funwind-tables -fstack-protector-strong -no-canonical-prefixes -D_FORTIFY_SOURCE=2 -march=armv7-a -mthumb -Wformat -Werror=format-security -O3 -DNDEBUG -static-libstdc++ -Wl,--build-id=sha1 -Wl,--no-rosegment -Wl,--no-undefined-version -Wl,--fatal-warnings -Wl,--no-undefined -Qunused-arguments -Wl,--gc-sections -shared -Wl,-soname,libgmssljni.so -o libgmssljni.so CMakeFiles/gmssljni.dir/Users/yichao.wu/deepctrl/GmSSL-Java/src/main/c/gmssljni.c.o /Users/yichao.wu/deepctrl/GmSSL-Java/../GmSSL/build-android-arm/bin/libgmssl.a -llog -latomic -lm diff --git a/android/build-jni-armeabi-v7a/CMakeFiles/gmssljni.dir/progress.make b/android/build-jni-armeabi-v7a/CMakeFiles/gmssljni.dir/progress.make new file mode 100644 index 0000000..abadeb0 --- /dev/null +++ b/android/build-jni-armeabi-v7a/CMakeFiles/gmssljni.dir/progress.make @@ -0,0 +1,3 @@ +CMAKE_PROGRESS_1 = 1 +CMAKE_PROGRESS_2 = 2 + diff --git a/android/build-jni-armeabi-v7a/CMakeFiles/progress.marks b/android/build-jni-armeabi-v7a/CMakeFiles/progress.marks new file mode 100644 index 0000000..0cfbf08 --- /dev/null +++ b/android/build-jni-armeabi-v7a/CMakeFiles/progress.marks @@ -0,0 +1 @@ +2 diff --git a/android/build-jni-armeabi-v7a/Makefile b/android/build-jni-armeabi-v7a/Makefile new file mode 100644 index 0000000..15c8fa2 --- /dev/null +++ b/android/build-jni-armeabi-v7a/Makefile @@ -0,0 +1,197 @@ +# CMAKE generated file: DO NOT EDIT! +# Generated by "Unix Makefiles" Generator, CMake Version 3.19 + +# Default target executed when no arguments are given to make. +default_target: all + +.PHONY : default_target + +# Allow only one "make -f Makefile2" at a time, but pass parallelism. +.NOTPARALLEL: + + +#============================================================================= +# Special targets provided by cmake. + +# Disable implicit rules so canonical targets will work. +.SUFFIXES: + + +# Disable VCS-based implicit rules. +% : %,v + + +# Disable VCS-based implicit rules. +% : RCS/% + + +# Disable VCS-based implicit rules. +% : RCS/%,v + + +# Disable VCS-based implicit rules. +% : SCCS/s.% + + +# Disable VCS-based implicit rules. +% : s.% + + +.SUFFIXES: .hpux_make_needs_suffix_list + + +# Command-line flag to silence nested $(MAKE). +$(VERBOSE)MAKESILENT = -s + +#Suppress display of executed commands. +$(VERBOSE).SILENT: + +# A target that is always out of date. +cmake_force: + +.PHONY : cmake_force + +#============================================================================= +# Set environment variables for the build. + +# The shell in which to execute make rules. +SHELL = /bin/sh + +# The CMake executable. +CMAKE_COMMAND = /usr/local/Cellar/cmake/3.19.1/bin/cmake + +# The command to remove a file. +RM = /usr/local/Cellar/cmake/3.19.1/bin/cmake -E rm -f + +# Escaping for special characters. +EQUALS = = + +# The top-level source directory on which CMake was run. +CMAKE_SOURCE_DIR = /Users/yichao.wu/deepctrl/GmSSL-Java/android + +# The top-level build directory on which CMake was run. +CMAKE_BINARY_DIR = /Users/yichao.wu/deepctrl/GmSSL-Java/android/build-jni-armeabi-v7a + +#============================================================================= +# Targets provided globally by CMake. + +# Special rule for the target rebuild_cache +rebuild_cache: + @$(CMAKE_COMMAND) -E cmake_echo_color --switch=$(COLOR) --cyan "Running CMake to regenerate build system..." + /usr/local/Cellar/cmake/3.19.1/bin/cmake --regenerate-during-build -S$(CMAKE_SOURCE_DIR) -B$(CMAKE_BINARY_DIR) +.PHONY : rebuild_cache + +# Special rule for the target rebuild_cache +rebuild_cache/fast: rebuild_cache + +.PHONY : rebuild_cache/fast + +# Special rule for the target edit_cache +edit_cache: + @$(CMAKE_COMMAND) -E cmake_echo_color --switch=$(COLOR) --cyan "Running CMake cache editor..." + /usr/local/Cellar/cmake/3.19.1/bin/ccmake -S$(CMAKE_SOURCE_DIR) -B$(CMAKE_BINARY_DIR) +.PHONY : edit_cache + +# Special rule for the target edit_cache +edit_cache/fast: edit_cache + +.PHONY : edit_cache/fast + +# The main all target +all: cmake_check_build_system + $(CMAKE_COMMAND) -E cmake_progress_start /Users/yichao.wu/deepctrl/GmSSL-Java/android/build-jni-armeabi-v7a/CMakeFiles /Users/yichao.wu/deepctrl/GmSSL-Java/android/build-jni-armeabi-v7a//CMakeFiles/progress.marks + $(MAKE) $(MAKESILENT) -f CMakeFiles/Makefile2 all + $(CMAKE_COMMAND) -E cmake_progress_start /Users/yichao.wu/deepctrl/GmSSL-Java/android/build-jni-armeabi-v7a/CMakeFiles 0 +.PHONY : all + +# The main clean target +clean: + $(MAKE) $(MAKESILENT) -f CMakeFiles/Makefile2 clean +.PHONY : clean + +# The main clean target +clean/fast: clean + +.PHONY : clean/fast + +# Prepare targets for installation. +preinstall: all + $(MAKE) $(MAKESILENT) -f CMakeFiles/Makefile2 preinstall +.PHONY : preinstall + +# Prepare targets for installation. +preinstall/fast: + $(MAKE) $(MAKESILENT) -f CMakeFiles/Makefile2 preinstall +.PHONY : preinstall/fast + +# clear depends +depend: + $(CMAKE_COMMAND) -S$(CMAKE_SOURCE_DIR) -B$(CMAKE_BINARY_DIR) --check-build-system CMakeFiles/Makefile.cmake 1 +.PHONY : depend + +#============================================================================= +# Target rules for targets named gmssljni + +# Build rule for target. +gmssljni: cmake_check_build_system + $(MAKE) $(MAKESILENT) -f CMakeFiles/Makefile2 gmssljni +.PHONY : gmssljni + +# fast build rule for target. +gmssljni/fast: + $(MAKE) $(MAKESILENT) -f CMakeFiles/gmssljni.dir/build.make CMakeFiles/gmssljni.dir/build +.PHONY : gmssljni/fast + +Users/yichao.wu/deepctrl/GmSSL-Java/src/main/c/gmssljni.o: Users/yichao.wu/deepctrl/GmSSL-Java/src/main/c/gmssljni.c.o + +.PHONY : Users/yichao.wu/deepctrl/GmSSL-Java/src/main/c/gmssljni.o + +# target to build an object file +Users/yichao.wu/deepctrl/GmSSL-Java/src/main/c/gmssljni.c.o: + $(MAKE) $(MAKESILENT) -f CMakeFiles/gmssljni.dir/build.make CMakeFiles/gmssljni.dir/Users/yichao.wu/deepctrl/GmSSL-Java/src/main/c/gmssljni.c.o +.PHONY : Users/yichao.wu/deepctrl/GmSSL-Java/src/main/c/gmssljni.c.o + +Users/yichao.wu/deepctrl/GmSSL-Java/src/main/c/gmssljni.i: Users/yichao.wu/deepctrl/GmSSL-Java/src/main/c/gmssljni.c.i + +.PHONY : Users/yichao.wu/deepctrl/GmSSL-Java/src/main/c/gmssljni.i + +# target to preprocess a source file +Users/yichao.wu/deepctrl/GmSSL-Java/src/main/c/gmssljni.c.i: + $(MAKE) $(MAKESILENT) -f CMakeFiles/gmssljni.dir/build.make CMakeFiles/gmssljni.dir/Users/yichao.wu/deepctrl/GmSSL-Java/src/main/c/gmssljni.c.i +.PHONY : Users/yichao.wu/deepctrl/GmSSL-Java/src/main/c/gmssljni.c.i + +Users/yichao.wu/deepctrl/GmSSL-Java/src/main/c/gmssljni.s: Users/yichao.wu/deepctrl/GmSSL-Java/src/main/c/gmssljni.c.s + +.PHONY : Users/yichao.wu/deepctrl/GmSSL-Java/src/main/c/gmssljni.s + +# target to generate assembly for a file +Users/yichao.wu/deepctrl/GmSSL-Java/src/main/c/gmssljni.c.s: + $(MAKE) $(MAKESILENT) -f CMakeFiles/gmssljni.dir/build.make CMakeFiles/gmssljni.dir/Users/yichao.wu/deepctrl/GmSSL-Java/src/main/c/gmssljni.c.s +.PHONY : Users/yichao.wu/deepctrl/GmSSL-Java/src/main/c/gmssljni.c.s + +# Help Target +help: + @echo "The following are some of the valid targets for this Makefile:" + @echo "... all (the default if no target is provided)" + @echo "... clean" + @echo "... depend" + @echo "... edit_cache" + @echo "... rebuild_cache" + @echo "... gmssljni" + @echo "... Users/yichao.wu/deepctrl/GmSSL-Java/src/main/c/gmssljni.o" + @echo "... Users/yichao.wu/deepctrl/GmSSL-Java/src/main/c/gmssljni.i" + @echo "... Users/yichao.wu/deepctrl/GmSSL-Java/src/main/c/gmssljni.s" +.PHONY : help + + + +#============================================================================= +# Special targets to cleanup operation of make. + +# Special rule to run CMake to check the build system integrity. +# No rule that depends on this can have commands that come from listfiles +# because they might be regenerated. +cmake_check_build_system: + $(CMAKE_COMMAND) -S$(CMAKE_SOURCE_DIR) -B$(CMAKE_BINARY_DIR) --check-build-system CMakeFiles/Makefile.cmake 0 +.PHONY : cmake_check_build_system + diff --git a/android/build-jni-armeabi-v7a/cmake_install.cmake b/android/build-jni-armeabi-v7a/cmake_install.cmake new file mode 100644 index 0000000..5ce4a85 --- /dev/null +++ b/android/build-jni-armeabi-v7a/cmake_install.cmake @@ -0,0 +1,54 @@ +# Install script for directory: /Users/yichao.wu/deepctrl/GmSSL-Java/android + +# Set the install prefix +if(NOT DEFINED CMAKE_INSTALL_PREFIX) + set(CMAKE_INSTALL_PREFIX "/usr/local") +endif() +string(REGEX REPLACE "/$" "" CMAKE_INSTALL_PREFIX "${CMAKE_INSTALL_PREFIX}") + +# Set the install configuration name. +if(NOT DEFINED CMAKE_INSTALL_CONFIG_NAME) + if(BUILD_TYPE) + string(REGEX REPLACE "^[^A-Za-z0-9_]+" "" + CMAKE_INSTALL_CONFIG_NAME "${BUILD_TYPE}") + else() + set(CMAKE_INSTALL_CONFIG_NAME "Release") + endif() + message(STATUS "Install configuration: \"${CMAKE_INSTALL_CONFIG_NAME}\"") +endif() + +# Set the component getting installed. +if(NOT CMAKE_INSTALL_COMPONENT) + if(COMPONENT) + message(STATUS "Install component: \"${COMPONENT}\"") + set(CMAKE_INSTALL_COMPONENT "${COMPONENT}") + else() + set(CMAKE_INSTALL_COMPONENT) + endif() +endif() + +# Install shared libraries without execute permission? +if(NOT DEFINED CMAKE_INSTALL_SO_NO_EXE) + set(CMAKE_INSTALL_SO_NO_EXE "0") +endif() + +# Is this installation the result of a crosscompile? +if(NOT DEFINED CMAKE_CROSSCOMPILING) + set(CMAKE_CROSSCOMPILING "TRUE") +endif() + +# Set default install directory permissions. +if(NOT DEFINED CMAKE_OBJDUMP) + set(CMAKE_OBJDUMP "/Users/yichao.wu/Library/Android/sdk/ndk/27.1.12297006/toolchains/llvm/prebuilt/darwin-x86_64/bin/llvm-objdump") +endif() + +if(CMAKE_INSTALL_COMPONENT) + set(CMAKE_INSTALL_MANIFEST "install_manifest_${CMAKE_INSTALL_COMPONENT}.txt") +else() + set(CMAKE_INSTALL_MANIFEST "install_manifest.txt") +endif() + +string(REPLACE ";" "\n" CMAKE_INSTALL_MANIFEST_CONTENT + "${CMAKE_INSTALL_MANIFEST_FILES}") +file(WRITE "/Users/yichao.wu/deepctrl/GmSSL-Java/android/build-jni-armeabi-v7a/${CMAKE_INSTALL_MANIFEST}" + "${CMAKE_INSTALL_MANIFEST_CONTENT}") diff --git a/android/build-jni-armeabi-v7a/libgmssljni.so b/android/build-jni-armeabi-v7a/libgmssljni.so new file mode 100755 index 0000000..786d261 Binary files /dev/null and b/android/build-jni-armeabi-v7a/libgmssljni.so differ diff --git a/android/build.gradle b/android/build.gradle new file mode 100644 index 0000000..59c7746 --- /dev/null +++ b/android/build.gradle @@ -0,0 +1,54 @@ +plugins { + id 'com.android.library' version '8.1.0' +} + +android { + namespace 'org.gmssl' + compileSdk 33 + + defaultConfig { + minSdk 21 + targetSdk 33 + + // Version info + versionCode 1 + versionName "3.1.1" + + // Supported ABIs + ndk { + abiFilters 'arm64-v8a', 'armeabi-v7a' + } + + testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner" + consumerProguardFiles "consumer-rules.pro" + } + + buildTypes { + release { + minifyEnabled false + proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro' + } + } + + compileOptions { + sourceCompatibility JavaVersion.VERSION_1_8 + targetCompatibility JavaVersion.VERSION_1_8 + } + + // Source sets + sourceSets { + main { + java.srcDirs = ['src/main/java'] + jniLibs.srcDirs = ['src/main/jniLibs'] + } + } + + // Lint options + lint { + abortOnError false + } +} + +dependencies { + // No external dependencies required +} diff --git a/android/consumer-rules.pro b/android/consumer-rules.pro new file mode 100644 index 0000000..ddb772b --- /dev/null +++ b/android/consumer-rules.pro @@ -0,0 +1,10 @@ +# Consumer ProGuard rules for GmSSL library +# These rules are included in the AAR and applied to consuming apps + +-keepclasseswithmembernames class org.gmssl.** { + native ; +} + +-keep public class org.gmssl.** { + public *; +} diff --git a/android/gradle.properties b/android/gradle.properties new file mode 100644 index 0000000..8a5c2e3 --- /dev/null +++ b/android/gradle.properties @@ -0,0 +1,24 @@ +# Project-wide Gradle settings. +# IDE (e.g. Android Studio) users: +# Gradle settings configured through the IDE *will override* +# any settings specified in this file. + +# For more details on how to configure your build environment visit +# http://www.gradle.org/docs/current/userguide/build_environment.html + +# Specifies the JVM arguments used for the daemon process. +# The setting is particularly useful for tweaking memory settings. +org.gradle.jvmargs=-Xmx2048m -Dfile.encoding=UTF-8 + +# When configured, Gradle will run in incubating parallel mode. +# This option should only be used with decoupled projects. +org.gradle.parallel=true + +# AndroidX package structure +android.useAndroidX=true + +# Kotlin code style +kotlin.code.style=official + +# Enables namespacing of each library's R class +android.nonTransitiveRClass=true diff --git a/android/gradle/wrapper/gradle-wrapper.properties b/android/gradle/wrapper/gradle-wrapper.properties new file mode 100644 index 0000000..15de902 --- /dev/null +++ b/android/gradle/wrapper/gradle-wrapper.properties @@ -0,0 +1,5 @@ +distributionBase=GRADLE_USER_HOME +distributionPath=wrapper/dists +distributionUrl=https\://services.gradle.org/distributions/gradle-8.2-bin.zip +zipStoreBase=GRADLE_USER_HOME +zipStorePath=wrapper/dists diff --git a/android/gradlew b/android/gradlew new file mode 100755 index 0000000..cb4243a --- /dev/null +++ b/android/gradlew @@ -0,0 +1,30 @@ +#!/bin/sh + +############################################################################## +# Gradle start up script for POSIX +############################################################################## + +# Resolve real path to script +SCRIPT="$0" +while [ -h "$SCRIPT" ] ; do + ls=$( ls -ld "$SCRIPT" ) + link=$( expr "$ls" : '.*-> \(.*\)$' ) + if expr "$link" : '/.*' > /dev/null; then + SCRIPT="$link" + else + SCRIPT=$( dirname "$SCRIPT" )/"$link" + fi +done +APP_HOME=$( cd -P -- "$(dirname -- "$SCRIPT")" && pwd -P ) + +CLASSPATH="$APP_HOME/gradle/wrapper/gradle-wrapper.jar" + +# Determine the Java command to use to start the JVM. +if [ -n "$JAVA_HOME" ] ; then + JAVACMD="$JAVA_HOME/bin/java" +else + JAVACMD="java" +fi + +# Execute Gradle +exec "$JAVACMD" -Xmx64m -Xms64m -classpath "$CLASSPATH" org.gradle.wrapper.GradleWrapperMain "$@" diff --git a/android/proguard-rules.pro b/android/proguard-rules.pro new file mode 100644 index 0000000..f7874a8 --- /dev/null +++ b/android/proguard-rules.pro @@ -0,0 +1,23 @@ +# Add project specific ProGuard rules here. +# By default, the flags in this file are appended to flags specified +# in android-sdk/tools/proguard/proguard-android.txt + +# GmSSL JNI classes - keep all native methods +-keepclasseswithmembernames class org.gmssl.** { + native ; +} + +# Keep all public classes and methods +-keep public class org.gmssl.** { + public *; +} + +# Keep GmSSLJNI class +-keep class org.gmssl.GmSSLJNI { + *; +} + +# Keep NativeLoader +-keep class org.gmssl.NativeLoader { + *; +} diff --git a/android/settings.gradle b/android/settings.gradle new file mode 100644 index 0000000..869430f --- /dev/null +++ b/android/settings.gradle @@ -0,0 +1,17 @@ +pluginManagement { + repositories { + google() + mavenCentral() + gradlePluginPortal() + } +} + +dependencyResolutionManagement { + repositoriesMode.set(RepositoriesMode.FAIL_ON_PROJECT_REPOS) + repositories { + google() + mavenCentral() + } +} + +rootProject.name = "gmssl-android" diff --git a/android/src/main/AndroidManifest.xml b/android/src/main/AndroidManifest.xml new file mode 100644 index 0000000..5001b58 --- /dev/null +++ b/android/src/main/AndroidManifest.xml @@ -0,0 +1,5 @@ + + + + + diff --git a/android/src/main/java/org/gmssl/GmSSLException.java b/android/src/main/java/org/gmssl/GmSSLException.java new file mode 100644 index 0000000..ec5c793 --- /dev/null +++ b/android/src/main/java/org/gmssl/GmSSLException.java @@ -0,0 +1,24 @@ +/* + * Copyright 2014-2023 The GmSSL Project. All Rights Reserved. + * + * Licensed under the Apache License, Version 2.0 (the License); you may + * not use this file except in compliance with the License. + * + * http://www.apache.org/licenses/LICENSE-2.0 + */ + +package org.gmssl; + +/** + * @author gmssl + */ +public class GmSSLException extends RuntimeException { + + public GmSSLException(String reason) { + super(reason); + } + + public GmSSLException(String reason, Throwable cause) { + super(reason, cause); + } +} diff --git a/android/src/main/java/org/gmssl/GmSSLJNI.java b/android/src/main/java/org/gmssl/GmSSLJNI.java new file mode 100644 index 0000000..4bbc8df --- /dev/null +++ b/android/src/main/java/org/gmssl/GmSSLJNI.java @@ -0,0 +1,373 @@ +/* + * Copyright 2014-2023 The GmSSL Project. All Rights Reserved. + * + * Licensed under the Apache License, Version 2.0 (the License); you may + * not use this file except in compliance with the License. + * + * http://www.apache.org/licenses/LICENSE-2.0 + */ + +package org.gmssl; + +public class GmSSLJNI { + + public final static String GMSSL_JNI_VERSION = "GmSSL JNI 3.1.1"; + + public final static int SM3_DIGEST_SIZE = 32; + public final static int SM3_HMAC_SIZE = 32; + public final static int SM3_HMAC_MIN_KEY_SIZE = 16; + public final static int SM3_PBKDF2_MIN_ITER = 10000; // from + public final static int SM3_PBKDF2_MAX_ITER = 16777216; // 2^24 + public final static int SM3_PBKDF2_MAX_SALT_SIZE = 64; // from + public final static int SM3_PBKDF2_DEFAULT_SALT_SIZE = 8; // from + public final static int SM3_PBKDF2_MAX_KEY_SIZE = 256; // from gmssljni.c:sm3_pbkdf2():sizeof(keybuf) + public final static int SM4_KEY_SIZE = 16; + public final static int SM4_BLOCK_SIZE = 16; + public final static int SM4_CBC_IV_SIZE = 16; + public final static int SM4_CTR_IV_SIZE = 16; + public final static int SM4_GCM_MIN_IV_SIZE = 1; + public final static int SM4_GCM_MAX_IV_SIZE = 64; + public final static int SM4_GCM_DEFAULT_IV_SIZE = 12; + public final static int SM4_GCM_MAX_TAG_SIZE = 16; + public final static String SM2_DEFAULT_ID = "1234567812345678"; + public final static int SM2_MAX_PLAINTEXT_SIZE = 255; + public final static int SM9_MAX_PLAINTEXT_SIZE = 255; + public final static int ZUC_KEY_SIZE = 16; + public final static int ZUC_IV_SIZE = 16; + + public final static native int version_num(); + public final static native String version_str(); + public final static native int rand_bytes(byte[] buf, int offset, long nbytes); + public final static native long sm3_ctx_new(); + public final static native void sm3_ctx_free(long sm3_ctx); + public final static native int sm3_init(long sm3_ctx); + public final static native int sm3_update(long sm3_ctx, byte[] data, int offset, int datalen); + public final static native int sm3_finish(long sm3_ctx, byte[] dgst); + public final static native long sm3_hmac_ctx_new(); + public final static native void sm3_hmac_ctx_free(long sm3_hmac_ctx); + public final static native int sm3_hmac_init(long sm3_hmac_ctx, byte[] key); + public final static native int sm3_hmac_update(long sm3_hmac_ctx, byte[] data, int offset, int datalen); + public final static native int sm3_hmac_finish(long sm3_hmac_ctx, byte[] hmac); + public final static native byte[] sm3_pbkdf2(String pass, byte[] salt, int iter, int keylen); + public final static native long sm4_key_new(); + public final static native void sm4_key_free(long sm4_key); + public final static native int sm4_set_encrypt_key(long sm4_key, byte[] key); + public final static native int sm4_set_decrypt_key(long sm4_key, byte[] key); + public final static native int sm4_encrypt(long sm4_key, byte[] in, int in_offset, byte[] out, int out_offset); + public final static native long sm4_cbc_ctx_new(); + public final static native void sm4_cbc_ctx_free(long sm4_cbc_ctx); + public final static native int sm4_cbc_encrypt_init(long sm4_cbc_ctx, byte[] key, byte[] iv); + public final static native int sm4_cbc_encrypt_update(long sm4_cbc_ctx, byte[] in, int in_offset, int inlen, byte[] out, int out_offset); + public final static native int sm4_cbc_encrypt_finish(long sm4_cbc_ctx, byte[] out, int out_offset); + public final static native int sm4_cbc_decrypt_init(long sm4_cbc_ctx, byte[] key, byte[] iv); + public final static native int sm4_cbc_decrypt_update(long sm4_cbc_ctx, byte[] in, int in_offset, int inlen, byte[] out, int out_offset); + public final static native int sm4_cbc_decrypt_finish(long sm4_cbc_ctx, byte[] out, int out_offset); + public final static native long sm4_ctr_ctx_new(); + public final static native void sm4_ctr_ctx_free(long sm4_ctr_ctx); + public final static native int sm4_ctr_encrypt_init(long sm4_ctr_ctx, byte[] key, byte[] iv); + public final static native int sm4_ctr_encrypt_update(long sm4_ctr_ctx, byte[] in, int in_offset, int inlen, byte[] out, int out_offset); + public final static native int sm4_ctr_encrypt_finish(long sm4_ctr_ctx, byte[] out, int out_offset); + public final static native int sm4_ctr_decrypt_init(long sm4_ctr_ctx, byte[] key, byte[] iv); + public final static native int sm4_ctr_decrypt_update(long sm4_ctr_ctx, byte[] in, int in_offset, int inlen, byte[] out, int out_offset); + public final static native int sm4_ctr_decrypt_finish(long sm4_ctr_ctx, byte[] out, int out_offset); + public final static native long sm4_gcm_ctx_new(); + public final static native void sm4_gcm_ctx_free(long sm4_gcm_ctx); + public final static native int sm4_gcm_encrypt_init(long sm4_gcm_ctx, byte[] key, byte[] iv, byte[] aad, int taglen); + public final static native int sm4_gcm_encrypt_update(long sm4_gcm_ctx, byte[] in, int in_offset, int inlen, byte[] out, int out_offset); + public final static native int sm4_gcm_encrypt_finish(long sm4_gcm_ctx, byte[] out, int out_offset); + public final static native int sm4_gcm_decrypt_init(long sm4_gcm_ctx, byte[] key, byte[] iv, byte[] aad, int taglen); + public final static native int sm4_gcm_decrypt_update(long sm4_gcm_ctx, byte[] in, int in_offset, int inlen, byte[] out, int out_offset); + public final static native int sm4_gcm_decrypt_finish(long sm4_gcm_ctx, byte[] out, int out_offset); + public final static native long zuc_ctx_new(); + public final static native void zuc_ctx_free(long zuc_ctx); + public final static native int zuc_encrypt_init(long zuc_ctx, byte[] key, byte[] iv); + public final static native int zuc_encrypt_update(long zuc_ctx, byte[] in, int in_offset, int inlen, byte[] out, int out_offset); + public final static native int zuc_encrypt_finish(long zuc_ctx, byte[] out, int out_offset); + public final static native long sm2_key_generate(); + public final static native void sm2_key_free(long sm2_key); + + public final static native byte[] sm2_private_key_info_to_der(long sm2_key); + public final static native long sm2_private_key_info_from_der(byte[] der); + public final static native byte[] sm2_public_key_info_to_der(long sm2_key); + public final static native long sm2_public_key_info_from_der(byte[] der); + + public final static native int sm2_private_key_info_encrypt_to_pem(long sm2_key, String pass, String file); + public final static native long sm2_private_key_info_decrypt_from_pem(String pass, String file); + public final static native int sm2_public_key_info_to_pem(long sm2_key, String file); + public final static native long sm2_public_key_info_from_pem(String file); + public final static native int sm2_compute_z(long sm2_key, String id, byte[] z); + public final static native byte[] sm2_sign(long sm2_key, byte[] dgst); + public final static native int sm2_verify(long sm2_key, byte[] dgst, byte[] sig); + public final static native byte[] sm2_encrypt(long sm2_key, byte[] in); + public final static native byte[] sm2_decrypt(long sm2_key, byte[] in); + public final static native long sm2_sign_ctx_new(); + public final static native void sm2_sign_ctx_free(long sm2_sign_ctx); + public final static native int sm2_sign_init(long sm2_sign_ctx, long sm2_key, String id); + public final static native int sm2_sign_update(long sm2_sign_ctx, byte[] data, int offset, int length); + public final static native byte[] sm2_sign_finish(long sm2_sign_ctx); + public final static native int sm2_verify_init(long sm2_sign_ctx, long sm2_key, String id); + public final static native int sm2_verify_update(long sm2_sign_ctx, byte[] data, int offset, int length); + public final static native int sm2_verify_finish(long sm2_sign_ctx, byte[] sig); + public final static native long sm9_sign_master_key_generate(); + public final static native void sm9_sign_master_key_free(long sm9_sign_master_key); + public final static native int sm9_sign_master_key_info_encrypt_to_pem(long sm9_sign_master_key, String pass, String file); + public final static native long sm9_sign_master_key_info_decrypt_from_pem(String pass, String file); + public final static native int sm9_sign_master_public_key_to_pem(long sm9_sign_master_pub, String file); + public final static native long sm9_sign_master_public_key_from_pem(String file); + public final static native long sm9_sign_master_key_extract_key(long sm9_sign_master_key, String id); + public final static native void sm9_sign_key_free(long sm9_sign_key); + public final static native int sm9_sign_key_info_encrypt_to_pem(long sm9_sign_key, String pass, String file); + public final static native long sm9_sign_key_info_decrypt_from_pem(String pass, String file); + public final static native long sm9_sign_ctx_new(); + public final static native void sm9_sign_ctx_free(long sm9_sign_ctx); + public final static native int sm9_sign_init(long sm9_sign_ctx); + public final static native int sm9_sign_update(long sm9_sign_ctx, byte[] data, int offset, int length); + public final static native byte[] sm9_sign_finish(long sm9_sign_ctx, long sm9_sign_key); + public final static native int sm9_verify_init(long sm9_sign_ctx); + public final static native int sm9_verify_update(long sm9_sign_ctx, byte[] data, int offset, int length); + public final static native int sm9_verify_finish(long sm9_sign_ctx, byte[] sig, long sm9_sign_master_pub, String id); + public final static native long sm9_enc_master_key_generate(); + public final static native void sm9_enc_master_key_free(long sm9_enc_master_key); + public final static native int sm9_enc_master_key_info_encrypt_to_pem(long sm9_enc_master_key, String pass, String file); + public final static native long sm9_enc_master_key_info_decrypt_from_pem(String pass, String file); + public final static native int sm9_enc_master_public_key_to_pem(long sm9_enc_master_pub, String file); + public final static native long sm9_enc_master_public_key_from_pem(String file); + public final static native long sm9_enc_master_key_extract_key(long sm9_enc_master_key, String id); + public final static native void sm9_enc_key_free(long sm9_sign_key); + public final static native int sm9_enc_key_info_encrypt_to_pem(long sm9_enc_key, String pass, String file); + public final static native long sm9_enc_key_info_decrypt_from_pem(String pass, String file); + public final static native byte[] sm9_encrypt(long sm9_enc_master_pub, String id, byte[] in); + public final static native byte[] sm9_decrypt(long sm9_enc_key, String id, byte[] in); + + public final static native byte[] cert_from_pem(String file); + public final static native int cert_to_pem(byte[] cert, String file); + public final static native byte[] cert_get_serial_number(byte[] cert); + public final static native String[] cert_get_issuer(byte[] cert); + public final static native String[] cert_get_subject(byte[] cert); + public final static native long cert_get_not_before(byte[] cert); + public final static native long cert_get_not_after(byte[] cert); + public final static native long cert_get_subject_public_key(byte[] cert); + public final static native int cert_verify_by_ca_cert(byte[] cert, byte[] cacert, String ca_sm2_id); + + // Certificate Request (CSR) functions + public final static native byte[] x509_req_new( + String country, String state, String locality, + String org, String orgUnit, String commonName, + long sm2Key, String signerId); + public final static native int x509_req_to_pem(byte[] req, String file); + public final static native byte[] x509_req_from_pem(String file); + public final static native String[] x509_req_get_subject(byte[] req); + public final static native long x509_req_get_subject_public_key(byte[] req); + public final static native int x509_req_verify(byte[] req, String signerId); + + public static void print_bytes(String label, byte[] data) { + int i; + System.out.printf("%s: ", label); + for (i = 0; i < data.length; i++) { + System.out.printf("%02x", data[i]); + } + System.out.print("\n"); + } + + public static void print_bytes_ex(String label, byte[] data, int offset, int len) { + int i; + System.out.printf("%s: ", label); + for (i = 0; i < len; i++) { + System.out.printf("%02x", data[offset + i]); + } + System.out.print("\n"); + } + + public static void main(String[] args) { + int i; + final GmSSLJNI gmssl = new GmSSLJNI(); + + System.out.println(gmssl.version_num()); + System.out.println(gmssl.version_str()); + + byte[] key = new byte[SM4_KEY_SIZE]; + rand_bytes(key, 0, gmssl.SM4_KEY_SIZE); + + print_bytes("rand_bytes(16)", key); + + long sm3_ctx = sm3_ctx_new(); + byte[] dgst = new byte[SM3_DIGEST_SIZE]; + sm3_init(sm3_ctx); + sm3_update(sm3_ctx, "abc".getBytes(), 0, 3); + sm3_finish(sm3_ctx, dgst); + print_bytes("sm3('abc')", dgst); + + long sm3_hmac_ctx = sm3_hmac_ctx_new(); + byte[] hmac = new byte[SM3_HMAC_SIZE]; + sm3_hmac_init(sm3_hmac_ctx, key); + sm3_hmac_update(sm3_hmac_ctx, "abc".getBytes(), 0, 3); + sm3_hmac_finish(sm3_hmac_ctx, hmac); + print_bytes("sm3_hmac('abc')", hmac); + + String password = "P@ssw0rd"; + byte[] salt = new byte[SM3_PBKDF2_MAX_SALT_SIZE]; + rand_bytes(salt, 0, salt.length); + byte[] derived_key = sm3_pbkdf2(password, salt, SM3_PBKDF2_MIN_ITER, 16); + print_bytes("sm2_pbkdf2", derived_key); + + long sm4_key = sm4_key_new(); + sm4_set_encrypt_key(sm4_key, key); + byte[] block = new byte[SM4_BLOCK_SIZE]; + rand_bytes(block, 0, block.length); + print_bytes("sm4 plain", block); + byte[] out_block = new byte[SM4_BLOCK_SIZE]; + sm4_encrypt(sm4_key, block, 0, out_block, 0); + sm4_set_decrypt_key(sm4_key, key); + byte[] plain_block = new byte[SM4_BLOCK_SIZE]; + sm4_encrypt(sm4_key, out_block, 0, plain_block, 0); + print_bytes("sm4 decrypt", plain_block); + + byte[] iv = new byte[SM4_BLOCK_SIZE]; + byte[] buf = new byte[100]; + byte[] plain = new byte[100]; + int outlen; + int left; + int cipherlen; + int plainlen; + + long sm4_cbc_ctx = sm4_cbc_ctx_new(); + sm4_cbc_encrypt_init(sm4_cbc_ctx, key, iv); + outlen = sm4_cbc_encrypt_update(sm4_cbc_ctx, "abc".getBytes(), 0, 3, buf, 0); + left = sm4_cbc_encrypt_finish(sm4_cbc_ctx, buf, outlen); + cipherlen = outlen + left; + print_bytes_ex("ciphertext", buf, 0, cipherlen); + sm4_cbc_decrypt_init(sm4_cbc_ctx, key, iv); + outlen = sm4_cbc_decrypt_update(sm4_cbc_ctx, buf, 0, cipherlen, plain, 0); + left = sm4_cbc_decrypt_finish(sm4_cbc_ctx, plain, outlen); + plainlen = outlen + left; + print_bytes_ex("plaintext", plain, 0, plainlen); + + long sm4_ctr_ctx = sm4_ctr_ctx_new(); + sm4_ctr_encrypt_init(sm4_ctr_ctx, key, iv); + outlen = sm4_ctr_encrypt_update(sm4_ctr_ctx, "abc".getBytes(), 0, 3, buf, 0); + left = sm4_ctr_encrypt_finish(sm4_ctr_ctx, buf, outlen); + cipherlen = outlen + left; + print_bytes_ex("ciphertext", buf, 0, cipherlen); + sm4_ctr_decrypt_init(sm4_ctr_ctx, key, iv); + outlen = sm4_ctr_decrypt_update(sm4_ctr_ctx, buf, 0, cipherlen, plain, 0); + left = sm4_ctr_decrypt_finish(sm4_ctr_ctx, plain, outlen); + plainlen = outlen + left; + print_bytes_ex("plaintext", plain, 0, plainlen); + + + long sm4_gcm_ctx = sm4_gcm_ctx_new(); + byte[] aad = "aad".getBytes(); + sm4_gcm_encrypt_init(sm4_gcm_ctx, key, iv, aad, SM4_GCM_MAX_TAG_SIZE); + outlen = sm4_gcm_encrypt_update(sm4_gcm_ctx, "abc".getBytes(), 0, 3, buf, 0); + left = sm4_gcm_encrypt_finish(sm4_gcm_ctx, buf, outlen); + cipherlen = outlen + left; + print_bytes_ex("gcm ciphertext", buf, 0, cipherlen); + sm4_gcm_decrypt_init(sm4_gcm_ctx, key, iv, aad, SM4_GCM_MAX_TAG_SIZE); + outlen = sm4_gcm_decrypt_update(sm4_gcm_ctx, buf, 0, cipherlen, plain, 0); + left = sm4_gcm_decrypt_finish(sm4_gcm_ctx, plain, outlen); + plainlen = outlen + left; + print_bytes_ex("gcm plaintext", plain, 0, plainlen); + + + + + long sm2_key; + long sm2_pub; + String pass = "123456"; + byte[] z = new byte[32]; + byte[] sig; + int verify_ret; + + sm2_key = sm2_key_generate(); + sm2_private_key_info_encrypt_to_pem(sm2_key, pass, "sm2.pem"); + sm2_key = sm2_private_key_info_decrypt_from_pem(pass, "sm2.pem"); + sm2_public_key_info_to_pem(sm2_key, "sm2pub.pem"); + sm2_pub = sm2_public_key_info_from_pem("sm2pub.pem"); + + sm2_compute_z(sm2_pub, SM2_DEFAULT_ID, z); + print_bytes("z", z); + + sig = sm2_sign(sm2_key, dgst); + verify_ret = sm2_verify(sm2_pub, dgst, sig); + System.out.println(verify_ret); + + long sm2_sign_ctx = sm2_sign_ctx_new(); + + sm2_sign_init(sm2_sign_ctx, sm2_key, SM2_DEFAULT_ID); + sm2_sign_update(sm2_sign_ctx, "abc".getBytes(), 0, 3); + sig = sm2_sign_finish(sm2_sign_ctx); + + sm2_verify_init(sm2_sign_ctx, sm2_pub, SM2_DEFAULT_ID); + sm2_verify_update(sm2_sign_ctx, "abc".getBytes(), 0, 3); + verify_ret = sm2_verify_finish(sm2_sign_ctx, sig); + System.out.println(verify_ret); + + byte[] sm2_cipher = sm2_encrypt(sm2_pub, "abc".getBytes()); + byte[] sm2_plain = sm2_decrypt(sm2_key, sm2_cipher); + print_bytes("sm2_plain", sm2_plain); + + + long sm9_master; + long sm9_master_pub; + long sm9_key; + long sm9_ctx; + byte[] sm9_sig; + + sm9_master = sm9_sign_master_key_generate(); + sm9_sign_master_key_info_encrypt_to_pem(sm9_master, "1234", "sm9.pem"); + sm9_master = sm9_sign_master_key_info_decrypt_from_pem("1234", "sm9.pem"); + sm9_sign_master_public_key_to_pem(sm9_master, "sm9pub.pem"); + sm9_master_pub = sm9_sign_master_public_key_from_pem("sm9pub.pem"); + sm9_key = sm9_sign_master_key_extract_key(sm9_master, "Alice"); + sm9_sign_key_info_encrypt_to_pem(sm9_key, "1234", "sm9key.pem"); + sm9_key = sm9_sign_key_info_decrypt_from_pem("1234", "sm9key.pem"); + sm9_ctx = sm9_sign_ctx_new(); + sm9_sign_init(sm9_ctx); + sm9_sign_update(sm9_ctx, "abc".getBytes(), 0, 3); + sm9_sig = sm9_sign_finish(sm9_ctx, sm9_key); + + sm9_verify_init(sm9_ctx); + sm9_verify_update(sm9_ctx, "abc".getBytes(), 0, 3); + verify_ret = sm9_verify_finish(sm9_ctx, sm9_sig, sm9_master_pub, "Alice"); + System.out.println(verify_ret); + + sm9_master = sm9_enc_master_key_generate(); + sm9_enc_master_key_info_encrypt_to_pem(sm9_master, "1234", "sm9.pem"); + sm9_master = sm9_enc_master_key_info_decrypt_from_pem("1234", "sm9.pem"); + sm9_enc_master_public_key_to_pem(sm9_master, "sm9pub.pem"); + sm9_master_pub = sm9_enc_master_public_key_from_pem("sm9pub.pem"); + sm9_key = sm9_enc_master_key_extract_key(sm9_master, "Alice"); + sm9_enc_key_info_encrypt_to_pem(sm9_key, "1234", "sm9key.pem"); + sm9_key = sm9_enc_key_info_decrypt_from_pem("1234", "sm9key.pem"); + + byte[] sm9_cipher = sm9_encrypt(sm9_master_pub, "Alice", "abc".getBytes()); + byte[] sm9_plain = sm9_decrypt(sm9_key, "Alice", sm9_cipher); + + print_bytes("sm9_plain", sm9_plain); + + byte[] cert = cert_from_pem("ROOTCA.pem"); + cert_to_pem(cert, "cert.pem"); + byte[] serial = cert_get_serial_number(cert); + print_bytes("serialNumber", serial); + String[] subject = cert_get_subject(cert); + for (i = 0; i < subject.length; i++) { + System.out.println(" "+subject[i]); + } + String[] issuer = cert_get_subject(cert); + for (i = 0; i < issuer.length; i++) { + System.out.println(" "+issuer[i]); + } + long not_before = cert_get_not_before(cert); + long not_after = cert_get_not_after(cert); + System.out.println(not_before); + System.out.println("not_before " + new java.util.Date(not_before * 1000)); + System.out.println("not_after " + new java.util.Date(not_after * 1000)); + sm2_pub = cert_get_subject_public_key(cert); + int cert_verify = cert_verify_by_ca_cert(cert, cert, SM2_DEFAULT_ID); + System.out.println("verify result " + cert_verify); + } + + static { + NativeLoader.load(NativeLoader.GMSSLJNILIB_NAME); + } +} diff --git a/android/src/main/java/org/gmssl/NativeLoader.java b/android/src/main/java/org/gmssl/NativeLoader.java new file mode 100644 index 0000000..7d5e614 --- /dev/null +++ b/android/src/main/java/org/gmssl/NativeLoader.java @@ -0,0 +1,203 @@ +/* + * Copyright 2014-2023 The GmSSL Project. All Rights Reserved. + * + * Licensed under the Apache License, Version 2.0 (the License); you may + * not use this file except in compliance with the License. + * + * http://www.apache.org/licenses/LICENSE-2.0 + */ +package org.gmssl; + +import java.io.*; +import java.util.Properties; + +/** + * @author yongfei.li + * @email 290836576@qq.com + * @date 2023/09/07 + * @description Native lib load util (Android version) + */ +public class NativeLoader { + + /* custom jni library prefix path relative to project resources */ + private static final String RESOURCELIB_PREFIXPATH = "lib"; + + static final String GMSSLJNILIB_NAME = "gmssljni"; + + private static final Properties PROPERTIES = new Properties(); + + private static boolean isLoaded = false; + + static { + // Load config properties if available (not required for Android) + try (InputStream input = NativeLoader.class.getClassLoader().getResourceAsStream("config.properties")) { + if (input != null) { + PROPERTIES.load(input); + } + } catch (IOException e) { + // Config file is optional for Android + } + } + + /** + * Check if running on Android platform. + * @return true if running on Android + */ + public static boolean isAndroid() { + String vmName = System.getProperty("java.vm.name"); + String vmVendor = System.getProperty("java.vm.vendor"); + + // Check for Dalvik (older Android) or ART (newer Android) + if (vmName != null) { + String vmNameLower = vmName.toLowerCase(); + if (vmNameLower.contains("dalvik") || vmNameLower.contains("art")) { + return true; + } + } + + // Check vendor + if (vmVendor != null && vmVendor.toLowerCase().contains("android")) { + return true; + } + + // Check for Android-specific system property + try { + Class.forName("android.os.Build"); + return true; + } catch (ClassNotFoundException e) { + // Not Android + } + + return false; + } + + /** + * Load JNI library. + * On Android: uses System.loadLibrary() to load from APK's lib directory. + * On Desktop: loads from JAR resources. + * + * @param library library name (without prefix and suffix) + */ + public synchronized static void load(String library) { + if (isLoaded) { + return; + } + + if (isAndroid()) { + loadAndroid(library); + } else { + loadDesktop(library); + } + + isLoaded = true; + } + + /** + * Load library on Android platform. + * Uses System.loadLibrary() which loads from APK's lib/[ABI]/ directory. + */ + private static void loadAndroid(String library) { + try { + // Remove "lib" prefix if present (Android doesn't need it) + String libName = library; + if (libName.startsWith("lib")) { + libName = libName.substring(3); + } + System.loadLibrary(libName); + } catch (UnsatisfiedLinkError e) { + throw new GmSSLException("Failed to load native library on Android: " + library, e); + } + } + + /** + * Load library on Desktop platform. + * Extracts library from JAR resources to temp file and loads it. + */ + private static void loadDesktop(String library) { + String resourceLibPath = RESOURCELIB_PREFIXPATH + "/" + library + "." + libExtension(); + + try (InputStream inputStream = NativeLoader.class.getClassLoader().getResourceAsStream(resourceLibPath)) { + if (inputStream == null) { + throw new GmSSLException("lib file not found in JAR: " + resourceLibPath); + } + + // Create temp file + File tempFile = File.createTempFile(library, "." + libExtension()); + tempFile.deleteOnExit(); + + // Copy library to temp file + try (FileOutputStream outputStream = new FileOutputStream(tempFile)) { + byte[] buffer = new byte[8192]; + int bytesRead; + while ((bytesRead = inputStream.read(buffer)) != -1) { + outputStream.write(buffer, 0, bytesRead); + } + } + + // Load referenced library on macOS + checkReferencedLib(); + + // Load the library + System.load(tempFile.getAbsolutePath()); + + } catch (IOException e) { + throw new GmSSLException("Unable to load lib from JAR: " + e.getMessage()); + } + } + + /** + * Get the operating system type. + * @return operating system name + */ + static String osType() { + if (isAndroid()) { + return "android"; + } + + String osName = System.getProperty("os.name").toLowerCase(); + if (osName.startsWith("windows")) { + return "win"; + } + if (osName.startsWith("linux")) { + return "linux"; + } + if (osName.startsWith("mac os x") || osName.startsWith("darwin")) { + return "osx"; + } + return "unknown"; + } + + /** + * Get the library extension name based on the operating system type. + * @return extension name + */ + static String libExtension() { + String osType = osType(); + switch (osType) { + case "win": + return "dll"; + case "osx": + return "dylib"; + case "linux": + case "android": + default: + return "so"; + } + } + + /** + * In macOS systems, the execution of library calls relies on loading gmssl.3.dylib. + * This is not needed for Android as the library is statically linked. + */ + private static void checkReferencedLib() { + if ("osx".equals(osType())) { + String macReferencedLib = PROPERTIES.getProperty("macReferencedLib"); + if (macReferencedLib != null && !macReferencedLib.isEmpty()) { + File libFile = new File(macReferencedLib); + if (libFile.exists()) { + System.load(macReferencedLib); + } + } + } + } +} diff --git a/android/src/main/java/org/gmssl/Random.java b/android/src/main/java/org/gmssl/Random.java new file mode 100644 index 0000000..d3a0112 --- /dev/null +++ b/android/src/main/java/org/gmssl/Random.java @@ -0,0 +1,37 @@ +/* + * Copyright 2014-2023 The GmSSL Project. All Rights Reserved. + * + * Licensed under the Apache License, Version 2.0 (the License); you may + * not use this file except in compliance with the License. + * + * http://www.apache.org/licenses/LICENSE-2.0 + */ + +package org.gmssl; + +public class Random { + + public Random() { + } + + public byte[] randBytes(int len) { + byte[] out = new byte[len]; + if (GmSSLJNI.rand_bytes(out, 0, len) != 1) { + throw new GmSSLException(""); + } + return out; + } + + public void randBytes(byte[] out, int offset, int len) { + if (out == null + || offset < 0 + || len < 0 + || offset + len <= 0 + || out.length < offset + len) { + throw new GmSSLException(""); + } + if (GmSSLJNI.rand_bytes(out, offset, len) != 1) { + throw new GmSSLException(""); + } + } +} diff --git a/android/src/main/java/org/gmssl/Sm2Certificate.java b/android/src/main/java/org/gmssl/Sm2Certificate.java new file mode 100644 index 0000000..64d3a55 --- /dev/null +++ b/android/src/main/java/org/gmssl/Sm2Certificate.java @@ -0,0 +1,112 @@ +/* + * Copyright 2014-2023 The GmSSL Project. All Rights Reserved. + * + * Licensed under the Apache License, Version 2.0 (the License); you may + * not use this file except in compliance with the License. + * + * http://www.apache.org/licenses/LICENSE-2.0 + */ + +package org.gmssl; + +public class Sm2Certificate { + + private byte[] cert = null; + + public Sm2Certificate() { + this.cert = null; + } + + public byte[] getBytes() { + if (this.cert == null) { + throw new GmSSLException(""); + } + return this.cert; + } + + public void importPem(String file) { + if ((this.cert = GmSSLJNI.cert_from_pem(file)) == null) { + throw new GmSSLException(""); + } + } + + public void exportPem(String file) { + if (this.cert == null) { + throw new GmSSLException(""); + } + if (GmSSLJNI.cert_to_pem(this.cert, file) != 1) { + throw new GmSSLException(""); + } + } + + public byte[] getSerialNumber() { + if (this.cert == null) { + throw new GmSSLException(""); + } + byte[] serial; + if ((serial = GmSSLJNI.cert_get_serial_number(this.cert)) == null) { + throw new GmSSLException(""); + } + return serial; + } + + public String[] getIssuer() { + if (this.cert == null) { + throw new GmSSLException(""); + } + String[] issuer; + if ((issuer = GmSSLJNI.cert_get_issuer(this.cert)) == null) { + throw new GmSSLException(""); + } + return issuer; + } + + public String[] getSubject() { + if (this.cert == null) { + throw new GmSSLException(""); + } + String[] subject; + if ((subject = GmSSLJNI.cert_get_subject(this.cert)) == null) { + throw new GmSSLException(""); + } + return subject; + } + + public java.util.Date getNotBefore() { + if (this.cert == null) { + throw new GmSSLException(""); + } + return new java.util.Date(GmSSLJNI.cert_get_not_before(this.cert)); + } + + public java.util.Date getNotAfter() { + if (this.cert == null) { + throw new GmSSLException(""); + } + return new java.util.Date(GmSSLJNI.cert_get_not_after(this.cert)); + } + + public Sm2Key getSubjectPublicKey() { + if (this.cert == null) { + throw new GmSSLException(""); + } + long pub_key; + if ((pub_key = GmSSLJNI.cert_get_subject_public_key(this.cert)) == 0) { + throw new GmSSLException(""); + } + boolean has_private_key = false; + return new Sm2Key(pub_key, has_private_key); + } + + public boolean verifyByCaCertificate(Sm2Certificate caCert, String sm2Id) { + if (this.cert == null) { + throw new GmSSLException(""); + } + int ret = GmSSLJNI.cert_verify_by_ca_cert(this.cert, caCert.getBytes(), sm2Id); + if (ret == 1) { + return true; + } else { + return false; + } + } +} diff --git a/android/src/main/java/org/gmssl/Sm2CertificateRequest.java b/android/src/main/java/org/gmssl/Sm2CertificateRequest.java new file mode 100644 index 0000000..190bc2c --- /dev/null +++ b/android/src/main/java/org/gmssl/Sm2CertificateRequest.java @@ -0,0 +1,264 @@ +/* + * Copyright 2014-2023 The GmSSL Project. All Rights Reserved. + * + * Licensed under the Apache License, Version 2.0 (the License); you may + * not use this file except in compliance with the License. + * + * http://www.apache.org/licenses/LICENSE-2.0 + */ + +package org.gmssl; + +/** + * SM2 Certificate Request (CSR) class. + * + * This class provides functionality to generate and manage X.509 Certificate + * Signing Requests (CSR) using SM2 algorithm, equivalent to the `gmssl reqgen` command. + * + * Example usage: + *
+ * // Generate a new key pair
+ * Sm2Key key = new Sm2Key();
+ * key.generateKey();
+ * 
+ * // Create a certificate request
+ * Sm2CertificateRequest csr = new Sm2CertificateRequest();
+ * csr.setSubject("CN", "Beijing", "Beijing", "MyOrg", "MyUnit", "www.example.com");
+ * byte[] reqData = csr.generate(key);
+ * 
+ * // Export to PEM file
+ * csr.toPem("request.pem");
+ * 
+ */ +public class Sm2CertificateRequest { + + public static final String DEFAULT_ID = GmSSLJNI.SM2_DEFAULT_ID; + + private byte[] req = null; + + // Subject fields + private String country = null; + private String state = null; + private String locality = null; + private String organization = null; + private String organizationalUnit = null; + private String commonName = null; + + public Sm2CertificateRequest() { + } + + /** + * Set the subject distinguished name fields. + * + * @param country Country code (C), e.g., "CN" + * @param state State or province name (ST), e.g., "Beijing" + * @param locality Locality name (L), e.g., "Beijing" + * @param organization Organization name (O), e.g., "MyCompany" + * @param organizationalUnit Organizational unit name (OU), e.g., "IT Department" + * @param commonName Common name (CN), e.g., "www.example.com" - REQUIRED + */ + public void setSubject(String country, String state, String locality, + String organization, String organizationalUnit, String commonName) { + if (commonName == null || commonName.isEmpty()) { + throw new GmSSLException("Common name (CN) is required"); + } + this.country = country; + this.state = state; + this.locality = locality; + this.organization = organization; + this.organizationalUnit = organizationalUnit; + this.commonName = commonName; + } + + /** + * Set only the common name (CN) for simple use cases. + * + * @param commonName Common name (CN), e.g., "www.example.com" + */ + public void setCommonName(String commonName) { + if (commonName == null || commonName.isEmpty()) { + throw new GmSSLException("Common name (CN) is required"); + } + this.commonName = commonName; + } + + /** + * Generate a certificate request using the provided SM2 key pair. + * Uses the default SM2 signer ID. + * + * @param key SM2 key pair (must contain private key) + * @return The DER-encoded certificate request + */ + public byte[] generate(Sm2Key key) { + return generate(key, DEFAULT_ID); + } + + /** + * Generate a certificate request using the provided SM2 key pair and signer ID. + * + * @param key SM2 key pair (must contain private key) + * @param signerId SM2 signer ID for signature + * @return The DER-encoded certificate request + */ + public byte[] generate(Sm2Key key, String signerId) { + if (this.commonName == null) { + throw new GmSSLException("Common name (CN) must be set before generating CSR"); + } + if (key == null) { + throw new GmSSLException("SM2 key is required"); + } + + long sm2Key = key.getPrivateKey(); + this.req = GmSSLJNI.x509_req_new( + this.country, this.state, this.locality, + this.organization, this.organizationalUnit, this.commonName, + sm2Key, signerId); + + if (this.req == null) { + throw new GmSSLException("Failed to generate certificate request"); + } + return this.req; + } + + /** + * Get the DER-encoded certificate request data. + * + * @return The DER-encoded certificate request, or null if not generated + */ + public byte[] getRequest() { + return this.req; + } + + /** + * Export the certificate request to a PEM file. + * + * @param file Path to the output PEM file + */ + public void toPem(String file) { + if (this.req == null) { + throw new GmSSLException("No certificate request to export"); + } + if (file == null || file.isEmpty()) { + throw new GmSSLException("File path is required"); + } + if (GmSSLJNI.x509_req_to_pem(this.req, file) != 1) { + throw new GmSSLException("Failed to export certificate request to PEM"); + } + } + + /** + * Import a certificate request from a PEM file. + * + * @param file Path to the PEM file + */ + public void fromPem(String file) { + if (file == null || file.isEmpty()) { + throw new GmSSLException("File path is required"); + } + this.req = GmSSLJNI.x509_req_from_pem(file); + if (this.req == null) { + throw new GmSSLException("Failed to import certificate request from PEM"); + } + } + + /** + * Get the subject distinguished name from the certificate request. + * + * @return Array of subject name components (e.g., ["C:CN", "ST:Beijing", "CN:www.example.com"]) + */ + public String[] getSubject() { + if (this.req == null) { + throw new GmSSLException("No certificate request loaded"); + } + String[] subject = GmSSLJNI.x509_req_get_subject(this.req); + if (subject == null) { + throw new GmSSLException("Failed to get subject from certificate request"); + } + return subject; + } + + /** + * Get the subject public key from the certificate request. + * + * @return SM2 public key + */ + public Sm2Key getSubjectPublicKey() { + if (this.req == null) { + throw new GmSSLException("No certificate request loaded"); + } + long sm2Pub = GmSSLJNI.x509_req_get_subject_public_key(this.req); + if (sm2Pub == 0) { + throw new GmSSLException("Failed to get subject public key from certificate request"); + } + return new Sm2Key(sm2Pub, false); + } + + /** + * Verify the signature of the certificate request. + * Uses the default SM2 signer ID. + * + * @return true if verification succeeds, false otherwise + */ + public boolean verify() { + return verify(DEFAULT_ID); + } + + /** + * Verify the signature of the certificate request with specified signer ID. + * + * @param signerId SM2 signer ID used for verification + * @return true if verification succeeds, false otherwise + */ + public boolean verify(String signerId) { + if (this.req == null) { + throw new GmSSLException("No certificate request loaded"); + } + int ret = GmSSLJNI.x509_req_verify(this.req, signerId); + if (ret < 0) { + throw new GmSSLException("Failed to verify certificate request"); + } + return ret == 1; + } + + /** + * Static method to generate a certificate request directly. + * + * @param country Country code (C) + * @param state State or province name (ST) + * @param locality Locality name (L) + * @param organization Organization name (O) + * @param organizationalUnit Organizational unit name (OU) + * @param commonName Common name (CN) - REQUIRED + * @param key SM2 key pair + * @param signerId SM2 signer ID + * @return The DER-encoded certificate request + */ + public static byte[] generateRequest( + String country, String state, String locality, + String organization, String organizationalUnit, String commonName, + Sm2Key key, String signerId) { + Sm2CertificateRequest csr = new Sm2CertificateRequest(); + csr.setSubject(country, state, locality, organization, organizationalUnit, commonName); + return csr.generate(key, signerId); + } + + /** + * Static method to generate a certificate request with default signer ID. + * + * @param country Country code (C) + * @param state State or province name (ST) + * @param locality Locality name (L) + * @param organization Organization name (O) + * @param organizationalUnit Organizational unit name (OU) + * @param commonName Common name (CN) - REQUIRED + * @param key SM2 key pair + * @return The DER-encoded certificate request + */ + public static byte[] generateRequest( + String country, String state, String locality, + String organization, String organizationalUnit, String commonName, + Sm2Key key) { + return generateRequest(country, state, locality, organization, organizationalUnit, + commonName, key, DEFAULT_ID); + } +} diff --git a/android/src/main/java/org/gmssl/Sm2Key.java b/android/src/main/java/org/gmssl/Sm2Key.java new file mode 100644 index 0000000..08d70fc --- /dev/null +++ b/android/src/main/java/org/gmssl/Sm2Key.java @@ -0,0 +1,233 @@ +/* + * Copyright 2014-2023 The GmSSL Project. All Rights Reserved. + * + * Licensed under the Apache License, Version 2.0 (the License); you may + * not use this file except in compliance with the License. + * + * http://www.apache.org/licenses/LICENSE-2.0 + */ + +package org.gmssl; + + +public class Sm2Key { + + public final static int MAX_PLAINTEXT_SIZE = GmSSLJNI.SM2_MAX_PLAINTEXT_SIZE; + public final static String DEFAULT_ID = GmSSLJNI.SM2_DEFAULT_ID; + + private long sm2_key = 0; + private boolean has_private_key = false; + + public Sm2Key() { + this.sm2_key = 0; + } + + Sm2Key(long sm2_key, boolean has_private_key) { + this.sm2_key = sm2_key; + this.has_private_key = has_private_key; + } + + long getPrivateKey() { + if (this.sm2_key == 0) { + throw new GmSSLException(""); + } + if (this.has_private_key == false) { + throw new GmSSLException(""); + } + return this.sm2_key; + } + + long getPublicKey() { + if (this.sm2_key == 0) { + throw new GmSSLException(""); + } + return this.sm2_key; + } + + public void generateKey() { + if (this.sm2_key != 0) { + GmSSLJNI.sm2_key_free(this.sm2_key); + } + if ((sm2_key = GmSSLJNI.sm2_key_generate()) == 0) { + throw new GmSSLException(""); + } + this.has_private_key = true; + } + + public void importPrivateKeyInfoDer(byte[] der) { + if (der == null) { + throw new GmSSLException(""); + } + if (this.sm2_key != 0) { + GmSSLJNI.sm2_key_free(this.sm2_key); + } + if ((this.sm2_key = GmSSLJNI.sm2_private_key_info_from_der(der)) == 0) { + throw new GmSSLException(""); + } + this.has_private_key = true; + } + + public byte[] exportPrivateKeyInfoDer() { + if (this.sm2_key == 0) { + throw new GmSSLException(""); + } + if (this.has_private_key == false) { + throw new GmSSLException(""); + } + byte[] der; + if ((der = GmSSLJNI.sm2_private_key_info_to_der(this.sm2_key)) == null) { + throw new GmSSLException(""); + } + return der; + } + + public void importPublicKeyInfoDer(byte[] der) { + if (der == null) { + throw new GmSSLException(""); + } + if (this.sm2_key != 0) { + GmSSLJNI.sm2_key_free(this.sm2_key); + } + if ((this.sm2_key = GmSSLJNI.sm2_public_key_info_from_der(der)) == 0) { + throw new GmSSLException(""); + } + this.has_private_key = false; + } + + public byte[] exportPublicKeyInfoDer() { + if (this.sm2_key == 0) { + throw new GmSSLException(""); + } + byte[] der; + if ((der = GmSSLJNI.sm2_public_key_info_to_der(this.sm2_key)) == null) { + throw new GmSSLException(""); + } + return der; + } + + public void importEncryptedPrivateKeyInfoPem(String pass, String file) { + if (this.sm2_key != 0) { + GmSSLJNI.sm2_key_free(this.sm2_key); + } + if ((sm2_key = GmSSLJNI.sm2_private_key_info_decrypt_from_pem(pass, file)) == 0) { + throw new GmSSLException(""); + } + this.has_private_key = true; + } + + public void exportEncryptedPrivateKeyInfoPem(String pass, String file) { + if (this.sm2_key == 0) { + throw new GmSSLException(""); + } + if (this.has_private_key == false) { + throw new GmSSLException(""); + } + if (GmSSLJNI.sm2_private_key_info_encrypt_to_pem(this.sm2_key, pass, file) != 1) { + throw new GmSSLException(""); + } + } + + public void importPublicKeyInfoPem(String file) { + if (this.sm2_key != 0) { + GmSSLJNI.sm2_key_free(this.sm2_key); + } + if ((this.sm2_key = GmSSLJNI.sm2_public_key_info_from_pem(file)) == 0) { + throw new GmSSLException(""); + } + this.has_private_key = false; + } + + public void exportPublicKeyInfoPem(String file) { + if (this.sm2_key == 0) { + throw new GmSSLException(""); + } + if (GmSSLJNI.sm2_public_key_info_to_pem(this.sm2_key, file) != 1) { + throw new GmSSLException(""); + } + } + + public byte[] computeZ(String id) { + if (this.sm2_key == 0) { + throw new GmSSLException(""); + } + byte[] z = new byte[Sm3.DIGEST_SIZE]; + if (GmSSLJNI.sm2_compute_z(this.sm2_key, id, z) != 1) { + throw new GmSSLException(""); + } + return z; + } + + public byte[] sign(byte[] dgst) { + if (this.sm2_key == 0) { + throw new GmSSLException(""); + } + if (this.has_private_key == false) { + throw new GmSSLException(""); + } + + if (dgst == null || dgst.length != Sm3.DIGEST_SIZE) { + throw new GmSSLException(""); + } + + byte[] sig; + if ((sig = GmSSLJNI.sm2_sign(this.sm2_key, dgst)) == null) { + throw new GmSSLException(""); + } + return sig; + } + + public boolean verify(byte[] dgst, byte[] signature) { + if (this.sm2_key == 0) { + throw new GmSSLException(""); + } + if (dgst == null + || dgst.length != Sm3.DIGEST_SIZE + || signature == null) { + throw new GmSSLException(""); + } + + int ret; + if ((ret = GmSSLJNI.sm2_verify(this.sm2_key, dgst, signature)) < 0) { + throw new GmSSLException(""); + } + if (ret > 0) { + return true; + } else { + return false; + } + } + + public byte[] encrypt(byte[] plaintext) { + if (this.sm2_key == 0) { + throw new GmSSLException(""); + } + if (plaintext == null + || plaintext.length > this.MAX_PLAINTEXT_SIZE) { + throw new GmSSLException(""); + } + + byte[] ciphertext; + if ((ciphertext = GmSSLJNI.sm2_encrypt(this.sm2_key, plaintext)) == null) { + throw new GmSSLException(""); + } + return ciphertext; + } + + public byte[] decrypt(byte[] ciphertext) { + if (this.sm2_key == 0) { + throw new GmSSLException(""); + } + if (this.has_private_key == false) { + throw new GmSSLException(""); + } + if (ciphertext == null) { + throw new GmSSLException(""); + } + + byte[] plaintext; + if ((plaintext = GmSSLJNI.sm2_decrypt(this.sm2_key, ciphertext)) == null) { + throw new GmSSLException(""); + } + return plaintext; + } +} diff --git a/android/src/main/java/org/gmssl/Sm2Signature.java b/android/src/main/java/org/gmssl/Sm2Signature.java new file mode 100644 index 0000000..984fef5 --- /dev/null +++ b/android/src/main/java/org/gmssl/Sm2Signature.java @@ -0,0 +1,114 @@ +/* + * Copyright 2014-2023 The GmSSL Project. All Rights Reserved. + * + * Licensed under the Apache License, Version 2.0 (the License); you may + * not use this file except in compliance with the License. + * + * http://www.apache.org/licenses/LICENSE-2.0 + */ + +package org.gmssl; + +public class Sm2Signature { + + public final static String DEFAULT_ID = GmSSLJNI.SM2_DEFAULT_ID; + + private long sm2_sign_ctx = 0; + private boolean inited = false; + private boolean do_sign = true; + + public Sm2Signature(Sm2Key key, String id, boolean do_sign) { + + if ((this.sm2_sign_ctx = GmSSLJNI.sm2_sign_ctx_new()) == 0) { + throw new GmSSLException(""); + } + + if (do_sign == true) { + if (GmSSLJNI.sm2_sign_init(this.sm2_sign_ctx, key.getPrivateKey(), id) != 1) { + throw new GmSSLException(""); + } + } else { + if (GmSSLJNI.sm2_verify_init(sm2_sign_ctx, key.getPublicKey(), id) != 1) { + throw new GmSSLException(""); + } + } + + this.inited = true; + this.do_sign = do_sign; + } + + public void reset(Sm2Key key, String id, boolean do_sign) { + if (do_sign == true) { + if (GmSSLJNI.sm2_sign_init(this.sm2_sign_ctx, key.getPrivateKey(), id) != 1) { + throw new GmSSLException(""); + } + } else { + if (GmSSLJNI.sm2_verify_init(sm2_sign_ctx, key.getPublicKey(), id) != 1) { + throw new GmSSLException(""); + } + } + this.inited = true; + this.do_sign = do_sign; + } + + public void update(byte[] data, int offset, int len) { + + if (this.inited == false) { + throw new GmSSLException(""); + } + + if (data == null + || offset < 0 + || len < 0 + || offset + len <= 0 + || data.length < offset + len) { + throw new GmSSLException(""); + } + + if (this.do_sign == true) { + if (GmSSLJNI.sm2_sign_update(this.sm2_sign_ctx, data, offset, len) != 1) { + throw new GmSSLException(""); + } + } else { + if (GmSSLJNI.sm2_verify_update(this.sm2_sign_ctx, data, offset, len) != 1) { + throw new GmSSLException(""); + } + } + } + + public void update(byte[] data) { + update(data, 0, data.length); + } + + public byte[] sign() { + if (this.inited == false) { + throw new GmSSLException(""); + } + if (this.do_sign == false) { + throw new GmSSLException(""); + } + this.inited = false; + + byte[] sig; + if ((sig = GmSSLJNI.sm2_sign_finish(this.sm2_sign_ctx)) == null) { + throw new GmSSLException(""); + } + return sig; + } + + public boolean verify(byte[] signature) { + if (this.sm2_sign_ctx == 0) { + throw new GmSSLException(""); + } + if (this.do_sign == true) { + throw new GmSSLException(""); + } + this.inited = false; + + int ret; + if ((ret = GmSSLJNI.sm2_verify_finish(sm2_sign_ctx, signature)) != 1) { + return false; + } + return true; + } +} diff --git a/android/src/main/java/org/gmssl/Sm3.java b/android/src/main/java/org/gmssl/Sm3.java new file mode 100644 index 0000000..e9d7eca --- /dev/null +++ b/android/src/main/java/org/gmssl/Sm3.java @@ -0,0 +1,65 @@ +/* + * Copyright 2014-2023 The GmSSL Project. All Rights Reserved. + * + * Licensed under the Apache License, Version 2.0 (the License); you may + * not use this file except in compliance with the License. + * + * http://www.apache.org/licenses/LICENSE-2.0 + */ + +package org.gmssl; + +public class Sm3 implements AutoCloseable{ + + public final static int DIGEST_SIZE = GmSSLJNI.SM3_DIGEST_SIZE; + + private long sm3_ctx = 0; + + public Sm3() { + if ((sm3_ctx = GmSSLJNI.sm3_ctx_new()) == 0) { + throw new GmSSLException(""); + } + if (GmSSLJNI.sm3_init(sm3_ctx) != 1) { + throw new GmSSLException(""); + } + } + + public void reset() { + if (GmSSLJNI.sm3_init(sm3_ctx) != 1) { + throw new GmSSLException(""); + } + } + + public void update(byte[] data, int offset, int len) { + if (data == null + || offset < 0 + || len < 0 + || offset + len <= 0 + || data.length < offset + len) { + throw new GmSSLException(""); + } + if (GmSSLJNI.sm3_update(sm3_ctx, data, offset, len) != 1) { + throw new GmSSLException(""); + } + } + + public void update(byte[] data) { + this.update(data, 0, data.length); + } + + public byte[] digest() { + byte[] dgst = new byte[DIGEST_SIZE]; + if (GmSSLJNI.sm3_finish(sm3_ctx, dgst) != 1) { + throw new GmSSLException(""); + } + if (GmSSLJNI.sm3_init(sm3_ctx) != 1) { + throw new GmSSLException(""); + } + return dgst; + } + + @Override + public void close() throws Exception { + GmSSLJNI.sm3_ctx_free(sm3_ctx); + } +} diff --git a/android/src/main/java/org/gmssl/Sm3Hmac.java b/android/src/main/java/org/gmssl/Sm3Hmac.java new file mode 100644 index 0000000..71f5fd5 --- /dev/null +++ b/android/src/main/java/org/gmssl/Sm3Hmac.java @@ -0,0 +1,71 @@ +/* + * Copyright 2014-2023 The GmSSL Project. All Rights Reserved. + * + * Licensed under the Apache License, Version 2.0 (the License); you may + * not use this file except in compliance with the License. + * + * http://www.apache.org/licenses/LICENSE-2.0 + */ + +package org.gmssl; + +public class Sm3Hmac { + + public final static int MAC_SIZE = GmSSLJNI.SM3_HMAC_SIZE; + + private byte[] key; + + private long sm3_hmac_ctx = 0; + + public Sm3Hmac(byte[] key) { + if (key == null) { + throw new GmSSLException(""); + } + if ((this.sm3_hmac_ctx = GmSSLJNI.sm3_hmac_ctx_new()) == 0) { + throw new GmSSLException(""); + } + if (GmSSLJNI.sm3_hmac_init(this.sm3_hmac_ctx, key) != 1) { + throw new GmSSLException(""); + } + this.key = key; + } + + public void reset(byte[] key) { + if (key == null) { + throw new GmSSLException(""); + } + if (GmSSLJNI.sm3_hmac_init(this.sm3_hmac_ctx, key) != 1) { + throw new GmSSLException(""); + } + this.key = key; + } + + public void update(byte[] data, int offset, int len) { + if (data == null + || offset < 0 + || len < 0 + || offset + len <= 0 + || data.length < offset + len) { + throw new GmSSLException(""); + } + if (GmSSLJNI.sm3_hmac_update(this.sm3_hmac_ctx, data, offset, len) != 1) { + throw new GmSSLException(""); + } + } + + public void update(byte[] data) { + this.update(data, 0, data.length); + } + + public byte[] generateMac() { + byte[] mac = new byte[this.MAC_SIZE]; + if (GmSSLJNI.sm3_hmac_finish(this.sm3_hmac_ctx, mac) != 1) { + throw new GmSSLException(""); + } + if (GmSSLJNI.sm3_hmac_init(this.sm3_hmac_ctx, this.key) != 1) { + throw new GmSSLException(""); + } + return mac; + } +} + diff --git a/android/src/main/java/org/gmssl/Sm3Pbkdf2.java b/android/src/main/java/org/gmssl/Sm3Pbkdf2.java new file mode 100644 index 0000000..4891300 --- /dev/null +++ b/android/src/main/java/org/gmssl/Sm3Pbkdf2.java @@ -0,0 +1,42 @@ +/* + * Copyright 2014-2023 The GmSSL Project. All Rights Reserved. + * + * Licensed under the Apache License, Version 2.0 (the License); you may + * not use this file except in compliance with the License. + * + * http://www.apache.org/licenses/LICENSE-2.0 + */ + +package org.gmssl; + +public class Sm3Pbkdf2 { + + public final static int MAX_SALT_SIZE = GmSSLJNI.SM3_PBKDF2_MAX_SALT_SIZE; + public final static int DEFAULT_SALT_SIZE = GmSSLJNI.SM3_PBKDF2_DEFAULT_SALT_SIZE; + public final static int MIN_ITER = GmSSLJNI.SM3_PBKDF2_MIN_ITER; + public final static int MAX_ITER = GmSSLJNI.SM3_PBKDF2_MAX_ITER; + public final static int MAX_KEY_SIZE = GmSSLJNI.SM3_PBKDF2_MAX_KEY_SIZE; + + public Sm3Pbkdf2() { + } + + public byte[] deriveKey(String pass, byte[] salt, int iter, int keylen) { + if (pass == null) { + throw new GmSSLException(""); + } + if (salt == null || salt.length > MAX_SALT_SIZE) { + throw new GmSSLException(""); + } + if (iter < MIN_ITER || iter > MAX_ITER) { + throw new GmSSLException(""); + } + if (keylen < 0 || keylen > MAX_KEY_SIZE) { + throw new GmSSLException(""); + } + byte[] key = GmSSLJNI.sm3_pbkdf2(pass, salt, iter, keylen); + if (key == null) { + throw new GmSSLException(""); + } + return key; + } +} diff --git a/android/src/main/java/org/gmssl/Sm4.java b/android/src/main/java/org/gmssl/Sm4.java new file mode 100644 index 0000000..d1b593c --- /dev/null +++ b/android/src/main/java/org/gmssl/Sm4.java @@ -0,0 +1,62 @@ +/* + * Copyright 2014-2023 The GmSSL Project. All Rights Reserved. + * + * Licensed under the Apache License, Version 2.0 (the License); you may + * not use this file except in compliance with the License. + * + * http://www.apache.org/licenses/LICENSE-2.0 + */ + +package org.gmssl; + +public class Sm4 { + + public final static int KEY_SIZE = GmSSLJNI.SM4_KEY_SIZE; + public final static int BLOCK_SIZE = GmSSLJNI.SM4_BLOCK_SIZE; + + private long sm4_key = 0; + + public Sm4(byte[] key, boolean do_encrypt) { + + if (key == null) { + throw new GmSSLException(""); + } + if (key.length != this.KEY_SIZE) { + throw new GmSSLException(""); + } + + if ((sm4_key = GmSSLJNI.sm4_key_new()) == 0) { + throw new GmSSLException(""); + } + + if (do_encrypt == true) { + if (GmSSLJNI.sm4_set_encrypt_key(sm4_key, key) != 1) { + throw new GmSSLException(""); + } + } else { + if (GmSSLJNI.sm4_set_decrypt_key(sm4_key, key) != 1) { + throw new GmSSLException(""); + } + } + } + + public void encrypt(byte[] in, int in_offset, byte[] out, int out_offset) { + + if (in == null + || in_offset < 0 + || in_offset + this.BLOCK_SIZE <= 0 + || in_offset + this.BLOCK_SIZE > in.length) { + throw new GmSSLException(""); + } + if (out == null + || out_offset < 0 + || out_offset + this.BLOCK_SIZE <= 0 + || out_offset + this.BLOCK_SIZE > in.length) { + throw new GmSSLException(""); + } + + if (GmSSLJNI.sm4_encrypt(sm4_key, in, in_offset, out, out_offset) != 1) { + throw new GmSSLException(""); + } + } +} diff --git a/android/src/main/java/org/gmssl/Sm4Cbc.java b/android/src/main/java/org/gmssl/Sm4Cbc.java new file mode 100644 index 0000000..0e45a1e --- /dev/null +++ b/android/src/main/java/org/gmssl/Sm4Cbc.java @@ -0,0 +1,112 @@ +/* + * Copyright 2014-2023 The GmSSL Project. All Rights Reserved. + * + * Licensed under the Apache License, Version 2.0 (the License); you may + * not use this file except in compliance with the License. + * + * http://www.apache.org/licenses/LICENSE-2.0 + */ + +package org.gmssl; + + +public class Sm4Cbc { + + public final static int KEY_SIZE = GmSSLJNI.SM4_KEY_SIZE; + public final static int IV_SIZE = GmSSLJNI.SM4_BLOCK_SIZE; + public final static int BLOCK_SIZE = GmSSLJNI.SM4_BLOCK_SIZE; + + private long sm4_cbc_ctx = 0; + private boolean do_encrypt = true; + private boolean inited = false; + + public Sm4Cbc() { + if ((this.sm4_cbc_ctx = GmSSLJNI.sm4_cbc_ctx_new()) == 0) { + throw new GmSSLException(""); + } + this.inited = false; + } + + public void init(byte[] key, byte[] iv, boolean do_encrypt) { + + if (key == null + || key.length != this.KEY_SIZE + || iv == null + || iv.length != this.IV_SIZE) { + throw new GmSSLException(""); + } + + if (do_encrypt == true) { + if (GmSSLJNI.sm4_cbc_encrypt_init(this.sm4_cbc_ctx, key, iv) != 1) { + throw new GmSSLException(""); + } + } else { + if (GmSSLJNI.sm4_cbc_decrypt_init(this.sm4_cbc_ctx, key, iv) != 1) { + throw new GmSSLException(""); + } + } + + this.do_encrypt = do_encrypt; + this.inited = true; + } + + public int update(byte[] in, int in_offset, int inlen, byte[] out, int out_offset) { + + if (this.inited == false) { + throw new GmSSLException(""); + } + + if (in == null + || in_offset < 0 + || inlen < 0 + || in_offset + inlen <= 0 + || in.length < in_offset + inlen) { + throw new GmSSLException(""); + } + if (out == null + || out_offset < 0 + || out.length < out_offset) { + throw new GmSSLException(""); + } + + int outlen; + if (this.do_encrypt) { + if ((outlen = GmSSLJNI.sm4_cbc_encrypt_update(this.sm4_cbc_ctx, in, in_offset, inlen, out, out_offset)) < 0) { + throw new GmSSLException(""); + } + } else { + if ((outlen = GmSSLJNI.sm4_cbc_decrypt_update(this.sm4_cbc_ctx, in, in_offset, inlen, out, out_offset)) < 0) { + throw new GmSSLException(""); + } + } + + return outlen; + } + + public int doFinal(byte[] out, int out_offset) { + + if (this.inited == false) { + throw new GmSSLException(""); + } + + if (out == null + || out_offset < 0 + || out.length < out_offset) { + throw new GmSSLException(""); + } + + int outlen; + if (this.do_encrypt) { + if ((outlen = GmSSLJNI.sm4_cbc_encrypt_finish(this.sm4_cbc_ctx, out, out_offset)) < 0) { + throw new GmSSLException(""); + } + } else { + if ((outlen = GmSSLJNI.sm4_cbc_decrypt_finish(this.sm4_cbc_ctx, out, out_offset)) < 0) { + throw new GmSSLException(""); + } + } + + this.inited = false; + return outlen; + } +} diff --git a/android/src/main/java/org/gmssl/Sm4Ctr.java b/android/src/main/java/org/gmssl/Sm4Ctr.java new file mode 100644 index 0000000..b41f8c8 --- /dev/null +++ b/android/src/main/java/org/gmssl/Sm4Ctr.java @@ -0,0 +1,90 @@ +/* + * Copyright 2014-2023 The GmSSL Project. All Rights Reserved. + * + * Licensed under the Apache License, Version 2.0 (the License); you may + * not use this file except in compliance with the License. + * + * http://www.apache.org/licenses/LICENSE-2.0 + */ + +package org.gmssl; + + +public class Sm4Ctr { + + public final static int KEY_SIZE = GmSSLJNI.SM4_KEY_SIZE; + public final static int IV_SIZE = GmSSLJNI.SM4_BLOCK_SIZE; + public final static int BLOCK_SIZE = GmSSLJNI.SM4_BLOCK_SIZE; + + private long sm4_ctr_ctx = 0; + private boolean inited = false; + + public Sm4Ctr() { + if ((this.sm4_ctr_ctx = GmSSLJNI.sm4_ctr_ctx_new()) == 0) { + throw new GmSSLException(""); + } + this.inited = false; + } + + public void init(byte[] key, byte[] iv) { + + if (key == null + || key.length != this.KEY_SIZE + || iv == null + || iv.length != this.IV_SIZE) { + throw new GmSSLException(""); + } + + if (GmSSLJNI.sm4_ctr_encrypt_init(this.sm4_ctr_ctx, key, iv) != 1) { + throw new GmSSLException(""); + } + + this.inited = true; + } + + public int update(byte[] in, int in_offset, int inlen, byte[] out, int out_offset) { + + if (this.inited == false) { + throw new GmSSLException(""); + } + + if (in == null + || in_offset < 0 + || inlen < 0 + || in_offset + inlen <= 0 + || in.length < in_offset + inlen) { + throw new GmSSLException(""); + } + if (out == null + || out_offset < 0 + || out.length < out_offset) { + throw new GmSSLException(""); + } + + int outlen; + if ((outlen = GmSSLJNI.sm4_ctr_encrypt_update(this.sm4_ctr_ctx, in, in_offset, inlen, out, out_offset)) < 0) { + throw new GmSSLException(""); + } + return outlen; + } + + public int doFinal(byte[] out, int out_offset) { + + if (this.inited == false) { + throw new GmSSLException(""); + } + + if (out == null + || out_offset < 0 + || out.length < out_offset) { + throw new GmSSLException(""); + } + + int outlen; + if ((outlen = GmSSLJNI.sm4_ctr_encrypt_finish(this.sm4_ctr_ctx, out, out_offset)) < 0) { + throw new GmSSLException(""); + } + this.inited = false; + return outlen; + } +} diff --git a/android/src/main/java/org/gmssl/Sm4Gcm.java b/android/src/main/java/org/gmssl/Sm4Gcm.java new file mode 100644 index 0000000..927422b --- /dev/null +++ b/android/src/main/java/org/gmssl/Sm4Gcm.java @@ -0,0 +1,120 @@ +/* + * Copyright 2014-2023 The GmSSL Project. All Rights Reserved. + * + * Licensed under the Apache License, Version 2.0 (the License); you may + * not use this file except in compliance with the License. + * + * http://www.apache.org/licenses/LICENSE-2.0 + */ + +package org.gmssl; + + +public class Sm4Gcm { + + public final static int KEY_SIZE = GmSSLJNI.SM4_KEY_SIZE; + public final static int MIN_IV_SIZE = GmSSLJNI.SM4_GCM_MIN_IV_SIZE; + public final static int MAX_IV_SIZE = GmSSLJNI.SM4_GCM_MAX_IV_SIZE; + public final static int DEFAULT_IV_SIZE = GmSSLJNI.SM4_GCM_DEFAULT_IV_SIZE; + public final static int MIN_TAG_SIZE = 8; + public final static int MAX_TAG_SIZE = GmSSLJNI.SM4_GCM_MAX_TAG_SIZE; + public final static int BLOCK_SIZE = GmSSLJNI.SM4_BLOCK_SIZE; + + private long sm4_gcm_ctx = 0; + private boolean do_encrypt = true; + private boolean inited = false; + + + public Sm4Gcm() { + if ((this.sm4_gcm_ctx = GmSSLJNI.sm4_gcm_ctx_new()) == 0) { + throw new GmSSLException(""); + } + this.inited = false; + } + + public void init(byte[] key, byte[] iv, byte[] aad, int taglen, boolean do_encrypt) { + + if (key == null + || key.length != this.KEY_SIZE + || iv == null + || iv.length < this.MIN_IV_SIZE + || iv.length > this.MAX_IV_SIZE + || taglen < this.MIN_TAG_SIZE + || taglen > this.MAX_TAG_SIZE) { + throw new GmSSLException(""); + } + + if (do_encrypt == true) { + if (GmSSLJNI.sm4_gcm_encrypt_init(this.sm4_gcm_ctx, key, iv, aad, taglen) != 1) { + throw new GmSSLException(""); + } + } else { + if (GmSSLJNI.sm4_gcm_decrypt_init(this.sm4_gcm_ctx, key, iv, aad, taglen) != 1) { + throw new GmSSLException(""); + } + } + + this.do_encrypt = do_encrypt; + this.inited = true; + } + + public int update(byte[] in, int in_offset, int inlen, byte[] out, int out_offset) { + + if (this.inited == false) { + throw new GmSSLException(""); + } + + if (in == null + || in_offset < 0 + || inlen < 0 + || in_offset + inlen <= 0 + || in.length < in_offset + inlen) { + throw new GmSSLException(""); + } + if (out == null + || out_offset < 0 + || out.length < out_offset) { + throw new GmSSLException(""); + } + + int outlen; + if (this.do_encrypt) { + if ((outlen = GmSSLJNI.sm4_gcm_encrypt_update(this.sm4_gcm_ctx, in, in_offset, inlen, out, out_offset)) < 0) { + throw new GmSSLException(""); + } + } else { + if ((outlen = GmSSLJNI.sm4_gcm_decrypt_update(this.sm4_gcm_ctx, in, in_offset, inlen, out, out_offset)) < 0) { + throw new GmSSLException(""); + } + } + + return outlen; + } + + public int doFinal(byte[] out, int out_offset) { + + if (this.inited == false) { + throw new GmSSLException(""); + } + + if (out == null + || out_offset < 0 + || out.length < out_offset) { + throw new GmSSLException(""); + } + + int outlen; + if (this.do_encrypt) { + if ((outlen = GmSSLJNI.sm4_gcm_encrypt_finish(this.sm4_gcm_ctx, out, out_offset)) < 0) { + throw new GmSSLException(""); + } + } else { + if ((outlen = GmSSLJNI.sm4_gcm_decrypt_finish(this.sm4_gcm_ctx, out, out_offset)) < 0) { + throw new GmSSLException(""); + } + } + + this.inited = false; + return outlen; + } +} diff --git a/android/src/main/java/org/gmssl/Sm9EncKey.java b/android/src/main/java/org/gmssl/Sm9EncKey.java new file mode 100644 index 0000000..c527d95 --- /dev/null +++ b/android/src/main/java/org/gmssl/Sm9EncKey.java @@ -0,0 +1,63 @@ +/* + * Copyright 2014-2023 The GmSSL Project. All Rights Reserved. + * + * Licensed under the Apache License, Version 2.0 (the License); you may + * not use this file except in compliance with the License. + * + * http://www.apache.org/licenses/LICENSE-2.0 + */ + +package org.gmssl; + +public class Sm9EncKey { + + private long sm9_enc_key = 0; + private String id; + + Sm9EncKey(long key, String id) { + this.sm9_enc_key = key; + this.id = id; + } + + public Sm9EncKey(String id) { + this.sm9_enc_key = 0; + this.id = id; + } + + public void importEncryptedPrivateKeyInfoPem(String pass, String file) { + if (this.sm9_enc_key != 0) { + GmSSLJNI.sm9_enc_key_free(this.sm9_enc_key); + } + if ((this.sm9_enc_key = GmSSLJNI.sm9_enc_key_info_decrypt_from_pem(pass, file)) == 0) { + throw new GmSSLException(""); + } + } + + public void exportEncryptedPrivateKeyInfoPem(String pass, String file) { + if (this.sm9_enc_key == 0) { + throw new GmSSLException("Key not initialized"); + } + if (GmSSLJNI.sm9_enc_key_info_encrypt_to_pem(this.sm9_enc_key, pass, file) != 1) { + throw new GmSSLException(""); + } + } + + public String getId() { + return this.id; + } + + public byte[] decrypt(byte[] ciphertext) { + if (this.sm9_enc_key == 0) { + throw new GmSSLException(""); + } + if (ciphertext == null) { + throw new GmSSLException(""); + } + + byte[] plaintext; + if ((plaintext = GmSSLJNI.sm9_decrypt(this.sm9_enc_key, this.id, ciphertext)) == null) { + throw new GmSSLException(""); + } + return plaintext; + } +} diff --git a/android/src/main/java/org/gmssl/Sm9EncMasterKey.java b/android/src/main/java/org/gmssl/Sm9EncMasterKey.java new file mode 100644 index 0000000..1e77f67 --- /dev/null +++ b/android/src/main/java/org/gmssl/Sm9EncMasterKey.java @@ -0,0 +1,121 @@ +/* + * Copyright 2014-2023 The GmSSL Project. All Rights Reserved. + * + * Licensed under the Apache License, Version 2.0 (the License); you may + * not use this file except in compliance with the License. + * + * http://www.apache.org/licenses/LICENSE-2.0 + */ + +package org.gmssl; + + +public class Sm9EncMasterKey { + + public final static int MAX_PLAINTEXT_SIZE = GmSSLJNI.SM9_MAX_PLAINTEXT_SIZE; + + private long master_key = 0; + private boolean has_private_key = false; + + public Sm9EncMasterKey() { + this.master_key = 0; + } + + public void generateMasterKey() { + if (this.master_key != 0) { + GmSSLJNI.sm9_enc_master_key_free(this.master_key); + } + if ((this.master_key = GmSSLJNI.sm9_enc_master_key_generate()) == 0) { + throw new GmSSLException(""); + } + this.has_private_key = true; + } + + public long getMasterKey() { + if (this.master_key == 0) { + throw new GmSSLException(""); + } + if (this.has_private_key == false) { + throw new GmSSLException(""); + } + return this.master_key; + } + + public long getPublicMasterKey() { + if (this.master_key == 0) { + throw new GmSSLException(""); + } + return this.master_key; + } + + public Sm9EncKey extractKey(String id) { + if (this.master_key == 0) { + throw new GmSSLException(""); + } + if (this.has_private_key == false) { + throw new GmSSLException(""); + } + long key; + if ((key = GmSSLJNI.sm9_enc_master_key_extract_key(this.master_key, id)) == 0) { + throw new GmSSLException(""); + } + return new Sm9EncKey(key, id); + } + + public void importEncryptedMasterKeyInfoPem(String pass, String file) { + if (this.master_key != 0) { + GmSSLJNI.sm9_enc_master_key_free(this.master_key); + } + if ((this.master_key = GmSSLJNI.sm9_enc_master_key_info_decrypt_from_pem(pass, file)) == 0) { + throw new GmSSLException(""); + } + this.has_private_key = true; + } + + public void exportEncryptedMasterKeyInfoPem(String pass, String file) { + if (this.master_key == 0) { + throw new GmSSLException(""); + } + if (this.has_private_key == false) { + throw new GmSSLException(""); + } + if (GmSSLJNI.sm9_enc_master_key_info_encrypt_to_pem(this.master_key, pass, file) != 1) { + throw new GmSSLException(""); + } + } + + public void importPublicMasterKeyPem(String file) { + if (this.master_key != 0) { + GmSSLJNI.sm9_enc_master_key_free(this.master_key); + } + if ((this.master_key = GmSSLJNI.sm9_enc_master_public_key_from_pem(file)) == 0) { + throw new GmSSLException(""); + } + this.has_private_key = false; + } + + public void exportPublicMasterKeyPem(String file) { + if (this.master_key == 0) { + throw new GmSSLException(""); + } + if (GmSSLJNI.sm9_enc_master_public_key_to_pem(this.master_key, file) != 1) { + throw new GmSSLException(""); + } + } + + public byte[] encrypt(byte[] plaintext, String id) { + if (this.master_key == 0) { + throw new GmSSLException(""); + } + if (plaintext == null + || plaintext.length > this.MAX_PLAINTEXT_SIZE) { + throw new GmSSLException(""); + } + + byte[] ciphertext; + if ((ciphertext = GmSSLJNI.sm9_encrypt(this.master_key, id, plaintext)) == null) { + throw new GmSSLException(""); + } + return ciphertext; + } +} diff --git a/android/src/main/java/org/gmssl/Sm9SignKey.java b/android/src/main/java/org/gmssl/Sm9SignKey.java new file mode 100644 index 0000000..5aae198 --- /dev/null +++ b/android/src/main/java/org/gmssl/Sm9SignKey.java @@ -0,0 +1,55 @@ +/* + * Copyright 2014-2023 The GmSSL Project. All Rights Reserved. + * + * Licensed under the Apache License, Version 2.0 (the License); you may + * not use this file except in compliance with the License. + * + * http://www.apache.org/licenses/LICENSE-2.0 + */ + +package org.gmssl; + +public class Sm9SignKey { + + private long sm9_sign_key = 0; + private String id; + + Sm9SignKey(long key, String id) { + this.sm9_sign_key = key; + this.id = id; + } + + public Sm9SignKey(String id) { + this.sm9_sign_key = 0; + this.id = id; + } + + long getKey() { + if (this.sm9_sign_key == 0) { + throw new GmSSLException(""); + } + return this.sm9_sign_key; + } + + public String getId() { + return this.id; + } + + public void exportEncryptedPrivateKeyInfoPem(String pass, String file) { + if (this.sm9_sign_key == 0) { + throw new GmSSLException("Key not initialized"); + } + if (GmSSLJNI.sm9_sign_key_info_encrypt_to_pem(this.sm9_sign_key, pass, file) != 1) { + throw new GmSSLException(""); + } + } + + public void importEncryptedPrivateKeyInfoPem(String pass, String file) { + if (this.sm9_sign_key != 0) { + GmSSLJNI.sm9_sign_key_free(this.sm9_sign_key); + } + if ((this.sm9_sign_key = GmSSLJNI.sm9_sign_key_info_decrypt_from_pem(pass, file)) == 0) { + throw new GmSSLException("Import key failure"); + } + } +} diff --git a/android/src/main/java/org/gmssl/Sm9SignMasterKey.java b/android/src/main/java/org/gmssl/Sm9SignMasterKey.java new file mode 100644 index 0000000..de5e535 --- /dev/null +++ b/android/src/main/java/org/gmssl/Sm9SignMasterKey.java @@ -0,0 +1,103 @@ +/* + * Copyright 2014-2023 The GmSSL Project. All Rights Reserved. + * + * Licensed under the Apache License, Version 2.0 (the License); you may + * not use this file except in compliance with the License. + * + * http://www.apache.org/licenses/LICENSE-2.0 + */ + +package org.gmssl; + + +public class Sm9SignMasterKey { + + private long master_key = 0; + private boolean has_private_key = false; + + public Sm9SignMasterKey() { + this.master_key = 0; + } + + public void generateMasterKey() { + if (this.master_key != 0) { + GmSSLJNI.sm9_sign_master_key_free(this.master_key); + } + if ((this.master_key = GmSSLJNI.sm9_sign_master_key_generate()) == 0) { + throw new GmSSLException(""); + } + this.has_private_key = true; + } + + public long getMasterKey() { + if (this.master_key == 0) { + throw new GmSSLException(""); + } + if (this.has_private_key == false) { + throw new GmSSLException(""); + } + return this.master_key; + } + + public long getPublicMasterKey() { + if (this.master_key == 0) { + throw new GmSSLException(""); + } + return this.master_key; + } + + public Sm9SignKey extractKey(String id) { + if (this.master_key == 0) { + throw new GmSSLException(""); + } + if (this.has_private_key == false) { + throw new GmSSLException(""); + } + long key; + if ((key = GmSSLJNI.sm9_sign_master_key_extract_key(this.master_key, id)) == 0) { + throw new GmSSLException(""); + } + return new Sm9SignKey(key, id); + } + + public void importEncryptedMasterKeyInfoPem(String pass, String file) { + if (this.master_key != 0) { + GmSSLJNI.sm9_sign_master_key_free(this.master_key); + } + if ((this.master_key = GmSSLJNI.sm9_sign_master_key_info_decrypt_from_pem(pass, file)) == 0) { + throw new GmSSLException(""); + } + this.has_private_key = true; + } + + public void exportEncryptedMasterKeyInfoPem(String pass, String file) { + if (this.master_key == 0) { + throw new GmSSLException(""); + } + if (this.has_private_key == false) { + throw new GmSSLException(""); + } + if (GmSSLJNI.sm9_sign_master_key_info_encrypt_to_pem(this.master_key, pass, file) != 1) { + throw new GmSSLException(""); + } + } + + public void importPublicMasterKeyPem(String file) { + if (this.master_key != 0) { + GmSSLJNI.sm9_sign_master_key_free(this.master_key); + } + if ((this.master_key = GmSSLJNI.sm9_sign_master_public_key_from_pem(file)) == 0) { + throw new GmSSLException(""); + } + this.has_private_key = false; + } + + public void exportPublicMasterKeyPem(String file) { + if (this.master_key == 0) { + throw new GmSSLException(""); + } + if (GmSSLJNI.sm9_sign_master_public_key_to_pem(this.master_key, file) != 1) { + throw new GmSSLException(""); + } + } +} diff --git a/android/src/main/java/org/gmssl/Sm9Signature.java b/android/src/main/java/org/gmssl/Sm9Signature.java new file mode 100644 index 0000000..ec21294 --- /dev/null +++ b/android/src/main/java/org/gmssl/Sm9Signature.java @@ -0,0 +1,108 @@ +/* + * Copyright 2014-2023 The GmSSL Project. All Rights Reserved. + * + * Licensed under the Apache License, Version 2.0 (the License); you may + * not use this file except in compliance with the License. + * + * http://www.apache.org/licenses/LICENSE-2.0 + */ + +package org.gmssl; + + +public class Sm9Signature { + + private long sm9_sign_ctx = 0; + private boolean inited = false; + private boolean do_sign = true; + + public Sm9Signature(boolean do_sign) { + if ((this.sm9_sign_ctx = GmSSLJNI.sm9_sign_ctx_new()) == 0) { + throw new GmSSLException(""); + } + if (do_sign == true) { + if (GmSSLJNI.sm9_sign_init(this.sm9_sign_ctx) != 1) { + throw new GmSSLException(""); + } + } else { + if (GmSSLJNI.sm9_verify_init(this.sm9_sign_ctx) != 1) { + throw new GmSSLException(""); + } + } + this.inited = true; + this.do_sign = do_sign; + } + + public void reset(boolean do_sign) { + if (do_sign == true) { + if (GmSSLJNI.sm9_sign_init(this.sm9_sign_ctx) != 1) { + throw new GmSSLException(""); + } + } else { + if (GmSSLJNI.sm9_verify_init(this.sm9_sign_ctx) != 1) { + throw new GmSSLException(""); + } + } + this.inited = true; + this.do_sign = do_sign; + } + + public void update(byte[] data, int offset, int len) { + if (this.inited == false) { + throw new GmSSLException(""); + } + if (data == null + || offset < 0 + || len < 0 + || offset + len <= 0 + || data.length < offset + len) { + throw new GmSSLException(""); + } + if (this.do_sign == true) { + if (GmSSLJNI.sm9_sign_update(this.sm9_sign_ctx, data, offset, len) != 1) { + throw new GmSSLException(""); + } + } else { + if (GmSSLJNI.sm9_verify_update(this.sm9_sign_ctx, data, offset, len) != 1) { + throw new GmSSLException(""); + } + } + } + + public void update(byte[] data) { + update(data, 0, data.length); + } + + public byte[] sign(Sm9SignKey signKey) { + if (this.inited == false) { + throw new GmSSLException(""); + } + if (this.do_sign == false) { + throw new GmSSLException(""); + } + + byte[] signature; + if ((signature = GmSSLJNI.sm9_sign_finish(this.sm9_sign_ctx, signKey.getKey())) == null) { + throw new GmSSLException(""); + } + this.inited = false; + return signature; + } + + public boolean verify(byte[] signature, Sm9SignMasterKey masterPublicKey, String id) { + if (this.inited == false) { + throw new GmSSLException(""); + } + if (this.do_sign == true) { + throw new GmSSLException(""); + } + int ret; + ret = GmSSLJNI.sm9_verify_finish(sm9_sign_ctx, signature, masterPublicKey.getPublicMasterKey(), id); + this.inited = false; + if (ret == 1) { + return true; + } else { + return false; + } + } +} diff --git a/android/src/main/java/org/gmssl/Zuc.java b/android/src/main/java/org/gmssl/Zuc.java new file mode 100644 index 0000000..b580c32 --- /dev/null +++ b/android/src/main/java/org/gmssl/Zuc.java @@ -0,0 +1,92 @@ +/* + * Copyright 2014-2023 The GmSSL Project. All Rights Reserved. + * + * Licensed under the Apache License, Version 2.0 (the License); you may + * not use this file except in compliance with the License. + * + * http://www.apache.org/licenses/LICENSE-2.0 + */ + +package org.gmssl; + + +public class Zuc { + + public final static int KEY_SIZE = GmSSLJNI.ZUC_KEY_SIZE; + public final static int IV_SIZE = GmSSLJNI.ZUC_IV_SIZE; + public final static int BLOCK_SIZE = 4; + + private long zuc_ctx = 0; + private boolean inited = false; + + public Zuc() { + if ((this.zuc_ctx = GmSSLJNI.zuc_ctx_new()) == 0) { + throw new GmSSLException(""); + } + this.inited = false; + } + + public void init(byte[] key, byte[] iv) { + + if (key == null + || key.length != this.KEY_SIZE + || iv == null + || iv.length != this.IV_SIZE) { + throw new GmSSLException(""); + } + + if (GmSSLJNI.zuc_encrypt_init(this.zuc_ctx, key, iv) != 1) { + throw new GmSSLException(""); + } + + this.inited = true; + } + + public int update(byte[] in, int in_offset, int inlen, byte[] out, int out_offset) { + + if (this.inited == false) { + throw new GmSSLException(""); + } + + if (in == null + || in_offset < 0 + || inlen < 0 + || in_offset + inlen <= 0 + || in.length < in_offset + inlen) { + throw new GmSSLException(""); + } + if (out == null + || out_offset < 0 + || out.length < out_offset) { + throw new GmSSLException(""); + } + + int outlen; + if ((outlen = GmSSLJNI.zuc_encrypt_update(this.zuc_ctx, in, in_offset, inlen, out, out_offset)) < 0) { + throw new GmSSLException(""); + } + + return outlen; + } + + public int doFinal(byte[] out, int out_offset) { + + if (this.inited == false) { + throw new GmSSLException(""); + } + + if (out == null + || out_offset < 0 + || out.length < out_offset) { + throw new GmSSLException(""); + } + + int outlen; + if ((outlen = GmSSLJNI.zuc_encrypt_finish(this.zuc_ctx, out, out_offset)) < 0) { + throw new GmSSLException(""); + } + + this.inited = false; + return outlen; + } +} diff --git a/android/src/main/jniLibs/arm64-v8a/libgmssljni.so b/android/src/main/jniLibs/arm64-v8a/libgmssljni.so new file mode 100755 index 0000000..fcc4bca Binary files /dev/null and b/android/src/main/jniLibs/arm64-v8a/libgmssljni.so differ diff --git a/android/src/main/jniLibs/armeabi-v7a/libgmssljni.so b/android/src/main/jniLibs/armeabi-v7a/libgmssljni.so new file mode 100755 index 0000000..786d261 Binary files /dev/null and b/android/src/main/jniLibs/armeabi-v7a/libgmssljni.so differ diff --git a/pom.xml b/pom.xml index 184d92d..4af5470 100644 --- a/pom.xml +++ b/pom.xml @@ -2,7 +2,7 @@ 4.0.0 org.gmssl GmSSLJNI - 3.1.1 + 3.1.2 GmSSL-Java jar GmSSL Java SDK diff --git a/scripts/Dockerfile.linux-arm64 b/scripts/Dockerfile.linux-arm64 new file mode 100644 index 0000000..ca592c1 --- /dev/null +++ b/scripts/Dockerfile.linux-arm64 @@ -0,0 +1,38 @@ +# Dockerfile for building GmSSL-Java on ARM64 Linux +FROM ubuntu:22.04 + +ENV DEBIAN_FRONTEND=noninteractive + +# ---------- Switch to Aliyun mirror for faster downloads in China ---------- +# Ubuntu 22.04 arm64 uses ports.ubuntu.com; replace with mirrors.aliyun.com/ubuntu-ports +RUN cp /etc/apt/sources.list /etc/apt/sources.list.bak && \ + sed -i 's|http://ports.ubuntu.com/ubuntu-ports|http://mirrors.aliyun.com/ubuntu-ports|g' /etc/apt/sources.list && \ + sed -i 's|http://archive.ubuntu.com/ubuntu|http://mirrors.aliyun.com/ubuntu|g' /etc/apt/sources.list && \ + sed -i 's|http://security.ubuntu.com/ubuntu|http://mirrors.aliyun.com/ubuntu|g' /etc/apt/sources.list + +# Install build essentials (JDK 8 for source/target 1.8 compatibility) +RUN apt-get update && apt-get install -y \ + build-essential \ + cmake \ + openjdk-8-jdk \ + maven \ + git \ + && rm -rf /var/lib/apt/lists/* + +# ---------- Configure Maven to use Aliyun mirror ---------- +RUN mkdir -p /root/.m2 && \ + printf '\n\ + \n\ + \n\ + aliyun\n\ + Aliyun Maven Mirror\n\ + https://maven.aliyun.com/repository/public\n\ + central\n\ + \n\ + \n\ +\n' > /root/.m2/settings.xml + +ENV JAVA_HOME=/usr/lib/jvm/java-8-openjdk-arm64 +ENV PATH=$JAVA_HOME/bin:$PATH + +WORKDIR /build diff --git a/scripts/_build-inside-docker.sh b/scripts/_build-inside-docker.sh new file mode 100755 index 0000000..81208e9 --- /dev/null +++ b/scripts/_build-inside-docker.sh @@ -0,0 +1,100 @@ +#!/bin/bash +# This script runs INSIDE the ARM64 Linux Docker container +# It builds GmSSL, compiles libgmssljni.so, and packages the JAR +set -e + +echo ">>> Step 1: Building and installing GmSSL..." +cp -r /src/GmSSL /tmp/GmSSL +cd /tmp/GmSSL +rm -rf build && mkdir build && cd build +cmake .. -DCMAKE_BUILD_TYPE=Release +make -j$(nproc) +make install +ldconfig +echo " GmSSL installed:" +gmssl version || true +ls /usr/local/lib/libgmssl* 2>/dev/null || true + +echo "" +echo ">>> Step 2: Building JNI native library (libgmssljni.so)..." +cd /src/GmSSL-Java +rm -rf target/build && mkdir -p target/build +cd target/build +export libName=gmssljni +export libSubFolder=Release +cmake /src/GmSSL-Java/src/main/c -DCMAKE_BUILD_TYPE=Release +make -j$(nproc) +echo " Native lib built:" +find . -name "libgmssljni.so" + +echo "" +echo ">>> Step 3: Copying native library to resources..." +mkdir -p /src/GmSSL-Java/src/main/resources/lib +SO_FILE=$(find /src/GmSSL-Java/target/build -name "libgmssljni.so" | head -1) +if [ -z "$SO_FILE" ]; then + echo "ERROR: libgmssljni.so not found" + exit 1 +fi +cp "$SO_FILE" /src/GmSSL-Java/src/main/resources/lib/libgmssljni.so +echo " Copied: $SO_FILE -> src/main/resources/lib/libgmssljni.so" + +# Copy ROOTCA.pem if generated +if [ -f /src/GmSSL-Java/target/build/ROOTCA.pem ]; then + cp /src/GmSSL-Java/target/build/ROOTCA.pem /src/GmSSL-Java/ROOTCA.pem +fi + +echo "" +echo ">>> Step 4: Packaging JAR with Maven..." +cd /src/GmSSL-Java + +# The cmake-maven-plugin does not support ARM_64. Strip it from pom.xml. +# Also override the Java source/target version to 1.8 for JDK 8 compatibility. +cp pom.xml pom.xml.bak +awk ' +// { buf=$0; capture=1; next } +capture { buf = buf "\n" $0 } +capture && /<\/plugin>/ { + if (buf !~ /cmake-maven-project/) print buf + buf=""; capture=0; next +} +!capture { print } +' pom.xml.bak > pom.xml.tmp + +# Force source/target to 1.8 (JDK 8) +sed -e 's|[^<]*|1.8|' \ + -e 's|[^<]*|1.8|' \ + pom.xml.tmp > pom.xml +rm pom.xml.tmp +echo " Stripped cmake-maven-plugin, set source/target to 1.8" +grep -E "maven.compiler.(source|target)" pom.xml + +# Ensure resources include the .so we just built +mkdir -p src/main/resources/lib +cp target/build/Release/libgmssljni.so src/main/resources/lib/ 2>/dev/null || \ + find target/build -name "libgmssljni.so" -exec cp {} src/main/resources/lib/ \; + +# Clean previous compiled classes so JDK 8 recompiles everything +rm -rf target/classes target/test-classes + +# Build JAR (compile with JDK 8 source/target) +mvn package -DskipTests --no-transfer-progress \ + -Dmaven.compiler.source=1.8 \ + -Dmaven.compiler.target=1.8 + +# Restore original pom.xml +mv pom.xml.bak pom.xml + +echo "" +echo ">>> Step 5: Verifying output..." +echo "Java compile version (class file magic):" +javap -v -p target/classes/org/gmssl/GmSSLJNI.class 2>/dev/null | grep -E "major version|minor version" | head -2 || true +ls -lh /src/GmSSL-Java/src/main/resources/lib/libgmssljni.so +echo "" +echo "JAR native lib contents:" +jar tf target/GmSSLJNI-*.jar 2>/dev/null | grep -E "\.so$|lib/" || true +echo "" +echo "JAR files:" +ls -lh target/*.jar + +echo "" +echo ">>> Done! <<<" diff --git a/scripts/build-android.sh b/scripts/build-android.sh new file mode 100755 index 0000000..2c57597 --- /dev/null +++ b/scripts/build-android.sh @@ -0,0 +1,180 @@ +#!/bin/bash + +# GmSSL Android Build Script +# This script builds GmSSL-Java for Android (arm64-v8a and armeabi-v7a) + +set -e + +# Colors for output +RED='\033[0;31m' +GREEN='\033[0;32m' +YELLOW='\033[1;33m' +NC='\033[0m' # No Color + +# Script directory +SCRIPT_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )" +PROJECT_DIR="$( cd "$SCRIPT_DIR/.." && pwd )" +GMSSL_DIR="${GMSSL_DIR:-$PROJECT_DIR/../GmSSL}" +ANDROID_DIR="$PROJECT_DIR/android" + +# Android SDK/NDK paths +ANDROID_SDK="${ANDROID_SDK:-$HOME/Library/Android/sdk}" +NDK_VERSION="${NDK_VERSION:-27.1.12297006}" +NDK="$ANDROID_SDK/ndk/$NDK_VERSION" + +# Target architectures +ABIS="arm64-v8a armeabi-v7a" + +echo -e "${GREEN}========================================${NC}" +echo -e "${GREEN}GmSSL Android Build Script${NC}" +echo -e "${GREEN}========================================${NC}" +echo "" +echo "Project directory: $PROJECT_DIR" +echo "GmSSL directory: $GMSSL_DIR" +echo "Android SDK: $ANDROID_SDK" +echo "NDK: $NDK" +echo "" + +# Check prerequisites +check_prerequisites() { + echo -e "${YELLOW}Checking prerequisites...${NC}" + + if [ ! -d "$GMSSL_DIR" ]; then + echo -e "${RED}Error: GmSSL source directory not found at $GMSSL_DIR${NC}" + echo "Please set GMSSL_DIR environment variable or place GmSSL source at $GMSSL_DIR" + exit 1 + fi + + if [ ! -d "$NDK" ]; then + echo -e "${RED}Error: Android NDK not found at $NDK${NC}" + echo "Please install NDK version $NDK_VERSION or set NDK_VERSION environment variable" + exit 1 + fi + + if ! command -v cmake &> /dev/null; then + echo -e "${RED}Error: cmake not found${NC}" + exit 1 + fi + + echo -e "${GREEN}All prerequisites met.${NC}" + echo "" +} + +# Build GmSSL for a specific ABI +build_gmssl() { + local ABI=$1 + local BUILD_DIR="" + + case $ABI in + "arm64-v8a") + BUILD_DIR="build-android-arm64" + ;; + "armeabi-v7a") + BUILD_DIR="build-android-arm" + ;; + *) + echo -e "${RED}Unsupported ABI: $ABI${NC}" + exit 1 + ;; + esac + + echo -e "${YELLOW}Building GmSSL for $ABI...${NC}" + + cd "$GMSSL_DIR" + + # Clean previous build + rm -rf "$BUILD_DIR" + + # Configure + cmake -B "$BUILD_DIR" \ + -DCMAKE_TOOLCHAIN_FILE="$NDK/build/cmake/android.toolchain.cmake" \ + -DANDROID_ABI="$ABI" \ + -DANDROID_PLATFORM=android-21 \ + -DBUILD_SHARED_LIBS=OFF \ + -DCMAKE_BUILD_TYPE=Release + + # Build + cmake --build "$BUILD_DIR" -j$(nproc 2>/dev/null || sysctl -n hw.ncpu) + + echo -e "${GREEN}GmSSL $ABI build completed.${NC}" +} + +# Build JNI library for a specific ABI +build_jni() { + local ABI=$1 + local GMSSL_BUILD_DIR="" + local JNI_BUILD_DIR="$ANDROID_DIR/build-jni-$ABI" + local OUTPUT_DIR="$ANDROID_DIR/src/main/jniLibs/$ABI" + + case $ABI in + "arm64-v8a") + GMSSL_BUILD_DIR="$GMSSL_DIR/build-android-arm64" + ;; + "armeabi-v7a") + GMSSL_BUILD_DIR="$GMSSL_DIR/build-android-arm" + ;; + esac + + echo -e "${YELLOW}Building JNI library for $ABI...${NC}" + + # Clean and create build directory + rm -rf "$JNI_BUILD_DIR" + mkdir -p "$JNI_BUILD_DIR" + mkdir -p "$OUTPUT_DIR" + + cd "$JNI_BUILD_DIR" + + # Configure + cmake "$ANDROID_DIR" \ + -DCMAKE_TOOLCHAIN_FILE="$NDK/build/cmake/android.toolchain.cmake" \ + -DANDROID_ABI="$ABI" \ + -DANDROID_PLATFORM=android-21 \ + -DGMSSL_SOURCE_DIR="$GMSSL_DIR" \ + -DGMSSL_LIB_DIR="$GMSSL_BUILD_DIR/bin" \ + -DCMAKE_BUILD_TYPE=Release + + # Build + cmake --build . -j$(nproc 2>/dev/null || sysctl -n hw.ncpu) + + # Copy to jniLibs + cp libgmssljni.so "$OUTPUT_DIR/" + + echo -e "${GREEN}JNI library $ABI build completed.${NC}" + echo "Output: $OUTPUT_DIR/libgmssljni.so" +} + +# Main build process +main() { + check_prerequisites + + # Build GmSSL for each ABI + for ABI in $ABIS; do + build_gmssl "$ABI" + done + + echo "" + + # Build JNI library for each ABI + for ABI in $ABIS; do + build_jni "$ABI" + done + + echo "" + echo -e "${GREEN}========================================${NC}" + echo -e "${GREEN}Build completed successfully!${NC}" + echo -e "${GREEN}========================================${NC}" + echo "" + echo "Native libraries are in:" + for ABI in $ABIS; do + echo " - $ANDROID_DIR/src/main/jniLibs/$ABI/libgmssljni.so" + done + echo "" + echo "To build the AAR:" + echo " cd $ANDROID_DIR" + echo " ./gradlew assembleRelease" + echo "" + echo "Or use Android Studio to open the android/ directory." +} + +# Run main +main "$@" diff --git a/scripts/build-linux-arm64.sh b/scripts/build-linux-arm64.sh new file mode 100755 index 0000000..2733091 --- /dev/null +++ b/scripts/build-linux-arm64.sh @@ -0,0 +1,110 @@ +#!/bin/bash + +# GmSSL-Java Linux ARM64 (aarch64) Build Script +# Builds a JAR with native libgmssljni.so for Linux ARM64 using Docker +# +# Prerequisites: +# - Docker Desktop running (with multi-arch / QEMU support) +# - GmSSL source code at ../GmSSL (or set GMSSL_DIR env var) +# +# Usage: +# ./scripts/build-linux-arm64.sh +# +# Output: +# target/GmSSLJNI-3.1.2.jar + +set -e + +# Colors +RED='\033[0;31m' +GREEN='\033[0;32m' +YELLOW='\033[1;33m' +NC='\033[0m' + +# Directories +SCRIPT_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )" +PROJECT_DIR="$( cd "$SCRIPT_DIR/.." && pwd )" +GMSSL_DIR="${GMSSL_DIR:-$PROJECT_DIR/../GmSSL}" + +echo -e "${GREEN}========================================${NC}" +echo -e "${GREEN}GmSSL-Java Linux ARM64 Build${NC}" +echo -e "${GREEN}========================================${NC}" +echo "" +echo "Project dir: $PROJECT_DIR" +echo "GmSSL dir: $GMSSL_DIR" +echo "" + +# --- Preflight checks --- +if [ ! -d "$GMSSL_DIR" ]; then + echo -e "${RED}Error: GmSSL source not found at $GMSSL_DIR${NC}" + echo "Set GMSSL_DIR or place GmSSL source at $GMSSL_DIR" + exit 1 +fi + +if ! docker info >/dev/null 2>&1; then + echo -e "${RED}Error: Docker daemon is not running.${NC}" + echo "Please start Docker Desktop and try again." + exit 1 +fi + +# --- Build Docker image --- +echo -e "${YELLOW}[1/4] Building ARM64 Linux Docker image...${NC}" +DOCKER_IMAGE="gmssl-java-arm64-builder" + +docker build -f "$SCRIPT_DIR/Dockerfile.linux-arm64" \ + -t "$DOCKER_IMAGE" \ + "$PROJECT_DIR" + +# --- Build inside container --- +echo -e "${YELLOW}[2/4] Compiling GmSSL + JNI + JAR inside ARM64 container...${NC}" +echo "" + +# Clean previous output +rm -f "$PROJECT_DIR/src/main/resources/lib/libgmssljni.so" + +chmod +x "$SCRIPT_DIR/_build-inside-docker.sh" + +docker run --rm \ + -v "$GMSSL_DIR:/src/GmSSL:ro" \ + -v "$PROJECT_DIR:/src/GmSSL-Java" \ + -w /src/GmSSL-Java \ + "$DOCKER_IMAGE" \ + bash /src/GmSSL-Java/scripts/_build-inside-docker.sh + +# --- Show results --- +echo "" +echo -e "${GREEN}========================================${NC}" +echo -e "${GREEN}[4/4] Build completed!${NC}" +echo -e "${GREEN}========================================${NC}" +echo "" + +JAR_FILE="$PROJECT_DIR/target/GmSSLJNI-3.1.2.jar" +if [ -f "$JAR_FILE" ]; then + echo -e "Output: ${GREEN}$JAR_FILE${NC}" + echo "" + echo "Architecture verification:" + file "$PROJECT_DIR/src/main/resources/lib/libgmssljni.so" 2>/dev/null || \ + file "$PROJECT_DIR/target/classes/lib/libgmssljni.so" 2>/dev/null || true + echo "" + echo "JAR native lib contents:" + jar tf "$JAR_FILE" | grep -E "\.so|lib/" || true +else + echo -e "${YELLOW}Looking for JAR output:${NC}" + ls -la "$PROJECT_DIR/target/"*.jar 2>/dev/null || echo "No JAR found. Check build logs above." +fi + +echo "" +echo -e "${GREEN}--- Deployment Instructions ---${NC}" +echo "" +echo "On target ARM64 Linux machine:" +echo "" +echo " 1. Install GmSSL (if not statically linked):" +echo " git clone https://github.com/guanzhi/GmSSL.git" +echo " cd GmSSL && mkdir build && cd build" +echo " cmake .. && make -j\$(nproc) && sudo make install && sudo ldconfig" +echo "" +echo " 2. Run your Java application:" +echo " java -cp GmSSLJNI-3.1.2.jar:your-app.jar com.example.Main" +echo "" +echo " 3. If library load fails, set:" +echo " export LD_LIBRARY_PATH=/usr/local/lib:\$LD_LIBRARY_PATH" diff --git a/src/main/c/CMakeLists.txt b/src/main/c/CMakeLists.txt index a16c4b3..2b0ab46 100644 --- a/src/main/c/CMakeLists.txt +++ b/src/main/c/CMakeLists.txt @@ -1,4 +1,5 @@ cmake_minimum_required(VERSION 3.11) + project(gmssljni) find_program(GMSSL_EXECUTABLE NAMES gmssl) @@ -21,6 +22,7 @@ if(WIN32) set_target_properties(gmssljni-native PROPERTIES OUTPUT_NAME lib$ENV{libName}) elseif(APPLE) message(STATUS "->Now is Apple systems.") + message(STATUS "CMAKE_OSX_ARCHITECTURES is set to: ${CMAKE_OSX_ARCHITECTURES}") set(CMAKE_LIBRARY_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/$ENV{libSubFolder}) add_library(gmssljni-native SHARED gmssljni.c) target_link_libraries(gmssljni-native -L"${GMSSL_PARENT_DIR}/lib") diff --git a/src/main/c/gmssljni.c b/src/main/c/gmssljni.c index fe1cc72..afd08c7 100644 --- a/src/main/c/gmssljni.c +++ b/src/main/c/gmssljni.c @@ -18,8 +18,9 @@ #include #include #include -#include +// #include // Removed: not available in current GmSSL version #include +#include #include #include #include @@ -390,7 +391,8 @@ JNIEXPORT jbyteArray JNICALL Java_org_gmssl_GmSSLJNI_sm3_1pbkdf2( goto end; } - if (pbkdf2_hmac_sm3_genkey(pass_str, strlen(pass_str), + // Use sm3_pbkdf2 instead of pbkdf2_hmac_sm3_genkey + if (sm3_pbkdf2(pass_str, strlen(pass_str), (const uint8_t *)saltbuf, saltlen, iter, keylen, keybuf) != 1) { error_print(); goto end; @@ -1051,7 +1053,8 @@ JNIEXPORT jint JNICALL Java_org_gmssl_GmSSLJNI_sm4_1ctr_1decrypt_1init( error_print(); goto end; } - if (sm4_ctr_decrypt_init((SM4_CTR_CTX *)sm4_ctr_ctx, (uint8_t *)keybuf, (uint8_t *)ivbuf) != 1) { + // CTR mode: decryption is the same as encryption + if (sm4_ctr_encrypt_init((SM4_CTR_CTX *)sm4_ctr_ctx, (uint8_t *)keybuf, (uint8_t *)ivbuf) != 1) { error_print(); goto end; } @@ -1101,7 +1104,8 @@ JNIEXPORT jint JNICALL Java_org_gmssl_GmSSLJNI_sm4_1ctr_1decrypt_1update( error_print(); goto end; } - if (sm4_ctr_decrypt_update((SM4_CTR_CTX *)sm4_ctr_ctx, (uint8_t *)inbuf + in_offset, (size_t)inlen, + // CTR mode: decryption is the same as encryption + if (sm4_ctr_encrypt_update((SM4_CTR_CTX *)sm4_ctr_ctx, (uint8_t *)inbuf + in_offset, (size_t)inlen, (uint8_t *)outbuf + out_offset, &outlen) != 1) { error_print(); goto end; @@ -1140,7 +1144,8 @@ JNIEXPORT jint JNICALL Java_org_gmssl_GmSSLJNI_sm4_1ctr_1decrypt_1finish( error_print(); goto end; } - if (sm4_ctr_decrypt_finish((SM4_CTR_CTX *)sm4_ctr_ctx, + // CTR mode: decryption is the same as encryption + if (sm4_ctr_encrypt_finish((SM4_CTR_CTX *)sm4_ctr_ctx, (uint8_t *)outbuf + offset, &outlen) != 1) { error_print(); goto end; @@ -3880,3 +3885,371 @@ JNIEXPORT jint JNICALL Java_org_gmssl_GmSSLJNI_cert_1verify_1by_1ca_1cert( return ret; } +/* + * Class: org_gmssl_GmSSLJNI + * Method: x509_req_new + * Signature: (Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;JLjava/lang/String;)[B + */ +JNIEXPORT jbyteArray JNICALL Java_org_gmssl_GmSSLJNI_x509_1req_1new( + JNIEnv *env, jclass this, + jstring country, jstring state, jstring locality, + jstring org, jstring org_unit, jstring common_name, + jlong sm2_key, jstring signer_id) +{ + jbyteArray ret = NULL; + const char *country_str = NULL; + const char *state_str = NULL; + const char *locality_str = NULL; + const char *org_str = NULL; + const char *org_unit_str = NULL; + const char *common_name_str = NULL; + const char *signer_id_str = NULL; + size_t signer_id_len = 0; + + uint8_t name[256]; + size_t namelen = 0; + uint8_t attrs[512]; + size_t attrs_len = 0; + uint8_t req[1024]; + uint8_t *p = req; + size_t reqlen = 0; + + if (!sm2_key) { + error_print(); + return NULL; + } + if (!common_name) { + error_print(); + return NULL; + } + + // Get string values (some can be NULL) + if (country) { + if (!(country_str = (*env)->GetStringUTFChars(env, country, NULL))) { + error_print(); + goto end; + } + } + if (state) { + if (!(state_str = (*env)->GetStringUTFChars(env, state, NULL))) { + error_print(); + goto end; + } + } + if (locality) { + if (!(locality_str = (*env)->GetStringUTFChars(env, locality, NULL))) { + error_print(); + goto end; + } + } + if (org) { + if (!(org_str = (*env)->GetStringUTFChars(env, org, NULL))) { + error_print(); + goto end; + } + } + if (org_unit) { + if (!(org_unit_str = (*env)->GetStringUTFChars(env, org_unit, NULL))) { + error_print(); + goto end; + } + } + if (!(common_name_str = (*env)->GetStringUTFChars(env, common_name, NULL))) { + error_print(); + goto end; + } + + // Get signer_id, use default if not provided + if (signer_id) { + if (!(signer_id_str = (*env)->GetStringUTFChars(env, signer_id, NULL))) { + error_print(); + goto end; + } + signer_id_len = strlen(signer_id_str); + } else { + signer_id_str = SM2_DEFAULT_ID; + signer_id_len = strlen(SM2_DEFAULT_ID); + } + + // Build subject name + if (x509_name_set(name, &namelen, sizeof(name), + country_str, state_str, locality_str, + org_str, org_unit_str, common_name_str) != 1) { + error_print(); + goto end; + } + + // Generate and sign the certificate request + if (x509_req_sign_to_der( + X509_version_v1, + name, namelen, + (SM2_KEY *)sm2_key, + attrs, attrs_len, + OID_sm2sign_with_sm3, + (SM2_KEY *)sm2_key, signer_id_str, signer_id_len, + &p, &reqlen) != 1) { + error_print(); + goto end; + } + + // Create return byte array + if (!(ret = (*env)->NewByteArray(env, reqlen))) { + error_print(); + goto end; + } + (*env)->SetByteArrayRegion(env, ret, 0, reqlen, (jbyte *)req); + +end: + if (country_str && country) (*env)->ReleaseStringUTFChars(env, country, country_str); + if (state_str && state) (*env)->ReleaseStringUTFChars(env, state, state_str); + if (locality_str && locality) (*env)->ReleaseStringUTFChars(env, locality, locality_str); + if (org_str && org) (*env)->ReleaseStringUTFChars(env, org, org_str); + if (org_unit_str && org_unit) (*env)->ReleaseStringUTFChars(env, org_unit, org_unit_str); + if (common_name_str) (*env)->ReleaseStringUTFChars(env, common_name, common_name_str); + if (signer_id_str && signer_id) (*env)->ReleaseStringUTFChars(env, signer_id, signer_id_str); + return ret; +} + +/* + * Class: org_gmssl_GmSSLJNI + * Method: x509_req_to_pem + * Signature: ([BLjava/lang/String;)I + */ +JNIEXPORT jint JNICALL Java_org_gmssl_GmSSLJNI_x509_1req_1to_1pem( + JNIEnv *env, jclass this, + jbyteArray req, jstring file) +{ + jint ret = -1; + jbyte *reqbuf = NULL; + jsize reqlen; + const char *file_str = NULL; + FILE *fp = NULL; + + if (!req || !file) { + error_print(); + return -1; + } + + if (!(reqbuf = (*env)->GetByteArrayElements(env, req, NULL))) { + error_print(); + return -1; + } + reqlen = (*env)->GetArrayLength(env, req); + + if (!(file_str = (*env)->GetStringUTFChars(env, file, NULL))) { + error_print(); + goto end; + } + if (!(fp = fopen(file_str, "wb"))) { + error_print(); + goto end; + } + if (x509_req_to_pem((uint8_t *)reqbuf, (size_t)reqlen, fp) != 1) { + error_print(); + goto end; + } + ret = 1; +end: + (*env)->ReleaseByteArrayElements(env, req, reqbuf, JNI_ABORT); + if (file_str) (*env)->ReleaseStringUTFChars(env, file, file_str); + if (fp) fclose(fp); + return ret; +} + +/* + * Class: org_gmssl_GmSSLJNI + * Method: x509_req_from_pem + * Signature: (Ljava/lang/String;)[B + */ +JNIEXPORT jbyteArray JNICALL Java_org_gmssl_GmSSLJNI_x509_1req_1from_1pem( + JNIEnv *env, jclass this, + jstring file) +{ + jbyteArray ret = NULL; + const char *file_str = NULL; + FILE *fp = NULL; + uint8_t req[1024]; + size_t reqlen; + + if (!file) { + error_print(); + return NULL; + } + + if (!(file_str = (*env)->GetStringUTFChars(env, file, NULL))) { + error_print(); + return NULL; + } + if (!(fp = fopen(file_str, "rb"))) { + error_print(); + goto end; + } + if (x509_req_from_pem(req, &reqlen, sizeof(req), fp) != 1) { + error_print(); + goto end; + } + + if (!(ret = (*env)->NewByteArray(env, reqlen))) { + error_print(); + goto end; + } + (*env)->SetByteArrayRegion(env, ret, 0, reqlen, (jbyte *)req); + +end: + if (file_str) (*env)->ReleaseStringUTFChars(env, file, file_str); + if (fp) fclose(fp); + return ret; +} + +/* + * Class: org_gmssl_GmSSLJNI + * Method: x509_req_get_subject + * Signature: ([B)[Ljava/lang/String; + */ +JNIEXPORT jobjectArray JNICALL Java_org_gmssl_GmSSLJNI_x509_1req_1get_1subject( + JNIEnv *env, jclass this, + jbyteArray req) +{ + jobjectArray ret = NULL; + jobjectArray arr = NULL; + jbyte *reqbuf = NULL; + jsize reqlen; + const uint8_t *subject; + size_t subject_len; + int cnt; + + if (!req) { + error_print(); + return NULL; + } + + if (!(reqbuf = (*env)->GetByteArrayElements(env, req, NULL))) { + error_print(); + return NULL; + } + reqlen = (*env)->GetArrayLength(env, req); + + if (x509_req_get_details((uint8_t *)reqbuf, reqlen, + NULL, &subject, &subject_len, NULL, NULL, NULL, NULL, NULL, NULL) != 1) { + error_print(); + goto end; + } + + if (gmssl_name_cnt(subject, subject_len, &cnt) != 1) { + error_print(); + goto end; + } + if (!(arr = (*env)->NewObjectArray(env, cnt, (*env)->FindClass(env, "java/lang/String"), 0))) { + error_print(); + goto end; + } + if (gmssl_parse_name(env, arr, subject, subject_len) != 1) { + error_print(); + } + ret = arr; + arr = NULL; + +end: + if (reqbuf) (*env)->ReleaseByteArrayElements(env, req, reqbuf, JNI_ABORT); + return ret; +} + +/* + * Class: org_gmssl_GmSSLJNI + * Method: x509_req_get_subject_public_key + * Signature: ([B)J + */ +JNIEXPORT jlong JNICALL Java_org_gmssl_GmSSLJNI_x509_1req_1get_1subject_1public_1key( + JNIEnv *env, jclass this, + jbyteArray req) +{ + jlong ret = 0; + jbyte *reqbuf = NULL; + jsize reqlen; + SM2_KEY *sm2_pub = NULL; + + if (!req) { + error_print(); + return 0; + } + + if (!(reqbuf = (*env)->GetByteArrayElements(env, req, NULL))) { + error_print(); + return 0; + } + reqlen = (*env)->GetArrayLength(env, req); + + if (!(sm2_pub = (SM2_KEY *)malloc(sizeof(SM2_KEY)))) { + error_print(); + goto end; + } + memset(sm2_pub, 0, sizeof(SM2_KEY)); + + if (x509_req_get_details((uint8_t *)reqbuf, reqlen, + NULL, NULL, NULL, sm2_pub, NULL, NULL, NULL, NULL, NULL) != 1) { + error_print(); + goto end; + } + + ret = (jlong)sm2_pub; + sm2_pub = NULL; + +end: + (*env)->ReleaseByteArrayElements(env, req, reqbuf, JNI_ABORT); + if (sm2_pub) { + gmssl_secure_clear(sm2_pub, sizeof(SM2_KEY)); + free(sm2_pub); + } + return ret; +} + +/* + * Class: org_gmssl_GmSSLJNI + * Method: x509_req_verify + * Signature: ([BLjava/lang/String;)I + */ +JNIEXPORT jint JNICALL Java_org_gmssl_GmSSLJNI_x509_1req_1verify( + JNIEnv *env, jclass this, + jbyteArray req, jstring signer_id) +{ + jint ret = -1; + jbyte *reqbuf = NULL; + jsize reqlen; + const char *signer_id_str = NULL; + size_t signer_id_len = 0; + + if (!req) { + error_print(); + return -1; + } + + if (!(reqbuf = (*env)->GetByteArrayElements(env, req, NULL))) { + error_print(); + return -1; + } + reqlen = (*env)->GetArrayLength(env, req); + + if (signer_id) { + if (!(signer_id_str = (*env)->GetStringUTFChars(env, signer_id, NULL))) { + error_print(); + goto end; + } + signer_id_len = strlen(signer_id_str); + } else { + signer_id_str = SM2_DEFAULT_ID; + signer_id_len = strlen(SM2_DEFAULT_ID); + } + + if (x509_req_verify((uint8_t *)reqbuf, reqlen, signer_id_str, signer_id_len) != 1) { + error_print(); + ret = 0; + goto end; + } + ret = 1; + +end: + (*env)->ReleaseByteArrayElements(env, req, reqbuf, JNI_ABORT); + if (signer_id_str && signer_id) (*env)->ReleaseStringUTFChars(env, signer_id, signer_id_str); + return ret; +} + diff --git a/src/main/c/gmssljni.h b/src/main/c/gmssljni.h index f9dbe2a..ae57e00 100644 --- a/src/main/c/gmssljni.h +++ b/src/main/c/gmssljni.h @@ -927,6 +927,54 @@ JNIEXPORT jlong JNICALL Java_org_gmssl_GmSSLJNI_cert_1get_1subject_1public_1key JNIEXPORT jint JNICALL Java_org_gmssl_GmSSLJNI_cert_1verify_1by_1ca_1cert (JNIEnv *, jclass, jbyteArray, jbyteArray, jstring); +/* + * Class: org_gmssl_GmSSLJNI + * Method: x509_req_new + * Signature: (Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;JLjava/lang/String;)[B + */ +JNIEXPORT jbyteArray JNICALL Java_org_gmssl_GmSSLJNI_x509_1req_1new + (JNIEnv *, jclass, jstring, jstring, jstring, jstring, jstring, jstring, jlong, jstring); + +/* + * Class: org_gmssl_GmSSLJNI + * Method: x509_req_to_pem + * Signature: ([BLjava/lang/String;)I + */ +JNIEXPORT jint JNICALL Java_org_gmssl_GmSSLJNI_x509_1req_1to_1pem + (JNIEnv *, jclass, jbyteArray, jstring); + +/* + * Class: org_gmssl_GmSSLJNI + * Method: x509_req_from_pem + * Signature: (Ljava/lang/String;)[B + */ +JNIEXPORT jbyteArray JNICALL Java_org_gmssl_GmSSLJNI_x509_1req_1from_1pem + (JNIEnv *, jclass, jstring); + +/* + * Class: org_gmssl_GmSSLJNI + * Method: x509_req_get_subject + * Signature: ([B)[Ljava/lang/String; + */ +JNIEXPORT jobjectArray JNICALL Java_org_gmssl_GmSSLJNI_x509_1req_1get_1subject + (JNIEnv *, jclass, jbyteArray); + +/* + * Class: org_gmssl_GmSSLJNI + * Method: x509_req_get_subject_public_key + * Signature: ([B)J + */ +JNIEXPORT jlong JNICALL Java_org_gmssl_GmSSLJNI_x509_1req_1get_1subject_1public_1key + (JNIEnv *, jclass, jbyteArray); + +/* + * Class: org_gmssl_GmSSLJNI + * Method: x509_req_verify + * Signature: ([BLjava/lang/String;)I + */ +JNIEXPORT jint JNICALL Java_org_gmssl_GmSSLJNI_x509_1req_1verify + (JNIEnv *, jclass, jbyteArray, jstring); + #ifdef __cplusplus } #endif diff --git a/src/main/java/org/gmssl/GmSSLJNI.java b/src/main/java/org/gmssl/GmSSLJNI.java index 64e6dbb..4bbc8df 100644 --- a/src/main/java/org/gmssl/GmSSLJNI.java +++ b/src/main/java/org/gmssl/GmSSLJNI.java @@ -149,6 +149,17 @@ public class GmSSLJNI { public final static native long cert_get_subject_public_key(byte[] cert); public final static native int cert_verify_by_ca_cert(byte[] cert, byte[] cacert, String ca_sm2_id); + // Certificate Request (CSR) functions + public final static native byte[] x509_req_new( + String country, String state, String locality, + String org, String orgUnit, String commonName, + long sm2Key, String signerId); + public final static native int x509_req_to_pem(byte[] req, String file); + public final static native byte[] x509_req_from_pem(String file); + public final static native String[] x509_req_get_subject(byte[] req); + public final static native long x509_req_get_subject_public_key(byte[] req); + public final static native int x509_req_verify(byte[] req, String signerId); + public static void print_bytes(String label, byte[] data) { int i; System.out.printf("%s: ", label); diff --git a/src/main/java/org/gmssl/Sm2CertificateRequest.java b/src/main/java/org/gmssl/Sm2CertificateRequest.java new file mode 100644 index 0000000..190bc2c --- /dev/null +++ b/src/main/java/org/gmssl/Sm2CertificateRequest.java @@ -0,0 +1,264 @@ +/* + * Copyright 2014-2023 The GmSSL Project. All Rights Reserved. + * + * Licensed under the Apache License, Version 2.0 (the License); you may + * not use this file except in compliance with the License. + * + * http://www.apache.org/licenses/LICENSE-2.0 + */ + +package org.gmssl; + +/** + * SM2 Certificate Request (CSR) class. + * + * This class provides functionality to generate and manage X.509 Certificate + * Signing Requests (CSR) using SM2 algorithm, equivalent to the `gmssl reqgen` command. + * + * Example usage: + *
+ * // Generate a new key pair
+ * Sm2Key key = new Sm2Key();
+ * key.generateKey();
+ * 
+ * // Create a certificate request
+ * Sm2CertificateRequest csr = new Sm2CertificateRequest();
+ * csr.setSubject("CN", "Beijing", "Beijing", "MyOrg", "MyUnit", "www.example.com");
+ * byte[] reqData = csr.generate(key);
+ * 
+ * // Export to PEM file
+ * csr.toPem("request.pem");
+ * 
+ */ +public class Sm2CertificateRequest { + + public static final String DEFAULT_ID = GmSSLJNI.SM2_DEFAULT_ID; + + private byte[] req = null; + + // Subject fields + private String country = null; + private String state = null; + private String locality = null; + private String organization = null; + private String organizationalUnit = null; + private String commonName = null; + + public Sm2CertificateRequest() { + } + + /** + * Set the subject distinguished name fields. + * + * @param country Country code (C), e.g., "CN" + * @param state State or province name (ST), e.g., "Beijing" + * @param locality Locality name (L), e.g., "Beijing" + * @param organization Organization name (O), e.g., "MyCompany" + * @param organizationalUnit Organizational unit name (OU), e.g., "IT Department" + * @param commonName Common name (CN), e.g., "www.example.com" - REQUIRED + */ + public void setSubject(String country, String state, String locality, + String organization, String organizationalUnit, String commonName) { + if (commonName == null || commonName.isEmpty()) { + throw new GmSSLException("Common name (CN) is required"); + } + this.country = country; + this.state = state; + this.locality = locality; + this.organization = organization; + this.organizationalUnit = organizationalUnit; + this.commonName = commonName; + } + + /** + * Set only the common name (CN) for simple use cases. + * + * @param commonName Common name (CN), e.g., "www.example.com" + */ + public void setCommonName(String commonName) { + if (commonName == null || commonName.isEmpty()) { + throw new GmSSLException("Common name (CN) is required"); + } + this.commonName = commonName; + } + + /** + * Generate a certificate request using the provided SM2 key pair. + * Uses the default SM2 signer ID. + * + * @param key SM2 key pair (must contain private key) + * @return The DER-encoded certificate request + */ + public byte[] generate(Sm2Key key) { + return generate(key, DEFAULT_ID); + } + + /** + * Generate a certificate request using the provided SM2 key pair and signer ID. + * + * @param key SM2 key pair (must contain private key) + * @param signerId SM2 signer ID for signature + * @return The DER-encoded certificate request + */ + public byte[] generate(Sm2Key key, String signerId) { + if (this.commonName == null) { + throw new GmSSLException("Common name (CN) must be set before generating CSR"); + } + if (key == null) { + throw new GmSSLException("SM2 key is required"); + } + + long sm2Key = key.getPrivateKey(); + this.req = GmSSLJNI.x509_req_new( + this.country, this.state, this.locality, + this.organization, this.organizationalUnit, this.commonName, + sm2Key, signerId); + + if (this.req == null) { + throw new GmSSLException("Failed to generate certificate request"); + } + return this.req; + } + + /** + * Get the DER-encoded certificate request data. + * + * @return The DER-encoded certificate request, or null if not generated + */ + public byte[] getRequest() { + return this.req; + } + + /** + * Export the certificate request to a PEM file. + * + * @param file Path to the output PEM file + */ + public void toPem(String file) { + if (this.req == null) { + throw new GmSSLException("No certificate request to export"); + } + if (file == null || file.isEmpty()) { + throw new GmSSLException("File path is required"); + } + if (GmSSLJNI.x509_req_to_pem(this.req, file) != 1) { + throw new GmSSLException("Failed to export certificate request to PEM"); + } + } + + /** + * Import a certificate request from a PEM file. + * + * @param file Path to the PEM file + */ + public void fromPem(String file) { + if (file == null || file.isEmpty()) { + throw new GmSSLException("File path is required"); + } + this.req = GmSSLJNI.x509_req_from_pem(file); + if (this.req == null) { + throw new GmSSLException("Failed to import certificate request from PEM"); + } + } + + /** + * Get the subject distinguished name from the certificate request. + * + * @return Array of subject name components (e.g., ["C:CN", "ST:Beijing", "CN:www.example.com"]) + */ + public String[] getSubject() { + if (this.req == null) { + throw new GmSSLException("No certificate request loaded"); + } + String[] subject = GmSSLJNI.x509_req_get_subject(this.req); + if (subject == null) { + throw new GmSSLException("Failed to get subject from certificate request"); + } + return subject; + } + + /** + * Get the subject public key from the certificate request. + * + * @return SM2 public key + */ + public Sm2Key getSubjectPublicKey() { + if (this.req == null) { + throw new GmSSLException("No certificate request loaded"); + } + long sm2Pub = GmSSLJNI.x509_req_get_subject_public_key(this.req); + if (sm2Pub == 0) { + throw new GmSSLException("Failed to get subject public key from certificate request"); + } + return new Sm2Key(sm2Pub, false); + } + + /** + * Verify the signature of the certificate request. + * Uses the default SM2 signer ID. + * + * @return true if verification succeeds, false otherwise + */ + public boolean verify() { + return verify(DEFAULT_ID); + } + + /** + * Verify the signature of the certificate request with specified signer ID. + * + * @param signerId SM2 signer ID used for verification + * @return true if verification succeeds, false otherwise + */ + public boolean verify(String signerId) { + if (this.req == null) { + throw new GmSSLException("No certificate request loaded"); + } + int ret = GmSSLJNI.x509_req_verify(this.req, signerId); + if (ret < 0) { + throw new GmSSLException("Failed to verify certificate request"); + } + return ret == 1; + } + + /** + * Static method to generate a certificate request directly. + * + * @param country Country code (C) + * @param state State or province name (ST) + * @param locality Locality name (L) + * @param organization Organization name (O) + * @param organizationalUnit Organizational unit name (OU) + * @param commonName Common name (CN) - REQUIRED + * @param key SM2 key pair + * @param signerId SM2 signer ID + * @return The DER-encoded certificate request + */ + public static byte[] generateRequest( + String country, String state, String locality, + String organization, String organizationalUnit, String commonName, + Sm2Key key, String signerId) { + Sm2CertificateRequest csr = new Sm2CertificateRequest(); + csr.setSubject(country, state, locality, organization, organizationalUnit, commonName); + return csr.generate(key, signerId); + } + + /** + * Static method to generate a certificate request with default signer ID. + * + * @param country Country code (C) + * @param state State or province name (ST) + * @param locality Locality name (L) + * @param organization Organization name (O) + * @param organizationalUnit Organizational unit name (OU) + * @param commonName Common name (CN) - REQUIRED + * @param key SM2 key pair + * @return The DER-encoded certificate request + */ + public static byte[] generateRequest( + String country, String state, String locality, + String organization, String organizationalUnit, String commonName, + Sm2Key key) { + return generateRequest(country, state, locality, organization, organizationalUnit, + commonName, key, DEFAULT_ID); + } +} diff --git a/src/test/java/org/gmssl/Sm2CertificateRequestTest.java b/src/test/java/org/gmssl/Sm2CertificateRequestTest.java new file mode 100644 index 0000000..1a0ab00 --- /dev/null +++ b/src/test/java/org/gmssl/Sm2CertificateRequestTest.java @@ -0,0 +1,164 @@ +/* + * Copyright 2014-2023 The GmSSL Project. All Rights Reserved. + * + * Licensed under the Apache License, Version 2.0 (the License); you may + * not use this file except in compliance with the License. + * + * http://www.apache.org/licenses/LICENSE-2.0 + */ + +package org.gmssl; + +import org.junit.Assert; +import org.junit.Test; +import java.io.File; + +public class Sm2CertificateRequestTest { + + @Test + public void testGenerateAndVerifyCsr() { + // 1. 生成 SM2 密钥对 + Sm2Key key = new Sm2Key(); + key.generateKey(); + System.out.println("Generated SM2 key pair"); + + // 2. 创建证书请求 + Sm2CertificateRequest csr = new Sm2CertificateRequest(); + csr.setSubject("CN", "Beijing", "Beijing", "Test Organization", "IT Department", "www.test.com"); + + // 3. 生成 CSR + byte[] reqData = csr.generate(key); + Assert.assertNotNull("CSR data should not be null", reqData); + Assert.assertTrue("CSR data should have content", reqData.length > 0); + System.out.println("Generated CSR, length: " + reqData.length + " bytes"); + + // 4. 验证 CSR 签名 + boolean verified = csr.verify(); + Assert.assertTrue("CSR signature verification should succeed", verified); + System.out.println("CSR signature verified: " + verified); + + // 5. 获取并打印主题信息 + String[] subject = csr.getSubject(); + Assert.assertNotNull("Subject should not be null", subject); + Assert.assertTrue("Subject should have entries", subject.length > 0); + System.out.println("CSR Subject:"); + for (String s : subject) { + System.out.println(" " + s); + } + + // 6. 获取公钥并验证 + Sm2Key pubKey = csr.getSubjectPublicKey(); + Assert.assertNotNull("Public key should not be null", pubKey); + System.out.println("Extracted public key from CSR"); + } + + @Test + public void testCsrPemExportImport() { + // 1. 生成密钥和 CSR + Sm2Key key = new Sm2Key(); + key.generateKey(); + + Sm2CertificateRequest csr = new Sm2CertificateRequest(); + csr.setSubject("CN", "Shanghai", "Shanghai", "Another Org", "Dev", "api.example.com"); + byte[] reqData = csr.generate(key); + + // 2. 导出到 PEM 文件 + String pemFile = "test_request.pem"; + csr.toPem(pemFile); + System.out.println("Exported CSR to: " + pemFile); + + // 验证文件存在 + File file = new File(pemFile); + Assert.assertTrue("PEM file should exist", file.exists()); + + // 3. 从 PEM 文件导入 + Sm2CertificateRequest csr2 = new Sm2CertificateRequest(); + csr2.fromPem(pemFile); + System.out.println("Imported CSR from: " + pemFile); + + // 4. 验证导入的 CSR + boolean verified = csr2.verify(); + Assert.assertTrue("Imported CSR verification should succeed", verified); + System.out.println("Imported CSR verified: " + verified); + + // 5. 比较主题信息 + String[] subject1 = csr.getSubject(); + String[] subject2 = csr2.getSubject(); + Assert.assertArrayEquals("Subjects should match", subject1, subject2); + System.out.println("Subject comparison passed"); + + // 清理测试文件 + file.delete(); + } + + @Test + public void testStaticGenerateMethod() { + // 使用静态方法生成 CSR + Sm2Key key = new Sm2Key(); + key.generateKey(); + + byte[] reqData = Sm2CertificateRequest.generateRequest( + "CN", "Shenzhen", "Shenzhen", + "Static Test Org", "QA", "static.test.com", + key); + + Assert.assertNotNull("Static generated CSR should not be null", reqData); + Assert.assertTrue("Static generated CSR should have content", reqData.length > 0); + System.out.println("Static method generated CSR, length: " + reqData.length + " bytes"); + + // 验证生成的 CSR + Sm2CertificateRequest csr = new Sm2CertificateRequest(); + // 需要先保存再读取来验证 + String pemFile = "test_static_request.pem"; + GmSSLJNI.x509_req_to_pem(reqData, pemFile); + csr.fromPem(pemFile); + + boolean verified = csr.verify(); + Assert.assertTrue("Static generated CSR verification should succeed", verified); + System.out.println("Static generated CSR verified: " + verified); + + // 清理 + new File(pemFile).delete(); + } + + @Test + public void testMinimalCsr() { + // 测试只设置 CommonName 的最小 CSR + Sm2Key key = new Sm2Key(); + key.generateKey(); + + Sm2CertificateRequest csr = new Sm2CertificateRequest(); + csr.setCommonName("minimal.test.com"); + byte[] reqData = csr.generate(key); + + Assert.assertNotNull("Minimal CSR should not be null", reqData); + boolean verified = csr.verify(); + Assert.assertTrue("Minimal CSR verification should succeed", verified); + System.out.println("Minimal CSR (CN only) generated and verified"); + } + + @Test + public void testCustomSignerId() { + // 测试自定义 signer ID + Sm2Key key = new Sm2Key(); + key.generateKey(); + + String customSignerId = "custom@signer.id"; + + Sm2CertificateRequest csr = new Sm2CertificateRequest(); + csr.setSubject("CN", "Hangzhou", "Hangzhou", "Custom ID Org", "Security", "custom.id.test.com"); + byte[] reqData = csr.generate(key, customSignerId); + + Assert.assertNotNull("CSR with custom signer ID should not be null", reqData); + + // 使用相同的 signer ID 验证 + boolean verified = csr.verify(customSignerId); + Assert.assertTrue("CSR with custom signer ID verification should succeed", verified); + System.out.println("CSR with custom signer ID generated and verified"); + + // 使用默认 signer ID 验证应该失败 + boolean verifiedWithDefault = csr.verify(); + Assert.assertFalse("CSR verification with wrong signer ID should fail", verifiedWithDefault); + System.out.println("CSR verification with wrong signer ID correctly failed"); + } +}