From 588368dd2a46ddec70741c6cc87a79a0b26ee383 Mon Sep 17 00:00:00 2001 From: Manuel Bentele Date: Fri, 23 Oct 2020 18:13:15 +0200 Subject: Add automatic generation of version and build type headers for compilation This change replaces the static version and build type header file generation by CMake with dynamic CMake targets to generate the version file whenever a Make target is executed. Thus, there is no need anymore to reconfigure and rerun CMake after the repository version or build configuration has changed. --- CMakeLists.txt | 154 ++++-- COPYING | 339 +++++++++++++ README.md | 8 +- cmake/Build.cmake | 27 + cmake/GenerateBuild.cmake | 10 + cmake/GenerateVersion.cmake | 20 + cmake/InstallVersionFile.cmake.in | 8 + cmake/Kernel.cmake | 57 +++ cmake/Version.cmake | 80 +++ cmake/version.cmake | 21 - inc/xloop/build.h.in | 10 + inc/xloop/version.h.in | 10 + src/kernel/CMakeLists.txt | 32 +- src/kernel/cmake/kernel.cmake | 56 --- src/kernel/xloop_file_fmt_qcow_main.c | 4 +- src/kernel/xloop_file_fmt_raw.c | 4 +- src/kernel/xloop_main.c | 6 +- src/utils/CMakeLists.txt | 8 +- src/utils/config.h | 896 +++++++++++++++++++++++++++++++++ src/utils/config.h.in | 897 ---------------------------------- src/utils/lib/CMakeLists.txt | 1 + src/utils/libsmartcols/CMakeLists.txt | 4 +- src/utils/sys-utils/CMakeLists.txt | 3 +- 23 files changed, 1614 insertions(+), 1041 deletions(-) create mode 100644 COPYING create mode 100644 cmake/Build.cmake create mode 100644 cmake/GenerateBuild.cmake create mode 100644 cmake/GenerateVersion.cmake create mode 100644 cmake/InstallVersionFile.cmake.in create mode 100644 cmake/Kernel.cmake create mode 100644 cmake/Version.cmake delete mode 100644 cmake/version.cmake create mode 100644 inc/xloop/build.h.in create mode 100644 inc/xloop/version.h.in delete mode 100644 src/kernel/cmake/kernel.cmake create mode 100644 src/utils/config.h delete mode 100644 src/utils/config.h.in diff --git a/CMakeLists.txt b/CMakeLists.txt index cc62a4b..a14e369 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1,21 +1,41 @@ cmake_minimum_required(VERSION 3.10) # include CMake macros -set (CMAKE_MODULE_PATH "${CMAKE_MODULE_PATH};${CMAKE_CURRENT_SOURCE_DIR}/cmake") -include(version) +set(PROJECT_MODULES_DIR ${CMAKE_CURRENT_SOURCE_DIR}/cmake) +set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} + ${PROJECT_MODULES_DIR}) # define root CMake project project(xloop DESCRIPTION "xloop Linux kernel modules and utility" LANGUAGES C) -# define project specific settings -set(BLK_DEV_XLOOP_MIN_COUNT 8 - CACHE STRING "Number of xloop devices to pre-create at init time") -set(XLOOP_MAJOR 120 - CACHE STRING "Major number for xloop devices") -set(XLOOP_CTRL_MINOR 15 - CACHE STRING "Minor number for the xloop-control device") +# check for system before all other stuff is configured +if(NOT UNIX OR NOT CMAKE_SYSTEM_NAME MATCHES "Linux") + # abort build of the xloop Linux kernel modules on a system other than Linux, eg. FreeBSD + message(FATAL_ERROR "Detected non-Linux system: Abort build of the xloop Linux kernel modules and utility") +endif(NOT UNIX OR NOT CMAKE_SYSTEM_NAME MATCHES "Linux") + +# set supported build configurations +set(CMAKE_CONFIGURATION_TYPES Debug Release) + +# set compilation in debug mode as default configuration +if(NOT CMAKE_BUILD_TYPE) + set(CMAKE_BUILD_TYPE Debug) + message(STATUS "Build type is not set. Defaulting to ${CMAKE_BUILD_TYPE} build!") +endif(NOT CMAKE_BUILD_TYPE) + +# include project version and build type related macros +include(Version) +include(Build) + +# search for required packages +find_package(Git) + +# abort if a required package is not available +if(NOT GIT_FOUND) + message(FATAL_ERROR "No Git found, can't determine xloop project version number!") +endif(NOT GIT_FOUND) # set Linux kernel directories set(KERNEL_BUILD_DIR "/lib/modules/${CMAKE_SYSTEM_VERSION}/build" @@ -23,6 +43,14 @@ set(KERNEL_BUILD_DIR "/lib/modules/${CMAKE_SYSTEM_VERSION}/build" set(KERNEL_INSTALL_DIR "/lib/modules/${CMAKE_SYSTEM_VERSION}/extra" CACHE PATH "Path to install Linux kernel modules") +# set linux kernel modules specific default settings +set(BLK_DEV_XLOOP_MIN_COUNT 8 + CACHE STRING "Number of xloop devices to pre-create at init time") +set(XLOOP_MAJOR 120 + CACHE STRING "Major number for xloop devices") +set(XLOOP_CTRL_MINOR 15 + CACHE STRING "Minor number for the xloop-control device") + # print configured settings message(STATUS "Path to Linux kernel modules to compile against is " ${KERNEL_BUILD_DIR}) message(STATUS "Path to install Linux kernel modules is " ${KERNEL_INSTALL_DIR}) @@ -30,48 +58,77 @@ message(STATUS "Number of xloop devices to pre-create at init time is " ${BLK_DE message(STATUS "Major number for xloop devices is " ${XLOOP_MAJOR}) message(STATUS "Minor number for the xloop-control device is " ${XLOOP_CTRL_MINOR}) -# set supported build configurations -set(CMAKE_CONFIGURATION_TYPES Debug Release) +# get the Linux kernel version +get_kernel_version(LINUX_KERNEL_VERSION ${KERNEL_BUILD_DIR}) -# set compilation in debug mode as default configuration -if(NOT CMAKE_BUILD_TYPE) - set(CMAKE_BUILD_TYPE Debug) - message(STATUS "Build type is not set. Defaulting to ${CMAKE_BUILD_TYPE} build!") -endif() +# set include directories +set(PROJECT_GEN_DIR ${CMAKE_BINARY_DIR}/generated) +set(PROJECT_INCLUDE_DIR_PREFIX inc) +set(PROJECT_INCLUDE_DIR ${CMAKE_SOURCE_DIR}/${PROJECT_INCLUDE_DIR_PREFIX}) +set(PROJECT_INCLUDE_GEN_DIR ${PROJECT_GEN_DIR}/${PROJECT_INCLUDE_DIR_PREFIX}) +include_directories(${PROJECT_INCLUDE_DIR}) -# get versions to define project version -get_kernel_version(LINUX_KERNEL_VERSION ${KERNEL_BUILD_DIR}) -get_repository_version(REPOSITORY_VERSION) -set(VERSION ${LINUX_KERNEL_VERSION}-${REPOSITORY_VERSION} - CACHE STRING "Version of xloop package") +# generate project version C header file from template +# exposes xloop-generate-version and xloop-version target +set(INCLUDE_VERSION_HEADER ${PROJECT_INCLUDE_DIR}/xloop/version.h) +set(INCLUDE_VERSION_HEADER_TEMPLATE ${PROJECT_INCLUDE_DIR}/xloop/version.h.in) +set(INCLUDE_VERSION_HEADER_GENERATE ${PROJECT_INCLUDE_GEN_DIR}/xloop/version.h) +set(INCLUDE_VERSION_HEADER_GENERATE_PREFIX ${PROJECT_INCLUDE_DIR_PREFIX}/xloop) +gen_project_version(${INCLUDE_VERSION_HEADER} ${INCLUDE_VERSION_HEADER_TEMPLATE} ${INCLUDE_VERSION_HEADER_GENERATE}) + +# generate project build type C header file from template +# exposes xloop-generate-build and xloop-build target +set(INCLUDE_BUILD_HEADER_TEMPLATE ${PROJECT_INCLUDE_DIR}/xloop/build.h.in) +set(INCLUDE_BUILD_HEADER_GENERATE ${PROJECT_INCLUDE_GEN_DIR}/xloop/build.h) +gen_build_type(${INCLUDE_BUILD_HEADER_TEMPLATE} ${INCLUDE_BUILD_HEADER_GENERATE}) + +# enable all error warnings in Debug build configuration +set(CMAKE_C_FLAGS_DEBUG "-Wall -Wextra -Wpedantic -Wconversion -Wformat -Wformat-security -Werror=format-security") +set(CMAKE_C_FLAGS_RELEASE "-Wno-error") + +# set compilation optimization +set(CMAKE_C_FLAGS_DEBUG "${CMAKE_C_FLAGS_DEBUG} -g -Og -DDEBUG") +set(CMAKE_C_FLAGS_RELEASE "${CMAKE_C_FLAGS_RELEASE} -O3 -DNDEBUG") # define packaging if Release build is enabled -if(${CMAKE_BUILD_TYPE} MATCHES Release) +if(CMAKE_BUILD_TYPE MATCHES "Release") + # get version source package or Git repository + get_repository_version(REPOSITORY_VERSION ${INCLUDE_VERSION_HEADER} ${CMAKE_BUILD_TYPE}) + + # define project version + set(REPOSITORY_VERSION_FULL ${REPOSITORY_VERSION}-${LINUX_KERNEL_VERSION}) + set(CPACK_GENERATOR "DEB;RPM;TGZ") - set(CPACK_SOURCE_GENERATOR "TGZ;ZIP") set(CPACK_PACKAGE_NAME ${CMAKE_PROJECT_NAME}) set(CPACK_MONOLITHIC_INSTALL True) - set(CPACK_SOURCE_IGNORE_FILES "/build/;/.git/;.gitignore$;.*~") - set(CPACK_PACKAGE_VERSION ${VERSION}) + set(CPACK_PACKAGE_VERSION ${REPOSITORY_VERSION}) + set(CPACK_PACKAGE_VERSION_FULL ${REPOSITORY_VERSION_FULL}) set(CPACK_PACKAGE_SECTION admin) set(CPACK_PACKAGE_VENDOR "University of Freiburg") set(CPACK_PACKAGE_CONTACT "Christian Rößler ") set(CPACK_PACKAGE_HOMEPAGE_URL "https://git.openslx.org/openslx-ng/xloop.git/") set(CPACK_PACKAGE_CHECKSUM SHA256) - set(CPACK_PACKAGE_FILE_NAME ${CPACK_PACKAGE_NAME}_${CPACK_PACKAGE_VERSION}_${CMAKE_SYSTEM_PROCESSOR}) + set(CPACK_PACKAGE_FILE_NAME ${CPACK_PACKAGE_NAME}_${REPOSITORY_VERSION_FULL}_${CMAKE_SYSTEM_PROCESSOR}) set(CPACK_SOURCE_PACKAGE_FILE_NAME ${CPACK_PACKAGE_NAME}_${CPACK_PACKAGE_VERSION}_source) set(CPACK_STRIP_FILES True) set(CPACK_PACKAGE_RELOCATABLE False) set(CPACK_SET_DESTDIR True) set(CMAKE_INSTALL_PREFIX "/usr") set(CPACK_PACKAGING_INSTALL_PREFIX ${CMAKE_INSTALL_PREFIX}) + set(CPACK_RESOURCE_FILE_LICENSE ${CMAKE_CURRENT_SOURCE_DIR}/COPYING) + set(CPACK_RESOURCE_FILE_README ${CMAKE_CURRENT_SOURCE_DIR}/README.md) + # set DEB generator specific packaging options - set(CPACK_DEBIAN_PACKAGE_DEPENDS "libc-bin") - file(WRITE ${CMAKE_CURRENT_BINARY_DIR}/package/deb/postinst "depmod -a\nudevadm control --reload-rules\n") - file(WRITE ${CMAKE_CURRENT_BINARY_DIR}/package/deb/postrm "depmod -a\nudevadm control --reload-rules\n") - set(CPACK_DEBIAN_PACKAGE_CONTROL_EXTRA ${CMAKE_CURRENT_BINARY_DIR}/package/deb/postinst - ${CMAKE_CURRENT_BINARY_DIR}/package/deb/postrm) + set(CPACK_DEBIAN_PACKAGE_DEPENDS "libc6") + if(XLOOP_KERNEL_MODULES) + file(WRITE ${CMAKE_CURRENT_BINARY_DIR}/package/deb/postinst "depmod -a\nudevadm control --reload-rules\n") + file(WRITE ${CMAKE_CURRENT_BINARY_DIR}/package/deb/postrm "depmod -a\nudevadm control --reload-rules\n") + set(CPACK_DEBIAN_PACKAGE_CONTROL_EXTRA ${CMAKE_CURRENT_BINARY_DIR}/package/deb/postinst + ${CMAKE_CURRENT_BINARY_DIR}/package/deb/postrm) + endif(XLOOP_KERNEL_MODULES) + # set RPM generator specific packaging options + set(CPACK_RPM_PACKAGE_REQUIRES "glibc") set(CPACK_RPM_EXCLUDE_FROM_AUTO_FILELIST_ADDITION "/lib" "/lib/modules" "/lib/modules/${CMAKE_SYSTEM_VERSION}" @@ -82,16 +139,35 @@ if(${CMAKE_BUILD_TYPE} MATCHES Release) "${CPACK_PACKAGING_INSTALL_PREFIX}/share/bash-completion/completions" "${CPACK_PACKAGING_INSTALL_PREFIX}/share/man" "${CPACK_PACKAGING_INSTALL_PREFIX}/share/man/man8") - file(WRITE ${CMAKE_CURRENT_BINARY_DIR}/package/rpm/post "depmod -a\nudevadm control --reload-rules\n") - file(WRITE ${CMAKE_CURRENT_BINARY_DIR}/package/rpm/postun "depmod -a\nudevadm control --reload-rules\n") - set(CPACK_RPM_POST_INSTALL_SCRIPT_FILE ${CMAKE_CURRENT_BINARY_DIR}/package/rpm/post) - set(CPACK_RPM_POST_UNINSTALL_SCRIPT_FILE ${CMAKE_CURRENT_BINARY_DIR}/package/rpm/postun) + if(XLOOP_KERNEL_MODULES) + file(WRITE ${CMAKE_CURRENT_BINARY_DIR}/package/rpm/post "depmod -a\nudevadm control --reload-rules\n") + file(WRITE ${CMAKE_CURRENT_BINARY_DIR}/package/rpm/postun "depmod -a\nudevadm control --reload-rules\n") + set(CPACK_RPM_POST_INSTALL_SCRIPT_FILE ${CMAKE_CURRENT_BINARY_DIR}/package/rpm/post) + set(CPACK_RPM_POST_UNINSTALL_SCRIPT_FILE ${CMAKE_CURRENT_BINARY_DIR}/package/rpm/postun) + endif(XLOOP_KERNEL_MODULES) + + # configure source packaging + set(CPACK_SOURCE_GENERATOR "TGZ;ZIP") + set(CPACK_SOURCE_INSTALLED_DIRECTORIES "${CMAKE_SOURCE_DIR}" "/" + "${PROJECT_GEN_DIR}" "/") + set(CPACK_SOURCE_IGNORE_FILES "/build/;/.git/;.gitignore$;.*~;version.h.in$") + + # generate install script for CPack to install generated files + configure_file(${PROJECT_MODULES_DIR}/InstallVersionFile.cmake.in ${CMAKE_CURRENT_BINARY_DIR}/package/InstallVersionFile.cmake) + + # set CPack install script + set(CPACK_INSTALL_SCRIPT ${CMAKE_CURRENT_BINARY_DIR}/package/InstallVersionFile.cmake) + # include CPack functionality include(CPack) -endif() + + # create custom target to build package source + add_custom_target(source + COMMAND ${CMAKE_COMMAND} --build ${CMAKE_BINARY_DIR} --target package_source + DEPENDS xloop-generate-version + VERBATIM + USES_TERMINAL) +endif(CMAKE_BUILD_TYPE MATCHES "Release") # add all xloop related projects from the source code directory add_subdirectory(src) - -# print version information -message(STATUS "Configured ${CMAKE_PROJECT_NAME} in version ${VERSION}") diff --git a/COPYING b/COPYING new file mode 100644 index 0000000..d159169 --- /dev/null +++ b/COPYING @@ -0,0 +1,339 @@ + GNU GENERAL PUBLIC LICENSE + Version 2, June 1991 + + Copyright (C) 1989, 1991 Free Software Foundation, Inc., + 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + Everyone is permitted to copy and distribute verbatim copies + of this license document, but changing it is not allowed. + + Preamble + + The licenses for most software are designed to take away your +freedom to share and change it. By contrast, the GNU General Public +License is intended to guarantee your freedom to share and change free +software--to make sure the software is free for all its users. This +General Public License applies to most of the Free Software +Foundation's software and to any other program whose authors commit to +using it. (Some other Free Software Foundation software is covered by +the GNU Lesser General Public License instead.) You can apply it to +your programs, too. + + When we speak of free software, we are referring to freedom, not +price. Our General Public Licenses are designed to make sure that you +have the freedom to distribute copies of free software (and charge for +this service if you wish), that you receive source code or can get it +if you want it, that you can change the software or use pieces of it +in new free programs; and that you know you can do these things. + + To protect your rights, we need to make restrictions that forbid +anyone to deny you these rights or to ask you to surrender the rights. +These restrictions translate to certain responsibilities for you if you +distribute copies of the software, or if you modify it. + + For example, if you distribute copies of such a program, whether +gratis or for a fee, you must give the recipients all the rights that +you have. You must make sure that they, too, receive or can get the +source code. And you must show them these terms so they know their +rights. + + We protect your rights with two steps: (1) copyright the software, and +(2) offer you this license which gives you legal permission to copy, +distribute and/or modify the software. + + Also, for each author's protection and ours, we want to make certain +that everyone understands that there is no warranty for this free +software. If the software is modified by someone else and passed on, we +want its recipients to know that what they have is not the original, so +that any problems introduced by others will not reflect on the original +authors' reputations. + + Finally, any free program is threatened constantly by software +patents. We wish to avoid the danger that redistributors of a free +program will individually obtain patent licenses, in effect making the +program proprietary. To prevent this, we have made it clear that any +patent must be licensed for everyone's free use or not licensed at all. + + The precise terms and conditions for copying, distribution and +modification follow. + + GNU GENERAL PUBLIC LICENSE + TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION + + 0. This License applies to any program or other work which contains +a notice placed by the copyright holder saying it may be distributed +under the terms of this General Public License. The "Program", below, +refers to any such program or work, and a "work based on the Program" +means either the Program or any derivative work under copyright law: +that is to say, a work containing the Program or a portion of it, +either verbatim or with modifications and/or translated into another +language. (Hereinafter, translation is included without limitation in +the term "modification".) Each licensee is addressed as "you". + +Activities other than copying, distribution and modification are not +covered by this License; they are outside its scope. The act of +running the Program is not restricted, and the output from the Program +is covered only if its contents constitute a work based on the +Program (independent of having been made by running the Program). +Whether that is true depends on what the Program does. + + 1. You may copy and distribute verbatim copies of the Program's +source code as you receive it, in any medium, provided that you +conspicuously and appropriately publish on each copy an appropriate +copyright notice and disclaimer of warranty; keep intact all the +notices that refer to this License and to the absence of any warranty; +and give any other recipients of the Program a copy of this License +along with the Program. + +You may charge a fee for the physical act of transferring a copy, and +you may at your option offer warranty protection in exchange for a fee. + + 2. You may modify your copy or copies of the Program or any portion +of it, thus forming a work based on the Program, and copy and +distribute such modifications or work under the terms of Section 1 +above, provided that you also meet all of these conditions: + + a) You must cause the modified files to carry prominent notices + stating that you changed the files and the date of any change. + + b) You must cause any work that you distribute or publish, that in + whole or in part contains or is derived from the Program or any + part thereof, to be licensed as a whole at no charge to all third + parties under the terms of this License. + + c) If the modified program normally reads commands interactively + when run, you must cause it, when started running for such + interactive use in the most ordinary way, to print or display an + announcement including an appropriate copyright notice and a + notice that there is no warranty (or else, saying that you provide + a warranty) and that users may redistribute the program under + these conditions, and telling the user how to view a copy of this + License. (Exception: if the Program itself is interactive but + does not normally print such an announcement, your work based on + the Program is not required to print an announcement.) + +These requirements apply to the modified work as a whole. If +identifiable sections of that work are not derived from the Program, +and can be reasonably considered independent and separate works in +themselves, then this License, and its terms, do not apply to those +sections when you distribute them as separate works. But when you +distribute the same sections as part of a whole which is a work based +on the Program, the distribution of the whole must be on the terms of +this License, whose permissions for other licensees extend to the +entire whole, and thus to each and every part regardless of who wrote it. + +Thus, it is not the intent of this section to claim rights or contest +your rights to work written entirely by you; rather, the intent is to +exercise the right to control the distribution of derivative or +collective works based on the Program. + +In addition, mere aggregation of another work not based on the Program +with the Program (or with a work based on the Program) on a volume of +a storage or distribution medium does not bring the other work under +the scope of this License. + + 3. You may copy and distribute the Program (or a work based on it, +under Section 2) in object code or executable form under the terms of +Sections 1 and 2 above provided that you also do one of the following: + + a) Accompany it with the complete corresponding machine-readable + source code, which must be distributed under the terms of Sections + 1 and 2 above on a medium customarily used for software interchange; or, + + b) Accompany it with a written offer, valid for at least three + years, to give any third party, for a charge no more than your + cost of physically performing source distribution, a complete + machine-readable copy of the corresponding source code, to be + distributed under the terms of Sections 1 and 2 above on a medium + customarily used for software interchange; or, + + c) Accompany it with the information you received as to the offer + to distribute corresponding source code. (This alternative is + allowed only for noncommercial distribution and only if you + received the program in object code or executable form with such + an offer, in accord with Subsection b above.) + +The source code for a work means the preferred form of the work for +making modifications to it. For an executable work, complete source +code means all the source code for all modules it contains, plus any +associated interface definition files, plus the scripts used to +control compilation and installation of the executable. However, as a +special exception, the source code distributed need not include +anything that is normally distributed (in either source or binary +form) with the major components (compiler, kernel, and so on) of the +operating system on which the executable runs, unless that component +itself accompanies the executable. + +If distribution of executable or object code is made by offering +access to copy from a designated place, then offering equivalent +access to copy the source code from the same place counts as +distribution of the source code, even though third parties are not +compelled to copy the source along with the object code. + + 4. You may not copy, modify, sublicense, or distribute the Program +except as expressly provided under this License. Any attempt +otherwise to copy, modify, sublicense or distribute the Program is +void, and will automatically terminate your rights under this License. +However, parties who have received copies, or rights, from you under +this License will not have their licenses terminated so long as such +parties remain in full compliance. + + 5. You are not required to accept this License, since you have not +signed it. However, nothing else grants you permission to modify or +distribute the Program or its derivative works. These actions are +prohibited by law if you do not accept this License. Therefore, by +modifying or distributing the Program (or any work based on the +Program), you indicate your acceptance of this License to do so, and +all its terms and conditions for copying, distributing or modifying +the Program or works based on it. + + 6. Each time you redistribute the Program (or any work based on the +Program), the recipient automatically receives a license from the +original licensor to copy, distribute or modify the Program subject to +these terms and conditions. You may not impose any further +restrictions on the recipients' exercise of the rights granted herein. +You are not responsible for enforcing compliance by third parties to +this License. + + 7. If, as a consequence of a court judgment or allegation of patent +infringement or for any other reason (not limited to patent issues), +conditions are imposed on you (whether by court order, agreement or +otherwise) that contradict the conditions of this License, they do not +excuse you from the conditions of this License. If you cannot +distribute so as to satisfy simultaneously your obligations under this +License and any other pertinent obligations, then as a consequence you +may not distribute the Program at all. For example, if a patent +license would not permit royalty-free redistribution of the Program by +all those who receive copies directly or indirectly through you, then +the only way you could satisfy both it and this License would be to +refrain entirely from distribution of the Program. + +If any portion of this section is held invalid or unenforceable under +any particular circumstance, the balance of the section is intended to +apply and the section as a whole is intended to apply in other +circumstances. + +It is not the purpose of this section to induce you to infringe any +patents or other property right claims or to contest validity of any +such claims; this section has the sole purpose of protecting the +integrity of the free software distribution system, which is +implemented by public license practices. Many people have made +generous contributions to the wide range of software distributed +through that system in reliance on consistent application of that +system; it is up to the author/donor to decide if he or she is willing +to distribute software through any other system and a licensee cannot +impose that choice. + +This section is intended to make thoroughly clear what is believed to +be a consequence of the rest of this License. + + 8. If the distribution and/or use of the Program is restricted in +certain countries either by patents or by copyrighted interfaces, the +original copyright holder who places the Program under this License +may add an explicit geographical distribution limitation excluding +those countries, so that distribution is permitted only in or among +countries not thus excluded. In such case, this License incorporates +the limitation as if written in the body of this License. + + 9. The Free Software Foundation may publish revised and/or new versions +of the General Public License from time to time. Such new versions will +be similar in spirit to the present version, but may differ in detail to +address new problems or concerns. + +Each version is given a distinguishing version number. If the Program +specifies a version number of this License which applies to it and "any +later version", you have the option of following the terms and conditions +either of that version or of any later version published by the Free +Software Foundation. If the Program does not specify a version number of +this License, you may choose any version ever published by the Free Software +Foundation. + + 10. If you wish to incorporate parts of the Program into other free +programs whose distribution conditions are different, write to the author +to ask for permission. For software which is copyrighted by the Free +Software Foundation, write to the Free Software Foundation; we sometimes +make exceptions for this. Our decision will be guided by the two goals +of preserving the free status of all derivatives of our free software and +of promoting the sharing and reuse of software generally. + + NO WARRANTY + + 11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY +FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN +OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES +PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED +OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF +MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS +TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE +PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, +REPAIR OR CORRECTION. + + 12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING +WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR +REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, +INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING +OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED +TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY +YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER +PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE +POSSIBILITY OF SUCH DAMAGES. + + END OF TERMS AND CONDITIONS + + How to Apply These Terms to Your New Programs + + If you develop a new program, and you want it to be of the greatest +possible use to the public, the best way to achieve this is to make it +free software which everyone can redistribute and change under these terms. + + To do so, attach the following notices to the program. It is safest +to attach them to the start of each source file to most effectively +convey the exclusion of warranty; and each file should have at least +the "copyright" line and a pointer to where the full notice is found. + + + Copyright (C) + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License along + with this program; if not, write to the Free Software Foundation, Inc., + 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + +Also add information on how to contact you by electronic and paper mail. + +If the program is interactive, make it output a short notice like this +when it starts in an interactive mode: + + Gnomovision version 69, Copyright (C) year name of author + Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'. + This is free software, and you are welcome to redistribute it + under certain conditions; type `show c' for details. + +The hypothetical commands `show w' and `show c' should show the appropriate +parts of the General Public License. Of course, the commands you use may +be called something other than `show w' and `show c'; they could even be +mouse-clicks or menu items--whatever suits your program. + +You should also get your employer (if you work as a programmer) or your +school, if any, to sign a "copyright disclaimer" for the program, if +necessary. Here is a sample; alter the names: + + Yoyodyne, Inc., hereby disclaims all copyright interest in the program + `Gnomovision' (which makes passes at compilers) written by James Hacker. + + , 1 April 1989 + Ty Coon, President of Vice + +This General Public License does not permit incorporating your program into +proprietary programs. If your program is a subroutine library, you may +consider it more useful to permit linking proprietary applications with the +library. If this is what you want to do, use the GNU Lesser General +Public License instead of this License. diff --git a/README.md b/README.md index d1229c9..efa50de 100644 --- a/README.md +++ b/README.md @@ -111,17 +111,17 @@ In the `Release` build configuration, installation packages can be built by call make package ``` -This target creates a Debian installation package (\*.deb) and a compressed archive (\*.tar.gz) containing the built xloop Linux kernel modules and the xlosetup utility executable as well as its man page and bash-completion support. +This target creates a Debian installation package (\*.deb), a RPM installation package (\*.rpm) and a compressed archive (\*.tar.gz) containing the built xloop Linux kernel modules and the xlosetup utility executable as well as its man page and bash-completion support. ### Sources -In the `Release` build configuration, sources can be built by calling the make target `package_source`: +In the `Release` build configuration, sources can be built by calling the make target `source`: ```shell -make package_source +make source ``` -This target creates compressed archives (\*_sources.tar.gz and \*_sources.zip) containing the source code of this repository for code distribution purposes. +This target creates compressed archives (\*_source.tar.gz and \*_source.zip) containing the source code of this repository for code distribution purposes. ## Debugging diff --git a/cmake/Build.cmake b/cmake/Build.cmake new file mode 100644 index 0000000..bad9755 --- /dev/null +++ b/cmake/Build.cmake @@ -0,0 +1,27 @@ +# SPDX-License-Identifier: GPL-2.0 +# +# Copyright (C) 2020 Manuel Bentele +# + +macro(gen_build_type BUILD_INPUT_FILE_TEMPLATE BUILD_OUTPUT_FILE) + get_filename_component(BUILD_OUTPUT_FILENAME ${BUILD_OUTPUT_FILE} NAME) + # command that will trigger a rebuild of build.h every time + add_custom_command(OUTPUT regenerate-build-file + COMMAND ${CMAKE_COMMAND} -E sleep 0 + COMMENT "Trigger generating ${BUILD_OUTPUT_FILENAME}") + + # call the GenerateBuild.cmake file to generate the build.h file + add_custom_command(OUTPUT ${BUILD_OUTPUT_FILE} + COMMAND ${CMAKE_COMMAND} -D BUILD_INPUT_FILE_TEMPLATE=${BUILD_INPUT_FILE_TEMPLATE} + -D BUILD_OUTPUT_FILE=${BUILD_OUTPUT_FILE} + -D BUILD_TYPE=${CMAKE_BUILD_TYPE} + -P ${PROJECT_MODULES_DIR}/GenerateBuild.cmake + COMMENT "Generating ${BUILD_OUTPUT_FILENAME}" + DEPENDS regenerate-build-file) + add_custom_target(xloop-generate-build DEPENDS ${BUILD_OUTPUT_FILE}) + + # create target to expose project build type + add_library(xloop-build INTERFACE) + target_include_directories(xloop-build INTERFACE ${PROJECT_INCLUDE_GEN_DIR}) + add_dependencies(xloop-build xloop-generate-build) +endmacro(gen_build_type BUILD_INPUT_FILE_TEMPLATE BUILD_OUTPUT_FILE) diff --git a/cmake/GenerateBuild.cmake b/cmake/GenerateBuild.cmake new file mode 100644 index 0000000..5af35d2 --- /dev/null +++ b/cmake/GenerateBuild.cmake @@ -0,0 +1,10 @@ +# SPDX-License-Identifier: GPL-2.0 +# +# Copyright (C) 2020 Manuel Bentele +# + +# set current build type of the project +set(XLOOP_BUILD ${BUILD_TYPE}) + +# write dnbd3 build type into a new C source file based on the specified build file template +configure_file(${BUILD_INPUT_FILE_TEMPLATE} ${BUILD_OUTPUT_FILE}) diff --git a/cmake/GenerateVersion.cmake b/cmake/GenerateVersion.cmake new file mode 100644 index 0000000..73b0771 --- /dev/null +++ b/cmake/GenerateVersion.cmake @@ -0,0 +1,20 @@ +# SPDX-License-Identifier: GPL-2.0 +# +# Copyright (C) 2020 Manuel Bentele +# + +# set CMake module path to include version macros +set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} + ${VERSION_MODULE_PATH}) + +# include version macros +include(Version) + +# get Git version of Git repository +get_repository_version(XLOOP_VERSION ${VERSION_INPUT_FILE} ${VERSION_BUILD_TYPE}) + +# generate version header if header does not exists +if(NOT EXISTS ${VERSION_INPUT_FILE}) + # write dnbd3 version into a new C source file based on the specified version template + configure_file(${VERSION_INPUT_FILE_TEMPLATE} ${VERSION_OUTPUT_FILE}) +endif(NOT EXISTS ${VERSION_INPUT_FILE}) diff --git a/cmake/InstallVersionFile.cmake.in b/cmake/InstallVersionFile.cmake.in new file mode 100644 index 0000000..8121c25 --- /dev/null +++ b/cmake/InstallVersionFile.cmake.in @@ -0,0 +1,8 @@ +# +# AUTOGENERATED: DO NOT EDIT THIS FILE +# + +if(CPACK_SOURCE_INSTALLED_DIRECTORIES AND EXISTS "@INCLUDE_VERSION_HEADER_GENERATE@") + file(INSTALL "@INCLUDE_VERSION_HEADER_GENERATE@" + DESTINATION "@INCLUDE_VERSION_HEADER_GENERATE_PREFIX@") +endif(CPACK_SOURCE_INSTALLED_DIRECTORIES AND EXISTS "@INCLUDE_VERSION_HEADER_GENERATE@") diff --git a/cmake/Kernel.cmake b/cmake/Kernel.cmake new file mode 100644 index 0000000..232c298 --- /dev/null +++ b/cmake/Kernel.cmake @@ -0,0 +1,57 @@ +# SPDX-License-Identifier: GPL-2.0 +# +# CMake macros to build and install Linux kernel modules +# Copyright (C) 2020 Manuel Bentele +# + +# macro to define kernel module targets +macro(add_kernel_module MODULE_NAME KERNEL_BUILD_DIR KERNEL_INSTALL_DIR MODULE_MACRO MODULE_SOURCE_FILES MODULE_HEADER_FILES BUILD_SOURCE_FILE) + # create directory for kernel module + file(MAKE_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/${MODULE_NAME}) + # copy build source file + get_filename_component(BUILD_SOURCE_FILENAME ${BUILD_SOURCE_FILE} NAME) + add_custom_command(OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/${MODULE_NAME}/${BUILD_SOURCE_FILENAME} + COMMAND ${CMAKE_COMMAND} -E copy_if_different ${BUILD_SOURCE_FILE} ${CMAKE_CURRENT_BINARY_DIR}/${MODULE_NAME} + DEPENDS ${BUILD_SOURCE_FILE}) + set(BUILD_SOURCE_FILE_PREPARED ${CMAKE_CURRENT_BINARY_DIR}/${MODULE_NAME}/${BUILD_SOURCE_FILENAME}) + # copy source files + foreach(MODULE_SOURCE_FILE ${MODULE_SOURCE_FILES}) + get_filename_component(MODULE_SOURCE_FILENAME ${MODULE_SOURCE_FILE} NAME) + add_custom_command(OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/${MODULE_NAME}/${MODULE_SOURCE_FILENAME} + COMMAND ${CMAKE_COMMAND} -E copy_if_different ${MODULE_SOURCE_FILE} ${CMAKE_CURRENT_BINARY_DIR}/${MODULE_NAME} + DEPENDS ${MODULE_SOURCE_FILE}) + set(MODULE_SOURCE_FILES_PREPARED ${MODULE_SOURCE_FILES_PREPARED} + ${CMAKE_CURRENT_BINARY_DIR}/${MODULE_NAME}/${MODULE_SOURCE_FILENAME}) + endforeach() + # copy header files + foreach(MODULE_HEADER_FILE ${MODULE_HEADER_FILES}) + get_filename_component(MODULE_HEADER_FILENAME ${MODULE_HEADER_FILE} NAME) + add_custom_command(OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/${MODULE_NAME}/${MODULE_HEADER_FILENAME} + COMMAND ${CMAKE_COMMAND} -E copy_if_different ${MODULE_HEADER_FILE} ${CMAKE_CURRENT_BINARY_DIR}/${MODULE_NAME} + DEPENDS ${MODULE_HEADER_FILE}) + set(MODULE_HEADER_FILES_PREPARED ${MODULE_HEADER_FILES_PREPARED} + ${CMAKE_CURRENT_BINARY_DIR}/${MODULE_NAME}/${MODULE_HEADER_FILENAME}) + endforeach() + # check if module depends on another module + if(NOT ${ARGV7} STREQUAL "") + set(MODULE_EXTRA_SYMBOLS ${CMAKE_CURRENT_BINARY_DIR}/${ARGV7}/Module.symvers) + endif() + # define build command + set(MODULE_BUILD_COMMAND ${CMAKE_MAKE_PROGRAM} ${MODULE_MACRO} + -C ${KERNEL_BUILD_DIR} + M=${CMAKE_CURRENT_BINARY_DIR}/${MODULE_NAME} modules + EXTRA_CFLAGS=${KERNEL_C_FLAGS} + KBUILD_EXTRA_SYMBOLS=${MODULE_EXTRA_SYMBOLS}) + add_custom_command(OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/${MODULE_NAME}/${MODULE_NAME}.ko + COMMAND ${MODULE_BUILD_COMMAND} + WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/${MODULE_NAME} + COMMENT "Build kernel module ${MODULE_NAME}" + DEPENDS ${BUILD_SOURCE_FILE_PREPARED} ${MODULE_HEADER_FILES_PREPARED} ${MODULE_SOURCE_FILES_PREPARED} + VERBATIM) + add_custom_target(${MODULE_NAME} ALL DEPENDS ${CMAKE_CURRENT_BINARY_DIR}/${MODULE_NAME}/${MODULE_NAME}.ko ${ARGV7}) + # install kernel module + install(PROGRAMS ${CMAKE_CURRENT_BINARY_DIR}/${MODULE_NAME}/${MODULE_NAME}.ko + DESTINATION ${KERNEL_INSTALL_DIR} + PERMISSIONS OWNER_READ OWNER_WRITE GROUP_READ WORLD_READ + COMPONENT kernel) +endmacro(add_kernel_module) diff --git a/cmake/Version.cmake b/cmake/Version.cmake new file mode 100644 index 0000000..a061e48 --- /dev/null +++ b/cmake/Version.cmake @@ -0,0 +1,80 @@ +# SPDX-License-Identifier: GPL-2.0 +# +# Copyright (C) 2020 Manuel Bentele +# + +macro(gen_project_version VERSION_INPUT_FILE VERSION_INPUT_FILE_TEMPLATE VERSION_OUTPUT_FILE) + get_filename_component(VERSION_OUTPUT_FILENAME ${VERSION_OUTPUT_FILE} NAME) + # command that will trigger a rebuild of version.h every time + add_custom_command(OUTPUT regenerate-version-file + COMMAND ${CMAKE_COMMAND} -E sleep 0 + COMMENT "Trigger generating ${VERSION_OUTPUT_FILENAME}") + + # call the GenerateVersion.cmake file to generate the version.c file + add_custom_command(OUTPUT ${VERSION_OUTPUT_FILE} + COMMAND ${CMAKE_COMMAND} -D VERSION_MODULE_PATH=${PROJECT_MODULES_DIR} + -D VERSION_INPUT_FILE=${VERSION_INPUT_FILE} + -D VERSION_INPUT_FILE_TEMPLATE=${VERSION_INPUT_FILE_TEMPLATE} + -D VERSION_OUTPUT_FILE=${VERSION_OUTPUT_FILE} + -D VERSION_BUILD_TYPE=${CMAKE_BUILD_TYPE} + -P ${PROJECT_MODULES_DIR}/GenerateVersion.cmake + COMMENT "Generating ${VERSION_OUTPUT_FILENAME}" + DEPENDS regenerate-version-file) + add_custom_target(xloop-generate-version DEPENDS ${VERSION_OUTPUT_FILE}) + + # create target to expose project version + add_library(xloop-version INTERFACE) + target_include_directories(xloop-version INTERFACE ${PROJECT_INCLUDE_GEN_DIR}) + add_dependencies(xloop-version xloop-generate-version) +endmacro(gen_project_version VERSION_INPUT_FILE VERSION_INPUT_FILE_TEMPLATE VERSION_OUTPUT_FILE) + +# macro to get Linux kernel version from KERNEL_BUILD_DIR string +macro(get_kernel_version LINUX_KERNEL_VERSION KERNEL_BUILD_DIR) + string(REGEX MATCH "[0-9]+\\.[0-9]+\\.[0-9]+" LINUX_KERNEL_VERSION ${KERNEL_BUILD_DIR}) + if(LINUX_KERNEL_VERSION STREQUAL "") + set(LINUX_KERNEL_VERSION "unknown") + endif(LINUX_KERNEL_VERSION STREQUAL "") +endmacro(get_kernel_version LINUX_KERNEL_VERSION KERNEL_BUILD_DIR) + +# macro to get Git version information +macro(get_repository_version REPOSITORY_VERSION VERSION_HEADER_FILE VERSION_BUILD_TYPE) + # check if generated version header from source package is available + if(EXISTS ${VERSION_HEADER_FILE}) + # get version information from the generated version header of the source package + file(READ ${VERSION_HEADER_FILE} GIT_VERSION) + string(REGEX MATCH "\"(([0-9]+:)?[0-9][A-Za-z0-9.+~-]*)\"" GIT_VERSION ${GIT_VERSION}) + set(GIT_VERSION "${CMAKE_MATCH_1}") + else(EXISTS ${VERSION_HEADER_FILE}) + # get detailed Git version information from Git repository + execute_process(COMMAND git describe HEAD + OUTPUT_VARIABLE GIT_VERSION + OUTPUT_STRIP_TRAILING_WHITESPACE) + + # remove the first letter of the version to satisfy packaging rules + string(REGEX MATCH "([0-9]+:)?[0-9][A-Za-z0-9.+~-]*" GIT_VERSION ${GIT_VERSION}) + + # overwrite version from Git if version is unknown + if(GIT_VERSION STREQUAL "") + set(GIT_VERSION "unknown") + endif(GIT_VERSION STREQUAL "") + + # get status of Git repository + execute_process(COMMAND git status --porcelain + OUTPUT_VARIABLE GIT_STATUS + OUTPUT_STRIP_TRAILING_WHITESPACE) + + # check if Git repository is dirty + if(NOT GIT_STATUS STREQUAL "") + # the Git repository is dirty, thus extend the version information + set(GIT_VERSION "${GIT_VERSION}-modified") + + # print a message in Release build configuration to warn about the dirty repository + if(${VERSION_BUILD_TYPE} MATCHES "Release") + message(WARNING "This xloop Git repository is dirty! Please commit or revert all changes for a ${VERSION_BUILD_TYPE} build!") + endif(${VERSION_BUILD_TYPE} MATCHES "Release") + endif(NOT GIT_STATUS STREQUAL "") + endif(EXISTS ${VERSION_HEADER_FILE}) + + # return version to caller + set(${REPOSITORY_VERSION} ${GIT_VERSION}) +endmacro(get_repository_version) diff --git a/cmake/version.cmake b/cmake/version.cmake deleted file mode 100644 index 07483af..0000000 --- a/cmake/version.cmake +++ /dev/null @@ -1,21 +0,0 @@ -# SPDX-License-Identifier: GPL-2.0 -# -# CMake macros to get version numbers -# Copyright (C) 2020 Manuel Bentele -# - -# macro to get Linux kernel version from KERNEL_BUILD_DIR -macro(get_kernel_version LINUX_KERNEL_VERSION KERNEL_BUILD_DIR) - string(REGEX MATCH "[0-9]+\\.[0-9]+\\.[0-9]+" LINUX_KERNEL_VERSION ${KERNEL_BUILD_DIR}) - if(LINUX_KERNEL_VERSION STREQUAL "") - set(LINUX_KERNEL_VERSION "unknown") - endif() -endmacro(get_kernel_version) - -# macro to get short hash of latest commit -macro(get_repository_version REPOSITORY_VERSION) - execute_process(COMMAND git rev-parse --short HEAD - OUTPUT_VARIABLE SHORT_HASH_RESULT - OUTPUT_STRIP_TRAILING_WHITESPACE) - string(REGEX MATCH "[0-9a-fA-F]+" REPOSITORY_VERSION ${SHORT_HASH_RESULT}) -endmacro(get_repository_version) diff --git a/inc/xloop/build.h.in b/inc/xloop/build.h.in new file mode 100644 index 0000000..4a8fbd3 --- /dev/null +++ b/inc/xloop/build.h.in @@ -0,0 +1,10 @@ +/* + * AUTOGENERATED: DO NOT EDIT THIS FILE + */ + +#ifndef BUILD_H_ +#define BUILD_H_ + +#define XLOOP_BUILD "@XLOOP_BUILD@" + +#endif /* BUILD_H_ */ diff --git a/inc/xloop/version.h.in b/inc/xloop/version.h.in new file mode 100644 index 0000000..99d730d --- /dev/null +++ b/inc/xloop/version.h.in @@ -0,0 +1,10 @@ +/* + * AUTOGENERATED: DO NOT EDIT THIS FILE + */ + +#ifndef VERSION_H_ +#define VERSION_H_ + +#define XLOOP_VERSION "@XLOOP_VERSION@" + +#endif /* VERSION_H_ */ diff --git a/src/kernel/CMakeLists.txt b/src/kernel/CMakeLists.txt index dd12c80..2f1446a 100644 --- a/src/kernel/CMakeLists.txt +++ b/src/kernel/CMakeLists.txt @@ -3,20 +3,26 @@ cmake_minimum_required(VERSION 3.10) # set the project name project(xloop-kernel) -set (CMAKE_MODULE_PATH "${CMAKE_MODULE_PATH};${CMAKE_CURRENT_SOURCE_DIR}/cmake") -include(kernel) +# include macros to define Linux kernel build targets +include(Kernel) # set C flags for a Linux kernel module -set(KERNEL_C_FLAGS "-DCONFIG_BLK_DEV_XLOOP_MIN_COUNT=${BLK_DEV_XLOOP_MIN_COUNT} -DXLOOP_MAJOR=${XLOOP_MAJOR} -DXLOOP_CTRL_MINOR=${XLOOP_CTRL_MINOR} -DVERSION=${VERSION}" - CACHE STRING "C flags to be used for building the kernel module") +set(KERNEL_C_FLAGS "-DCONFIG_BLK_DEV_XLOOP_MIN_COUNT=${BLK_DEV_XLOOP_MIN_COUNT} -DXLOOP_MAJOR=${XLOOP_MAJOR} -DXLOOP_CTRL_MINOR=${XLOOP_CTRL_MINOR} -I ${PROJECT_INCLUDE_GEN_DIR}" + CACHE STRING "C flags to be used for building the kernel module") # set C flags for the debug mode of a Linux kernel module set(KERNEL_C_FLAGS_DEBUG "-g -DDEBUG" - CACHE STRING "Additional C flags to be used for building the kernel module in debug mode") + CACHE STRING "Additional C flags to be used for building the kernel module in debug mode") + +# append include directories to the C flags +get_property(KERNEL_INCLUDE_DIRS DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR} PROPERTY INCLUDE_DIRECTORIES) +foreach(KERNEL_INCLUDE_DIR ${KERNEL_INCLUDE_DIRS}) + set(KERNEL_C_FLAGS "${KERNEL_C_FLAGS} -I ${KERNEL_INCLUDE_DIR}") +endforeach(KERNEL_INCLUDE_DIR ${KERNEL_INCLUDE_DIRS}) # append debug C flags if debug mode is enabled -if(CMAKE_BUILD_TYPE MATCHES Debug) +if(CMAKE_BUILD_TYPE MATCHES "Debug") set(KERNEL_C_FLAGS "${KERNEL_C_FLAGS} ${KERNEL_C_FLAGS_DEBUG}") -endif(CMAKE_BUILD_TYPE MATCHES Debug) +endif(CMAKE_BUILD_TYPE MATCHES "Debug") # xloop main Linux kernel module set(KERNEL_MODULE_XLOOP_SOURCE_FILES ${CMAKE_CURRENT_SOURCE_DIR}/xloop_file_fmt.c @@ -30,6 +36,8 @@ add_kernel_module(xloop "${KERNEL_BUILD_DIR}" "${KERNEL_MODULE_XLOOP_SOURCE_FILES}" "${KERNEL_MODULE_XLOOP_HEADER_FILES}" ${CMAKE_CURRENT_SOURCE_DIR}/Kbuild) +# add dependency to generate project version header before xloop.ko is built +add_dependencies(xloop xloop-generate-version) # xloop_file_fmt_raw Linux kernel module set(KERNEL_MODULE_XLOOP_RAW_SOURCE_FILES ${CMAKE_CURRENT_SOURCE_DIR}/xloop_file_fmt_raw.c) @@ -43,6 +51,8 @@ add_kernel_module(xloop_file_fmt_raw "${KERNEL_BUILD_DIR}" "${KERNEL_MODULE_XLOOP_RAW_HEADER_FILES}" ${CMAKE_CURRENT_SOURCE_DIR}/Kbuild xloop) +# add dependency to generate project version header before xloop_file_fmt_raw.ko is built +add_dependencies(xloop_file_fmt_raw xloop-generate-version) # xloop_file_fmt_qcow Linux kernel module set(KERNEL_MODULE_XLOOP_QCOW_SOURCE_FILES ${CMAKE_CURRENT_SOURCE_DIR}/xloop_file_fmt_qcow_cache.c @@ -61,13 +71,15 @@ add_kernel_module(xloop_file_fmt_qcow "${KERNEL_BUILD_DIR}" "${KERNEL_MODULE_XLOOP_QCOW_HEADER_FILES}" ${CMAKE_CURRENT_SOURCE_DIR}/Kbuild xloop) +# add dependency to generate project version header before xloop_file_fmt_qcow.ko is built +add_dependencies(xloop_file_fmt_qcow xloop-generate-version) -if(${CMAKE_BUILD_TYPE} MATCHES Debug) +if(CMAKE_BUILD_TYPE MATCHES "Debug") add_subdirectory(tests) -endif() +endif(CMAKE_BUILD_TYPE MATCHES "Debug") # install udev rules for xloop devices exposed by the xloop kernel module install(PROGRAMS ${CMAKE_CURRENT_SOURCE_DIR}/udev/50-xloop.rules DESTINATION /lib/udev/rules.d PERMISSIONS OWNER_READ OWNER_WRITE GROUP_READ WORLD_READ - COMPONENT main) + COMPONENT kernel) diff --git a/src/kernel/cmake/kernel.cmake b/src/kernel/cmake/kernel.cmake deleted file mode 100644 index 811ce86..0000000 --- a/src/kernel/cmake/kernel.cmake +++ /dev/null @@ -1,56 +0,0 @@ -# SPDX-License-Identifier: GPL-2.0 -# -# CMake macros to build and install Linux kernel modules -# Copyright (C) 2020 Manuel Bentele -# - -# macro to define kernel module targets -macro(add_kernel_module MODULE_NAME KERNEL_BUILD_DIR KERNEL_INSTALL_DIR MODULE_MACRO MODULE_SOURCE_FILES MODULE_HEADER_FILES BUILD_SOURCE_FILE) - # create directory for kernel module - file(MAKE_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/${MODULE_NAME}) - # copy build source file - get_filename_component(BUILD_SOURCE_FILENAME ${BUILD_SOURCE_FILE} NAME) - add_custom_command(OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/${MODULE_NAME}/${BUILD_SOURCE_FILENAME} - COMMAND ${CMAKE_COMMAND} -E copy_if_different ${BUILD_SOURCE_FILE} ${CMAKE_CURRENT_BINARY_DIR}/${MODULE_NAME} - DEPENDS ${BUILD_SOURCE_FILE}) - set(BUILD_SOURCE_FILE_PREPARED ${CMAKE_CURRENT_BINARY_DIR}/${MODULE_NAME}/${BUILD_SOURCE_FILENAME}) - # copy source files - foreach(MODULE_SOURCE_FILE ${MODULE_SOURCE_FILES}) - get_filename_component(MODULE_SOURCE_FILENAME ${MODULE_SOURCE_FILE} NAME) - add_custom_command(OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/${MODULE_NAME}/${MODULE_SOURCE_FILENAME} - COMMAND ${CMAKE_COMMAND} -E copy_if_different ${MODULE_SOURCE_FILE} ${CMAKE_CURRENT_BINARY_DIR}/${MODULE_NAME} - DEPENDS ${MODULE_SOURCE_FILE}) - set(MODULE_SOURCE_FILES_PREPARED ${MODULE_SOURCE_FILES_PREPARED} - ${CMAKE_CURRENT_BINARY_DIR}/${MODULE_NAME}/${MODULE_SOURCE_FILENAME}) - endforeach() - # copy header files - foreach(MODULE_HEADER_FILE ${MODULE_HEADER_FILES}) - get_filename_component(MODULE_HEADER_FILENAME ${MODULE_HEADER_FILE} NAME) - add_custom_command(OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/${MODULE_NAME}/${MODULE_HEADER_FILENAME} - COMMAND ${CMAKE_COMMAND} -E copy_if_different ${MODULE_HEADER_FILE} ${CMAKE_CURRENT_BINARY_DIR}/${MODULE_NAME} - DEPENDS ${MODULE_HEADER_FILE}) - set(MODULE_HEADER_FILES_PREPARED ${MODULE_HEADER_FILES_PREPARED} - ${CMAKE_CURRENT_BINARY_DIR}/${MODULE_NAME}/${MODULE_HEADER_FILENAME}) - endforeach() - # check if module depends on another module - if(NOT ${ARGV7} STREQUAL "") - set(MODULE_EXTRA_SYMBOLS ${CMAKE_CURRENT_BINARY_DIR}/${ARGV7}/Module.symvers) - endif() - # define build command - set(MODULE_BUILD_COMMAND ${CMAKE_MAKE_PROGRAM} ${MODULE_MACRO} - -C ${KERNEL_BUILD_DIR} - M=${CMAKE_CURRENT_BINARY_DIR}/${MODULE_NAME} modules - EXTRA_CFLAGS=${KERNEL_C_FLAGS} - KBUILD_EXTRA_SYMBOLS=${MODULE_EXTRA_SYMBOLS}) - add_custom_command(OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/${MODULE_NAME}/${MODULE_NAME}.ko - COMMAND ${MODULE_BUILD_COMMAND} - WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/${MODULE_NAME} - COMMENT "Build kernel module ${MODULE_NAME}" - DEPENDS ${BUILD_SOURCE_FILE_PREPARED} ${MODULE_HEADER_FILES_PREPARED} ${MODULE_SOURCE_FILES_PREPARED} - VERBATIM) - add_custom_target(${MODULE_NAME} ALL DEPENDS ${CMAKE_CURRENT_BINARY_DIR}/${MODULE_NAME}/${MODULE_NAME}.ko ${ARGV7}) - install(PROGRAMS ${CMAKE_CURRENT_BINARY_DIR}/${MODULE_NAME}/${MODULE_NAME}.ko - DESTINATION ${KERNEL_INSTALL_DIR} - PERMISSIONS OWNER_READ OWNER_WRITE GROUP_READ WORLD_READ - COMPONENT main) -endmacro(add_kernel_module) diff --git a/src/kernel/xloop_file_fmt_qcow_main.c b/src/kernel/xloop_file_fmt_qcow_main.c index 38fe1af..dfde76d 100644 --- a/src/kernel/xloop_file_fmt_qcow_main.c +++ b/src/kernel/xloop_file_fmt_qcow_main.c @@ -27,6 +27,8 @@ #include #endif +#include + #include "xloop_file_fmt.h" #include "xloop_file_fmt_qcow_main.h" #include "xloop_file_fmt_qcow_cache.h" @@ -1280,4 +1282,4 @@ MODULE_LICENSE("GPL"); MODULE_AUTHOR("Manuel Bentele "); MODULE_DESCRIPTION("xloop device QCOW file format driver"); MODULE_SOFTDEP("pre: xloop"); -MODULE_VERSION(__stringify(VERSION)); +MODULE_VERSION(XLOOP_VERSION); diff --git a/src/kernel/xloop_file_fmt_raw.c b/src/kernel/xloop_file_fmt_raw.c index 76ab39e..12914e8 100644 --- a/src/kernel/xloop_file_fmt_raw.c +++ b/src/kernel/xloop_file_fmt_raw.c @@ -23,6 +23,8 @@ #include #include +#include + #include "xloop_file_fmt.h" static inline loff_t __raw_file_fmt_rq_get_pos(struct xloop_file_fmt *xlo_fmt, @@ -473,4 +475,4 @@ MODULE_LICENSE("GPL"); MODULE_AUTHOR("Manuel Bentele "); MODULE_DESCRIPTION("xloop device RAW file format driver"); MODULE_SOFTDEP("pre: xloop"); -MODULE_VERSION(__stringify(VERSION)); +MODULE_VERSION(XLOOP_VERSION); diff --git a/src/kernel/xloop_main.c b/src/kernel/xloop_main.c index a3e20a6..300554f 100644 --- a/src/kernel/xloop_main.c +++ b/src/kernel/xloop_main.c @@ -88,6 +88,8 @@ #include #endif +#include + #include "xloop_file_fmt.h" #include "xloop_main.h" @@ -1719,7 +1721,7 @@ module_param(max_part, int, 0444); MODULE_PARM_DESC(max_part, "Maximum number of partitions per xloop device"); MODULE_LICENSE("GPL"); MODULE_AUTHOR("Manuel Bentele "); -MODULE_VERSION(__stringify(VERSION)); +MODULE_VERSION(XLOOP_VERSION); MODULE_ALIAS_BLOCKDEV_MAJOR(XLOOP_MAJOR); int xloop_register_transfer(struct xloop_func_table *funcs) @@ -2189,7 +2191,7 @@ static int __init xloop_init(void) xloop_add(&xlo, i); mutex_unlock(&xloop_ctl_mutex); - pr_info("module in version %s loaded\n", __stringify(VERSION)); + pr_info("module in version %s loaded\n", XLOOP_VERSION); return 0; misc_out: diff --git a/src/utils/CMakeLists.txt b/src/utils/CMakeLists.txt index cfc5548..f3ea912 100644 --- a/src/utils/CMakeLists.txt +++ b/src/utils/CMakeLists.txt @@ -4,15 +4,11 @@ cmake_minimum_required(VERSION 3.10) project(xloop-utils) # include global headers -include_directories(${CMAKE_CURRENT_SOURCE_DIR}) include_directories(${CMAKE_CURRENT_SOURCE_DIR}/include) - -# prepare date for configuring config.h -string(TIMESTAMP DATE "%d-%b-%Y") +include_directories(${PROJECT_INCLUDE_GEN_DIR}) # configure configuration config.h and add it to each source file -configure_file(${CMAKE_CURRENT_SOURCE_DIR}/config.h.in ${CMAKE_CURRENT_BINARY_DIR}/config.h) -add_compile_options(-include ${CMAKE_CURRENT_BINARY_DIR}/config.h) +add_compile_options(-include ${CMAKE_CURRENT_SOURCE_DIR}/config.h) # add xloop specific compile options add_definitions(-DCONFIG_BLK_DEV_XLOOP_MIN_COUNT=${BLK_DEV_XLOOP_MIN_COUNT} -DXLOOP_MAJOR=${XLOOP_MAJOR}) diff --git a/src/utils/config.h b/src/utils/config.h new file mode 100644 index 0000000..781ddc7 --- /dev/null +++ b/src/utils/config.h @@ -0,0 +1,896 @@ +/* config.h. Generated from config.h.in by configure. */ +/* config.h.in. Generated from configure.ac by autoheader. */ + +#include + +/* Define if building universal (internal helper macro) */ +/* #undef AC_APPLE_UNIVERSAL_BUILD */ + +/* Enable agetty --reload feature */ +#define AGETTY_RELOAD 1 + +/* Should chfn and chsh require the user to enter the password? */ +#define CHFN_CHSH_PASSWORD 1 + +/* Path to hwclock adjtime file */ +#define CONFIG_ADJTIME_PATH "/etc/adjtime" + +/* Define if cryptsetup is to be loaded via dlopen */ +/* #undef CRYPTSETUP_VIA_DLOPEN */ + +/* Define to 1 if translation of program messages to the user's native + language is requested. */ +#define ENABLE_NLS 1 + +/* search path for fs helpers */ +#define FS_SEARCH_PATH "/sbin:/sbin/fs.d:/sbin/fs" + +/* Define to 1 if you have the header file. */ +/* #undef HAVE_ASM_IO_H */ + +/* Define if btrfs stuff is available */ +#define HAVE_BTRFS_SUPPORT 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_BYTESWAP_H 1 + +/* Define to 1 if you have the Mac OS X function CFLocaleCopyCurrent in the + CoreFoundation framework. */ +/* #undef HAVE_CFLOCALECOPYCURRENT */ + +/* Define to 1 if you have the Mac OS X function CFPreferencesCopyAppValue in + the CoreFoundation framework. */ +/* #undef HAVE_CFPREFERENCESCOPYAPPVALUE */ + +/* Define to 1 if you have the `clearenv' function. */ +#define HAVE_CLEARENV 1 + +/* Define to 1 if you have the `clock_gettime' function. */ +#define HAVE_CLOCK_GETTIME 1 + +/* Define to 1 if the system has the type `cpu_set_t'. */ +#define HAVE_CPU_SET_T 1 + +/* Define if cryptsetup is available */ +/* #undef HAVE_CRYPTSETUP */ + +/* Define if crypt_activate_by_signed_key exist in -lcryptsetup */ +/* #undef HAVE_CRYPT_ACTIVATE_BY_SIGNED_KEY */ + +/* Define to 1 if you have the header file. */ +#define HAVE_CRYPT_H 1 + +/* Define if the GNU dcgettext() function is already present or preinstalled. + */ +#define HAVE_DCGETTEXT 1 + +/* Define to 1 if you have the declaration of `BLK_ZONE_REP_CAPACITY', and to + 0 if you don't. */ +#define HAVE_DECL_BLK_ZONE_REP_CAPACITY 0 + +/* Define to 1 if you have the declaration of `CPU_ALLOC', and to 0 if you + don't. */ +#define HAVE_DECL_CPU_ALLOC 1 + +/* Define to 1 if you have the declaration of `dirfd', and to 0 if you don't. + */ +/* #undef HAVE_DECL_DIRFD */ + +/* Define to 1 if you have the declaration of `tzname', and to 0 if you don't. + */ +/* #undef HAVE_DECL_TZNAME */ + +/* Define to 1 if you have the declaration of `_NL_TIME_WEEK_1STDAY', and to 0 + if you don't. */ +#define HAVE_DECL__NL_TIME_WEEK_1STDAY 1 + +/* Define to 1 if you have the `dirfd' function. */ +#define HAVE_DIRFD 1 + +/* Define to 1 if `dd_fd' is a member of `DIR'. */ +/* #undef HAVE_DIR_DD_FD */ + +/* Define to 1 if you have the header file. */ +#define HAVE_DLFCN_H 1 + +/* Define to 1 if you have the `eaccess' function. */ +#define HAVE_EACCESS 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_ENDIAN_H 1 + +/* Define to 1 if have **environ prototype */ +#define HAVE_ENVIRON_DECL 1 + +/* Define to 1 if you have the `err' function. */ +#define HAVE_ERR 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_ERRNO_H 1 + +/* Define to 1 if you have the `errx' function. */ +#define HAVE_ERRX 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_ERR_H 1 + +/* Define to 1 if you have the `explicit_bzero' function. */ +#define HAVE_EXPLICIT_BZERO 1 + +/* Have valid fallocate() function */ +#define HAVE_FALLOCATE 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_FCNTL_H 1 + +/* Define to 1 if you have the `fpurge' function. */ +/* #undef HAVE_FPURGE */ + +/* Define to 1 if fseeko (and presumably ftello) exists and is declared. */ +#define HAVE_FSEEKO 1 + +/* Define to 1 if you have the `fstatat' function. */ +#define HAVE_FSTATAT 1 + +/* Define to 1 if you have the `fsync' function. */ +#define HAVE_FSYNC 1 + +/* Define to 1 if you have the `futimens' function. */ +#define HAVE_FUTIMENS 1 + +/* Define to 1 if you have the `getdomainname' function. */ +#define HAVE_GETDOMAINNAME 1 + +/* Define to 1 if you have the `getdtablesize' function. */ +#define HAVE_GETDTABLESIZE 1 + +/* Define to 1 if you have the `getexecname' function. */ +/* #undef HAVE_GETEXECNAME */ + +/* Define to 1 if you have the `getmntinfo' function. */ +/* #undef HAVE_GETMNTINFO */ + +/* Define to 1 if you have the header file. */ +#define HAVE_GETOPT_H 1 + +/* Define to 1 if you have the `getrandom' function. */ +#define HAVE_GETRANDOM 1 + +/* Define to 1 if you have the `getrlimit' function. */ +#define HAVE_GETRLIMIT 1 + +/* Define to 1 if you have the `getsgnam' function. */ +#define HAVE_GETSGNAM 1 + +/* Define if the GNU gettext() function is already present or preinstalled. */ +#define HAVE_GETTEXT 1 + +/* Define to 1 if you have the `getusershell' function. */ +#define HAVE_GETUSERSHELL 1 + +/* Define if you have the iconv() function and it works. */ +/* #undef HAVE_ICONV */ + +/* Define to 1 if you have the `inotify_init' function. */ +#define HAVE_INOTIFY_INIT 1 + +/* Define to 1 if you have the `inotify_init1' function. */ +#define HAVE_INOTIFY_INIT1 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_INTTYPES_H 1 + +/* Define to 1 if you have the `ioperm' function. */ +#define HAVE_IOPERM 1 + +/* Define to 1 if you have the `iopl' function. */ +#define HAVE_IOPL 1 + +/* Define to 1 if you have the `isnan' function. */ +#define HAVE_ISNAN 1 + +/* Define to 1 if you have the `jrand48' function. */ +#define HAVE_JRAND48 1 + +/* Define if langinfo.h defines ALTMON_x constants */ +#define HAVE_LANGINFO_ALTMON 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_LANGINFO_H 1 + +/* Define if langinfo.h defines _NL_ABALTMON_x constants */ +#define HAVE_LANGINFO_NL_ABALTMON 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_LASTLOG_H 1 + +/* Define to 1 if you have the `lchown' function. */ +#define HAVE_LCHOWN 1 + +/* Define to 1 if you have the `audit' library (-laudit). */ +/* #undef HAVE_LIBAUDIT */ + +/* Define to 1 if you have the -lblkid. */ +#define HAVE_LIBBLKID 1 + +/* Define to 1 if you have the `cap-ng' library (-lcap-ng). */ +#define HAVE_LIBCAP_NG 1 + +/* Do we need -lcrypt? */ +#define HAVE_LIBCRYPT 1 + +/* Define if libeconf is available */ +/* #undef HAVE_LIBECONF */ + +/* Define if libmount available. */ +#define HAVE_LIBMOUNT 1 + +/* Define if ncurses library available */ +/* #undef HAVE_LIBNCURSES */ + +/* Define if ncursesw library available */ +#define HAVE_LIBNCURSESW 1 + +/* Define to 1 if you have the `readline' library (-lreadline). */ +#define HAVE_LIBREADLINE 1 + +/* Define if librtas exists */ +/* #undef HAVE_LIBRTAS */ + +/* Define if SELinux is available */ +/* #undef HAVE_LIBSELINUX */ + +/* Define if libsystemd is available */ +#define HAVE_LIBSYSTEMD 1 + +/* Define if libtinfo or libtinfow available. */ +#define HAVE_LIBTINFO 1 + +/* Define to 1 if you have the `udev' library (-ludev). */ +#define HAVE_LIBUDEV 1 + +/* Define if libuser is available */ +/* #undef HAVE_LIBUSER */ + +/* Define to 1 if you have the `utempter' library (-lutempter). */ +/* #undef HAVE_LIBUTEMPTER */ + +/* Define to 1 if you have the `util' library (-lutil). */ +#define HAVE_LIBUTIL 1 + +/* Define to 1 if you have the header file. */ +/* #undef HAVE_LIBUTIL_H */ + +/* Define to 1 if you have the -luuid. */ +#define HAVE_LIBUUID 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_LINUX_BLKPG_H 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_LINUX_BLKZONED_H 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_LINUX_BTRFS_H 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_LINUX_CAPABILITY_H 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_LINUX_CDROM_H 1 + +/* Define to 1 if you have the header file. */ +/* #undef HAVE_LINUX_COMPILER_H */ + +/* Define to 1 if you have the header file. */ +#define HAVE_LINUX_FALLOC_H 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_LINUX_FD_H 1 + +/* Define to 1 if you have the header file. */ +/* #undef HAVE_LINUX_FS_H */ + +/* Define to 1 if you have the header file. */ +#define HAVE_LINUX_GSMMUX_H 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_LINUX_MAJOR_H 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_LINUX_NET_NAMESPACE_H 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_LINUX_RAW_H 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_LINUX_SECUREBITS_H 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_LINUX_TIOCL_H 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_LINUX_VERSION_H 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_LINUX_WATCHDOG_H 1 + +/* Define to 1 if you have the `llseek' function. */ +/* #undef HAVE_LLSEEK */ + +/* Define to 1 if you have the header file. */ +#define HAVE_LOCALE_H 1 + +/* Define to 1 if the system has the type `loff_t'. */ +#define HAVE_LOFF_T 1 + +/* Define to 1 if you have the libmagic present. */ +#define HAVE_MAGIC 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_MEMORY_H 1 + +/* Define to 1 if you have the `mempcpy' function. */ +#define HAVE_MEMPCPY 1 + +/* Define to 1 if you have the `mkostemp' function. */ +#define HAVE_MKOSTEMP 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_MNTENT_H 1 + +/* Define to 1 if you have the `nanosleep' function. */ +#define HAVE_NANOSLEEP 1 + +/* Define to 1 if you have the header file. */ +/* #undef HAVE_NCURSESW_NCURSES_H */ + +/* Define to 1 if you have the header file. */ +/* #undef HAVE_NCURSESW_TERM_H */ + +/* Define to 1 if you have the header file. */ +#define HAVE_NCURSES_H 1 + +/* Define to 1 if you have the header file. */ +/* #undef HAVE_NCURSES_NCURSES_H */ + +/* Define to 1 if you have the header file. */ +/* #undef HAVE_NCURSES_TERM_H */ + +/* Define to 1 if you have the header file. */ +#define HAVE_NETINET_IN_H 1 + +/* Define to 1 if you have the header file. */ +/* #undef HAVE_NET_IF_DL_H */ + +/* Define to 1 if you have the header file. */ +#define HAVE_NET_IF_H 1 + +/* Define to 1 if you have the `ntp_gettime' function. */ +#define HAVE_NTP_GETTIME 1 + +/* Define to 1 if you have the `openat' function. */ +#define HAVE_OPENAT 1 + +/* Define to 1 if you have the `open_memstream' function. */ +#define HAVE_OPEN_MEMSTREAM 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_PATHS_H 1 + +/* Define if libpcre2 is available */ +#define HAVE_PCRE 1 + +/* Define to 1 if you have the `personality' function. */ +#define HAVE_PERSONALITY 1 + +/* Define to 1 if you have the `pidfd_open' function. */ +/* #undef HAVE_PIDFD_OPEN */ + +/* Define to 1 if you have the `pidfd_send_signal' function. */ +/* #undef HAVE_PIDFD_SEND_SIGNAL */ + +/* Define to 1 if you have the `posix_fadvise' function. */ +#define HAVE_POSIX_FADVISE 1 + +/* Have valid posix_fallocate() function */ +#define HAVE_POSIX_FALLOCATE 1 + +/* Define to 1 if you have the `prctl' function. */ +#define HAVE_PRCTL 1 + +/* Define to 1 if you have the `prlimit' function. */ +#define HAVE_PRLIMIT 1 + +/* Define if program_invocation_short_name is defined */ +#define HAVE_PROGRAM_INVOCATION_SHORT_NAME 1 + +/* have PTY support */ +#define HAVE_PTY 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_PTY_H 1 + +/* Define to 1 if you have the `qsort_r' function. */ +#define HAVE_QSORT_R 1 + +/* Define to 1 if you have the `reboot' function. */ +#define HAVE_REBOOT 1 + +/* Define if curses library has the resizeterm(). */ +#define HAVE_RESIZETERM 1 + +/* Define to 1 if you have the `rpmatch' function. */ +#define HAVE_RPMATCH 1 + +/* Define if struct sockaddr contains sa_len */ +/* #undef HAVE_SA_LEN */ + +/* Define to 1 if you have the `scandirat' function. */ +#define HAVE_SCANDIRAT 1 + +/* Define to 1 if you have the `sched_setattr' function. */ +/* #undef HAVE_SCHED_SETATTR */ + +/* Define to 1 if you have the `sched_setscheduler' function. */ +#define HAVE_SCHED_SETSCHEDULER 1 + +/* Define to 1 if you have the `secure_getenv' function. */ +#define HAVE_SECURE_GETENV 1 + +/* Define to 1 if you have the `security_get_initial_context' function. */ +/* #undef HAVE_SECURITY_GET_INITIAL_CONTEXT */ + +/* Define to 1 if you have the header file. */ +/* #undef HAVE_SECURITY_OPENPAM_H */ + +/* Define to 1 if you have the header file. */ +#define HAVE_SECURITY_PAM_APPL_H 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_SECURITY_PAM_MISC_H 1 + +/* Define to 1 if you have the `setitimer' function. */ +/* #undef HAVE_SETITIMER */ + +/* Define to 1 if you have the `setns' function. */ +#define HAVE_SETNS 1 + +/* Define to 1 if you have the `setprogname' function. */ +/* #undef HAVE_SETPROGNAME */ + +/* Define to 1 if you have the `setresgid' function. */ +#define HAVE_SETRESGID 1 + +/* Define to 1 if you have the `setresuid' function. */ +#define HAVE_SETRESUID 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_SHADOW_H 1 + +/* Define to 1 if the system has the type `sighandler_t'. */ +#define HAVE_SIGHANDLER_T 1 + +/* Define to 1 if you have the `sigqueue' function. */ +#define HAVE_SIGQUEUE 1 + +/* Define to 1 if you have the header file. */ +/* #undef HAVE_SLANG_H */ + +/* Define to 1 if you have the header file. */ +/* #undef HAVE_SLANG_SLANG_H */ + +/* Define to 1 if you have the header file. */ +/* #undef HAVE_SLANG_SLCURSES_H */ + +/* Define to 1 if you have the header file. */ +/* #undef HAVE_SLCURSES_H */ + +/* Add SMACK support */ +/* #undef HAVE_SMACK */ + +/* Define to 1 if you have the `srandom' function. */ +#define HAVE_SRANDOM 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_STDINT_H 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_STDIO_EXT_H 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_STDLIB_H 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_STRINGS_H 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_STRING_H 1 + +/* Define to 1 if you have the `strnchr' function. */ +/* #undef HAVE_STRNCHR */ + +/* Define to 1 if you have the `strndup' function. */ +#define HAVE_STRNDUP 1 + +/* Define to 1 if you have the `strnlen' function. */ +#define HAVE_STRNLEN 1 + +/* Define to 1 if have strsignal function prototype */ +#define HAVE_STRSIGNAL_DECL 1 + +/* Define to 1 if `st_mtim.tv_nsec' is a member of `struct stat'. */ +#define HAVE_STRUCT_STAT_ST_MTIM_TV_NSEC 1 + +/* Define to 1 if `c_line' is a member of `struct termios'. */ +#define HAVE_STRUCT_TERMIOS_C_LINE 1 + +/* Define to 1 if `tm_zone' is a member of `struct tm'. */ +#define HAVE_STRUCT_TM_TM_ZONE 1 + +/* Define to 1 if you have the `swapoff' function. */ +#define HAVE_SWAPOFF 1 + +/* Define to 1 if you have the `swapon' function. */ +#define HAVE_SWAPON 1 + +/* Define to 1 if you have the `sysconf' function. */ +#define HAVE_SYSCONF 1 + +/* Define to 1 if you have the `sysinfo' function. */ +#define HAVE_SYSINFO 1 + +/* Define to 1 if you have the header file. */ +/* #undef HAVE_SYS_DISKLABEL_H */ + +/* Define to 1 if you have the header file. */ +/* #undef HAVE_SYS_DISK_H */ + +/* Define to 1 if you have the header file. */ +/* #undef HAVE_SYS_ENDIAN_H */ + +/* Define to 1 if you have the header file. */ +#define HAVE_SYS_FILE_H 1 + +/* Define to 1 if you have the header file. */ +/* #undef HAVE_SYS_IOCCOM_H */ + +/* Define to 1 if you have the header file. */ +#define HAVE_SYS_IOCTL_H 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_SYS_IO_H 1 + +/* Define to 1 if you have the header file. */ +/* #undef HAVE_SYS_MKDEV_H */ + +/* Define to 1 if you have the header file. */ +#define HAVE_SYS_MOUNT_H 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_SYS_PARAM_H 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_SYS_PRCTL_H 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_SYS_RESOURCE_H 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_SYS_SIGNALFD_H 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_SYS_SOCKET_H 1 + +/* Define to 1 if you have the header file. */ +/* #undef HAVE_SYS_SOCKIO_H */ + +/* Define to 1 if you have the header file. */ +#define HAVE_SYS_STAT_H 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_SYS_SWAP_H 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_SYS_SYSCALL_H 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_SYS_SYSMACROS_H 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_SYS_TIMEX_H 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_SYS_TIME_H 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_SYS_TTYDEFAULTS_H 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_SYS_TYPES_H 1 + +/* Define to 1 if you have the header file. */ +/* #undef HAVE_SYS_UCRED_H */ + +/* Define to 1 if you have the header file. */ +#define HAVE_SYS_UN_H 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_TERM_H 1 + +/* Define to 1 if you have the `timegm' function. */ +#define HAVE_TIMEGM 1 + +/* Define if timer_create exist in -lrt -lpthread */ +#define HAVE_TIMER_CREATE 1 + +/* Define to 1 if the target supports thread-local storage. */ +#define HAVE_TLS 1 + +/* Does struct tm have a field tm_gmtoff? */ +#define HAVE_TM_GMTOFF 1 + +/* Define to 1 if your `struct tm' has `tm_zone'. Deprecated, use + `HAVE_STRUCT_TM_TM_ZONE' instead. */ +#define HAVE_TM_ZONE 1 + +/* Define to 1 if you don't have `tm_zone' but do have the external array + `tzname'. */ +/* #undef HAVE_TZNAME */ + +/* Define to 1 if the system has the type `union semun'. */ +/* #undef HAVE_UNION_SEMUN */ + +/* Define to 1 if you have the header file. */ +#define HAVE_UNISTD_H 1 + +/* Define to 1 if you have the `unlinkat' function. */ +#define HAVE_UNLINKAT 1 + +/* Define to 1 if you have the `unshare' function. */ +#define HAVE_UNSHARE 1 + +/* Define to 1 if you have the `updwtmpx' function. */ +#define HAVE_UPDWTMPX 1 + +/* Define if curses library has the use_default_colors(). */ +#define HAVE_USE_DEFAULT_COLORS 1 + +/* Define to 1 if you have the `usleep' function. */ +#define HAVE_USLEEP 1 + +/* Define to 1 if you have the `utimensat' function. */ +#define HAVE_UTIMENSAT 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_UTMPX_H 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_UTMP_H 1 + +/* Define to 1 if you want to use uuid daemon. */ +#define HAVE_UUIDD 1 + +/* Define to 1 if you have the `vwarnx' function. */ +#define HAVE_VWARNX 1 + +/* Define to 1 if you have the `warn' function. */ +#define HAVE_WARN 1 + +/* Define to 1 if you have the `warnx' function. */ +#define HAVE_WARNX 1 + +/* Do we have wide character support? */ +#define HAVE_WIDECHAR 1 + +/* Define to 1 if you have the `__fpending' function. */ +#define HAVE___FPENDING 1 + +/* Define to 1 if you have the `__fpurge' function. */ +#define HAVE___FPURGE 1 + +/* Define if __progname is defined */ +#define HAVE___PROGNAME 1 + +/* Define to 1 if you have the `__secure_getenv' function. */ +/* #undef HAVE___SECURE_GETENV */ + +/* libblkid version string */ +#define LIBBLKID_VERSION XLOOP_VERSION + +/* libfdisk version string */ +#define LIBFDISK_VERSION XLOOP_VERSION + +/* libmount version string */ +#define LIBMOUNT_VERSION XLOOP_VERSION + +/* libsmartcols version string */ +#define LIBSMARTCOLS_VERSION XLOOP_VERSION + +/* Should login chown /dev/vcsN? */ +/* #undef LOGIN_CHOWN_VCS */ + +/* Should login stat() the mailbox? */ +/* #undef LOGIN_STAT_MAIL */ + +/* Define to the sub-directory where libtool stores uninstalled libraries. */ +#define LT_OBJDIR ".libs/" + +/* "Multi-arch triplet for whereis library search path" */ +/* #undef MULTIARCHTRIPLET */ + +/* Define to 1 if assertions should be disabled. */ +/* #undef NDEBUG */ + +/* Should chsh allow only shells in /etc/shells? */ +#define ONLY_LISTED_SHELLS 1 + +/* Name of package */ +#define PACKAGE "util-linux" + +/* Define to the address where bug reports for this package should be sent. */ +#define PACKAGE_BUGREPORT "kzak@redhat.com" + +/* Define to the full name of this package. */ +#define PACKAGE_NAME "util-linux" + +/* Define to the full name and version of this package. */ +#define PACKAGE_STRING ("util-linux " XLOOP_VERSION) + +/* Define to the one symbol short name of this package. */ +#define PACKAGE_TARNAME "util-linux" + +/* Define to the home page for this package. */ +#define PACKAGE_URL "http://www.kernel.org/pub/linux/utils/util-linux/" + +/* Define to the version of this package. */ +#define PACKAGE_VERSION XLOOP_VERSION + +/* Should pg ring the bell on invalid keys? */ +#define PG_BELL 1 + +/* Define to 1 if you have the ANSI C header files. */ +#define STDC_HEADERS 1 + +/* Fallback syscall number for fallocate */ +/* #undef SYS_fallocate */ + +/* Fallback syscall number for ioprio_get */ +/* #undef SYS_ioprio_get */ + +/* Fallback syscall number for ioprio_set */ +/* #undef SYS_ioprio_set */ + +/* Fallback syscall number for pidfd_open */ +/* #undef SYS_pidfd_open */ + +/* Fallback syscall number for pidfd_send_signal */ +/* #undef SYS_pidfd_send_signal */ + +/* Fallback syscall number for pivot_root */ +/* #undef SYS_pivot_root */ + +/* Fallback syscall number for prlimit64 */ +/* #undef SYS_prlimit64 */ + +/* Fallback syscall number for sched_getaffinity */ +/* #undef SYS_sched_getaffinity */ + +/* Fallback syscall number for sched_setattr */ +/* #undef SYS_sched_setattr */ + +/* Fallback syscall number for setns */ +/* #undef SYS_setns */ + +/* Fallback syscall number for swapoff */ +/* #undef SYS_swapoff */ + +/* Fallback syscall number for swapon */ +/* #undef SYS_swapon */ + +/* Fallback syscall number for unshare */ +/* #undef SYS_unshare */ + +/* Define to 1 if your declares `struct tm'. */ +/* #undef TM_IN_SYS_TIME */ + +/* Enables colorized output from utils by default */ +#define USE_COLORS_BY_DEFAULT 1 + +/* Define to 1 if want to use CMOS clock. */ +#define USE_HWCLOCK_CMOS 1 + +/* use datetime parsing GPLv3 code to hwclock */ +#define USE_HWCLOCK_GPLv3_DATETIME 1 + +/* Define to 1 if want to support mtab. */ +/* #undef USE_LIBMOUNT_SUPPORT_MTAB */ + +/* Define to 1 if want to support namepaces. */ +#define USE_LIBMOUNT_SUPPORT_NAMESPACES 1 + +/* Enable plymouth support feature for sulogin and aggety */ +#define USE_PLYMOUTH_SUPPORT 1 + +/* Should sulogin use a emergency mount of /dev and /proc? */ +/* #undef USE_SULOGIN_EMERGENCY_MOUNT */ + +/* Enable extensions on AIX 3, Interix. */ +#ifndef _ALL_SOURCE +# define _ALL_SOURCE 1 +#endif +/* Enable GNU extensions on systems that have them. */ +#ifndef _GNU_SOURCE +# define _GNU_SOURCE 1 +#endif +/* Enable threading extensions on Solaris. */ +#ifndef _POSIX_PTHREAD_SEMANTICS +# define _POSIX_PTHREAD_SEMANTICS 1 +#endif +/* Enable extensions on HP NonStop. */ +#ifndef _TANDEM_SOURCE +# define _TANDEM_SOURCE 1 +#endif +/* Enable general extensions on Solaris. */ +#ifndef __EXTENSIONS__ +# define __EXTENSIONS__ 1 +#endif + + +/* Should wall and write be installed setgid tty? */ +#define USE_TTY_GROUP 1 + +/* Define to 1 to remove /bin and /sbin from PATH env.variable */ +/* #undef USE_USRDIR_PATHS_ONLY */ + +/* Define to 1 to use vendordir */ +/* #undef USE_VENDORDIR */ + +/* Version number of package */ +#define VERSION XLOOP_VERSION + +/* Define WORDS_BIGENDIAN to 1 if your processor stores words with the most + significant byte first (like Motorola and SPARC, unlike Intel). */ +#if defined AC_APPLE_UNIVERSAL_BUILD +# if defined __BIG_ENDIAN__ +# define WORDS_BIGENDIAN 1 +# endif +#else +# ifndef WORDS_BIGENDIAN +/* # undef WORDS_BIGENDIAN */ +# endif +#endif + +/* Enable MAP_ANON in sys/mman.h on Mac OS X */ +/* #undef _DARWIN_C_SOURCE */ + +/* Enable large inode numbers on Mac OS X 10.5. */ +#ifndef _DARWIN_USE_64_BIT_INODE +# define _DARWIN_USE_64_BIT_INODE 1 +#endif + +/* Number of bits in a file offset, on hosts where this is settable. */ +/* #undef _FILE_OFFSET_BITS */ + +/* Define to 1 to make fseeko visible on some hosts (e.g. glibc 2.2). */ +/* #undef _LARGEFILE_SOURCE */ + +/* Define for large files, on AIX-style hosts. */ +/* #undef _LARGE_FILES */ + +/* Define to 1 if on MINIX. */ +/* #undef _MINIX */ + +/* Define to 2 if the system does not provide POSIX.1 features except with + this defined. */ +/* #undef _POSIX_1_SOURCE */ + +/* Define to 1 if you need to in order for `stat' and other things to work. */ +/* #undef _POSIX_SOURCE */ + +/* Define to empty if `const' does not conform to ANSI C. */ +/* #undef const */ + +/* Define to empty if the keyword `volatile' does not work. Warning: valid + code using `volatile' can become incorrect without. Disable with care. */ +/* #undef volatile */ diff --git a/src/utils/config.h.in b/src/utils/config.h.in deleted file mode 100644 index 40b8d34..0000000 --- a/src/utils/config.h.in +++ /dev/null @@ -1,897 +0,0 @@ -/* config.h. Generated from config.h.in by configure. */ -/* config.h.in. Generated from configure.ac by autoheader. */ - -/* Define if building universal (internal helper macro) */ -/* #undef AC_APPLE_UNIVERSAL_BUILD */ - -/* Enable agetty --reload feature */ -#define AGETTY_RELOAD 1 - -/* Should chfn and chsh require the user to enter the password? */ -#define CHFN_CHSH_PASSWORD 1 - -/* Path to hwclock adjtime file */ -#define CONFIG_ADJTIME_PATH "/etc/adjtime" - -/* Define if cryptsetup is to be loaded via dlopen */ -/* #undef CRYPTSETUP_VIA_DLOPEN */ - -/* Define to 1 if translation of program messages to the user's native - language is requested. */ -#define ENABLE_NLS 1 - -/* search path for fs helpers */ -#define FS_SEARCH_PATH "/sbin:/sbin/fs.d:/sbin/fs" - -/* Define to 1 if you have the header file. */ -/* #undef HAVE_ASM_IO_H */ - -/* Define if btrfs stuff is available */ -#define HAVE_BTRFS_SUPPORT 1 - -/* Define to 1 if you have the header file. */ -#define HAVE_BYTESWAP_H 1 - -/* Define to 1 if you have the Mac OS X function CFLocaleCopyCurrent in the - CoreFoundation framework. */ -/* #undef HAVE_CFLOCALECOPYCURRENT */ - -/* Define to 1 if you have the Mac OS X function CFPreferencesCopyAppValue in - the CoreFoundation framework. */ -/* #undef HAVE_CFPREFERENCESCOPYAPPVALUE */ - -/* Define to 1 if you have the `clearenv' function. */ -#define HAVE_CLEARENV 1 - -/* Define to 1 if you have the `clock_gettime' function. */ -#define HAVE_CLOCK_GETTIME 1 - -/* Define to 1 if the system has the type `cpu_set_t'. */ -#define HAVE_CPU_SET_T 1 - -/* Define if cryptsetup is available */ -/* #undef HAVE_CRYPTSETUP */ - -/* Define if crypt_activate_by_signed_key exist in -lcryptsetup */ -/* #undef HAVE_CRYPT_ACTIVATE_BY_SIGNED_KEY */ - -/* Define to 1 if you have the header file. */ -#define HAVE_CRYPT_H 1 - -/* Define if the GNU dcgettext() function is already present or preinstalled. - */ -#define HAVE_DCGETTEXT 1 - -/* Define to 1 if you have the declaration of `BLK_ZONE_REP_CAPACITY', and to - 0 if you don't. */ -#define HAVE_DECL_BLK_ZONE_REP_CAPACITY 0 - -/* Define to 1 if you have the declaration of `CPU_ALLOC', and to 0 if you - don't. */ -#define HAVE_DECL_CPU_ALLOC 1 - -/* Define to 1 if you have the declaration of `dirfd', and to 0 if you don't. - */ -/* #undef HAVE_DECL_DIRFD */ - -/* Define to 1 if you have the declaration of `tzname', and to 0 if you don't. - */ -/* #undef HAVE_DECL_TZNAME */ - -/* Define to 1 if you have the declaration of `_NL_TIME_WEEK_1STDAY', and to 0 - if you don't. */ -#define HAVE_DECL__NL_TIME_WEEK_1STDAY 1 - -/* Define to 1 if you have the `dirfd' function. */ -#define HAVE_DIRFD 1 - -/* Define to 1 if `dd_fd' is a member of `DIR'. */ -/* #undef HAVE_DIR_DD_FD */ - -/* Define to 1 if you have the header file. */ -#define HAVE_DLFCN_H 1 - -/* Define to 1 if you have the `eaccess' function. */ -#define HAVE_EACCESS 1 - -/* Define to 1 if you have the header file. */ -#define HAVE_ENDIAN_H 1 - -/* Define to 1 if have **environ prototype */ -#define HAVE_ENVIRON_DECL 1 - -/* Define to 1 if you have the `err' function. */ -#define HAVE_ERR 1 - -/* Define to 1 if you have the header file. */ -#define HAVE_ERRNO_H 1 - -/* Define to 1 if you have the `errx' function. */ -#define HAVE_ERRX 1 - -/* Define to 1 if you have the header file. */ -#define HAVE_ERR_H 1 - -/* Define to 1 if you have the `explicit_bzero' function. */ -#define HAVE_EXPLICIT_BZERO 1 - -/* Have valid fallocate() function */ -#define HAVE_FALLOCATE 1 - -/* Define to 1 if you have the header file. */ -#define HAVE_FCNTL_H 1 - -/* Define to 1 if you have the `fpurge' function. */ -/* #undef HAVE_FPURGE */ - -/* Define to 1 if fseeko (and presumably ftello) exists and is declared. */ -#define HAVE_FSEEKO 1 - -/* Define to 1 if you have the `fstatat' function. */ -#define HAVE_FSTATAT 1 - -/* Define to 1 if you have the `fsync' function. */ -#define HAVE_FSYNC 1 - -/* Define to 1 if you have the `futimens' function. */ -#define HAVE_FUTIMENS 1 - -/* Define to 1 if you have the `getdomainname' function. */ -#define HAVE_GETDOMAINNAME 1 - -/* Define to 1 if you have the `getdtablesize' function. */ -#define HAVE_GETDTABLESIZE 1 - -/* Define to 1 if you have the `getexecname' function. */ -/* #undef HAVE_GETEXECNAME */ - -/* Define to 1 if you have the `getmntinfo' function. */ -/* #undef HAVE_GETMNTINFO */ - -/* Define to 1 if you have the header file. */ -#define HAVE_GETOPT_H 1 - -/* Define to 1 if you have the `getrandom' function. */ -#define HAVE_GETRANDOM 1 - -/* Define to 1 if you have the `getrlimit' function. */ -#define HAVE_GETRLIMIT 1 - -/* Define to 1 if you have the `getsgnam' function. */ -#define HAVE_GETSGNAM 1 - -/* Define if the GNU gettext() function is already present or preinstalled. */ -#define HAVE_GETTEXT 1 - -/* Define to 1 if you have the `getusershell' function. */ -#define HAVE_GETUSERSHELL 1 - -/* Define if you have the iconv() function and it works. */ -/* #undef HAVE_ICONV */ - -/* Define to 1 if you have the `inotify_init' function. */ -#define HAVE_INOTIFY_INIT 1 - -/* Define to 1 if you have the `inotify_init1' function. */ -#define HAVE_INOTIFY_INIT1 1 - -/* Define to 1 if you have the header file. */ -#define HAVE_INTTYPES_H 1 - -/* Define to 1 if you have the `ioperm' function. */ -#define HAVE_IOPERM 1 - -/* Define to 1 if you have the `iopl' function. */ -#define HAVE_IOPL 1 - -/* Define to 1 if you have the `isnan' function. */ -#define HAVE_ISNAN 1 - -/* Define to 1 if you have the `jrand48' function. */ -#define HAVE_JRAND48 1 - -/* Define if langinfo.h defines ALTMON_x constants */ -#define HAVE_LANGINFO_ALTMON 1 - -/* Define to 1 if you have the header file. */ -#define HAVE_LANGINFO_H 1 - -/* Define if langinfo.h defines _NL_ABALTMON_x constants */ -#define HAVE_LANGINFO_NL_ABALTMON 1 - -/* Define to 1 if you have the header file. */ -#define HAVE_LASTLOG_H 1 - -/* Define to 1 if you have the `lchown' function. */ -#define HAVE_LCHOWN 1 - -/* Define to 1 if you have the `audit' library (-laudit). */ -/* #undef HAVE_LIBAUDIT */ - -/* Define to 1 if you have the -lblkid. */ -#define HAVE_LIBBLKID 1 - -/* Define to 1 if you have the `cap-ng' library (-lcap-ng). */ -#define HAVE_LIBCAP_NG 1 - -/* Do we need -lcrypt? */ -#define HAVE_LIBCRYPT 1 - -/* Define if libeconf is available */ -/* #undef HAVE_LIBECONF */ - -/* Define if libmount available. */ -#define HAVE_LIBMOUNT 1 - -/* Define if ncurses library available */ -/* #undef HAVE_LIBNCURSES */ - -/* Define if ncursesw library available */ -#define HAVE_LIBNCURSESW 1 - -/* Define to 1 if you have the `readline' library (-lreadline). */ -#define HAVE_LIBREADLINE 1 - -/* Define if librtas exists */ -/* #undef HAVE_LIBRTAS */ - -/* Define if SELinux is available */ -/* #undef HAVE_LIBSELINUX */ - -/* Define if libsystemd is available */ -#define HAVE_LIBSYSTEMD 1 - -/* Define if libtinfo or libtinfow available. */ -#define HAVE_LIBTINFO 1 - -/* Define to 1 if you have the `udev' library (-ludev). */ -#define HAVE_LIBUDEV 1 - -/* Define if libuser is available */ -/* #undef HAVE_LIBUSER */ - -/* Define to 1 if you have the `utempter' library (-lutempter). */ -/* #undef HAVE_LIBUTEMPTER */ - -/* Define to 1 if you have the `util' library (-lutil). */ -#define HAVE_LIBUTIL 1 - -/* Define to 1 if you have the header file. */ -/* #undef HAVE_LIBUTIL_H */ - -/* Define to 1 if you have the -luuid. */ -#define HAVE_LIBUUID 1 - -/* Define to 1 if you have the header file. */ -#define HAVE_LINUX_BLKPG_H 1 - -/* Define to 1 if you have the header file. */ -#define HAVE_LINUX_BLKZONED_H 1 - -/* Define to 1 if you have the header file. */ -#define HAVE_LINUX_BTRFS_H 1 - -/* Define to 1 if you have the header file. */ -#define HAVE_LINUX_CAPABILITY_H 1 - -/* Define to 1 if you have the header file. */ -#define HAVE_LINUX_CDROM_H 1 - -/* Define to 1 if you have the header file. */ -/* #undef HAVE_LINUX_COMPILER_H */ - -/* Define to 1 if you have the header file. */ -#define HAVE_LINUX_FALLOC_H 1 - -/* Define to 1 if you have the header file. */ -#define HAVE_LINUX_FD_H 1 - -/* Define to 1 if you have the header file. */ -/* #undef HAVE_LINUX_FS_H */ - -/* Define to 1 if you have the header file. */ -#define HAVE_LINUX_GSMMUX_H 1 - -/* Define to 1 if you have the header file. */ -#define HAVE_LINUX_MAJOR_H 1 - -/* Define to 1 if you have the header file. */ -#define HAVE_LINUX_NET_NAMESPACE_H 1 - -/* Define to 1 if you have the header file. */ -#define HAVE_LINUX_RAW_H 1 - -/* Define to 1 if you have the header file. */ -#define HAVE_LINUX_SECUREBITS_H 1 - -/* Define to 1 if you have the header file. */ -#define HAVE_LINUX_TIOCL_H 1 - -/* Define to 1 if you have the header file. */ -#define HAVE_LINUX_VERSION_H 1 - -/* Define to 1 if you have the header file. */ -#define HAVE_LINUX_WATCHDOG_H 1 - -/* Define to 1 if you have the `llseek' function. */ -/* #undef HAVE_LLSEEK */ - -/* Define to 1 if you have the header file. */ -#define HAVE_LOCALE_H 1 - -/* Define to 1 if the system has the type `loff_t'. */ -#define HAVE_LOFF_T 1 - -/* Define to 1 if you have the libmagic present. */ -#define HAVE_MAGIC 1 - -/* Define to 1 if you have the header file. */ -#define HAVE_MEMORY_H 1 - -/* Define to 1 if you have the `mempcpy' function. */ -#define HAVE_MEMPCPY 1 - -/* Define to 1 if you have the `mkostemp' function. */ -#define HAVE_MKOSTEMP 1 - -/* Define to 1 if you have the header file. */ -#define HAVE_MNTENT_H 1 - -/* Define to 1 if you have the `nanosleep' function. */ -#define HAVE_NANOSLEEP 1 - -/* Define to 1 if you have the header file. */ -/* #undef HAVE_NCURSESW_NCURSES_H */ - -/* Define to 1 if you have the header file. */ -/* #undef HAVE_NCURSESW_TERM_H */ - -/* Define to 1 if you have the header file. */ -#define HAVE_NCURSES_H 1 - -/* Define to 1 if you have the header file. */ -/* #undef HAVE_NCURSES_NCURSES_H */ - -/* Define to 1 if you have the header file. */ -/* #undef HAVE_NCURSES_TERM_H */ - -/* Define to 1 if you have the header file. */ -#define HAVE_NETINET_IN_H 1 - -/* Define to 1 if you have the header file. */ -/* #undef HAVE_NET_IF_DL_H */ - -/* Define to 1 if you have the header file. */ -#define HAVE_NET_IF_H 1 - -/* Define to 1 if you have the `ntp_gettime' function. */ -#define HAVE_NTP_GETTIME 1 - -/* Define to 1 if you have the `openat' function. */ -#define HAVE_OPENAT 1 - -/* Define to 1 if you have the `open_memstream' function. */ -#define HAVE_OPEN_MEMSTREAM 1 - -/* Define to 1 if you have the header file. */ -#define HAVE_PATHS_H 1 - -/* Define if libpcre2 is available */ -#define HAVE_PCRE 1 - -/* Define to 1 if you have the `personality' function. */ -#define HAVE_PERSONALITY 1 - -/* Define to 1 if you have the `pidfd_open' function. */ -/* #undef HAVE_PIDFD_OPEN */ - -/* Define to 1 if you have the `pidfd_send_signal' function. */ -/* #undef HAVE_PIDFD_SEND_SIGNAL */ - -/* Define to 1 if you have the `posix_fadvise' function. */ -#define HAVE_POSIX_FADVISE 1 - -/* Have valid posix_fallocate() function */ -#define HAVE_POSIX_FALLOCATE 1 - -/* Define to 1 if you have the `prctl' function. */ -#define HAVE_PRCTL 1 - -/* Define to 1 if you have the `prlimit' function. */ -#define HAVE_PRLIMIT 1 - -/* Define if program_invocation_short_name is defined */ -#define HAVE_PROGRAM_INVOCATION_SHORT_NAME 1 - -/* have PTY support */ -#define HAVE_PTY 1 - -/* Define to 1 if you have the header file. */ -#define HAVE_PTY_H 1 - -/* Define to 1 if you have the `qsort_r' function. */ -#define HAVE_QSORT_R 1 - -/* Define to 1 if you have the `reboot' function. */ -#define HAVE_REBOOT 1 - -/* Define if curses library has the resizeterm(). */ -#define HAVE_RESIZETERM 1 - -/* Define to 1 if you have the `rpmatch' function. */ -#define HAVE_RPMATCH 1 - -/* Define if struct sockaddr contains sa_len */ -/* #undef HAVE_SA_LEN */ - -/* Define to 1 if you have the `scandirat' function. */ -#define HAVE_SCANDIRAT 1 - -/* Define to 1 if you have the `sched_setattr' function. */ -/* #undef HAVE_SCHED_SETATTR */ - -/* Define to 1 if you have the `sched_setscheduler' function. */ -#define HAVE_SCHED_SETSCHEDULER 1 - -/* Define to 1 if you have the `secure_getenv' function. */ -#define HAVE_SECURE_GETENV 1 - -/* Define to 1 if you have the `security_get_initial_context' function. */ -/* #undef HAVE_SECURITY_GET_INITIAL_CONTEXT */ - -/* Define to 1 if you have the header file. */ -/* #undef HAVE_SECURITY_OPENPAM_H */ - -/* Define to 1 if you have the header file. */ -#define HAVE_SECURITY_PAM_APPL_H 1 - -/* Define to 1 if you have the header file. */ -#define HAVE_SECURITY_PAM_MISC_H 1 - -/* Define to 1 if you have the `setitimer' function. */ -/* #undef HAVE_SETITIMER */ - -/* Define to 1 if you have the `setns' function. */ -#define HAVE_SETNS 1 - -/* Define to 1 if you have the `setprogname' function. */ -/* #undef HAVE_SETPROGNAME */ - -/* Define to 1 if you have the `setresgid' function. */ -#define HAVE_SETRESGID 1 - -/* Define to 1 if you have the `setresuid' function. */ -#define HAVE_SETRESUID 1 - -/* Define to 1 if you have the header file. */ -#define HAVE_SHADOW_H 1 - -/* Define to 1 if the system has the type `sighandler_t'. */ -#define HAVE_SIGHANDLER_T 1 - -/* Define to 1 if you have the `sigqueue' function. */ -#define HAVE_SIGQUEUE 1 - -/* Define to 1 if you have the header file. */ -/* #undef HAVE_SLANG_H */ - -/* Define to 1 if you have the header file. */ -/* #undef HAVE_SLANG_SLANG_H */ - -/* Define to 1 if you have the header file. */ -/* #undef HAVE_SLANG_SLCURSES_H */ - -/* Define to 1 if you have the header file. */ -/* #undef HAVE_SLCURSES_H */ - -/* Add SMACK support */ -/* #undef HAVE_SMACK */ - -/* Define to 1 if you have the `srandom' function. */ -#define HAVE_SRANDOM 1 - -/* Define to 1 if you have the header file. */ -#define HAVE_STDINT_H 1 - -/* Define to 1 if you have the header file. */ -#define HAVE_STDIO_EXT_H 1 - -/* Define to 1 if you have the header file. */ -#define HAVE_STDLIB_H 1 - -/* Define to 1 if you have the header file. */ -#define HAVE_STRINGS_H 1 - -/* Define to 1 if you have the header file. */ -#define HAVE_STRING_H 1 - -/* Define to 1 if you have the `strnchr' function. */ -/* #undef HAVE_STRNCHR */ - -/* Define to 1 if you have the `strndup' function. */ -#define HAVE_STRNDUP 1 - -/* Define to 1 if you have the `strnlen' function. */ -#define HAVE_STRNLEN 1 - -/* Define to 1 if have strsignal function prototype */ -#define HAVE_STRSIGNAL_DECL 1 - -/* Define to 1 if `st_mtim.tv_nsec' is a member of `struct stat'. */ -#define HAVE_STRUCT_STAT_ST_MTIM_TV_NSEC 1 - -/* Define to 1 if `c_line' is a member of `struct termios'. */ -#define HAVE_STRUCT_TERMIOS_C_LINE 1 - -/* Define to 1 if `tm_zone' is a member of `struct tm'. */ -#define HAVE_STRUCT_TM_TM_ZONE 1 - -/* Define to 1 if you have the `swapoff' function. */ -#define HAVE_SWAPOFF 1 - -/* Define to 1 if you have the `swapon' function. */ -#define HAVE_SWAPON 1 - -/* Define to 1 if you have the `sysconf' function. */ -#define HAVE_SYSCONF 1 - -/* Define to 1 if you have the `sysinfo' function. */ -#define HAVE_SYSINFO 1 - -/* Define to 1 if you have the header file. */ -/* #undef HAVE_SYS_DISKLABEL_H */ - -/* Define to 1 if you have the header file. */ -/* #undef HAVE_SYS_DISK_H */ - -/* Define to 1 if you have the header file. */ -/* #undef HAVE_SYS_ENDIAN_H */ - -/* Define to 1 if you have the header file. */ -#define HAVE_SYS_FILE_H 1 - -/* Define to 1 if you have the header file. */ -/* #undef HAVE_SYS_IOCCOM_H */ - -/* Define to 1 if you have the header file. */ -#define HAVE_SYS_IOCTL_H 1 - -/* Define to 1 if you have the header file. */ -#define HAVE_SYS_IO_H 1 - -/* Define to 1 if you have the header file. */ -/* #undef HAVE_SYS_MKDEV_H */ - -/* Define to 1 if you have the header file. */ -#define HAVE_SYS_MOUNT_H 1 - -/* Define to 1 if you have the header file. */ -#define HAVE_SYS_PARAM_H 1 - -/* Define to 1 if you have the header file. */ -#define HAVE_SYS_PRCTL_H 1 - -/* Define to 1 if you have the header file. */ -#define HAVE_SYS_RESOURCE_H 1 - -/* Define to 1 if you have the header file. */ -#define HAVE_SYS_SIGNALFD_H 1 - -/* Define to 1 if you have the header file. */ -#define HAVE_SYS_SOCKET_H 1 - -/* Define to 1 if you have the header file. */ -/* #undef HAVE_SYS_SOCKIO_H */ - -/* Define to 1 if you have the header file. */ -#define HAVE_SYS_STAT_H 1 - -/* Define to 1 if you have the header file. */ -#define HAVE_SYS_SWAP_H 1 - -/* Define to 1 if you have the header file. */ -#define HAVE_SYS_SYSCALL_H 1 - -/* Define to 1 if you have the header file. */ -#define HAVE_SYS_SYSMACROS_H 1 - -/* Define to 1 if you have the header file. */ -#define HAVE_SYS_TIMEX_H 1 - -/* Define to 1 if you have the header file. */ -#define HAVE_SYS_TIME_H 1 - -/* Define to 1 if you have the header file. */ -#define HAVE_SYS_TTYDEFAULTS_H 1 - -/* Define to 1 if you have the header file. */ -#define HAVE_SYS_TYPES_H 1 - -/* Define to 1 if you have the header file. */ -/* #undef HAVE_SYS_UCRED_H */ - -/* Define to 1 if you have the header file. */ -#define HAVE_SYS_UN_H 1 - -/* Define to 1 if you have the header file. */ -#define HAVE_TERM_H 1 - -/* Define to 1 if you have the `timegm' function. */ -#define HAVE_TIMEGM 1 - -/* Define if timer_create exist in -lrt -lpthread */ -#define HAVE_TIMER_CREATE 1 - -/* Define to 1 if the target supports thread-local storage. */ -#define HAVE_TLS 1 - -/* Does struct tm have a field tm_gmtoff? */ -#define HAVE_TM_GMTOFF 1 - -/* Define to 1 if your `struct tm' has `tm_zone'. Deprecated, use - `HAVE_STRUCT_TM_TM_ZONE' instead. */ -#define HAVE_TM_ZONE 1 - -/* Define to 1 if you don't have `tm_zone' but do have the external array - `tzname'. */ -/* #undef HAVE_TZNAME */ - -/* Define to 1 if the system has the type `union semun'. */ -/* #undef HAVE_UNION_SEMUN */ - -/* Define to 1 if you have the header file. */ -#define HAVE_UNISTD_H 1 - -/* Define to 1 if you have the `unlinkat' function. */ -#define HAVE_UNLINKAT 1 - -/* Define to 1 if you have the `unshare' function. */ -#define HAVE_UNSHARE 1 - -/* Define to 1 if you have the `updwtmpx' function. */ -#define HAVE_UPDWTMPX 1 - -/* Define if curses library has the use_default_colors(). */ -#define HAVE_USE_DEFAULT_COLORS 1 - -/* Define to 1 if you have the `usleep' function. */ -#define HAVE_USLEEP 1 - -/* Define to 1 if you have the `utimensat' function. */ -#define HAVE_UTIMENSAT 1 - -/* Define to 1 if you have the header file. */ -#define HAVE_UTMPX_H 1 - -/* Define to 1 if you have the header file. */ -#define HAVE_UTMP_H 1 - -/* Define to 1 if you want to use uuid daemon. */ -#define HAVE_UUIDD 1 - -/* Define to 1 if you have the `vwarnx' function. */ -#define HAVE_VWARNX 1 - -/* Define to 1 if you have the `warn' function. */ -#define HAVE_WARN 1 - -/* Define to 1 if you have the `warnx' function. */ -#define HAVE_WARNX 1 - -/* Do we have wide character support? */ -#define HAVE_WIDECHAR 1 - -/* Define to 1 if you have the `__fpending' function. */ -#define HAVE___FPENDING 1 - -/* Define to 1 if you have the `__fpurge' function. */ -#define HAVE___FPURGE 1 - -/* Define if __progname is defined */ -#define HAVE___PROGNAME 1 - -/* Define to 1 if you have the `__secure_getenv' function. */ -/* #undef HAVE___SECURE_GETENV */ - -/* libblkid date string */ -#define LIBBLKID_DATE "@DATE@" - -/* libblkid version string */ -#define LIBBLKID_VERSION "@VERSION@" - -/* libfdisk version string */ -#define LIBFDISK_VERSION "@VERSION@" - -/* libmount version string */ -#define LIBMOUNT_VERSION "@VERSION@" - -/* libsmartcols version string */ -#define LIBSMARTCOLS_VERSION "@VERSION@" - -/* Should login chown /dev/vcsN? */ -/* #undef LOGIN_CHOWN_VCS */ - -/* Should login stat() the mailbox? */ -/* #undef LOGIN_STAT_MAIL */ - -/* Define to the sub-directory where libtool stores uninstalled libraries. */ -#define LT_OBJDIR ".libs/" - -/* "Multi-arch triplet for whereis library search path" */ -/* #undef MULTIARCHTRIPLET */ - -/* Define to 1 if assertions should be disabled. */ -/* #undef NDEBUG */ - -/* Should chsh allow only shells in /etc/shells? */ -#define ONLY_LISTED_SHELLS 1 - -/* Name of package */ -#define PACKAGE "util-linux" - -/* Define to the address where bug reports for this package should be sent. */ -#define PACKAGE_BUGREPORT "kzak@redhat.com" - -/* Define to the full name of this package. */ -#define PACKAGE_NAME "util-linux" - -/* Define to the full name and version of this package. */ -#define PACKAGE_STRING "util-linux @VERSION@" - -/* Define to the one symbol short name of this package. */ -#define PACKAGE_TARNAME "util-linux" - -/* Define to the home page for this package. */ -#define PACKAGE_URL "http://www.kernel.org/pub/linux/utils/util-linux/" - -/* Define to the version of this package. */ -#define PACKAGE_VERSION "@VERSION@" - -/* Should pg ring the bell on invalid keys? */ -#define PG_BELL 1 - -/* Define to 1 if you have the ANSI C header files. */ -#define STDC_HEADERS 1 - -/* Fallback syscall number for fallocate */ -/* #undef SYS_fallocate */ - -/* Fallback syscall number for ioprio_get */ -/* #undef SYS_ioprio_get */ - -/* Fallback syscall number for ioprio_set */ -/* #undef SYS_ioprio_set */ - -/* Fallback syscall number for pidfd_open */ -/* #undef SYS_pidfd_open */ - -/* Fallback syscall number for pidfd_send_signal */ -/* #undef SYS_pidfd_send_signal */ - -/* Fallback syscall number for pivot_root */ -/* #undef SYS_pivot_root */ - -/* Fallback syscall number for prlimit64 */ -/* #undef SYS_prlimit64 */ - -/* Fallback syscall number for sched_getaffinity */ -/* #undef SYS_sched_getaffinity */ - -/* Fallback syscall number for sched_setattr */ -/* #undef SYS_sched_setattr */ - -/* Fallback syscall number for setns */ -/* #undef SYS_setns */ - -/* Fallback syscall number for swapoff */ -/* #undef SYS_swapoff */ - -/* Fallback syscall number for swapon */ -/* #undef SYS_swapon */ - -/* Fallback syscall number for unshare */ -/* #undef SYS_unshare */ - -/* Define to 1 if your declares `struct tm'. */ -/* #undef TM_IN_SYS_TIME */ - -/* Enables colorized output from utils by default */ -#define USE_COLORS_BY_DEFAULT 1 - -/* Define to 1 if want to use CMOS clock. */ -#define USE_HWCLOCK_CMOS 1 - -/* use datetime parsing GPLv3 code to hwclock */ -#define USE_HWCLOCK_GPLv3_DATETIME 1 - -/* Define to 1 if want to support mtab. */ -/* #undef USE_LIBMOUNT_SUPPORT_MTAB */ - -/* Define to 1 if want to support namepaces. */ -#define USE_LIBMOUNT_SUPPORT_NAMESPACES 1 - -/* Enable plymouth support feature for sulogin and aggety */ -#define USE_PLYMOUTH_SUPPORT 1 - -/* Should sulogin use a emergency mount of /dev and /proc? */ -/* #undef USE_SULOGIN_EMERGENCY_MOUNT */ - -/* Enable extensions on AIX 3, Interix. */ -#ifndef _ALL_SOURCE -# define _ALL_SOURCE 1 -#endif -/* Enable GNU extensions on systems that have them. */ -#ifndef _GNU_SOURCE -# define _GNU_SOURCE 1 -#endif -/* Enable threading extensions on Solaris. */ -#ifndef _POSIX_PTHREAD_SEMANTICS -# define _POSIX_PTHREAD_SEMANTICS 1 -#endif -/* Enable extensions on HP NonStop. */ -#ifndef _TANDEM_SOURCE -# define _TANDEM_SOURCE 1 -#endif -/* Enable general extensions on Solaris. */ -#ifndef __EXTENSIONS__ -# define __EXTENSIONS__ 1 -#endif - - -/* Should wall and write be installed setgid tty? */ -#define USE_TTY_GROUP 1 - -/* Define to 1 to remove /bin and /sbin from PATH env.variable */ -/* #undef USE_USRDIR_PATHS_ONLY */ - -/* Define to 1 to use vendordir */ -/* #undef USE_VENDORDIR */ - -/* Version number of package */ -#define VERSION "@VERSION@" - -/* Define WORDS_BIGENDIAN to 1 if your processor stores words with the most - significant byte first (like Motorola and SPARC, unlike Intel). */ -#if defined AC_APPLE_UNIVERSAL_BUILD -# if defined __BIG_ENDIAN__ -# define WORDS_BIGENDIAN 1 -# endif -#else -# ifndef WORDS_BIGENDIAN -/* # undef WORDS_BIGENDIAN */ -# endif -#endif - -/* Enable MAP_ANON in sys/mman.h on Mac OS X */ -/* #undef _DARWIN_C_SOURCE */ - -/* Enable large inode numbers on Mac OS X 10.5. */ -#ifndef _DARWIN_USE_64_BIT_INODE -# define _DARWIN_USE_64_BIT_INODE 1 -#endif - -/* Number of bits in a file offset, on hosts where this is settable. */ -/* #undef _FILE_OFFSET_BITS */ - -/* Define to 1 to make fseeko visible on some hosts (e.g. glibc 2.2). */ -/* #undef _LARGEFILE_SOURCE */ - -/* Define for large files, on AIX-style hosts. */ -/* #undef _LARGE_FILES */ - -/* Define to 1 if on MINIX. */ -/* #undef _MINIX */ - -/* Define to 2 if the system does not provide POSIX.1 features except with - this defined. */ -/* #undef _POSIX_1_SOURCE */ - -/* Define to 1 if you need to in order for `stat' and other things to work. */ -/* #undef _POSIX_SOURCE */ - -/* Define to empty if `const' does not conform to ANSI C. */ -/* #undef const */ - -/* Define to empty if the keyword `volatile' does not work. Warning: valid - code using `volatile' can become incorrect without. Disable with care. */ -/* #undef volatile */ diff --git a/src/utils/lib/CMakeLists.txt b/src/utils/lib/CMakeLists.txt index e5fa459..22eafb3 100644 --- a/src/utils/lib/CMakeLists.txt +++ b/src/utils/lib/CMakeLists.txt @@ -42,3 +42,4 @@ add_library(libcommon STATIC ${CMAKE_CURRENT_SOURCE_DIR}/blkdev.c ${CMAKE_CURRENT_SOURCE_DIR}/timer.c ${CMAKE_CURRENT_SOURCE_DIR}/timeutils.c ${CMAKE_CURRENT_SOURCE_DIR}/ttyutils.c) +target_link_libraries(libcommon xloop-version) diff --git a/src/utils/libsmartcols/CMakeLists.txt b/src/utils/libsmartcols/CMakeLists.txt index c8deb72..dccb5e2 100644 --- a/src/utils/libsmartcols/CMakeLists.txt +++ b/src/utils/libsmartcols/CMakeLists.txt @@ -18,5 +18,5 @@ add_library(libsmartcols STATIC ${CMAKE_CURRENT_SOURCE_DIR}/src/buffer.c ${CMAKE_CURRENT_SOURCE_DIR}/src/table.c ${CMAKE_CURRENT_SOURCE_DIR}/src/version.c ${CMAKE_CURRENT_SOURCE_DIR}/src/walk.c) -target_include_directories(libsmartcols PUBLIC ${CMAKE_CURRENT_SOURCE_DIR}/src ${CMAKE_CURRENT_SOURCE_DIR}/../lib) -target_link_libraries(libsmartcols LINK_PUBLIC libcommon) +target_include_directories(libsmartcols PUBLIC ${CMAKE_CURRENT_SOURCE_DIR}/src) +target_link_libraries(libsmartcols LINK_PUBLIC libcommon xloop-version) diff --git a/src/utils/sys-utils/CMakeLists.txt b/src/utils/sys-utils/CMakeLists.txt index 01295d9..e05b5cf 100644 --- a/src/utils/sys-utils/CMakeLists.txt +++ b/src/utils/sys-utils/CMakeLists.txt @@ -5,8 +5,7 @@ project(xloop-utils-sys-utils) # add xlosetup executable add_executable(xlosetup ${CMAKE_CURRENT_SOURCE_DIR}/xlosetup.c) -target_link_libraries(xlosetup LINK_PUBLIC libcommon libsmartcols) -target_include_directories(xlosetup PUBLIC ${CMAKE_CURRENT_SOURCE_DIR}/../lib ${CMAKE_CURRENT_SOURCE_DIR}/../libsmartcols) +target_link_libraries(xlosetup libcommon libsmartcols xloop-version) install(TARGETS xlosetup DESTINATION bin COMPONENT main) -- cgit v1.2.3-55-g7522