Skip to content

Commit 2ee326f

Browse files
committed
Fix for LibMagic
- requires magic.h (file-devel, libmagic-dev) Signed-off-by: Scott R. Shinn <scott@atomicorp.com>
1 parent f650201 commit 2ee326f

1 file changed

Lines changed: 10 additions & 2 deletions

File tree

src/Makefile

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -70,8 +70,10 @@ ifeq (${USE_SYSTEMD},yes)
7070
DEFINES+=-DHAVE_SYSTEMD
7171
OSSEC_LDFLAGS+=-lsystemd
7272
endif
73-
# DEFINES+=-DUSE_MAGIC
74-
# OSSEC_LDFLAGS+=-lmagic
73+
ifneq (${USE_MAGIC},no)
74+
DEFINES+=-DUSE_MAGIC
75+
OSSEC_LDFLAGS+=-lmagic
76+
endif
7577
else
7678
ifeq (${uname_S},AIX)
7779
DEFINES+=-DAIX
@@ -1272,6 +1274,9 @@ ifdef TEST
12721274
endif #TEST
12731275

12741276
test_programs = test_os_zlib test_os_xml test_os_regex test_os_crypto test_shared
1277+
ifneq ($(filter -DUSE_MAGIC,$(DEFINES)),)
1278+
test_programs += test_seechanges
1279+
endif
12751280

12761281
.PHONY: test run_tests build_tests test_valgrind test_coverage
12771282

@@ -1308,6 +1313,9 @@ test_os_crypto: tests/test_os_crypto.c os_crypto.a shared.a os_xml.a os_net.a os
13081313
test_shared: tests/test_shared.c shared.a os_xml.a os_net.a os_regex.a ${JSON_LIB}
13091314
${OSSEC_CCBIN} ${OSSEC_CFLAGS} $^ ${OSSEC_LDFLAGS} -o $@
13101315

1316+
test_seechanges: tests/test_seechanges.o syscheckd/seechanges.o config.a shared.a os_xml.a os_net.a os_regex.a os_crypto.a ${ZLIB_LIB} ${JSON_LIB}
1317+
${OSSEC_CCBIN} ${OSSEC_CFLAGS} $^ ${OSSEC_LDFLAGS} -o $@
1318+
13111319
test_valgrind: build_tests
13121320
valgrind --leak-check=full --track-origins=yes --trace-children=yes --vgdb=no --error-exitcode=0 --gen-suppressions=all --suppressions=tests/valgrind.supp ${MAKE} run_tests
13131321

0 commit comments

Comments
 (0)