Update linux makefiles to 1) use libbsd-overlay and 2) isolate common code from linux makefiles into included makefiles. And update Cmakelists to use libbsd-overlay package in case of Linux; Update Cmakelists to include an install target similar to that used in the makefiles.#542
Update linux makefiles to 1) use libbsd-overlay and 2) isolate common code from linux makefiles into included makefiles. And update Cmakelists to use libbsd-overlay package in case of Linux; Update Cmakelists to include an install target similar to that used in the makefiles.#542
Conversation
…init-linux*. Add libbsd to MAIKO_LIBRARIES (where appropriate) in CMakeLists.txt. This will support building maiko on Ubuntu 22.04 and Debian 12, where strlcat is found only in libbsd. For Ubuntu 24.04 and beyond and Debian 13 and beyond, strlcat is now in glibc (>2.38).
…on systems with glibc <2.38 (e.g., Ubuntu 22.04 and Debian 12).
…file as well as common makefiles for X and sdl. These included makefiles have the name linux-*.mk. Updated all linux makefiles to use the libbsd-overlay package, using pkg-config to set the appropriate flags. Updated CMakelists to also use the libbsd-overlay package via pkgconfig for Linux only. Finally added install targets to the CMakelists file so that cmake --install . will place the lde binaries into the appropriate directory in maiko as the makefiles currently do.
… be used by libbsd changes to linux makefiles
Summary of ChangesHello, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed! This pull request significantly modernizes and streamlines the build process for Linux targets by introducing a standardized approach to handling BSD-specific functions and refactoring existing build configurations. The changes aim to improve portability, reduce boilerplate, and ensure a more consistent build and installation experience across different Linux environments and architectures, whether using Makefiles or CMake. Highlights
🧠 New Feature in Public Preview: You can now enable Memory to help Gemini Code Assist learn from your team's feedback. This makes future code reviews more consistent and personalized to your project's style. Click here to enable Memory in your admin console. Changelog
Ignored Files
Using Gemini Code AssistThe full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips. Invoking Gemini You can request assistance from Gemini at any point by creating a comment using either
Customization To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a Limitations & Feedback Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for GitHub and other Google products, sign up here. You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension. Footnotes
|
There was a problem hiding this comment.
Code Review
This pull request refactors the Linux Makefiles to use common includes and adds support for libbsd-overlay. It also updates CMakeLists.txt with libbsd-overlay support and a new install target. The refactoring of the Makefiles is a great improvement for maintainability. I've found a critical issue in one of the makefiles that would lead to an incorrect build, and have some suggestions to improve the robustness of the CMake changes and the consistency of the Makefile refactoring.
|
I tried this PR in my submodules repo by executing Then I tried to directly check out the branch but got several warnings: How am I supposed to check out a PR in the submodules repo? When checking out the PR I get the same error also in my non submodules repo: |
nbriggs
left a comment
There was a problem hiding this comment.
I've added comments to the bot's notes.
| ifneq ($(MAKECMDGOALS),clean) | ||
| ifneq ($(MAKECMDGOALS),cleanup) | ||
|
|
||
| CHK_PKG_CONFIG := $(shell command -v pkg-config) |
There was a problem hiding this comment.
On online.interlisp.org, this fails with:
$ ./makeright x
making release 351 for linux on x86_64.
making with display x releasename linux.x86_64-x ldename ldex
start making lde for linux.x86_64-x
make: command: Command not found
linux-libbsd.mk:10: *** "pkg-config not found. Please install it to build this project.". Stop.
This may be a case where $(shell which pkg-config) is needed.
| XFLAGS = -DXWINDOW | ||
|
|
||
| XLDFLAGS = -L/usr/X11/lib -lX11 | ||
|
|
There was a problem hiding this comment.
One thing I'd note is that we require libx11 version 1.7.0 or later, since we're using XSetIOErrorExitHandler.
|
Never mind, I executed At this point I don't have to |
|
With the previously mentioned setup (not executing One thing to note is that on Linux Mint 22.1 Cinnamon libbsd-dev, which is a dependency of this PR, is not installed by default and I had to install it manually. |
|
Merged into PR 544 (fgh_redo-linux-makefiles branch). Closing without merge to master. |
This PR# includes 4 changes to the Makefiles for Linux and the CMakeslist file.
All linux Makefiles now (when necessary) compile and link using the libbsd-overlay scheme via pkg-config.
Cmakelists now has special code for Linux that (when necessary) causes compile and link to use the libbsd-overlay scheme via pkg-config.
All Linux makefiles have been refactored so that common code is factored out of the top level linux makefiles and added to several common code makefiles (linux-*.mk) that are included into the top level makefiles.
Added an install target to CMakeLists that installs lde, ldeinit ldex and ldesdl in the same binary directories that the Makefiles do, e.g., maiko/linux.x86_64.
Also added the pkgconf package to the Builder Docker image since it is required for the libbsd-overlay linux builds.