I did a lot of this in a very ad-hoc fashion with no proper commit
history. As such, the kindest thing to do seemed to be to just squash it
into this one commit.
This will help with packaging things to meet current policies on
FreeBSD without having to patch things or manually strip binaries,
etc.
-D in FreeBSD's install(1) does not work like GNU install's -D and
is something else entirely. Manually create the target directories
with mkdir first before installing files.
Signed-off-by: Tobias Kortkamp <tobik@FreeBSD.org>
PR #98 hints that we were venturing into downstream's territory: compiler and
linker flags may be OS-specific, while preprocessor flags and libraries are our
responsibility. Provide clean separation between these categories.
Downstreams may still need to provide "--std=c99" in CFLAGS though.
When '--as-needed' linker flag is added to LDFLAGS, linker strips out
the symbols from the libraries needed for the tests due to the order
in which the libraries appear on the command line. List the source
files before the libraries to fix the linking issue.
For more information, see:
https://wiki.gentoo.org/wiki/Project:Quality_Assurance/As-needed#Importance_of_linking_order
Signed-off-by: Göktürk Yüksek <gokturk@gentoo.org>
Previously imv used -std=gnu11 flag which activated GNU "extensions" of C11
standard. This masked a portability issue in imv: strduo(3) should not have
been visible in `src/loader.c` without inclusion of `<string.h>` header. This
have been fixed. To remidy GNU libc's stange choice to hide X/Open interfaces
in C99 code by default _XOPEN_SOURCE macro was also set. (This should have no
effect on most other platforms.)
When operating in git repo, build system will include abbreviated git hash in
imv version number. If there is no git repo around (eg. building from tarball),
fall back to version number in Makefile.
Fixes#90