-
Notifications
You must be signed in to change notification settings - Fork 16
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
OpenBSD: "error: unknown type name 'u_int'" when compiling #20
Comments
@vl-ms Have you tried to use gmake? OpenBSD doesn't use GNU make in their base operating system. |
Yeah, forgot to mention. Gives pretty much the same error
|
I'm trying to get up to speed on OpenBSD as I am writing this, but for now there's this trick from an early-2013 LinuxQuestions thread: what include am i missing for types like u_int8_t? Maybe try adding this one line to #include <sys/types.h> I'm under the impression that on Linux the typical C/C++ toolchain makes subtle but important assumptions that OpenBSD doesn't. I also added that line |
Adding #include <sys/types.h> did not make a difference.
|
@vl-ms are you compiling CUPS from source along with captdriver? Are there OpenBSD equivalents to the (Sorry for the late reply, I'm still trying to figure out OpenBSD) |
@vl-ms Can you provide guide steps how install dependencies and build it in OpenBSD? I think it may help @mounaiban check why it isn't compile in OpenBSD. I would love to see captdriver work in OpenBSD too since I have lbp2900 printer at home. |
@mounaiban no, we don't have -dev packages on OpenBSD. Everything is bundled in one package, sometimes the -debug packages are also made available. On installing dependencies: it's very easy, for searching the repositories we use |
on building, I just followed the build steps from here and added |
If a problem is with getting OpenBSD to install on your devices, I recommend virt-manager or virtualbox. Both allow USB passthrough, and both should work ok with OpenBSD as a guest OS. |
@vl-ms OpenBSD was actually pretty easy to get up and running in QEMU and VirtualBox due to excellent VMM support, my sticking point is with coming to terms with differences between BSD and Linux when it comes to compiling code. I'll get back to this when I get the time. BSD support is part of our master plan! Hopefully no editing of makefile or automake files would be necessary. The automake documentation really makes it look like automake is too complex to document in an understandable way... |
Yeah, automake certainly seems to be overcomplicated. I'm in no hurry to make this printer work tomorrow or anything, it would just be nice to be able to print something once in a while. Maybe I will contribute myself one day when I come to understand C. If you are interested in other makefile generators, I heard mostly good things about Premake (Lua + C), and heard both good and bad things about Cmake (C++). Other than that, Meson requires Python, and everything else is much more obscure. E.g. Zig is still unstable, Gradle is mostly for Android, mk requires plan9port or Go... I heard that it is a possible to write Makefiles that work with both GNU and BSD make, but I don't know of any specific guidelines which show how to do that. |
Maybe it helps: I was able to successfully build and run this on FreeBSD by applying #25 and using By the way, as of commit 6271924 my LBP3010 works! (it didn't work with 195ea02 due to some unexpected USB responses). Thank you very very much! |
#26 fixes the need to play with |
Happy Lunar New Year, folks! You might have gotten something fortunate today... 🧧 🐇 @vl-ms @hopingstar1806 I have successfully compiled and built Captdriver in OpenBSD, with the patches in #28 by @saper. I used automake 1.16 and autoconf 2.71. Remember to Please let me know if it compiles and prints for you. I will be attempting some actual single and multi-page print jobs soon. If #28 works for all of us, I'll submit a PR to Alexey's original master branch and merge it into my master branch too, making Captdriver officially BSD-compatible. Meanwhile, I am liking OpenBSD, and take this from a Linux and macOS user. There's a considerably more reading and extra work involved (if the installer isn't already an indication), but I nothing I can't handle. I might eventually adopt it as my server OS at this rate. P.S: My OpenBSD build environment and Captdriver build processAfter completing the OpenBSD installation and setting up pkg_add cups autoconf automake git
export AUTOCONF_VERSION=2.71 AUTOMAKE_VERSION=1.16
aclocal
autoconf
automake --add-missing
./configure
make
doas make install Also try the EXPERT VERSION for a more copy-paste-friendly experience: pkg_add cups autoconf automake git
export AUTOCONF_VERSION=$(pkg_info -a | grep autoconf | tail -n1 | awk -F '-' '{ print $2 }' | awk -F '.' '{ print $1"."$2 }')
export AUTOMAKE_VERSION=$(pkg_info -a | grep automake | tail -n1 | awk -F '-' '{ print $2 }' | awk -F '.' '{ print $1"."$2 }')
aclocal
autoconf
automake --add-missing
./configure
make
doas make install |
Happy to hear it worked for you! I think instead of
you can always use (in relatively modern autotools versions) this instead:
Maybe we should put this in the git building instructions as well |
@saper I finally got the chance to install the driver and attempt to print pages on OpenBSD, but I ran into difficulties with CUPS' USB backend. It appears that nothing had been sent and received from the printer at all. I am suspecting that I have missed a crucial security-related step given how OpenBSD seems to be trying to get away with the minimum number of features enabled, for security purposes. The CUPS
The second line ends after the word 'got', as the backend did not receive anything. I'm just going to try FreeBSD first. Isn't FreeBSD more ready to use out of the box than the other libre BSDs? |
It worked for me, but maybe it makes no point to switch operating systems like crazy just for this. Maybe there is some permission problem regarding reading/writing raw USB devices? You can use usbdevs(8) to find out if the device is visible at all. On FreeBSD, one might need to adjust rights in
ugen.4 suggests that OpenBSD is using FreeBSD has this symlink there:
I have achieved this with the following devfs rule:
(as far as I know OpenBSD does not have equivalent to this, you might just need to use |
@saper thanks for the tip on OpenBSD's Not leaving OpenBSD just yet, but I'm right now trying to find out how many of the BSDs I can print from so that I can update the Installation Guide to add something I have personally verified to work, hopefully soon so that we can get more people on board. I'm just expecting to take a while before I finally get OpenBSD to print. |
@vl-ms @hopingstar1806 is there any way someone can help @mounaiban to get this running? I can't seem to be able to find any reasonable docs regarding "accessing raw USB devices with OpenBSD". |
I guess the best place to start is to read the USB manpage and go from there. Maybe looking at the sources of drivers for different USB devices is a good idea too: https://cvsweb.openbsd.org/src/sys/dev/usb/ I will test whether the current driver works for me on the weekends, thank you so much for the work you do! |
Everything up until the make command worked fine. I installed required dependencies, and the configuation did not produce any errors.
The text was updated successfully, but these errors were encountered: