mirror of
https://github.com/espressif/openthread.git
synced 2026-08-29 13:29:54 +00:00
[build] option to disable executable build (#3391)
This commit is contained in:
committed by
Jonathan Hui
parent
35eaaab653
commit
52c06c6858
@@ -566,6 +566,38 @@ AC_SUBST(OPENTHREAD_ENABLE_RADIO_ONLY)
|
||||
AM_CONDITIONAL([OPENTHREAD_ENABLE_RADIO_ONLY], [test "${enable_radio_only}" = "yes"])
|
||||
AC_DEFINE_UNQUOTED([OPENTHREAD_ENABLE_RADIO_ONLY], [${OPENTHREAD_ENABLE_RADIO_ONLY}], [Define to 1 to build radio-only library.])
|
||||
|
||||
#
|
||||
# whether to build executables
|
||||
#
|
||||
|
||||
AC_MSG_CHECKING([whether to build executables])
|
||||
AC_ARG_ENABLE(executable,
|
||||
[AS_HELP_STRING([--enable-executable], [Build executables @<:@default=yes@:>@.])],
|
||||
[
|
||||
case "${enableval}" in
|
||||
|
||||
no|yes)
|
||||
enable_executable=${enableval}
|
||||
;;
|
||||
|
||||
*)
|
||||
AC_MSG_ERROR([Invalid value ${enable_executable} for --enable-executable])
|
||||
;;
|
||||
esac
|
||||
],
|
||||
[enable_executable=yes])
|
||||
|
||||
if test "$enable_executable" = "yes"; then
|
||||
OPENTHREAD_ENABLE_EXECUTABLE=1
|
||||
else
|
||||
OPENTHREAD_ENABLE_EXECUTABLE=0
|
||||
fi
|
||||
|
||||
AC_MSG_RESULT(${enable_executable})
|
||||
AC_SUBST(OPENTHREAD_ENABLE_EXECUTABLE)
|
||||
AM_CONDITIONAL([OPENTHREAD_ENABLE_EXECUTABLE], [test "${enable_executable}" = "yes"])
|
||||
AC_DEFINE_UNQUOTED([OPENTHREAD_ENABLE_EXECUTABLE], [${OPENTHREAD_ENABLE_EXECUTABLE}], [Define to 1 to build executables.])
|
||||
|
||||
#
|
||||
# CLI Library
|
||||
#
|
||||
|
||||
@@ -40,6 +40,7 @@ DIST_SUBDIRS = \
|
||||
SUBDIRS = \
|
||||
$(NULL)
|
||||
|
||||
if OPENTHREAD_ENABLE_EXECUTABLE
|
||||
if OPENTHREAD_ENABLE_CLI
|
||||
SUBDIRS += cli
|
||||
endif
|
||||
@@ -47,6 +48,7 @@ endif
|
||||
if OPENTHREAD_ENABLE_NCP
|
||||
SUBDIRS += ncp
|
||||
endif
|
||||
endif
|
||||
|
||||
# Always pretty (e.g. for 'make pretty') these subdirectories.
|
||||
|
||||
|
||||
@@ -131,6 +131,10 @@ ifeq ($(DISABLE_BUILTIN_MBEDTLS), 1)
|
||||
configure_OPTIONS += --disable-builtin-mbedtls
|
||||
endif
|
||||
|
||||
ifeq ($(DISABLE_EXECUTABLE), 1)
|
||||
configure_OPTIONS += --enable-executable=no
|
||||
endif
|
||||
|
||||
ifeq ($(DEBUG_UART),1)
|
||||
CFLAGS += -DOPENTHREAD_CONFIG_ENABLE_DEBUG_UART=1
|
||||
CXXFLAGS += -DOPENTHREAD_CONFIG_ENABLE_DEBUG_UART=1
|
||||
|
||||
@@ -76,6 +76,7 @@ endif # OPENTHREAD_ENABLE_DIAG
|
||||
bin_PROGRAMS = \
|
||||
$(NULL)
|
||||
|
||||
if OPENTHREAD_ENABLE_EXECUTABLE
|
||||
if OPENTHREAD_ENABLE_NCP
|
||||
bin_PROGRAMS += \
|
||||
ot-ncp \
|
||||
@@ -150,5 +151,6 @@ CPPFLAGS_COMMON += \
|
||||
|
||||
CLEANFILES = $(wildcard *.gcda *.gcno)
|
||||
endif # OPENTHREAD_BUILD_COVERAGE
|
||||
endif # OPENTHREAD_ENABLE_EXECUTABLE
|
||||
|
||||
include $(abs_top_nlbuild_autotools_dir)/automake/post.am
|
||||
|
||||
Reference in New Issue
Block a user