Skip to content
This repository has been archived by the owner on Jan 16, 2023. It is now read-only.

Trying to build on FreeBSD #436

Open
plasmoduck opened this issue Jan 31, 2021 · 10 comments
Open

Trying to build on FreeBSD #436

plasmoduck opened this issue Jan 31, 2021 · 10 comments

Comments

@plasmoduck
Copy link

I have imlib2 installed (/usr/local/include/Imlib2.h)

CC autoreload_inotify.o
In file included from autoreload_inotify.c:19:
./sxiv.h:27:10: fatal error: 'Imlib2.h' file not found
#include <Imlib2.h>
^~~~~~~~~~
1 error generated.
*** Error code 1

Stop.

@iamleot
Copy link
Contributor

iamleot commented Jan 31, 2021

It is probably needed to pass CPPFLAGS and LDFLAGS in the make invocation so the include files and libraries can be picked up, e.g.:

$ make CPPFLAGS=-I/usr/local/include LDFLAGS="-L/usr/local/lib -Wl,-R/usr/local/lib"

...will probably DTRT.

@plasmoduck
Copy link
Author

LINK sxiv
ld: error: unable to find library -lImlib2
ld: error: unable to find library -lX11
ld: error: unable to find library -lXft
ld: error: unable to find library -lfontconfig
ld: error: unable to find library -lexif
ld: error: unable to find library -lgif
cc: error: linker command failed with exit code 1 (use -v to see invocation)
*** Error code 1

@plasmoduck
Copy link
Author

Maybe you can make a patch config.mk or something that supports FreeBSD as well

@iamleot
Copy link
Contributor

iamleot commented Feb 4, 2021

Sorry, there was a copypasto: I missed /lib in LDFLAGS.

Please retry!

@plasmoduck
Copy link
Author

make CPPFLAGS=-I/usr/local/include LDFLAGS="-L/usr/local/lib
-Wl,-R/usr/local/lib"
LINK sxiv
ld: error: undefined symbol: inotify_init1

referenced by autoreload_inotify.c
autoreload_inotify.o:(arl_init)

ld: error: undefined symbol: inotify_rm_watch

referenced by autoreload_inotify.c
autoreload_inotify.o:(arl_setup)
referenced by autoreload_inotify.c
autoreload_inotify.o:(arl_setup)
referenced by autoreload_inotify.c
autoreload_inotify.o:(arl_handle)

ld: error: undefined symbol: inotify_add_watch

referenced by autoreload_inotify.c
autoreload_inotify.o:(arl_setup)
referenced by autoreload_inotify.c
autoreload_inotify.o:(arl_setup)
cc: error: linker command failed with exit code 1 (use -v to see invocation)
*** Error code 1

Stop.
make: stopped in /usr/home/cjg/suckless/sxiv

@iamleot
Copy link
Contributor

iamleot commented Feb 4, 2021

Passing AUTORELOAD=nop as a Make flag similar to CPPFLAGS and LDFLAGS should disable inotify support and probably address this issue too.

@plasmoduck
Copy link
Author

thanks, thats crazy all these flags I have to use. I still think a config.mk would be much easier.

@iamleot
Copy link
Contributor

iamleot commented Feb 4, 2021

I would just use the package provided by your favourite package system (and/or look for possible adjustments there!). :)

Without using pkg-config - and for AUTORELOAD probably also checking it at configure time - I think that also having a config.mk thingie would need manual intervention (it would only move some variables currently present in Makefile to a separate file).

@plasmoduck
Copy link
Author

I just find that structure easier to follow and modify like the other suckless programs.

@plasmoduck
Copy link
Author

so what can I put in my Makefile edit so I can just type make?

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants