From 4affafe91579799efd83f4c8e05c291eeb684c9c Mon Sep 17 00:00:00 2001 From: Christian Hesse Date: Wed, 5 Jan 2022 14:35:15 +0100 Subject: use libmagic to detect valid file formats Writing our own magic bytes detection is prone to errors and an everlasting catch-up-game. Let's use libmagic to get things right, this is less code and makes things more reliable. Building without libmagic is still possible. That will make the code act like specifying FEH_SKIP_MAGIC=1, effectively passing everything to imlib2. --- config.mk | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'config.mk') diff --git a/config.mk b/config.mk index 2d63f72..910eac7 100644 --- a/config.mk +++ b/config.mk @@ -6,6 +6,7 @@ curl ?= 1 debug ?= 0 exif ?= 0 help ?= 0 +magic ?= 1 mkstemps ?= 1 verscmp ?= 1 xinerama ?= 1 @@ -68,6 +69,11 @@ ifeq (${mkstemps},1) CFLAGS += -DHAVE_MKSTEMPS endif +ifeq (${magic},1) + CFLAGS += -DHAVE_LIBMAGIC + LDLIBS += -lmagic +endif + ifeq (${verscmp},1) CFLAGS += -DHAVE_STRVERSCMP endif -- cgit v1.2.3