-
Notifications
You must be signed in to change notification settings - Fork 0
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
Cannot build on OpenBSD #1
Comments
try building it again! |
It doesn't work. But after messing up a little (I'm not familiar with C and GNU Make), I found a working solution: diff --git a/Makefile b/Makefile
index 64b74f2..1b07d19 100644
--- a/Makefile
+++ b/Makefile
@@ -7,6 +7,10 @@ ifeq ($(UNAME_S),FreeBSD)
LFLAGS+=-lexecinfo
endif
+ifeq ($(UNAME_S),OpenBSD)
+ LFLAGS+=-lexecinfo
+endif
+
bin:=termrec
obj:=obj
diff --git a/src/main.h b/src/main.h
index cd582a1..97648ce 100644
--- a/src/main.h
+++ b/src/main.h
@@ -13,6 +13,10 @@
#define __BSD_VISIBLE 1
#endif
+#ifdef __OpenBSD__
+#define _BSD_SOURCE 1
+#endif
+
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
diff --git a/src/signals.c b/src/signals.c
index 3647f49..9413ce8 100644
--- a/src/signals.c
+++ b/src/signals.c
@@ -14,7 +14,6 @@
#include <execinfo.h>
#include <fcntl.h>
-#define __BSD_VISIBLE 1
#include <signal.h>
#include <termios.h> After successful compilation I had a problem with starting the program: $ ./termrec
Segmentation fault (core dumped) which was caused by invalid number of arguments. So it may be useful for other users to implement something like: diff --git a/src/main.c b/src/main.c
index 4cb5e5d..520d559 100644
--- a/src/main.c
+++ b/src/main.c
@@ -15,6 +15,11 @@ void PrintUsage(const char* name) {
}
int main(int argc, char** argv) {
+ if (argc == 1) {
+ PrintUsage(argv[0]);
+ exit(EXIT_FAILURE);
+ }
+
struct outargs oa;
memset(&oa, 0, sizeof oa); Anyway, thanks for a great program and your fast reaction |
thanks for pointing out the exact issue! i don't have a BSD-based system and i was too lazy to setup one so these issues are kinda hard to debug... you didn't raise a PR but in my commits i mentioned you! thanks alot! do try to rebuild it and see if there's any problem... |
Now it can be build on my system. I've configure CI for OpenBSD in #2 |
Hi,
when I try to build it on OpenBSD, I've got an error (
gmake
is a GNU Make):Additional info:
The text was updated successfully, but these errors were encountered: