Browse Source

Make dml_httpd conditional on libmagic presence

master
Jeroen Vreeken 4 years ago
parent
commit
a9a4a0404e
2 changed files with 26 additions and 1 deletions
  1. +9
    -1
      Makefile.am
  2. +17
    -0
      configure.ac

+ 9
- 1
Makefile.am View File

@ -23,7 +23,7 @@ libdml_la_SOURCES = \
libdml_la_CFLAGS=-fPIC
libdml_la_LDFLAGS= -shared -fPIC -version-info 0:0:0 -lcrypto
bin_PROGRAMS = dmld dml_list dml_reflector dml_streamer dml_stream_client dml_stream_client_codec2 dml_trx dml_httpd dml_fprs_db
bin_PROGRAMS = dmld dml_list dml_reflector dml_streamer dml_stream_client dml_stream_client_codec2 dml_trx dml_fprs_db
DML_SRCS = \
dml_config.c \
@ -74,10 +74,18 @@ dml_stream_client_codec2_LDADD = libdml.la
dml_stream_client_codec2_LDFLAGS = -lm
if ENABLE_DML_HTTPD
bin_PROGRAMS += dml_httpd
dml_httpd_SOURCES = $(DML_SRCS) dml_httpd.c
dml_httpd_LDADD = libdml.la
dml_httpd_LDFLAGS = -lwebsockets -lmagic
endif
dml_fprs_db_SOURCES = $(DML_SRCS) $(FPRS_DB_SRCS) dml_fprs_db.c
dml_fprs_db_LDADD = libdml.la
dml_fprs_db_LDFLAGS = -leth_ar -lm

+ 17
- 0
configure.ac View File

@ -75,4 +75,21 @@ AS_IF([ test "x$flite_headers_found" == "xyes" && \
[CFLAGS+=" -DHAVE_FLITE"])
dnl Search for libmagic
AC_SEARCH_LIBS([magic_open], [magic], [libmagic_found_lib=yes], [])
AC_CHECK_HEADERS([magic.h],
[libmagic_found_headers=yes; break;])
AS_IF([test "x$libmagic_found_headers" = "xyes" && test "x$libmagic_found_lib" = "xyes"],
[enable_dml_httpd="yes"], [enable_dml_httpd="no"]
)
AM_CONDITIONAL(ENABLE_DML_HTTPD, test "x$enable_dml_httpd" = "xyes")
AC_OUTPUT([Makefile])
echo "Optional parts:"
echo " dml_httpd:" $enable_dml_httpd

Loading…
Cancel
Save