Commit 9596739f authored by Rémi Denis-Courmont's avatar Rémi Denis-Courmont

contrib: bootstrap --disable-FOO and --enable-FOO

The automatic packages selection can be overriden.
parent f033c284
...@@ -24,11 +24,15 @@ usage() ...@@ -24,11 +24,15 @@ usage()
echo " --build=BUILD configure for building on BUILD" echo " --build=BUILD configure for building on BUILD"
echo " --host=HOST cross-compile to build to run on HOST" echo " --host=HOST cross-compile to build to run on HOST"
echo " --prefix=PREFIX install files in PREFIX" echo " --prefix=PREFIX install files in PREFIX"
echo " --disable-FOO configure to not build package FOO"
echo " --enable-FOO configure to build package FOO"
} }
BUILD= BUILD=
HOST= HOST=
PREFIX= PREFIX=
PKGS_ENABLE=
PKGS_DISABLE=
if test ! -f "../src/main.mak" if test ! -f "../src/main.mak"
then then
...@@ -52,6 +56,12 @@ do ...@@ -52,6 +56,12 @@ do
--prefix=*) --prefix=*)
PREFIX="${1#--prefix=}" PREFIX="${1#--prefix=}"
;; ;;
--disable-*)
PKGS_DISABLE="${PKGS_DISABLE} ${1#--disable-}"
;;
--enable-*)
PKGS_ENABLE="${PKGS_ENABLE} ${1#--enable-}"
;;
*) *)
echo "Unrecognized options $1" echo "Unrecognized options $1"
usage usage
...@@ -102,6 +112,8 @@ cat >&3 << EOF ...@@ -102,6 +112,8 @@ cat >&3 << EOF
BUILD := $BUILD BUILD := $BUILD
HOST := $HOST HOST := $HOST
PREFIX := $PREFIX PREFIX := $PREFIX
PKGS_DISABLE := $PKGS_DISABLE
PKGS_ENABLE := $PKGS_ENABLE
EOF EOF
add_make() add_make()
......
...@@ -175,6 +175,11 @@ include ../src/*/rules.mak ...@@ -175,6 +175,11 @@ include ../src/*/rules.mak
# #
# Targets # Targets
# #
ifneq ($(filter $(PKGS_DISABLE),$(PKGS_ENABLE)),)
$(error Same package(s) disabled and enabled at the same time)
endif
PKGS := $(filter-out $(PKGS_DISABLE),$(PKGS)) $(PKGS_ENABLE)
fetch: $(PKGS:%=.sum-%) fetch: $(PKGS:%=.sum-%)
fetch-all: $(ALL_PKGS:%=.sum-%) fetch-all: $(ALL_PKGS:%=.sum-%)
install: $(PKGS:%=.%) install: $(PKGS:%=.%)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment