Add --enable-examples switch (default on) to configure script

This commit is contained in:
Richard Hacker
2025-10-25 14:40:05 +02:00
parent 2543cc55bd
commit 642c55cfbe
2 changed files with 36 additions and 1 deletions

View File

@@ -21,7 +21,11 @@
#
#-----------------------------------------------------------------------------
obj-m := examples/ master/ devices/
obj-m := master/ devices/
ifeq (@ENABLE_EXAMPLES@,1)
obj-m += examples/
endif
ifeq (@ENABLE_TTY@,1)
obj-m += tty/

View File

@@ -1209,6 +1209,37 @@ fi
AM_CONDITIONAL(ENABLE_FAKEUSERLIB, test "x$fakeuserlib" = "x1")
#-----------------------------------------------------------------------------
# example programs
#-----------------------------------------------------------------------------
AC_MSG_CHECKING([whether to build the examples])
AC_ARG_ENABLE([examples],
AS_HELP_STRING([--enable-examples],
[Generation of example modules (default: yes)]),
[
case "${enableval}" in
yes) examples=1
;;
no) examples=0
;;
*) AC_MSG_ERROR([Invalid value for --enable-examples])
;;
esac
],
[examples=1]
)
if test "x${examples}" = "x1"; then
AC_MSG_RESULT([yes])
else
AC_MSG_RESULT([no])
fi
AM_CONDITIONAL(ENABLE_EXAMPLES, test "x$examples" = "x1")
AC_SUBST(ENABLE_EXAMPLES,[$examples])
#-----------------------------------------------------------------------------
# TTY driver
#-----------------------------------------------------------------------------