diff options
author | Yann E. MORIN" <yann.morin.1998@anciens.enib.fr> | 2011-05-26 22:51:03 +0200 |
---|---|---|
committer | Yann E. MORIN" <yann.morin.1998@anciens.enib.fr> | 2011-05-26 22:51:03 +0200 |
commit | a257ff7da8d2ae772011d3cce0b22c741e5b3ce1 (patch) | |
tree | 77368caaa2730b7a8fbee52837284433509af9eb /Makefile.in | |
parent | 7aa57aa228e88bf2b90f27ab75a9e86c7a6410a9 (diff) | |
download | crosstool-ng-a257ff7da8d2ae772011d3cce0b22c741e5b3ce1.tar.gz crosstool-ng-a257ff7da8d2ae772011d3cce0b22c741e5b3ce1.tar.bz2 crosstool-ng-a257ff7da8d2ae772011d3cce0b22c741e5b3ce1.zip |
configure: add possibility to set arbitrary variable in check_for
If check_for is able to find the required prog/inc/lib, allow it to
set an arbitrary variable to 'y'. This variable is then pushed down
to the kconfig definition.
For example:
has_or_abort prog=foobar kconfig=has_foobar
If foobar is available, it yields a kconfig variable defaulting to y:
config CONFIGURE_has_foobar
bool
default y
If foobar is missing, it yields a kconfig variable defaulting to n:
config CONFIGURE_has_foobar
bool
Thus it is possible to depends on that variabel to show/hide options:
config SOME_FEATURE
bool
prompt "Some feature"
depends on CONFIGURE_has_foobar
Signed-off-by: "Yann E. MORIN" <yann.morin.1998@anciens.enib.fr>
Diffstat (limited to 'Makefile.in')
-rw-r--r-- | Makefile.in | 25 |
1 files changed, 23 insertions, 2 deletions
diff --git a/Makefile.in b/Makefile.in index 35f6d369..a211fd63 100644 --- a/Makefile.in +++ b/Makefile.in @@ -58,6 +58,9 @@ objdump:= @@objdump@@ readelf:= @@readelf@@ patch := @@patch@@ +# config options to push down to kconfig +KCONFIG:= @@KCONFIG@@ + ############################################################################### # Non-configure variables MAN_SECTION := 1 @@ -115,7 +118,7 @@ uninstall: real-uninstall build-bin: ct-ng scripts/crosstool-NG.sh scripts/saveSample.sh scripts/showTuple.sh @chmod 755 $^ -build-lib: paths.mk +build-lib: paths.mk config/configure.in build-doc: @@ -142,7 +145,7 @@ docs/ct-ng.1.gz: docs/ct-ng.1 # use := to set variables, although that will incur a (very small) # penalty from the Makefile that includes it (due to re-evaluation at # each call). -paths.mk: +paths.mk: FORCE @echo " GEN '$@'" @(echo "export install=$(install)"; \ echo "export bash=$(bash)"; \ @@ -156,6 +159,22 @@ paths.mk: echo "export patch=$(patch)"; \ ) >paths.mk +config/configure.in: FORCE + @echo " GEN '$@'" + @{ printf "# Generated file, do not edit\n"; \ + printf "# Default values as found by ./configure\n"; \ + for var in $(KCONFIG); do \ + printf "\n"; \ + printf "config CONFIGURE_$${var%%=*}\n"; \ + printf " bool\n"; \ + if [ "$${var#*=}" = "y" ]; then \ + printf " default y\n"; \ + fi; \ + done; \ + } >$@ + +FORCE: + #-------------------------------------- # Clean rules @@ -172,6 +191,8 @@ clean-bin: clean-lib: @echo " RM 'paths.mk'" @rm -f paths.mk + @echo " RM 'config/configure.in'" + @rm -f config/configure.in clean-doc: |