tudurom / windowchef

Window Chef is a stacking window manager that cooks windows with orders from the Waitron
https://tudorr.ro/software/windowchef/
ISC License
204 stars 14 forks source link

OpenBSD Search Paths #50

Closed 0x4d6165 closed 5 years ago

0x4d6165 commented 6 years ago

It's mentioned in the README that OpenBSD users need to change the search paths in config.mk. Going off of what I normally have to do, I added this:

CFLAGS += -std=c99 -Wall -Wextra -O2 -I/usr/X11R6/include
LDFLAGS += "-L /usr/X11R6/lib" -lm -lxcb -lxcb-ewmh -lxcb-icccm -lxcb-randr -lxcb-keysyms -v

This results in the error:

/usr/bin/ld: cannot find -lxcb
cc: error: linker command failed with exit code 1 (use -v to see invocation)
*** Error 1 in /home/gigavinyl/labs/windowchef (Makefile:20 'windowchef': @cc -o windowchef   "-L /usr/X11R6/lib" -lm -lxcb -lxcb-ewmh -lxcb...)

Removing the quotes from LDFLAGS (which I don't think is correct) results in:

/usr/X11R6/lib/libxcb.so.4.0: warning: strcpy() is almost always misused, please use strlcpy()
/usr/bin/../lib/crt0.o: In function `_start':
(.text+0x52): undefined reference to `main'
cc: error: linker command failed with exit code 1 (use -v to see invocation)
*** Error 1 in /home/gigavinyl/labs/windowchef (Makefile:20 'windowchef': @cc -o windowchef   -L /usr/X11R6/lib -lm -lxcb -lxcb-ewmh -lxcb-i...)

What am I doing wrong?

tudurom commented 6 years ago

Try letting pkg-config handle it. config.mk should look like this:

CFLAGS += -std=c99 -Wall -Wextra -O2 $(shell pkgconf --cflags xcb xcb-ewmh xcb-icccm xcb-randr xcb-keysyms)
LDFLAGS += -lm $(shell pkgconf --libs xcb xcb-ewmh xcb-icccm xcb-randr xcb-keysyms)

If there's any complain about pkgconf not being available, replace it with pkg-config.

0x4d6165 commented 6 years ago

Hmm well it looks like it started working but:

cc -O2 -pipe  -std=c99 -Wall -Wextra -O2  -D__NAME__=\"windowchef\"                  -D__NAME_CLIENT__=\"waitron\"    -D__THIS_VERSION__=\"\"  -D__CONFIG_NAME__=\"windowchefrc\"      -c wm.c
wm.c:4:10: fatal error: 'xcb/randr.h' file not found
#include <xcb/randr.h>
         ^~~~~~~~~~~~~
1 error generated.
*** Error 1 in /home/gigavinyl/labs/windowchef (<sys.mk>:87 'wm.o')
0x4d6165 commented 4 years ago

I'm still having this issue on NetBSD :(. It looks like xcb-randr is installed by default by libxcb or xcb since there's a libxcbrandr file in /usr/pkg/lib

0x4d6165 commented 4 years ago

Oop! Never mind got it working :)