Add a --disable-plugins option to ./configure (Fixes #8)

This commit is contained in:
James Mills committed 2015-03-11 07:04:38 +10:00
1 parent c3fcfe7e4e
commit 4955e05882
1 file changed
+21 -8
Vendored
+21 -8
View File
@@ -4,6 +4,7 @@
# --with-plugins="time initctl" # --with-plugins="time initctl"
# --enable-static # --enable-static
# --disable-inetd # --disable-inetd
# --disable-plugins
# #
# This creates a configuration where Finit is built statically, with the # This creates a configuration where Finit is built statically, with the
# time and initctl plugins built-in, and no inetd support. # time and initctl plugins built-in, and no inetd support.
@@ -28,6 +29,7 @@ defaults()
embedded=${embedded:=0} embedded=${embedded:=0}
inetd=${inetd:=1} inetd=${inetd:=1}
static=${static:=0} static=${static:=0}
disable_plugins=${disable_plugins:=0}
} }
result() result()
@@ -60,10 +62,14 @@ fi
if [ $static -ne 0 ]; then if [ $static -ne 0 ]; then
echo "Static finit : YES" echo "Static finit : YES"
fi fi
if [ x"$plugins" = x"" ]; then if [ $disable_plugins -eq 1 ]; then
echo "Plugins : ALL" echo "Plugins : DISABLED"
else else
echo "Plugins : $plugins" if [ x"$plugins" = x"" ]; then
echo "Plugins : ALL"
else
echo "Plugins : $plugins"
fi
fi fi
echo echo
} }
@@ -94,6 +100,7 @@ usage()
echo " --enable-debug Enable debug flags, '-O0, -g'" echo " --enable-debug Enable debug flags, '-O0, -g'"
echo " --enable-static Link finit statically. This disables a few features." echo " --enable-static Link finit statically. This disables a few features."
echo " --disable-inetd Disable inetd support if not needed." echo " --disable-inetd Disable inetd support if not needed."
echo " --disable-plugins Disable plugins"
echo echo
echo "The build system also supports external CFLAGS, CPPFLAGS, LDFLAGS, LDLIBS," echo "The build system also supports external CFLAGS, CPPFLAGS, LDFLAGS, LDLIBS,"
echo "and DESTDIR, useful for packaging or cross-compiling." echo "and DESTDIR, useful for packaging or cross-compiling."
@@ -168,6 +175,10 @@ while [ "$*" != "" ]; do
inetd=0 inetd=0
;; ;;
disable-plugins)
disable_plugins=1
;;
enable-static) enable-static)
static=1 static=1
;; ;;
@@ -216,11 +227,13 @@ if [ $static -ne 0 ]; then
echo "LDFLAGS += -static" >> config.mk echo "LDFLAGS += -static" >> config.mk
echo "CPPFLAGS += -DENABLE_STATIC" >> config.mk echo "CPPFLAGS += -DENABLE_STATIC" >> config.mk
echo "PLUGINS = \"\"" >> config.mk echo "PLUGINS = \"\"" >> config.mk
if [ x"$plugins" != x"" ]; then if [ $disable_plugins -ne 1 ]; then
echo "OBJS += \$(addsuffix .o, \$(addprefix plugins/, $plugins))" >> config.mk if [ x"$plugins" != x"" ]; then
else echo "OBJS += \$(addsuffix .o, \$(addprefix plugins/, $plugins))" >> config.mk
echo "tmp += \$(wildcard plugins/*.c)" >> config.mk else
echo "OBJS += \$(tmp:.c=.o)" >> config.mk echo "tmp += \$(wildcard plugins/*.c)" >> config.mk
echo "OBJS += \$(tmp:.c=.o)" >> config.mk
fi
fi fi
else else
echo "STATIC = 0" >> config.mk echo "STATIC = 0" >> config.mk