Browse Source

Better/faster detection for libmagic (when present)

Signed-off-by: falkTX <falktx@falktx.com>
tags/v2.3.0-RC1
falkTX 4 years ago
parent
commit
e9eed8bb86
1 changed files with 6 additions and 2 deletions
  1. +6
    -2
      source/Makefile.mk

+ 6
- 2
source/Makefile.mk View File

@@ -297,8 +297,12 @@ endif

ifneq ($(WIN32),true)

# libmagic doesn't have a pkg-config file, so we need to call the compiler to test it
HAVE_LIBMAGIC = $(shell echo '\#include <magic.h>' | $(CC) $(CFLAGS) -x c -w -c - -o .libmagic-tmp 2>/dev/null && echo true)
ifeq ($(shell $(PKG_CONFIG) --exists libmagic && echo true),true)
HAVE_LIBMAGIC = true
else
# old libmagic versions don't have a pkg-config file, so we need to call the compiler to test it
HAVE_LIBMAGIC = $(shell echo '\#include <magic.h>' | $(CC) $(CFLAGS) -x c -w -c - -o /dev/null 2>/dev/null && echo true)
endif

endif



Loading…
Cancel
Save