hanatos / vkdt

raw photography workflow that sucks less
https://jo.dreggn.org/vkdt
BSD 2-Clause "Simplified" License
378 stars 35 forks source link

initial library, libinstall #83

Closed hanatos closed 1 year ago

hanatos commented 1 year ago

about -fPIE and -fPIC. vkdt uses the former, for a library build you'd need the latter. executables are built with -pie, so at the price some small overhead and at the cost of allowing symbol interposition, you'll probably want to replace

EXE_CFLAGS=-fPIE

by

EXE_CFLAGS?=-fPIC

where the question mark means to set it only in case a user didn't provide an override up front (say from config.mk).

butcherg commented 1 year ago

I just pushed a new commit to the branch, tested installation/clean to /usr/local, and compilation/link/run of libtest. User has to run sudo ldconfig after the install.

Thing is, as-is the libinstall target has to put data/ and modules/ in /usr/local/lib so the dlinfo() can provide a directory that resolves them. Maybe some search strategy that allows a subdirectory in fs_basedir(), e.g. first look in dlinfo_dir, then dlinfo_dir/vkdt?

Edit: sorry, forgot #pragma once in libvkdt.h. Committed and pushed...

hanatos commented 1 year ago

merged!

and adjusted a few things:

i suppose up next: write test code using the library and put it into a github action to make sure this code path does not rot over time.