Re-instate the --local configure switch to not install and use the local crosstool-NG copy.
author"Yann E. MORIN" <yann.morin.1998@anciens.enib.fr>
Sun Jul 22 17:44:27 2007 +0000 (2007-07-22)
changeset 285148f0a31e2d8
parent 284 23ae4aebb94c
child 286 983d9c3949e1
Re-instate the --local configure switch to not install and use the local crosstool-NG copy.
Makefile.in
configure
ct-ng.in
kconfig/kconfig.mk
     1.1 --- a/Makefile.in	Sun Jul 22 16:36:20 2007 +0000
     1.2 +++ b/Makefile.in	Sun Jul 22 17:44:27 2007 +0000
     1.3 @@ -12,14 +12,15 @@
     1.4  DOCDIR := @@DOCDIR@@
     1.5  MANDIR := @@MANDIR@@
     1.6  DATE   := @@DATE@@
     1.7 -MAKE   := $(shell which make || type -p make || echo /usr/bin/make)
     1.8 +LOCAL  := @@LOCAL@@
     1.9 +MAKE   := $(shell which $(MAKE) || type -p $(MAKE) || echo /usr/bin/make)
    1.10  
    1.11  ###############################################################################
    1.12  # Global make rules
    1.13  
    1.14  build: build-bin build-lib build-doc
    1.15  
    1.16 -install: build install-bin install-lib install-doc
    1.17 +install: install-local-test build install-bin install-lib install-doc
    1.18  
    1.19  clean: clean-bin clean-lib clean-doc
    1.20  
    1.21 @@ -66,13 +67,20 @@
    1.22  #--------------------------------------
    1.23  # Install rules
    1.24  
    1.25 -install-bin: $(BINDIR)
    1.26 +# If using localy, don't install
    1.27 +install-local-test:
    1.28 +	@if [ "$(LOCAL)" = "1" ]; then                                      \
    1.29 +	     echo "You're using local copy as runtime. You can't install."; \
    1.30 +	     false;                                                         \
    1.31 +	 fi
    1.32 +
    1.33 +install-bin: install-local-test $(BINDIR)
    1.34  	@echo "  INST   ct-ng"
    1.35  	@install -m 755 ct-ng $(BINDIR)/ct-ng
    1.36  
    1.37 -install-lib: $(LIBDIR) install-lib-main install-lib-samples
    1.38 +install-lib: install-local-test $(LIBDIR) install-lib-main install-lib-samples
    1.39  
    1.40 -install-lib-main: $(LIBDIR)
    1.41 +install-lib-main: install-local-test $(LIBDIR)
    1.42  	@for src_dir in config kconfig patches scripts tools; do            \
    1.43  	     echo "  INST   $${src_dir}/";                                  \
    1.44  	     tar cf - --exclude=.svn $${src_dir} |(cd $(LIBDIR); tar xf -); \
    1.45 @@ -85,20 +93,20 @@
    1.46  
    1.47  # Samples need a little love:
    1.48  #  - change every occurence of CT_TOP_DIR to CT_LIB_DIR
    1.49 -install-lib-samples: $(LIBDIR) install-lib-main
    1.50 +install-lib-samples: install-local-test $(LIBDIR) install-lib-main
    1.51  	@echo "  INST   samples/"
    1.52  	@tar cf - --exclude=.svn samples |(cd $(LIBDIR); tar xf -)
    1.53  	@for samp_file in $(LIBDIR)/samples/*/crosstool.config; do                  \
    1.54  	     sed -r -i -e 's,\$$\{CT_TOP_DIR\},\$$\{CT_LIB_DIR\},g;' $${samp_file}; \
    1.55  	 done
    1.56  
    1.57 -install-doc: install-man $(DOCDIR)
    1.58 +install-doc: install-local-test $(DOCDIR)
    1.59  	@for doc_file in CREDITS docs/overview.txt; do  \
    1.60  	     echo "  INST   $${doc_file}";              \
    1.61  	     install -m 644 "$${doc_file}" $(DOCDIR);   \
    1.62  	 done
    1.63  
    1.64 -install-man: $(MANDIR)
    1.65 +install-man: install-local-test $(MANDIR)
    1.66  	@echo "  INST   ct-ng.1"
    1.67  	@install -m 644 docs/ct-ng.1 $(MANDIR)
    1.68  
     2.1 --- a/configure	Sun Jul 22 16:36:20 2007 +0000
     2.2 +++ b/configure	Sun Jul 22 17:44:27 2007 +0000
     2.3 @@ -9,6 +9,7 @@
     2.4  LIBDIR_set=
     2.5  DOCDIR_set=
     2.6  MANDIR_set=
     2.7 +LOCAL_set=
     2.8  
     2.9  get_optval(){
    2.10      local ret
    2.11 @@ -79,6 +80,7 @@
    2.12  Configuration:
    2.13    -h, --help              display this help and exit                                                                                                                  
    2.14    --prefix=PREFIX         install files in PREFIX [${PREFIX_DEFAULT}]
    2.15 +  --local                 don't install, and use current directory
    2.16  
    2.17  By default, \`make install' will install all the files in
    2.18  \`${PREFIX_DEFAULT}/bin', \`${PREFIX_DEFAULT}/lib' etc.  You can specify
    2.19 @@ -102,12 +104,20 @@
    2.20          --libdir*)  set_libdir "$1" "$2" && shift || shift 2;;
    2.21          --docdir*)  set_docdir "$1" "$2" && shift || shift 2;;
    2.22          --mandir*)  set_mandir "$1" "$2" && shift || shift 2;;
    2.23 +        --local)    LOCAL_set=1; shift;;
    2.24          --help|-h)  do_help; exit 0;;
    2.25          *)          do_help; exit 1;;
    2.26      esac
    2.27  done
    2.28  
    2.29  [ -z "${PREFIX}" ] && set_prefix "" "${PREFIX_DEFAULT}"
    2.30 +if [ "${LOCAL_set}" = "1" ]; then
    2.31 +    set_prefix "" $(pwd)
    2.32 +    set_bindir "" $(pwd)
    2.33 +    set_libdir "" $(pwd)
    2.34 +    set_docdir "" $(pwd)/docs
    2.35 +    set_mandir "" $(pwd)/docs
    2.36 +fi
    2.37  
    2.38  sed -r -e "s,@@BINDIR@@,${BINDIR},g;"   \
    2.39         -e "s,@@LIBDIR@@,${LIBDIR},g;"   \
    2.40 @@ -115,6 +125,7 @@
    2.41         -e "s,@@MANDIR@@,${MANDIR},g;"   \
    2.42         -e "s,@@VERSION@@,${VERSION},g;" \
    2.43         -e "s,@@DATE@@,${DATE},g;"       \
    2.44 +       -e "s,@@LOCAL@@,${LOCAL_set},g;" \
    2.45         Makefile.in >Makefile
    2.46  
    2.47  cat <<__EOF__
     3.1 --- a/ct-ng.in	Sun Jul 22 16:36:20 2007 +0000
     3.2 +++ b/ct-ng.in	Sun Jul 22 17:44:27 2007 +0000
     3.3 @@ -3,7 +3,7 @@
     3.4  # Copyright 2006 Yann E. MORIN <yann.morin.1998@anciens.enib.fr>
     3.5  
     3.6  # Don't print directory as we descend into them
     3.7 -MAKEFLAGS += --no-print-directory
     3.8 +MAKEFLAGS += --no-print-directory --no-builtin-rules
     3.9  
    3.10  # Remember the name of the Makefile
    3.11  CT_MAKEFILE := $(lastword $(MAKEFILE_LIST))
     4.1 --- a/kconfig/kconfig.mk	Sun Jul 22 16:36:20 2007 +0000
     4.2 +++ b/kconfig/kconfig.mk	Sun Jul 22 17:44:27 2007 +0000
     4.3 @@ -82,7 +82,7 @@
     4.4  
     4.5  # Cheesy build
     4.6  
     4.7 -SHIPPED = $(CT_LIB_DIR)/kconfig/zconf.tab.c $(CT_LIB_DIR)/kconfig/lex.zconf.c $(CT_LIB_DIR)/kconfig/zconf.hash.c
     4.8 +SHIPPED := $(CT_LIB_DIR)/kconfig/zconf.tab.c $(CT_LIB_DIR)/kconfig/lex.zconf.c $(CT_LIB_DIR)/kconfig/zconf.hash.c
     4.9  
    4.10  %.c: %.c_shipped
    4.11  	@ln -s $(notdir $<) $@
    4.12 @@ -101,9 +101,7 @@
    4.13  
    4.14  clean::
    4.15  	@rm -f $(CT_TOP_DIR)/kconfig/{,m}conf
    4.16 +	@rm -f $(SHIPPED)
    4.17  	@rmdir --ignore-fail-on-non-empty $(CT_TOP_DIR)/kconfig 2>/dev/null || true
    4.18 -	@rm -f $(CT_TOP_DIR)/config
    4.19 +	@rm -f $(CT_TOP_DIR)/config 2>/dev/null || true
    4.20  	@rm -rf $(CT_TOP_DIR)/config.gen
    4.21 -
    4.22 -distclean::
    4.23 -	@rm -f $(CT_TOP_DIR)/config