From a80e9de0cbe6f4301103d8c2fc4ebe317e37643c Mon Sep 17 00:00:00 2001 From: Ivan Yarcev Date: Mon, 18 Dec 2023 09:34:04 +0600 Subject: [PATCH 1/4] Library rename --- README.md | 8 ++++---- source/CMakeLists.txt | 4 +++- source/{ublsettings.c => libublsettings.c} | 2 +- source/{ublsettings.h => libublsettings.h} | 0 4 files changed, 8 insertions(+), 6 deletions(-) rename source/{ublsettings.c => libublsettings.c} (99%) rename source/{ublsettings.h => libublsettings.h} (100%) diff --git a/README.md b/README.md index 500d5e5..61c4f72 100644 --- a/README.md +++ b/README.md @@ -22,13 +22,13 @@ After a successful build, just use: $ sudo make uninstall ``` # Library usage -Libublsettings-ui provides 2 libraries: +Libublsettings-ui provides library: ```C - #include + #include ``` -## ublsettings -UBL utils provides various utility functions used in ubl-settings- applications. They are divided into sections as: +## libublsettings +Library provides various utility functions used in ubl-settings- applications. They are divided into sections as: - **Dictionary functions** yon_dictionary; - **String functions** yon_char; - **String array functions** yon_char_parsed; diff --git a/source/CMakeLists.txt b/source/CMakeLists.txt index 761ee99..f202cb5 100644 --- a/source/CMakeLists.txt +++ b/source/CMakeLists.txt @@ -1,9 +1,10 @@ cmake_minimum_required(VERSION 3.9) -project(ublsettings VERSION 0) +project(libublsettings VERSION 3.1) include(GNUInstallDirs) find_package(PkgConfig REQUIRED) + set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -pedantic -Wall -Wextra -Werror -Wmissing-declarations -fdiagnostics-color=always \ -O2 -pipe -fno-plt -fexceptions \ -Wp,-D_FORTIFY_SOURCE=2 -Wformat -Werror=format-security \ @@ -13,6 +14,7 @@ add_library(${PROJECT_NAME} SHARED ublsettings.c ublsettings.h) + set(LIBRARIES pthread) diff --git a/source/ublsettings.c b/source/libublsettings.c similarity index 99% rename from source/ublsettings.c rename to source/libublsettings.c index 211df08..2a8e337 100644 --- a/source/ublsettings.c +++ b/source/libublsettings.c @@ -1,4 +1,4 @@ -#include "ublsettings.h" +#include "libublsettings.h" // dictionary functions diff --git a/source/ublsettings.h b/source/libublsettings.h similarity index 100% rename from source/ublsettings.h rename to source/libublsettings.h From 438e017e23ce7a82eb83dd102a607f6f0c46488b Mon Sep 17 00:00:00 2001 From: Ivan Yarcev Date: Mon, 18 Dec 2023 09:35:59 +0600 Subject: [PATCH 2/4] Leftover renames --- Makefile | 4 ++-- source/CMakeLists.txt | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/Makefile b/Makefile index 6fe60df..238064e 100644 --- a/Makefile +++ b/Makefile @@ -63,10 +63,10 @@ prepare: check: @echo "Check ..."; \ - if [ -f ${CMAKE_UTILS_BUILD_DIR}/${PKGNAME}.so ]; then \ + if [ -f ${CMAKE_UTILS_BUILD_DIR}/lib${PKGNAME}.so ]; then \ echo "Check: OK"; \ else \ - echo "Check: ${CMAKE_UTILS_BUILD_DIR}/${PKGNAME}.so not found !"; \ + echo "Check: ${CMAKE_UTILS_BUILD_DIR}/lib${PKGNAME}.so not found !"; \ exit 1; \ fi diff --git a/source/CMakeLists.txt b/source/CMakeLists.txt index f202cb5..8840d3f 100644 --- a/source/CMakeLists.txt +++ b/source/CMakeLists.txt @@ -11,8 +11,8 @@ set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -pedantic -Wall -Wextra -Werror -Wmissin -fstack-clash-protection -fcf-protection") add_library(${PROJECT_NAME} SHARED - ublsettings.c - ublsettings.h) + libublsettings.c + libublsettings.h) set(LIBRARIES From c7e392ec9936e7209f9d683bb55c174eea2b1314 Mon Sep 17 00:00:00 2001 From: Ivan Yarcev Date: Mon, 18 Dec 2023 11:43:45 +0600 Subject: [PATCH 3/4] Library rename fixes --- Makefile | 6 ++++-- source/CMakeLists.txt | 5 ++++- 2 files changed, 8 insertions(+), 3 deletions(-) diff --git a/Makefile b/Makefile index 238064e..fae2d02 100644 --- a/Makefile +++ b/Makefile @@ -63,10 +63,10 @@ prepare: check: @echo "Check ..."; \ - if [ -f ${CMAKE_UTILS_BUILD_DIR}/lib${PKGNAME}.so ]; then \ + if [ -f ${CMAKE_UTILS_BUILD_DIR}/${PKGNAME}.so ]; then \ echo "Check: OK"; \ else \ - echo "Check: ${CMAKE_UTILS_BUILD_DIR}/lib${PKGNAME}.so not found !"; \ + echo "Check: ${CMAKE_UTILS_BUILD_DIR}/${PKGNAME}.so not found !"; \ exit 1; \ fi @@ -81,6 +81,8 @@ uninstall: @echo "Uninstall ..." @$(RM) "${DESTDIR}${PREFIX}/lib/${PKGNAME}".so* @$(RM) "${DESTDIR}${PREFIX}/include/${PKGNAME}".h* + @$(RM) "${DESTDIR}/lib/${PKGNAME}".so* + @$(RM) "${DESTDIR}/include/${PKGNAME}".h* @if [ -z ${DESTDIR} ]; then \ ldconfig -n ${DESTDIR}${PREFIX}/lib; \ fi diff --git a/source/CMakeLists.txt b/source/CMakeLists.txt index 8840d3f..e275a8f 100644 --- a/source/CMakeLists.txt +++ b/source/CMakeLists.txt @@ -1,5 +1,5 @@ cmake_minimum_required(VERSION 3.9) -project(libublsettings VERSION 3.1) +project(libublsettings VERSION 0) include(GNUInstallDirs) find_package(PkgConfig REQUIRED) @@ -10,6 +10,8 @@ set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -pedantic -Wall -Wextra -Werror -Wmissin -Wp,-D_FORTIFY_SOURCE=2 -Wformat -Werror=format-security \ -fstack-clash-protection -fcf-protection") + + add_library(${PROJECT_NAME} SHARED libublsettings.c libublsettings.h) @@ -28,6 +30,7 @@ set_target_properties(${PROJECT_NAME} PROPERTIES LINKER_LANGUAGE C) set_target_properties(${PROJECT_NAME} PROPERTIES VERSION ${PROJECT_VERSION}) set_target_properties(${PROJECT_NAME} PROPERTIES SOVERSION ${PROJECT_VERSION_MAJOR}) set_target_properties(${PROJECT_NAME} PROPERTIES PUBLIC_HEADER ${PROJECT_NAME}.h) +set_target_properties(${PROJECT_NAME} PROPERTIES PREFIX "") install(TARGETS ${PROJECT_NAME} LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR} From d670d249e6d1fd23114d56a3c7637cd5ce75849a Mon Sep 17 00:00:00 2001 From: Ivan Yarcev Date: Mon, 18 Dec 2023 12:02:36 +0600 Subject: [PATCH 4/4] Description changes --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 61c4f72..7321359 100644 --- a/README.md +++ b/README.md @@ -22,7 +22,7 @@ After a successful build, just use: $ sudo make uninstall ``` # Library usage -Libublsettings-ui provides library: +Libublsettings provides library: ```C #include ```