@@ -348,10 +348,12 @@ add_subdirectory(config)
348348add_subdirectory(tools)
349349add_subdirectory(ntp)
350350
351+ option(USE_READLINE " Build FTL with readline support, if available " ON)
352+
351353find_library(LIBREADLINE NAMES libreadline${LIBRARY_SUFFIX} readline)
352354find_library(LIBHISTORY NAMES libhistory${LIBRARY_SUFFIX} history)
353355find_library(LIBTERMCAP NAMES libtermcap${LIBRARY_SUFFIX} termcap)
354- if(LIBREADLINE AND LIBHISTORY AND LIBTERMCAP)
356+ if(LIBREADLINE AND LIBHISTORY AND LIBTERMCAP AND USE_READLINE )
355357 message(STATUS " Building FTL with readline support: YES ")
356358 target_compile_definitions(lua PRIVATE LUA_USE_READLINE)
357359 target_compile_definitions(sqlite3 PRIVATE HAVE_READLINE)
@@ -364,19 +366,21 @@ if(CMAKE_INSTALL_PREFIX_INITIALIZED_TO_DEFAULT)
364366 set(CMAKE_INSTALL_PREFIX " /usr " CACHE PATH " ... " FORCE)
365367endif()
366368
369+ option(USE_MBED_TLS " Build FTL with TLS support, if available " ON)
370+
367371find_library(LIBMBEDCRYPTO NAMES lmbedcrypto${LIBRARY_SUFFIX} mbedcrypto)
368372find_library(LIBMBEDX509 NAMES lmbedx509${LIBRARY_SUFFIX} mbedx509)
369373find_library(LIBMBEDTLS NAMES lmbedtls${LIBRARY_SUFFIX} mbedtls)
370- if(LIBMBEDCRYPTO AND LIBMBEDX509 AND LIBMBEDTLS)
371- # Enable TLS support in civetweb if mbedTLS is available
374+ if(LIBMBEDCRYPTO AND LIBMBEDX509 AND LIBMBEDTLS AND USE_MBED_TLS )
375+ # Enable TLS support in civetweb if mbedTLS is selected and available
372376 message(STATUS " Building FTL with TLS support: YES ")
373377 target_compile_definitions(core PRIVATE HAVE_MBEDTLS)
374378 target_compile_definitions(civetweb PRIVATE USE_MBEDTLS)
375379 target_compile_definitions(webserver PRIVATE HAVE_MBEDTLS)
376380 # Link against the mbedTLS libraries, the order is important (!)
377381 target_link_libraries(pihole-FTL ${LIBMBEDTLS} ${LIBMBEDX509} ${LIBMBEDCRYPTO} )
378382else()
379- # Disable TLS support in civetweb if mbedTLS is not available
383+ # Disable TLS support in civetweb if mbedTLS is not selected or not available
380384 message(STATUS " Building FTL with TLS support: NO ")
381385 target_compile_definitions(civetweb PRIVATE NO_SSL)
382386endif()
0 commit comments