Compare commits
12 Commits
v1.0.0-rc3
...
v1.0.0-rc7
Author | SHA1 | Date | |
---|---|---|---|
4eab5532d0 | |||
e68db8a433 | |||
4b9e2aa96a | |||
b726d5ba75 | |||
bfb587360d | |||
f964ef7b60 | |||
dd05449f36 | |||
3ff626134e | |||
29fdc841b7 | |||
dc30188593 | |||
2bea5d288c | |||
8a0226a5ea |
2
3rdparty/libfort
vendored
2
3rdparty/libfort
vendored
Submodule 3rdparty/libfort updated: 41237162a9...5a8f9312bd
@@ -16,7 +16,7 @@ sha1sums=('SKIP' 'SKIP' 'SKIP')
|
|||||||
pkgver () {
|
pkgver () {
|
||||||
_date=`date +"%Y%m%d"`
|
_date=`date +"%Y%m%d"`
|
||||||
cd "${srcdir}/${pkgname}-git"
|
cd "${srcdir}/${pkgname}-git"
|
||||||
echo "$(echo "$(sh ./gen-version-string.sh)" | sed 's/-/_/g')"
|
echo "$(echo "$(git describe --always --dirty)" | sed 's/-/_/g')"
|
||||||
}
|
}
|
||||||
|
|
||||||
build () {
|
build () {
|
||||||
@@ -24,6 +24,7 @@ build () {
|
|||||||
cd "$srcdir/$pkgname-git/build"
|
cd "$srcdir/$pkgname-git/build"
|
||||||
cmake -DCMAKE_BUILD_TYPE=Release ..
|
cmake -DCMAKE_BUILD_TYPE=Release ..
|
||||||
make -j12
|
make -j12
|
||||||
|
make man-page
|
||||||
}
|
}
|
||||||
|
|
||||||
prepare () {
|
prepare () {
|
||||||
|
@@ -1,4 +1,4 @@
|
|||||||
cmake_minimum_required(VERSION 3.5)
|
cmake_minimum_required(VERSION 3.5...3.18)
|
||||||
|
|
||||||
project(patchelfcrc LANGUAGES C)
|
project(patchelfcrc LANGUAGES C)
|
||||||
|
|
||||||
@@ -28,8 +28,6 @@ pkg_check_modules(ELF REQUIRED libelf)
|
|||||||
find_package(Doxygen)
|
find_package(Doxygen)
|
||||||
find_package(LibXml2 REQUIRED)
|
find_package(LibXml2 REQUIRED)
|
||||||
|
|
||||||
add_subdirectory(man)
|
|
||||||
|
|
||||||
aux_source_directory("src" CFILES)
|
aux_source_directory("src" CFILES)
|
||||||
|
|
||||||
set(GEN_HEADER_PATH "${CMAKE_CURRENT_BINARY_DIR}/include/generated")
|
set(GEN_HEADER_PATH "${CMAKE_CURRENT_BINARY_DIR}/include/generated")
|
||||||
@@ -37,12 +35,17 @@ set(GEN_HEADER_PATH "${CMAKE_CURRENT_BINARY_DIR}/include/generated")
|
|||||||
add_custom_target(
|
add_custom_target(
|
||||||
version-header
|
version-header
|
||||||
COMMAND
|
COMMAND
|
||||||
mkdir -p ${GEN_HEADER_PATH} && bash "${CMAKE_CURRENT_SOURCE_DIR}/gen_version_header.sh" "${GEN_HEADER_PATH}/version.h"
|
${CMAKE_COMMAND} -D SRC=${CMAKE_SOURCE_DIR}/version.h.template
|
||||||
|
-D DST=${GEN_HEADER_PATH}/version.h
|
||||||
|
-P ${CMAKE_SOURCE_DIR}/GenerateVersion.cmake
|
||||||
WORKING_DIRECTORY
|
WORKING_DIRECTORY
|
||||||
${CMAKE_CURRENT_SOURCE_DIR}
|
${CMAKE_CURRENT_SOURCE_DIR}
|
||||||
COMMENT "Generating version header"
|
COMMENT "Generating version header"
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
||||||
|
add_subdirectory(man)
|
||||||
|
|
||||||
add_custom_target(schema-header DEPENDS "${GEN_HEADER_PATH}/schema-blob.h")
|
add_custom_target(schema-header DEPENDS "${GEN_HEADER_PATH}/schema-blob.h")
|
||||||
add_custom_command(
|
add_custom_command(
|
||||||
OUTPUT "${GEN_HEADER_PATH}/schema-blob.h"
|
OUTPUT "${GEN_HEADER_PATH}/schema-blob.h"
|
||||||
@@ -66,7 +69,8 @@ target_link_directories(${PROJECT_NAME} PRIVATE ${ELF_LIBRARY_DIRS} ${LIBXML2_LI
|
|||||||
target_include_directories(${PROJECT_NAME} PRIVATE ${ELF_INCLUDE_DIRS})
|
target_include_directories(${PROJECT_NAME} PRIVATE ${ELF_INCLUDE_DIRS})
|
||||||
target_include_directories(${PROJECT_NAME} PRIVATE "${CMAKE_CURRENT_BINARY_DIR}/include")
|
target_include_directories(${PROJECT_NAME} PRIVATE "${CMAKE_CURRENT_BINARY_DIR}/include")
|
||||||
target_include_directories(${PROJECT_NAME} PRIVATE "include")
|
target_include_directories(${PROJECT_NAME} PRIVATE "include")
|
||||||
add_dependencies(${PROJECT_NAME} version-header schema-header)
|
add_dependencies(${PROJECT_NAME} schema-header)
|
||||||
|
add_dependencies(${PROJECT_NAME} version-header)
|
||||||
|
|
||||||
if (DOXYGEN_FOUND)
|
if (DOXYGEN_FOUND)
|
||||||
set(DOXYFILE_SRC "${CMAKE_CURRENT_SOURCE_DIR}/doxygen/Doxyfile.in")
|
set(DOXYFILE_SRC "${CMAKE_CURRENT_SOURCE_DIR}/doxygen/Doxyfile.in")
|
||||||
@@ -83,11 +87,13 @@ if (DOXYGEN_FOUND)
|
|||||||
|
|
||||||
add_custom_target(doxygen-version-header
|
add_custom_target(doxygen-version-header
|
||||||
COMMAND
|
COMMAND
|
||||||
bash ${CMAKE_CURRENT_SOURCE_DIR}/doxygen/gen-version-string.sh "${CMAKE_CURRENT_BINARY_DIR}/doxyversion.in"
|
${CMAKE_COMMAND} -D SRC="${CMAKE_SOURCE_DIR}/doxyversion.in.template"
|
||||||
|
-D DST="${CMAKE_CURRENT_BINARY_DIR}/doxyversion.in"
|
||||||
|
-P ${CMAKE_SOURCE_DIR}/GenerateVersion.cmake
|
||||||
WORKING_DIRECTORY
|
WORKING_DIRECTORY
|
||||||
${CMAKE_CURRENT_SOURCE_DIR}
|
${CMAKE_CURRENT_SOURCE_DIR}
|
||||||
)
|
)
|
||||||
else (DOXYGEN_FOUND)
|
else (DOXYGEN_FOUND)
|
||||||
message("${BoldMagenta}Doxygen needs to be installed to generate the doxygen documentation${ColorReset}")
|
message("${BoldMagenta}Doxygen needs to be installed to generate the doxygen documentation${ColorReset}")
|
||||||
message("${BoldMagenta}doxygen target will not be available${ColorReset}")
|
message("${BoldMagenta}doxygen target will not be available${ColorReset}")
|
||||||
endif (DOXYGEN_FOUND)
|
endif (DOXYGEN_FOUND)
|
||||||
|
26
GenerateVersion.cmake
Normal file
26
GenerateVersion.cmake
Normal file
@@ -0,0 +1,26 @@
|
|||||||
|
find_package(Git)
|
||||||
|
|
||||||
|
if(GIT_EXECUTABLE)
|
||||||
|
get_filename_component(WORKING_DIR ${SRC} DIRECTORY)
|
||||||
|
execute_process(
|
||||||
|
COMMAND ${GIT_EXECUTABLE} describe --always --dirty
|
||||||
|
WORKING_DIRECTORY ${WORKING_DIR}
|
||||||
|
OUTPUT_VARIABLE PROGRAM_GIT_VERSION
|
||||||
|
RESULT_VARIABLE ERROR_CODE
|
||||||
|
OUTPUT_STRIP_TRAILING_WHITESPACE
|
||||||
|
)
|
||||||
|
|
||||||
|
if(NOT ERROR_CODE EQUAL "0")
|
||||||
|
set(PROGRAM_GIT_VERSION "")
|
||||||
|
endif()
|
||||||
|
|
||||||
|
endif()
|
||||||
|
|
||||||
|
if(PROGRAM_GIT_VERSION STREQUAL "")
|
||||||
|
set(PROGRAM_GIT_VERSION 0.0.0-unknown)
|
||||||
|
message(WARNING "Failed to determine version from Git tags. Using default version \"${PROGRAM_GIT_VERSION}\".")
|
||||||
|
else()
|
||||||
|
message("Git Version: \"${PROGRAM_GIT_VERSION}\".")
|
||||||
|
endif()
|
||||||
|
|
||||||
|
configure_file(${SRC} ${DST} @ONLY)
|
1
doxyversion.in.template
Normal file
1
doxyversion.in.template
Normal file
@@ -0,0 +1 @@
|
|||||||
|
@PROGRAM_GIT_VERSION@
|
@@ -1 +0,0 @@
|
|||||||
echo `git describe --tags --always --dirty`
|
|
@@ -1,11 +0,0 @@
|
|||||||
#!/bin/bash
|
|
||||||
|
|
||||||
if [[ -z $1 ]]; then
|
|
||||||
exit -1;
|
|
||||||
fi
|
|
||||||
|
|
||||||
ver=`git describe --tags --always --dirty`
|
|
||||||
echo "#ifndef _VERSION_GENERATED_H_" > $1
|
|
||||||
echo "#define _VERSION_GENERATED_H_" >> $1
|
|
||||||
echo "#define GIT_VERSION_STRING \"$ver\"" >> $1
|
|
||||||
echo "#endif /* _VERSION_GENERATED_H_ */" >> $1
|
|
Submodule linklist-lib updated: c20b5c2528...fdd99bad48
@@ -1,7 +1,6 @@
|
|||||||
set (MAN_PAGE_NAME "patchelfcrc.1.gz")
|
set (MAN_PAGE_NAME "patchelfcrc.1.gz")
|
||||||
|
|
||||||
add_custom_target(man-page
|
add_custom_target(man-page
|
||||||
ALL
|
|
||||||
DEPENDS
|
DEPENDS
|
||||||
${CMAKE_CURRENT_BINARY_DIR}/${MAN_PAGE_NAME}
|
${CMAKE_CURRENT_BINARY_DIR}/${MAN_PAGE_NAME}
|
||||||
)
|
)
|
||||||
|
@@ -61,7 +61,7 @@
|
|||||||
: Export the calculated files to an XML file *XMLFILE*.
|
: Export the calculated files to an XML file *XMLFILE*.
|
||||||
|
|
||||||
**--import**=*XMLFILE*
|
**--import**=*XMLFILE*
|
||||||
: Import the CRCs from an XML file *XMLFILE* and do not caclulate anything in the given *ELF*
|
: Import the CRCs from an XML file *XMLFILE* and do not calculate anything in the given *ELF*
|
||||||
|
|
||||||
**--help**, **-h**, **-?**
|
**--help**, **-h**, **-?**
|
||||||
: Print help.
|
: Print help.
|
||||||
@@ -134,7 +134,7 @@
|
|||||||
|
|
||||||
**patchelfcrc** -l -g word --start-magic=0x12345678 --end-magic=0x8754321 -p crc-32-mpeg -f bare -O .outputsection -S .text executable.elf
|
**patchelfcrc** -l -g word --start-magic=0x12345678 --end-magic=0x8754321 -p crc-32-mpeg -f bare -O .outputsection -S .text executable.elf
|
||||||
: Calculate the CRC over *.text* section and place the result in the *.outputsection* section.
|
: Calculate the CRC over *.text* section and place the result in the *.outputsection* section.
|
||||||
The output sections start and end are checked for the given magic numbers in order to assure correct memory layout.
|
The output sections start and end are checked for the given magic numbers in order to ensure correct memory layout.
|
||||||
*CRC-32-MPEG* is used as CRC algorithm.
|
*CRC-32-MPEG* is used as CRC algorithm.
|
||||||
The memory is interpreted as *little endian* and the CRC calculation granularity is a 32 bit *word*.
|
The memory is interpreted as *little endian* and the CRC calculation granularity is a 32 bit *word*.
|
||||||
|
|
||||||
|
4
version.h.template
Normal file
4
version.h.template
Normal file
@@ -0,0 +1,4 @@
|
|||||||
|
#ifndef _GENRATED_VERSION_H_
|
||||||
|
#define _GENRATED_VERSION_H_
|
||||||
|
#define GIT_VERSION_STRING "@PROGRAM_GIT_VERSION@"
|
||||||
|
#endif /* _GENRATED_VERSION_H_ */
|
Reference in New Issue
Block a user