From 1d990781a30942c5c153e139c3649a9562b9e936 Mon Sep 17 00:00:00 2001 From: Samuel Marks <807580+SamuelMarks@users.noreply.github.com> Date: Wed, 4 Oct 2023 20:47:06 -0400 Subject: [PATCH 1/3] Initial CMake and vcpkg support --- .gitignore | 3 + CMakeLists.txt | 123 ++++++++++++++++++++++++ cmake/BundleIcon.icns | Bin 0 -> 33452 bytes cmake/CTestConfig.cmake | 7 ++ cmake/Config.cmake.in | 4 + cmake/CustomVolumeIcon.icns | Bin 0 -> 37827 bytes cmake/Info.plist | 14 +++ cmake/MultiCPackConfig.cmake | 6 ++ cmake/README.txt | 3 + cmake/Welcome.txt | 1 + cmake/config.h.in | 9 ++ pkg/CMakeLists.txt | 31 ++++++ pkg/c3/CMakeLists.txt | 41 ++++++++ pkg/ent/CMakeLists.txt | 56 +++++++++++ pkg/noun/CMakeLists.txt | 86 +++++++++++++++++ pkg/noun/nock.h | 6 +- pkg/noun/trace.h | 2 +- pkg/ur/CMakeLists.txt | 51 ++++++++++ pkg/urcrypt/CMakeLists.txt | 53 ++++++++++ pkg/urcrypt/ge-additions/CMakeLists.txt | 40 ++++++++ pkg/vere/CMakeLists.txt | 71 ++++++++++++++ pkg/vere/db/CMakeLists.txt | 40 ++++++++ vcpkg.json | 7 ++ 23 files changed, 650 insertions(+), 4 deletions(-) create mode 100644 CMakeLists.txt create mode 100644 cmake/BundleIcon.icns create mode 100644 cmake/CTestConfig.cmake create mode 100644 cmake/Config.cmake.in create mode 100644 cmake/CustomVolumeIcon.icns create mode 100644 cmake/Info.plist create mode 100644 cmake/MultiCPackConfig.cmake create mode 100644 cmake/README.txt create mode 100644 cmake/Welcome.txt create mode 100644 cmake/config.h.in create mode 100644 pkg/CMakeLists.txt create mode 100644 pkg/c3/CMakeLists.txt create mode 100644 pkg/ent/CMakeLists.txt create mode 100644 pkg/noun/CMakeLists.txt create mode 100644 pkg/ur/CMakeLists.txt create mode 100644 pkg/urcrypt/CMakeLists.txt create mode 100644 pkg/urcrypt/ge-additions/CMakeLists.txt create mode 100644 pkg/vere/CMakeLists.txt create mode 100644 pkg/vere/db/CMakeLists.txt create mode 100644 vcpkg.json diff --git a/.gitignore b/.gitignore index da5bf8e6c8..55fc8cf889 100644 --- a/.gitignore +++ b/.gitignore @@ -277,3 +277,6 @@ GTAGS /nel /nev /fes + +# Build dirs +*build* diff --git a/CMakeLists.txt b/CMakeLists.txt new file mode 100644 index 0000000000..0fc9de876d --- /dev/null +++ b/CMakeLists.txt @@ -0,0 +1,123 @@ +cmake_minimum_required(VERSION 3.11) + +project(vere VERSION 2.1.2 LANGUAGES C) + +set(CMAKE_C_STANDARD 90) +set(CMAKE_C_STANDARD_REQUIRED ON) + +add_library("${PROJECT_NAME}_compiler_flags" INTERFACE) + +if (NOT DEFINED MSVC_VERSION + OR MSVC_VERSION STRGREATER "1900" # 2015 + OR NOT (CMAKE_C_COMPILER_ID STREQUAL "OpenWatcom")) + target_compile_features("${PROJECT_NAME}_compiler_flags" INTERFACE "c_std_${CMAKE_C_STANDARD}") +endif () +if (CMAKE_VERSION VERSION_GREATER_EQUAL "3.15") + # add compiler warning flags just when building this project via + # the BUILD_INTERFACE genex + set(gcc_like "$") + set(msvc "$") + target_compile_options( + "${PROJECT_NAME}_compiler_flags" + INTERFACE + "$<${gcc_like}:$>" + "$<${msvc}:$>" + ) +endif (CMAKE_VERSION VERSION_GREATER_EQUAL "3.15") +# Set the build directories +if (CMAKE_SYSTEM_NAME STREQUAL "Windows" + OR CMAKE_SYSTEM_NAME STREQUAL "CYGWIN" + OR CMAKE_SYSTEM_NAME MATCHES "MINGW.*") + set(CMAKE_ARCHIVE_OUTPUT_DIRECTORY "${PROJECT_BINARY_DIR}") + set(CMAKE_RUNTIME_OUTPUT_DIRECTORY "${PROJECT_BINARY_DIR}") + set(CMAKE_LIBRARY_OUTPUT_DIRECTORY "${PROJECT_BINARY_DIR}") +else () + set(CMAKE_ARCHIVE_OUTPUT_DIRECTORY "${PROJECT_BINARY_DIR}/lib") + set(CMAKE_RUNTIME_OUTPUT_DIRECTORY "${PROJECT_BINARY_DIR}/bin") + set(CMAKE_LIBRARY_OUTPUT_DIRECTORY "${PROJECT_BINARY_DIR}/lib") +endif () + +if (CMAKE_GENERATOR MATCHES "Visual Studio 8 2005.*") + set(COMPILE_LANG_AND_ID "MSVC") +else () + set(CMAKE_C_VISIBILITY_PRESET hidden) + set(CMAKE_CXX_VISIBILITY_PRESET hidden) + set(CMAKE_VISIBILITY_INLINES_HIDDEN YES) + + target_compile_features("${PROJECT_NAME}_compiler_flags" INTERFACE "c_std_${CMAKE_C_STANDARD}") + + # add compiler warning flags just when building this project via + # the BUILD_INTERFACE genex + set(gcc_like "$") + set(msvc "$") + target_compile_options( + "${PROJECT_NAME}_compiler_flags" + INTERFACE + "$<${gcc_like}:$>" + "$<${msvc}:$>" + ) +endif () + +include(CheckSymbolExists) +check_symbol_exists(BCryptGenRandom "windows.h;bcrypt.h" HAVE_BCRYPT) + +# configure a header file to pass the version number and exist flags only +configure_file( + "${CMAKE_CURRENT_SOURCE_DIR}/cmake/config.h.in" + "${PROJECT_NAME}Config.h" +) + +#=============================================================================== +# 4. ADD SUB-TARGETS +# Doing this at the end so that all definitions and link/include paths are +# available for the sub-projects. +#=============================================================================== +add_subdirectory("pkg") + +########### +# Install # +########### + +include(GNUInstallDirs) + +install( + FILES "${PROJECT_BINARY_DIR}/${PROJECT_NAME}Config.h" + DESTINATION "${CMAKE_INSTALL_INCLUDEDIR}" +) +include(InstallRequiredSystemLibraries) +set(CPACK_BUNDLE_NAME "${PROJECT_NAME}") +set(CPACK_PACKAGE_VENDOR "urbit/vere maintainers") +set(CPACK_PACKAGE_DESCRIPTION "The lowest layer of the Urbit stack.") +set(CPACK_PACKAGE_DESCRIPTION_SUMMARY "${CPACK_PACKAGE_DESCRIPTION_SUMMARY}") +if (APPLE) + set(CPACK_BUNDLE_PLIST "${CMAKE_CURRENT_SOURCE_DIR}/cmake/Info.plist") + set(CPACK_BUNDLE_ICON "${CMAKE_CURRENT_SOURCE_DIR}/cmake/Info.plist") + set(CPACK_PACKAGE_ICON "${CMAKE_CURRENT_SOURCE_DIR}/cmake/CustomVolumeIcon.icns") +endif (APPLE) +set(CPACK_RESOURCE_FILE_LICENSE "${CMAKE_SOURCE_DIR}/LICENSE.txt") +set(CPACK_PACKAGE_VERSION_MAJOR "${${PROJECT_NAME}_VERSION_MAJOR}") +set(CPACK_PACKAGE_VERSION_MINOR "${${PROJECT_NAME}_VERSION_MINOR}") +set(CPACK_RESOURCE_FILE_README "${CMAKE_CURRENT_SOURCE_DIR}/cmake/README.txt") +set(CPACK_RESOURCE_FILE_WELCOME "${CMAKE_CURRENT_SOURCE_DIR}/cmake/Welcome.txt") +set(CPACK_PACKAGE_CONTACT "https://github.com/urbit/${PROJECT_NAME}") + +include(CPack) +include(CMakePackageConfigHelpers) + +# generate the config file that is includes the exports +configure_package_config_file( + "${CMAKE_CURRENT_SOURCE_DIR}/cmake/Config.cmake.in" + "${CMAKE_CURRENT_BINARY_DIR}/${PROJECT_NAME}Config.cmake" + INSTALL_DESTINATION "${CMAKE_INSTALL_DATADIR}/${PROJECT_NAME}" + NO_SET_AND_CHECK_MACRO + NO_CHECK_REQUIRED_COMPONENTS_MACRO +) + +# generate the version file for the config file +write_basic_package_version_file( + "${CMAKE_CURRENT_BINARY_DIR}/${PROJECT_NAME}ConfigVersion.cmake" + VERSION "${${PROJECT_NAME}_VERSION_MAJOR}.${${PROJECT_NAME}_VERSION_MINOR}" + COMPATIBILITY AnyNewerVersion +) +install(FILES "${CMAKE_CURRENT_BINARY_DIR}/${PROJECT_NAME}Config.cmake" + DESTINATION "${CMAKE_INSTALL_DATADIR}/${PROJECT_NAME}") diff --git a/cmake/BundleIcon.icns b/cmake/BundleIcon.icns new file mode 100644 index 0000000000000000000000000000000000000000..8808dd62db64540292417e8865bdf627aaf8792e GIT binary patch literal 33452 zcmeHOdvsOhmH+ND3E@$o&e9H@%&P5L{1ctwU<;)Zs`WM6I?kfg89Hm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WIvt^BqRIr_)kXk+`e{%{#cRrZJTpQ`8&R{^Q?Kez%?nf;+6kjm_n|JVqmGWz5{_BS)1`RAyl?mhZ9 tOR28E*!-vZ`iu211pSsWm4C6nTBP5Srt)v{ezlppUr2uD>HmEM{tp8ay}tke literal 0 HcmV?d00001 diff --git a/cmake/CTestConfig.cmake b/cmake/CTestConfig.cmake new file mode 100644 index 0000000000..9c8795f0b3 --- /dev/null +++ b/cmake/CTestConfig.cmake @@ -0,0 +1,7 @@ +set(CTEST_PROJECT_NAME "bc") +set(CTEST_NIGHTLY_START_TIME "00:00:00 EST") + +set(CTEST_DROP_METHOD "http") +set(CTEST_DROP_SITE "my.cdash.org") +set(CTEST_DROP_LOCATION "/submit.php?project=vere") +set(CTEST_DROP_SITE_CDASH TRUE) diff --git a/cmake/Config.cmake.in b/cmake/Config.cmake.in new file mode 100644 index 0000000000..8a1144ea8d --- /dev/null +++ b/cmake/Config.cmake.in @@ -0,0 +1,4 @@ + +@PACKAGE_INIT@ + +include ( "${CMAKE_CURRENT_LIST_DIR}/vereTargets.cmake" ) diff --git a/cmake/CustomVolumeIcon.icns b/cmake/CustomVolumeIcon.icns new file mode 100644 index 0000000000000000000000000000000000000000..3862a51917954ff9c92cfe8e7469c4b12525796b GIT binary patch literal 37827 zcmeI4`EOgj0}mY0!jd6Q+W*1lQ$W=SNqZ(g)myGV)@DN@|u?K$uAiIhajo&-VC&KtnM zNbj6`&pG#=``-J!ul?Q+fA;gFq`aQ@e*U$;NJ=`^c8rj4dN4_1$jM#P%JS;k`li)p z-+IN6k5}5A)-C(C)8*dv4u=Ste+oZ4wp}}(-N1y8kZF@^%i+Wyz0%YUAtMtzcKNE$ zPoCKc8F;Zne+&f3{01RCOFL-n3j~8?d5Ms&O*j296e62*B-r6_!%Y4_FdQb1XJq%! zIz1jQSck$AA)aaC=yb^Qx!v%4=NMTZB$9z>rHSymxvxoV(KngL0_(jO|LYY0f$r4L z9vB1Os)vS0$4l-Hl3zbf_mOGBRo`b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*Pq&N=vo!t}qQt+!d zd`9j|)yEOw`Fg3Z=t_cDtEim#GYNeW79$@`NPgqe;z(?Xb-s#MjHLJtbiNVti<;H_ z3kzmy&?FG3Vl%>s~}l1p3rxGpV0RZ_!U9Gaaibk5d2~;QQ2-{@Vj4u z%Yrl*=pqmAVsXK5tkUqLaUX;Gmsu;PP0O3jdB9L;?Z zOdiw*zn1$_E*U8RRqY-Peh=YKgb4}AZ&ZWK%iKE_FDC@Q!nOt#kWoo7q8XX}V%ZXj zePflloU)wAE;Qjd0C;H|6~(bK%e_e`YmB4!#f8~Fi!6>-Er35(6926_XL%@iP z_d7&2!f_BV)%-?zYm}cMZ;gk5QS+!!5?P86s8~4=EjlzF2~4zDFappjxYO-$AA%Y@00z; zgTT?jvGrvkuR?*-qOxC^N8<-CS`wufWvuEv2VQMzAc?G>>5THP-dnPQSxkQg7< z{VKRNnj#wK9;y39Vho3R6lV&DF|Z>1jcyM*t|5-_mx*xv{dM~c!e10u$HBmBZv3mT z@nCf3VGIoafZ0J?s@euyMfRJj$bQ|RtYP7;5*79I^9r8SuZ6&ovf=8X5c}6w{T`d2 zn`33=FCgH;1wwRrRl`{{5X(|9&92JY6a8^s1;BvpjJSwfLZ~y0%`@+3aAxOE1*_Dt$(s+eu0P3)=f^qW}N^ literal 0 HcmV?d00001 diff --git a/cmake/Info.plist b/cmake/Info.plist new file mode 100644 index 0000000000..e5a7d0047a --- /dev/null +++ b/cmake/Info.plist @@ -0,0 +1,14 @@ + + + + + CFBundleExecutable + BundleGeneratorTest + CFBundleIconFile + BundleGeneratorTest.icns + CFBundleInfoDictionaryVersion + 6.0 + CFBundlePackageType + APPL + + diff --git a/cmake/MultiCPackConfig.cmake b/cmake/MultiCPackConfig.cmake new file mode 100644 index 0000000000..5c2984e556 --- /dev/null +++ b/cmake/MultiCPackConfig.cmake @@ -0,0 +1,6 @@ +include("release/CPackConfig.cmake") + +set(CPACK_INSTALL_CMAKE_PROJECTS + "debug;vere;ALL;/" + "release;vere;ALL;/" +) diff --git a/cmake/README.txt b/cmake/README.txt new file mode 100644 index 0000000000..d4b8a8b49b --- /dev/null +++ b/cmake/README.txt @@ -0,0 +1,3 @@ +vere + +The lowest layer of the Urbit stack. diff --git a/cmake/Welcome.txt b/cmake/Welcome.txt new file mode 100644 index 0000000000..1fd25597bd --- /dev/null +++ b/cmake/Welcome.txt @@ -0,0 +1 @@ +This installs vere. diff --git a/cmake/config.h.in b/cmake/config.h.in new file mode 100644 index 0000000000..896891c9a9 --- /dev/null +++ b/cmake/config.h.in @@ -0,0 +1,9 @@ +#ifndef VERE_CONFIG_H +#define VERE_CONFIG_H + +#define VERE_VERSION_MAJOR @vere_VERSION_MAJOR@ +#define VERE_VERSION_MINOR @vere_VERSION_MINOR@ +#define VERE_VERSION_PATCH @vere_VERSION_PATCH@ +#define VERE_VERSION "@vere_VERSION@" + +#endif /* !VERE_CONFIG_H */ diff --git a/pkg/CMakeLists.txt b/pkg/CMakeLists.txt new file mode 100644 index 0000000000..22df9ef98c --- /dev/null +++ b/pkg/CMakeLists.txt @@ -0,0 +1,31 @@ +set(installable_libs "c3" "ent" "noun" "ur" "urcrypt" "vere") + +foreach (pkg ${installable_libs}) + add_subdirectory("${pkg}") +endforeach (pkg ${installable_libs}) + +######### +# Tests # +######### + +# TODO + +################# +# Install rules # +################# + +include(GNUInstallDirs) + +if (TARGET "${DEPENDANT_LIBRARY}") + list(APPEND installable_libs "${DEPENDANT_LIBRARY}") +endif () +if (CMAKE_VERSION VERSION_GREATER_EQUAL "3.13") + list(APPEND installable_libs "${PROJECT_NAME}_compiler_flags") +endif () +install(TARGETS ${installable_libs} + EXPORT "${LIBRARY_NAME}Targets" + ARCHIVE DESTINATION "${CMAKE_INSTALL_LIBDIR}" + LIBRARY DESTINATION "${CMAKE_INSTALL_LIBDIR}" + RUNTIME DESTINATION "${CMAKE_INSTALL_BINDIR}") +install(EXPORT "${LIBRARY_NAME}Targets" + DESTINATION "${CMAKE_INSTALL_DATADIR}/${LIBRARY_NAME}") diff --git a/pkg/c3/CMakeLists.txt b/pkg/c3/CMakeLists.txt new file mode 100644 index 0000000000..ae676d9a58 --- /dev/null +++ b/pkg/c3/CMakeLists.txt @@ -0,0 +1,41 @@ +get_filename_component(LIBRARY_NAME "${CMAKE_CURRENT_SOURCE_DIR}" NAME) + +set(Header_Files "c3.h" "defs.h" "motes.h" "portable.h" "types.h") +source_group("Header Files" FILES "${Header_Files}") + +set(Source_Files "defs.c") +source_group("Source Files" FILES "${Source_Files}") + +add_library("${LIBRARY_NAME}" "${Header_Files}" "${Source_Files}") + +include(GNUInstallDirs) + +target_link_libraries( + "${LIBRARY_NAME}" + PRIVATE + "${PROJECT_NAME}_compiler_flags" +) + +foreach (header ${Header_Files}) + target_sources( + "${LIBRARY_NAME}" + PUBLIC + "$" + "$" + ) + message(STATUS "Added ${CMAKE_CURRENT_SOURCE_DIR}/${header}") +endforeach (header ${Header_Files}) + +########### +# Install # +########### + +set_property(TARGET "${LIBRARY_NAME}" PROPERTY VERSION "${${PROJECT_NAME}_VERSION}") +set_property(TARGET "${LIBRARY_NAME}" PROPERTY SOVERSION "${${PROJECT_NAME}_VERSION_MAJOR}") + +include(GenerateExportHeader) +set(_export_file "${CMAKE_BINARY_DIR}/include/${PROJECT_NAME}_export.h") +generate_export_header("${LIBRARY_NAME}" EXPORT_FILE_NAME "${_export_file}") + +install(FILES ${Header_Files} "${_export_file}" + DESTINATION "${CMAKE_INSTALL_INCLUDEDIR}") diff --git a/pkg/ent/CMakeLists.txt b/pkg/ent/CMakeLists.txt new file mode 100644 index 0000000000..d31148a316 --- /dev/null +++ b/pkg/ent/CMakeLists.txt @@ -0,0 +1,56 @@ +get_filename_component(LIBRARY_NAME "${CMAKE_CURRENT_SOURCE_DIR}" NAME) + +set(Header_Files "ent.h") +source_group("Header Files" FILES "${Header_Files}") + +set(Source_Files "ent.c") +source_group("Source Files" FILES "${Source_Files}") + +# TODO: `add_test` for tests.c + +add_library("${LIBRARY_NAME}" "${Header_Files}" "${Source_Files}") + +if (DEFINED ENT_GETENTROPY_BCRYPTGENRANDOM) + target_compile_definitions("${LIBRARY_NAME}" PRIVATE ENT_GETENTROPY_BCRYPTGENRANDOM=1) +elseif (DEFINED ENT_DEV_URANDOM) + target_compile_definitions("${LIBRARY_NAME}" PRIVATE ENT_DEV_URANDOM=1) +elseif (DEFINED ENT_GETENTROPY_UNISTD) + target_compile_definitions("${LIBRARY_NAME}" PRIVATE ENT_GETENTROPY_UNISTD=1) +elseif (DEFINED ENT_GETENTROPY_SYSRANDOM) + target_compile_definitions("${LIBRARY_NAME}" PRIVATE ENT_GETENTROPY_SYSRANDOM=1) +elseif (DEFINED ENT_GETRANDOM_SYSCALL) + target_compile_definitions("${LIBRARY_NAME}" PRIVATE ENT_GETRANDOM_SYSCALL=1) +else () + message(FATAL_ERROR "One of these must be set: ENT_GETENTROPY_BCRYPTGENRANDOM, ENT_DEV_URANDOM, ENT_GETENTROPY_UNISTD, ENT_GETENTROPY_SYSRANDOM, ENT_GETRANDOM_SYSCALL") +endif () + +include(GNUInstallDirs) + +target_link_libraries( + "${LIBRARY_NAME}" + PRIVATE + "${PROJECT_NAME}_compiler_flags" +) + +foreach (header ${Header_Files}) + target_sources( + "${LIBRARY_NAME}" + PUBLIC + "$" + "$" + ) +endforeach (header ${Header_Files}) + +########### +# Install # +########### + +set_property(TARGET "${LIBRARY_NAME}" PROPERTY VERSION "${${PROJECT_NAME}_VERSION}") +set_property(TARGET "${LIBRARY_NAME}" PROPERTY SOVERSION "${${PROJECT_NAME}_VERSION_MAJOR}") + +include(GenerateExportHeader) +set(_export_file "${CMAKE_BINARY_DIR}/include/${PROJECT_NAME}_export.h") +generate_export_header("${LIBRARY_NAME}" EXPORT_FILE_NAME "${_export_file}") + +install(FILES ${Header_Files} "${_export_file}" + DESTINATION "${CMAKE_INSTALL_INCLUDEDIR}") diff --git a/pkg/noun/CMakeLists.txt b/pkg/noun/CMakeLists.txt new file mode 100644 index 0000000000..ef9955cead --- /dev/null +++ b/pkg/noun/CMakeLists.txt @@ -0,0 +1,86 @@ +get_filename_component(LIBRARY_NAME "${CMAKE_CURRENT_SOURCE_DIR}" NAME) + +set(Header_Files "allocate.h" + "error.h" + "events.h" + "hashtable.h" + "imprison.h" + "jets.h" + "log.h" + "manage.h" + "nock.h" + "noun.h" + "options.h" + "retrieve.h" + "serial.h" + "trace.h" + "types.h" + "urth.h" + "version.h" + "vortex.h" + "xtract.h" + "zave.h" +) +source_group("Header Files" FILES "${Header_Files}") + +set(Source_Files + "allocate.c" + "events.c" + "hashtable.c" + # "hashtable_tests.c" + "imprison.c" + "jets.c" + # "jets_tests.c" + "log.c" + "manage.c" + "nock.c" + # "nock_tests.c" + "options.c" + "retrieve.c" + # "retrieve_tests.c" + "serial.c" + # "serial_tests.c" + "trace.c" + "urth.c" + "vortex.c" + "xtract.c" + "zave.c") +source_group("Source Files" FILES "${Source_Files}") + +add_library("${LIBRARY_NAME}" "${Header_Files}" "${Source_Files}") + +include(GNUInstallDirs) + +target_link_libraries( + "${LIBRARY_NAME}" + PRIVATE + "${PROJECT_NAME}_compiler_flags" +) +target_link_libraries( + "${LIBRARY_NAME}" + PUBLIC + "c3" +) + +foreach (header ${Header_Files}) + target_sources( + "${LIBRARY_NAME}" + PUBLIC + "$" + "$" + ) +endforeach (header ${Header_Files}) + +########### +# Install # +########### + +set_property(TARGET "${LIBRARY_NAME}" PROPERTY VERSION "${${PROJECT_NAME}_VERSION}") +set_property(TARGET "${LIBRARY_NAME}" PROPERTY SOVERSION "${${PROJECT_NAME}_VERSION_MAJOR}") + +include(GenerateExportHeader) +set(_export_file "${CMAKE_BINARY_DIR}/include/${PROJECT_NAME}_export.h") +generate_export_header("${LIBRARY_NAME}" EXPORT_FILE_NAME "${_export_file}") + +install(FILES ${Header_Files} "${_export_file}" + DESTINATION "${CMAKE_INSTALL_INCLUDEDIR}") diff --git a/pkg/noun/nock.h b/pkg/noun/nock.h index 7dded22058..6d72786463 100644 --- a/pkg/noun/nock.h +++ b/pkg/noun/nock.h @@ -9,9 +9,9 @@ #include "jets.h" #include "types.h" - /** Data structures. - *** - **/ +/** Data structures. +*** +**/ /* u3n_memo: %memo hint space */ diff --git a/pkg/noun/trace.h b/pkg/noun/trace.h index 667cdfae4b..f422dd0d0a 100644 --- a/pkg/noun/trace.h +++ b/pkg/noun/trace.h @@ -3,7 +3,7 @@ #ifndef U3_TRACE_H #define U3_TRACE_H -#include "c3/c3.h" +#include "c3.h" #include "options.h" #include "types.h" diff --git a/pkg/ur/CMakeLists.txt b/pkg/ur/CMakeLists.txt new file mode 100644 index 0000000000..c912ea4fdb --- /dev/null +++ b/pkg/ur/CMakeLists.txt @@ -0,0 +1,51 @@ +get_filename_component(LIBRARY_NAME "${CMAKE_CURRENT_SOURCE_DIR}" NAME) + +set(Header_Files "bitstream.h" + "defs.h" + "hashcons.h" + "serial.h" + "ur.h") +source_group("Header Files" FILES "${Header_Files}") + +set(Source_Files + "bitstream.c" + "hashcons.c" + "serial.c" + #"tests.c" +) +source_group("Source Files" FILES "${Source_Files}") + +# TODO: `add_test` for tests.c + +add_library("${LIBRARY_NAME}" "${Header_Files}" "${Source_Files}") + +include(GNUInstallDirs) + +target_link_libraries( + "${LIBRARY_NAME}" + PRIVATE + "${PROJECT_NAME}_compiler_flags" +) + +foreach (header ${Header_Files}) + target_sources( + "${LIBRARY_NAME}" + PUBLIC + "$" + "$" + ) +endforeach (header ${Header_Files}) + +########### +# Install # +########### + +set_property(TARGET "${LIBRARY_NAME}" PROPERTY VERSION "${${PROJECT_NAME}_VERSION}") +set_property(TARGET "${LIBRARY_NAME}" PROPERTY SOVERSION "${${PROJECT_NAME}_VERSION_MAJOR}") + +include(GenerateExportHeader) +set(_export_file "${CMAKE_BINARY_DIR}/include/${PROJECT_NAME}_export.h") +generate_export_header("${LIBRARY_NAME}" EXPORT_FILE_NAME "${_export_file}") + +install(FILES ${Header_Files} "${_export_file}" + DESTINATION "${CMAKE_INSTALL_INCLUDEDIR}") diff --git a/pkg/urcrypt/CMakeLists.txt b/pkg/urcrypt/CMakeLists.txt new file mode 100644 index 0000000000..27bd9db98b --- /dev/null +++ b/pkg/urcrypt/CMakeLists.txt @@ -0,0 +1,53 @@ +get_filename_component(LIBRARY_NAME "${CMAKE_CURRENT_SOURCE_DIR}" NAME) + +set(Header_Files "urcrypt.h" "util.h") +source_group("Header Files" FILES "${Header_Files}") + +set(Source_Files + "aes_cbc.c" + "aes_ecb.c" + "aes_siv.c" + "argon.c" + "ed25519.c" + "ge_additions.c" + "keccak.c" + "ripemd.c" + "scrypt.c" + "secp256k1.c" + "sha.c" + "util.c" +) +source_group("Source Files" FILES "${Source_Files}") + +add_library("${LIBRARY_NAME}" "${Header_Files}" "${Source_Files}") + +include(GNUInstallDirs) + +target_link_libraries( + "${LIBRARY_NAME}" + PRIVATE + "${PROJECT_NAME}_compiler_flags" +) + +foreach (header ${Header_Files}) + target_sources( + "${LIBRARY_NAME}" + PUBLIC + "$" + "$" + ) +endforeach (header ${Header_Files}) + +########### +# Install # +########### + +set_property(TARGET "${LIBRARY_NAME}" PROPERTY VERSION "${${PROJECT_NAME}_VERSION}") +set_property(TARGET "${LIBRARY_NAME}" PROPERTY SOVERSION "${${PROJECT_NAME}_VERSION_MAJOR}") + +include(GenerateExportHeader) +set(_export_file "${CMAKE_BINARY_DIR}/include/${PROJECT_NAME}_export.h") +generate_export_header("${LIBRARY_NAME}" EXPORT_FILE_NAME "${_export_file}") + +install(FILES ${Header_Files} "${_export_file}" + DESTINATION "${CMAKE_INSTALL_INCLUDEDIR}") diff --git a/pkg/urcrypt/ge-additions/CMakeLists.txt b/pkg/urcrypt/ge-additions/CMakeLists.txt new file mode 100644 index 0000000000..346ff7c90c --- /dev/null +++ b/pkg/urcrypt/ge-additions/CMakeLists.txt @@ -0,0 +1,40 @@ +get_filename_component(LIBRARY_NAME "${CMAKE_CURRENT_SOURCE_DIR}" NAME) + +set(Header_Files "ge-additions.h") +source_group("Header Files" FILES "${Header_Files}") + +set(Source_Files "ge-additions.c") +source_group("Source Files" FILES "${Source_Files}") + +add_library("${LIBRARY_NAME}" "${Header_Files}" "${Source_Files}") + +include(GNUInstallDirs) + +target_link_libraries( + "${LIBRARY_NAME}" + PRIVATE + "${PROJECT_NAME}_compiler_flags" +) + +foreach (header ${Header_Files}) + target_sources( + "${LIBRARY_NAME}" + PUBLIC + "$" + "$" + ) +endforeach (header ${Header_Files}) + +########### +# Install # +########### + +set_property(TARGET "${LIBRARY_NAME}" PROPERTY VERSION "${${PROJECT_NAME}_VERSION}") +set_property(TARGET "${LIBRARY_NAME}" PROPERTY SOVERSION "${${PROJECT_NAME}_VERSION_MAJOR}") + +include(GenerateExportHeader) +set(_export_file "${CMAKE_BINARY_DIR}/include/${PROJECT_NAME}_export.h") +generate_export_header("${LIBRARY_NAME}" EXPORT_FILE_NAME "${_export_file}") + +install(FILES ${Header_Files} "${_export_file}" + DESTINATION "${CMAKE_INSTALL_INCLUDEDIR}") diff --git a/pkg/vere/CMakeLists.txt b/pkg/vere/CMakeLists.txt new file mode 100644 index 0000000000..7342378cf4 --- /dev/null +++ b/pkg/vere/CMakeLists.txt @@ -0,0 +1,71 @@ +get_filename_component(LIBRARY_NAME "${CMAKE_CURRENT_SOURCE_DIR}" NAME) + +set(Header_Files "mars.h" "serf.h" "vere.h") +source_group("Header Files" FILES "${Header_Files}") + +set(Source_Files #"ames_tests.c" + "auto.c" + "benchmarks.c" + #"boot_tests.c" + "dawn.c" + "disk.c" + "foil.c" + "king.c" + "lord.c" + "main.c" + "mars.c" + "newt.c" + #"newt_tests.c" + #"noun_tests.c" + "pier.c" + "save.c" + "serf.c" + "time.c" + #"unix_tests.c" + "ward.c" + + "io/ames.c" + "io/behn.c" + "io/conn.c" + "io/cttp.c" + "io/fore.c" + "io/hind.c" + "io/http.c" + "io/lick.c" + "io/term.c" + "io/unix.c" +) +source_group("Source Files" FILES "${Source_Files}") + +add_library("${LIBRARY_NAME}" "${Header_Files}" "${Source_Files}") + +include(GNUInstallDirs) + +target_link_libraries( + "${LIBRARY_NAME}" + PRIVATE + "${PROJECT_NAME}_compiler_flags" +) + +foreach (header ${Header_Files}) + target_sources( + "${LIBRARY_NAME}" + PUBLIC + "$" + "$" + ) +endforeach (header ${Header_Files}) + +########### +# Install # +########### + +set_property(TARGET "${LIBRARY_NAME}" PROPERTY VERSION "${${PROJECT_NAME}_VERSION}") +set_property(TARGET "${LIBRARY_NAME}" PROPERTY SOVERSION "${${PROJECT_NAME}_VERSION_MAJOR}") + +include(GenerateExportHeader) +set(_export_file "${CMAKE_BINARY_DIR}/include/${PROJECT_NAME}_export.h") +generate_export_header("${LIBRARY_NAME}" EXPORT_FILE_NAME "${_export_file}") + +install(FILES ${Header_Files} "${_export_file}" + DESTINATION "${CMAKE_INSTALL_INCLUDEDIR}") diff --git a/pkg/vere/db/CMakeLists.txt b/pkg/vere/db/CMakeLists.txt new file mode 100644 index 0000000000..72a0ea4f63 --- /dev/null +++ b/pkg/vere/db/CMakeLists.txt @@ -0,0 +1,40 @@ +get_filename_component(LIBRARY_NAME "${CMAKE_CURRENT_SOURCE_DIR}" NAME) + +set(Header_Files "lmdb.h") +source_group("Header Files" FILES "${Header_Files}") + +set(Source_Files "lmdb.c") +source_group("Source Files" FILES "${Source_Files}") + +add_library("${LIBRARY_NAME}" "${Header_Files}" "${Source_Files}") + +include(GNUInstallDirs) + +target_link_libraries( + "${LIBRARY_NAME}" + PRIVATE + "${PROJECT_NAME}_compiler_flags" +) + +foreach (header ${Header_Files}) + target_sources( + "${LIBRARY_NAME}" + PUBLIC + "$" + "$" + ) +endforeach (header ${Header_Files}) + +########### +# Install # +########### + +set_property(TARGET "${LIBRARY_NAME}" PROPERTY VERSION "${${PROJECT_NAME}_VERSION}") +set_property(TARGET "${LIBRARY_NAME}" PROPERTY SOVERSION "${${PROJECT_NAME}_VERSION_MAJOR}") + +include(GenerateExportHeader) +set(_export_file "${CMAKE_BINARY_DIR}/include/${PROJECT_NAME}_export.h") +generate_export_header("${LIBRARY_NAME}" EXPORT_FILE_NAME "${_export_file}") + +install(FILES ${Header_Files} "${_export_file}" + DESTINATION "${CMAKE_INSTALL_INCLUDEDIR}") diff --git a/vcpkg.json b/vcpkg.json new file mode 100644 index 0000000000..1a9eaa216d --- /dev/null +++ b/vcpkg.json @@ -0,0 +1,7 @@ +{ + "name": "vere", + "version-string": "2.1.2", + "dependencies": [ + "argon2", "openssl" + ] +} From a36d447094b1cbb242ba7959001e770505087808 Mon Sep 17 00:00:00 2001 From: Samuel Marks <807580+SamuelMarks@users.noreply.github.com> Date: Thu, 5 Oct 2023 00:02:30 -0400 Subject: [PATCH 2/3] [**CMakeLists.txt] Get closer to Linux support using cmake build system --- CMakeLists.txt | 19 ++++++-- pkg/CMakeLists.txt | 4 +- pkg/c3/CMakeLists.txt | 42 ++++++++++++++---- pkg/ent/CMakeLists.txt | 14 +++--- pkg/noun/CMakeLists.txt | 58 +++++++++++++++++++++---- pkg/ur/CMakeLists.txt | 14 +++--- pkg/urcrypt/CMakeLists.txt | 24 +++++----- pkg/urcrypt/ge-additions/CMakeLists.txt | 14 +++--- pkg/vere/CMakeLists.txt | 14 +++--- pkg/vere/db/CMakeLists.txt | 14 +++--- vcpkg.json | 2 +- vcpkg_TODO.md | 5 +++ 12 files changed, 151 insertions(+), 73 deletions(-) create mode 100644 vcpkg_TODO.md diff --git a/CMakeLists.txt b/CMakeLists.txt index 0fc9de876d..5f0984cc39 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -2,15 +2,26 @@ cmake_minimum_required(VERSION 3.11) project(vere VERSION 2.1.2 LANGUAGES C) -set(CMAKE_C_STANDARD 90) -set(CMAKE_C_STANDARD_REQUIRED ON) +set(CMAKE_C_STANDARD 11) +set(CMAKE_C_STANDARD_REQUIRED OFF) +set(CMAKE_CXX_STANDARD_REQUIRED OFF) +set(CMAKE_C_EXTENSIONS ON) +set(CMAKE_CXX_EXTENSIONS ON) add_library("${PROJECT_NAME}_compiler_flags" INTERFACE) +if (NOT DEFINED CMAKE_SYSTEM_NAME) + set(CMAKE_SYSTEM_NAME "${CMAKE_HOST_SYSTEM_NAME}") +endif (NOT DEFINED CMAKE_SYSTEM_NAME) + if (NOT DEFINED MSVC_VERSION OR MSVC_VERSION STRGREATER "1900" # 2015 OR NOT (CMAKE_C_COMPILER_ID STREQUAL "OpenWatcom")) - target_compile_features("${PROJECT_NAME}_compiler_flags" INTERFACE "c_std_${CMAKE_C_STANDARD}") + target_compile_features( + "${PROJECT_NAME}_compiler_flags" + INTERFACE + "c_std_${CMAKE_C_STANDARD}" + ) endif () if (CMAKE_VERSION VERSION_GREATER_EQUAL "3.15") # add compiler warning flags just when building this project via @@ -20,7 +31,7 @@ if (CMAKE_VERSION VERSION_GREATER_EQUAL "3.15") target_compile_options( "${PROJECT_NAME}_compiler_flags" INTERFACE - "$<${gcc_like}:$>" + "$<${gcc_like}:$>" "$<${msvc}:$>" ) endif (CMAKE_VERSION VERSION_GREATER_EQUAL "3.15") diff --git a/pkg/CMakeLists.txt b/pkg/CMakeLists.txt index 22df9ef98c..6e8f08b730 100644 --- a/pkg/CMakeLists.txt +++ b/pkg/CMakeLists.txt @@ -1,9 +1,11 @@ -set(installable_libs "c3" "ent" "noun" "ur" "urcrypt" "vere") +set(installable_libs "c3" "ent" "ur" "noun" "urcrypt" "vere") foreach (pkg ${installable_libs}) add_subdirectory("${pkg}") endforeach (pkg ${installable_libs}) +list(APPEND installable_libs "ge-additions") + ######### # Tests # ######### diff --git a/pkg/c3/CMakeLists.txt b/pkg/c3/CMakeLists.txt index ae676d9a58..9028a2e2eb 100644 --- a/pkg/c3/CMakeLists.txt +++ b/pkg/c3/CMakeLists.txt @@ -8,6 +8,26 @@ source_group("Source Files" FILES "${Source_Files}") add_library("${LIBRARY_NAME}" "${Header_Files}" "${Source_Files}") +if (LINUX) + target_compile_definitions("${LIBRARY_NAME}" PUBLIC -DU3_OS_linux=1) +elseif (APPLE) + target_compile_definitions("${LIBRARY_NAME}" PUBLIC -DU3_OS_osx=1) +elseif (BSD) + target_compile_definitions("${LIBRARY_NAME}" PUBLIC -DU3_OS_bsd=1) +else () + message(FATAL_ERROR "${CMAKE_SYSTEM_NAME} unsupported. Port it!") +endif () + +if (CMAKE_VERSION VERSION_LESS "3.20") + include(TestBigEndian) + test_big_endian(CMAKE_C_BYTE_ORDER) +endif () +if (CMAKE_C_BYTE_ORDER EQUAL 1) + target_compile_definitions("${LIBRARY_NAME}" PUBLIC -DU3_OS_ENDIAN_big=1) +else () + target_compile_definitions("${LIBRARY_NAME}" PUBLIC -DU3_OS_ENDIAN_little=1) +endif () + include(GNUInstallDirs) target_link_libraries( @@ -16,15 +36,19 @@ target_link_libraries( "${PROJECT_NAME}_compiler_flags" ) -foreach (header ${Header_Files}) - target_sources( - "${LIBRARY_NAME}" - PUBLIC - "$" - "$" - ) - message(STATUS "Added ${CMAKE_CURRENT_SOURCE_DIR}/${header}") -endforeach (header ${Header_Files}) +target_include_directories( + "${LIBRARY_NAME}" + PUBLIC + "$" + "$" +) + +target_include_directories( + "${LIBRARY_NAME}" + PUBLIC + "$" + "$" +) ########### # Install # diff --git a/pkg/ent/CMakeLists.txt b/pkg/ent/CMakeLists.txt index d31148a316..8a7819399f 100644 --- a/pkg/ent/CMakeLists.txt +++ b/pkg/ent/CMakeLists.txt @@ -32,14 +32,12 @@ target_link_libraries( "${PROJECT_NAME}_compiler_flags" ) -foreach (header ${Header_Files}) - target_sources( - "${LIBRARY_NAME}" - PUBLIC - "$" - "$" - ) -endforeach (header ${Header_Files}) +target_include_directories( + "${LIBRARY_NAME}" + PUBLIC + "$" + "$" +) ########### # Install # diff --git a/pkg/noun/CMakeLists.txt b/pkg/noun/CMakeLists.txt index ef9955cead..05c43bff1b 100644 --- a/pkg/noun/CMakeLists.txt +++ b/pkg/noun/CMakeLists.txt @@ -56,20 +56,60 @@ target_link_libraries( PRIVATE "${PROJECT_NAME}_compiler_flags" ) + +set(rsignal "${CMAKE_CURRENT_SOURCE_DIR}/platform") +if (LINUX) + set(rsignal "${rsignal}/linux") +elseif (APPLE) + set(rsignal "${rsignal}/darwin") +else () + message(FATAL_ERROR "You need to port rsignal.h") +endif () +target_include_directories( + "${LIBRARY_NAME}" + PUBLIC + "$" +) +set(rsignal "${rsignal}/rsignal.h") + + target_link_libraries( "${LIBRARY_NAME}" PUBLIC "c3" + "ur" +) + +target_include_directories( + "${LIBRARY_NAME}" + PUBLIC + "$" + "$" +) + +target_include_directories( + "${LIBRARY_NAME}" + PUBLIC + "$" + "$" ) -foreach (header ${Header_Files}) - target_sources( - "${LIBRARY_NAME}" - PUBLIC - "$" - "$" - ) -endforeach (header ${Header_Files}) +# TODO: Port libavutil to vcpkg +find_path(LIBAVUTIL_INCLUDE_DIR + NAMES libavutil/murmur3.h + PATHS + /usr/include /usr/local/include #system level + /opt/local/include /sw/include #macports & fink + /usr/include/x86_64-linux-gnu + /usr/include/x86_64-linux-gnu/libavutil + PATH_SUFFIXES libav ffmpeg libavutil + REQUIRED +) +target_include_directories( + "${LIBRARY_NAME}" + PRIVATE + "${LIBAVUTIL_INCLUDE_DIR}" +) ########### # Install # @@ -84,3 +124,5 @@ generate_export_header("${LIBRARY_NAME}" EXPORT_FILE_NAME "${_export_file}") install(FILES ${Header_Files} "${_export_file}" DESTINATION "${CMAKE_INSTALL_INCLUDEDIR}") +install(FILES ${rsignal} + DESTINATION "${CMAKE_INSTALL_INCLUDEDIR}/platform") diff --git a/pkg/ur/CMakeLists.txt b/pkg/ur/CMakeLists.txt index c912ea4fdb..18b328c554 100644 --- a/pkg/ur/CMakeLists.txt +++ b/pkg/ur/CMakeLists.txt @@ -27,14 +27,12 @@ target_link_libraries( "${PROJECT_NAME}_compiler_flags" ) -foreach (header ${Header_Files}) - target_sources( - "${LIBRARY_NAME}" - PUBLIC - "$" - "$" - ) -endforeach (header ${Header_Files}) +target_include_directories( + "${LIBRARY_NAME}" + PUBLIC + "$" + "$" +) ########### # Install # diff --git a/pkg/urcrypt/CMakeLists.txt b/pkg/urcrypt/CMakeLists.txt index 27bd9db98b..98db15e3bf 100644 --- a/pkg/urcrypt/CMakeLists.txt +++ b/pkg/urcrypt/CMakeLists.txt @@ -21,22 +21,26 @@ source_group("Source Files" FILES "${Source_Files}") add_library("${LIBRARY_NAME}" "${Header_Files}" "${Source_Files}") -include(GNUInstallDirs) - +find_package(unofficial-argon2 CONFIG REQUIRED) +find_package(OpenSSL REQUIRED) +add_subdirectory("ge-additions") target_link_libraries( "${LIBRARY_NAME}" PRIVATE "${PROJECT_NAME}_compiler_flags" + ge-additions + unofficial::argon2::libargon2 + OpenSSL::SSL OpenSSL::Crypto ) -foreach (header ${Header_Files}) - target_sources( - "${LIBRARY_NAME}" - PUBLIC - "$" - "$" - ) -endforeach (header ${Header_Files}) +include(GNUInstallDirs) + +target_include_directories( + "${LIBRARY_NAME}" + PUBLIC + "$" + "$" +) ########### # Install # diff --git a/pkg/urcrypt/ge-additions/CMakeLists.txt b/pkg/urcrypt/ge-additions/CMakeLists.txt index 346ff7c90c..828ad080bc 100644 --- a/pkg/urcrypt/ge-additions/CMakeLists.txt +++ b/pkg/urcrypt/ge-additions/CMakeLists.txt @@ -16,14 +16,12 @@ target_link_libraries( "${PROJECT_NAME}_compiler_flags" ) -foreach (header ${Header_Files}) - target_sources( - "${LIBRARY_NAME}" - PUBLIC - "$" - "$" - ) -endforeach (header ${Header_Files}) +target_include_directories( + "${LIBRARY_NAME}" + PUBLIC + "$" + "$" +) ########### # Install # diff --git a/pkg/vere/CMakeLists.txt b/pkg/vere/CMakeLists.txt index 7342378cf4..01464f04ea 100644 --- a/pkg/vere/CMakeLists.txt +++ b/pkg/vere/CMakeLists.txt @@ -47,14 +47,12 @@ target_link_libraries( "${PROJECT_NAME}_compiler_flags" ) -foreach (header ${Header_Files}) - target_sources( - "${LIBRARY_NAME}" - PUBLIC - "$" - "$" - ) -endforeach (header ${Header_Files}) +target_include_directories( + "${LIBRARY_NAME}" + PUBLIC + "$" + "$" +) ########### # Install # diff --git a/pkg/vere/db/CMakeLists.txt b/pkg/vere/db/CMakeLists.txt index 72a0ea4f63..a1b3575caf 100644 --- a/pkg/vere/db/CMakeLists.txt +++ b/pkg/vere/db/CMakeLists.txt @@ -16,14 +16,12 @@ target_link_libraries( "${PROJECT_NAME}_compiler_flags" ) -foreach (header ${Header_Files}) - target_sources( - "${LIBRARY_NAME}" - PUBLIC - "$" - "$" - ) -endforeach (header ${Header_Files}) +target_include_directories( + "${LIBRARY_NAME}" + PUBLIC + "$" + "$" +) ########### # Install # diff --git a/vcpkg.json b/vcpkg.json index 1a9eaa216d..170838be91 100644 --- a/vcpkg.json +++ b/vcpkg.json @@ -2,6 +2,6 @@ "name": "vere", "version-string": "2.1.2", "dependencies": [ - "argon2", "openssl" + "argon2", "openssl", "libb2" ] } diff --git a/vcpkg_TODO.md b/vcpkg_TODO.md new file mode 100644 index 0000000000..d5d26842fb --- /dev/null +++ b/vcpkg_TODO.md @@ -0,0 +1,5 @@ +## Port to vcpkg +- libavutil for `murmur.h` from https://ffmpeg.org/libavutil.html +- keccak-tiny for `keccak-tiny.h` from https://github.com/coruus/keccak-tiny +- libaes_siv for `aes_siv.h` from https://github.com/dfoxfranke/libaes_siv +- ed25519 for `ge.h` from https://github.com/orlp/ed25519 From c823d4c1b55ab6ab59297ae3973b0daba0cd4fe8 Mon Sep 17 00:00:00 2001 From: Samuel Marks <807580+SamuelMarks@users.noreply.github.com> Date: Thu, 5 Oct 2023 00:03:46 -0400 Subject: [PATCH 3/3] [{pkg/noun,pkg/ur/serial.c}] Conform codebase by resolving errors found by `-pedantic -Wall` --- pkg/noun/allocate.c | 11 ++++++----- pkg/noun/allocate.h | 2 +- pkg/noun/events.c | 4 +++- pkg/noun/hashtable.c | 2 +- pkg/noun/imprison.c | 6 +++--- pkg/noun/jets.c | 2 +- pkg/noun/jets.h | 2 +- pkg/noun/nock.c | 6 +++--- pkg/noun/nock.h | 2 +- pkg/noun/trace.c | 6 +++--- pkg/noun/trace.h | 6 +++--- pkg/noun/urth.c | 6 +++--- pkg/noun/vortex.c | 2 +- pkg/noun/vortex.h | 2 +- pkg/ur/serial.c | 7 +++++-- 15 files changed, 36 insertions(+), 30 deletions(-) diff --git a/pkg/noun/allocate.c b/pkg/noun/allocate.c index ace4473a4a..08e695aa51 100644 --- a/pkg/noun/allocate.c +++ b/pkg/noun/allocate.c @@ -504,8 +504,8 @@ _ca_willoc(c3_w len_w, c3_w ald_w, c3_w off_w) } } else { /* we got a non-null freelist */ - u3_post box_p, all_p; - box_p = all_p = *pfr_p; + u3_post all_p; + all_p = *pfr_p; all_p += c3_wiseof(u3a_box) + off_w; c3_w pad_w = c3_align(all_p, ald_w, C3_ALGHI) - all_p; c3_w des_w = c3_align(siz_w + pad_w, u3C.walign_w, C3_ALGHI); @@ -909,7 +909,8 @@ u3a_cfree(c3_w* cel_w) #endif if ( u3R == &(u3H->rod_u) ) { - return u3a_wfree(cel_w); + u3a_wfree(cel_w); + return; } else { u3a_box* box_u = u3a_botox(cel_w); @@ -2281,7 +2282,7 @@ _ca_print_leak(c3_c* cap_c, u3a_box* box_u, c3_ws use_ws) { fprintf(stderr, "%s: %p mug=%x swept=%d\r\n", cap_c, - box_u, + (void*)box_u, ((u3a_noun *)(u3a_boxto(box_u)))->mug_w, use_ws); @@ -2831,7 +2832,7 @@ u3a_string(u3_atom a) /* u3a_loom_sane(): sanity checks the state of the loom for obvious corruption */ void -u3a_loom_sane() +u3a_loom_sane(void) { /* Only checking validity of freelists for now. Other checks could be added, diff --git a/pkg/noun/allocate.h b/pkg/noun/allocate.h index 7355954abd..4e6dcafcaa 100644 --- a/pkg/noun/allocate.h +++ b/pkg/noun/allocate.h @@ -757,6 +757,6 @@ /* u3a_loom_sane(): sanity checks the state of the loom for obvious corruption */ void - u3a_loom_sane(); + u3a_loom_sane(void); #endif /* ifndef U3_ALLOCATE_H */ diff --git a/pkg/noun/events.c b/pkg/noun/events.c index 0294f522ab..f119eefc08 100644 --- a/pkg/noun/events.c +++ b/pkg/noun/events.c @@ -1066,7 +1066,7 @@ _ce_loom_protect_south(c3_w pgs_w, c3_w old_w) /* _ce_loom_mapf_ephemeral(): map entire loom into ephemeral file */ static void -_ce_loom_mapf_ephemeral() +_ce_loom_mapf_ephemeral(void) { if ( MAP_FAILED == mmap(_ce_ptr(0), _ce_len(u3P.pag_w), @@ -1690,7 +1690,9 @@ u3e_yolo(void) return c3n; } +#ifdef U3_GUARD_PAGE u3_assert( !_ce_ward_protect() ); +#endif return c3y; } diff --git a/pkg/noun/hashtable.c b/pkg/noun/hashtable.c index 5915de5944..bcb6df8236 100644 --- a/pkg/noun/hashtable.c +++ b/pkg/noun/hashtable.c @@ -801,7 +801,7 @@ u3h_walk_with(u3p(u3h_root) har_p, static void _ch_walk_plain(u3_noun kev, void* wit) { - void (*fun_f)(u3_noun) = wit; + void (*fun_f)(u3_noun) = (void (*)(u3_noun))wit; fun_f(kev); } diff --git a/pkg/noun/imprison.c b/pkg/noun/imprison.c index 1ff8200790..7d30b4e645 100644 --- a/pkg/noun/imprison.c +++ b/pkg/noun/imprison.c @@ -235,9 +235,9 @@ u3i_slab_mint(u3i_slab* sab_u) u3t_on(mal_o); } else { - u3a_atom* vat_u = sab_u->_._vat_u; + u3a_atom* sab_u_vat_u = sab_u->_._vat_u; c3_w* tav_w = (sab_u->buf_w - c3_wiseof(u3a_atom)); - u3_assert( tav_w == (c3_w*)vat_u ); + u3_assert( tav_w == (c3_w*)sab_u_vat_u ); // trim trailing zeros // @@ -245,7 +245,7 @@ u3i_slab_mint(u3i_slab* sab_u) len_w--; } - pro = _ci_atom_mint(vat_u, len_w); + pro = _ci_atom_mint(sab_u_vat_u, len_w); } u3t_off(mal_o); diff --git a/pkg/noun/jets.c b/pkg/noun/jets.c index 00edefec40..941f3352d4 100644 --- a/pkg/noun/jets.c +++ b/pkg/noun/jets.c @@ -2394,7 +2394,7 @@ u3j_reclaim(void) * history at e8a307a. */ void -u3j_rewrite_compact() +u3j_rewrite_compact(void) { u3h_rewrite(u3R->jed.war_p); u3h_rewrite(u3R->jed.cod_p); diff --git a/pkg/noun/jets.h b/pkg/noun/jets.h index 9c5241c5db..c5621592ac 100644 --- a/pkg/noun/jets.h +++ b/pkg/noun/jets.h @@ -305,6 +305,6 @@ /* u3j_rewrite_compact(): rewrite jet state for compaction. */ void - u3j_rewrite_compact(); + u3j_rewrite_compact(void); #endif /* ifndef U3_JETS_H */ diff --git a/pkg/noun/nock.c b/pkg/noun/nock.c index 6ac08779ef..7e3ed9d502 100644 --- a/pkg/noun/nock.c +++ b/pkg/noun/nock.c @@ -2989,7 +2989,7 @@ _n_ream(u3_noun kev) /* u3n_ream(): refresh after restoring from checkpoint. */ void -u3n_ream() +u3n_ream(void) { u3_assert(u3R == &(u3H->rod_u)); u3h_walk(u3R->byc.har_p, _n_ream); @@ -3073,7 +3073,7 @@ u3n_reclaim(void) * many more words (plus one?). */ void -u3n_rewrite_compact() +u3n_rewrite_compact(void) { u3h_rewrite(u3R->byc.har_p); u3R->byc.har_p = u3a_rewritten(u3R->byc.har_p); @@ -3091,7 +3091,7 @@ _n_feb(u3_noun kev) /* u3n_free(): free bytecode cache */ void -u3n_free() +u3n_free(void) { u3p(u3h_root) har_p = u3R->byc.har_p; u3h_walk(har_p, _n_feb); diff --git a/pkg/noun/nock.h b/pkg/noun/nock.h index 6d72786463..cda3a8c687 100644 --- a/pkg/noun/nock.h +++ b/pkg/noun/nock.h @@ -132,7 +132,7 @@ /* u3n_rewrite_compact(): rewrite bytecode cache for compaction. */ void - u3n_rewrite_compact(); + u3n_rewrite_compact(void); /* u3n_free(): free bytecode cache. */ diff --git a/pkg/noun/trace.c b/pkg/noun/trace.c index 8768531d62..18f912d4f7 100644 --- a/pkg/noun/trace.c +++ b/pkg/noun/trace.c @@ -359,7 +359,7 @@ u3t_trace_open(c3_c* dir_c) /* u3t_trace_close(): closes a trace file. optional. */ void -u3t_trace_close() +u3t_trace_close(void) { if ( !_file_u ) return; @@ -372,7 +372,7 @@ u3t_trace_close() /* u3t_trace_time(): microsecond clock */ -c3_d u3t_trace_time() +c3_d u3t_trace_time(void) { struct timeval tim_tv; gettimeofday(&tim_tv, 0); @@ -408,7 +408,7 @@ u3t_nock_trace_push(u3_noun lab) * calls. If it is, we write it out to the tracefile. */ void -u3t_nock_trace_pop() +u3t_nock_trace_pop(void) { if ( !_file_u ) return; diff --git a/pkg/noun/trace.h b/pkg/noun/trace.h index f422dd0d0a..579fed89e9 100644 --- a/pkg/noun/trace.h +++ b/pkg/noun/trace.h @@ -108,13 +108,13 @@ /* u3t_trace_close(): closes the trace file. optional. */ void - u3t_trace_close(); + u3t_trace_close(void); /* u3t_trace_time(): returns current time since system epoc, * whatever it is per system, in microseconds. */ c3_d - u3t_trace_time(); + u3t_trace_time(void); /* u3t_nock_trace_push(): pushes a frame onto the trace stack; * return yes if active push. @@ -125,7 +125,7 @@ /* u3t_nock_trace_pop(): pop off trace stack. */ void - u3t_nock_trace_pop(); + u3t_nock_trace_pop(void); /* u3t_event_trace(): record a lifecycle event. */ diff --git a/pkg/noun/urth.c b/pkg/noun/urth.c index 701d235637..31149052c5 100644 --- a/pkg/noun/urth.c +++ b/pkg/noun/urth.c @@ -343,12 +343,12 @@ _cu_all_to_loom(ur_root_t* rot_u, ur_nref ken, ur_nvec_t* cod_u) // { c3_d max_d = cod_u->fill; - c3_d i_d; + c3_d j_d; ur_nref ref; u3_noun kev; - for ( i_d = 0; i_d < max_d; i_d++) { - ref = cod_u->refs[i_d]; + for ( j_d = 0; j_d < max_d; j_d++) { + ref = cod_u->refs[j_d]; kev = lom_u.cel[ur_nref_idx(ref)]; u3h_put(u3R->jed.cod_p, u3h(kev), u3k(u3t(kev))); u3z(kev); diff --git a/pkg/noun/vortex.c b/pkg/noun/vortex.c index 5981068b87..9dd942424d 100644 --- a/pkg/noun/vortex.c +++ b/pkg/noun/vortex.c @@ -427,7 +427,7 @@ u3v_reclaim(void) /* u3v_rewrite_compact(): rewrite arvo kernel for compaction. */ void -u3v_rewrite_compact() +u3v_rewrite_compact(void) { u3v_arvo* arv_u = &(u3H->arv_u); diff --git a/pkg/noun/vortex.h b/pkg/noun/vortex.h index cbd0f295ff..703400a876 100644 --- a/pkg/noun/vortex.h +++ b/pkg/noun/vortex.h @@ -144,6 +144,6 @@ /* u3v_rewrite_compact(): rewrite arvo kernel for compaction. */ void - u3v_rewrite_compact(); + u3v_rewrite_compact(void); #endif /* ifndef U3_VORTEX_H */ diff --git a/pkg/ur/serial.c b/pkg/ur/serial.c index 72fb4483b9..3675853a36 100644 --- a/pkg/ur/serial.c +++ b/pkg/ur/serial.c @@ -23,11 +23,14 @@ _bsw_atom(ur_root_t *r, ur_nref ref, ur_bsw_t *bsw, uint64_t len) switch ( ur_nref_tag(ref) ) { default: assert(0); - case ur_direct: return ur_bsw_atom64(bsw, len, ref); + case ur_direct: + ur_bsw_atom64(bsw, len, ref); + break; case ur_iatom: { uint8_t *byt = r->atoms.bytes[ur_nref_idx(ref)]; - return ur_bsw_atom_bytes(bsw, len, byt); + ur_bsw_atom_bytes(bsw, len, byt); + break; } } }