Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update to compile on FreeBSD. #134

Merged
merged 1 commit into from
Jan 8, 2024
Merged

Update to compile on FreeBSD. #134

merged 1 commit into from
Jan 8, 2024

Conversation

DanielO
Copy link
Contributor

@DanielO DanielO commented Dec 9, 2023

What it says on the tin, I have only tested on FreeBSD and only run a quick orbtop

@@ -16,14 +16,14 @@
#include <sys/ioctl.h>
#include <libusb.h>
#include <termios.h>
#elif defined LINUX
#include <libusb-1.0/libusb.h>
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
#include <libusb-1.0/libusb.h>
#include <libusb.h>

Consider dropping the subfolder -- it is not needed, if Makefile + pkg-config, or meson, is used as the build system. This allows simplifying most of nested macros dispatch in here and other places. I tested building on Linux. Git annotate points to early Makefile from 2017 without pkg-config, where it could be attributed to pointing under /usr/include ad-hoc.

@ALTracer
Copy link
Contributor

ALTracer commented Dec 9, 2023

Confirming builds-and-runs successfully under NomadBSD 13.2-RELEASE -- it opens an swlink BMP-compatible's trace capture port, and the other tools launch. I did not have an appropriate ELF firmware file on that LiveUSB, so I did not test actual operation either.
The macro dispatch nest (which you're touching with this PR) could use some simplification, but being myself an external user/contributor, I can't ask you that.

@DanielO
Copy link
Contributor Author

DanielO commented Dec 9, 2023

Yeah I didn't want to touch that too much, I wasn't sure why it was like it is.

You can detect Windows/FreeBSD/Linux/macOS/etc with pre-existing compiler defines so I am not sure why there is a Meson rule to add a define.

I'm also not sure why ioctl is declared manually on Linux etc.. I would expect the same includes that work on FreeBSD would work on Linux, but presumably they were added for a good reason.

@mubes mubes merged commit 3f72ca7 into orbcode:main Jan 8, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants