From 1bb07c805cee0c74fd522e9e56c25e58a2bb54e9 Mon Sep 17 00:00:00 2001 From: "Yann E. MORIN\"" Date: Sun, 1 Jul 2007 21:21:11 +0000 Subject: [PATCH] Fix running without installing. Update README. Point help to the man page. --- Makefile.in | 24 ++++++++++++++++-------- README | 10 ++++++---- configure | 37 ++++++++++++++++++++++++++----------- ct-ng.in | 1 + 4 files changed, 49 insertions(+), 23 deletions(-) diff --git a/Makefile.in b/Makefile.in index 7c63232c..001963b0 100644 --- a/Makefile.in +++ b/Makefile.in @@ -8,10 +8,11 @@ all: build VERSION:= @@VERSION@@ BINDIR := @@BINDIR@@ -LIBDIR := @@LIBDIR@@/ct-ng-$(VERSION) -DOCDIR := @@DOCDIR@@/ct-ng-$(VERSION) -MANDIR := @@MANDIR@@/man1 +LIBDIR := @@LIBDIR@@ +DOCDIR := @@DOCDIR@@ +MANDIR := @@MANDIR@@ DATE := @@DATE@@ +LOCAL := @@LOCAL@@ MAKE := $(shell which make || type -p make || echo /usr/bin/make) ############################################################################### @@ -65,12 +66,19 @@ clean-doc: #-------------------------------------- # Install rules -install-bin: $(BINDIR) +# If using localy, don't install +install-local: + @if [ "$(LOCAL)" = "1" ]; then \ + echo "You're using local copy as runtime. You can't install."; \ + false; \ + fi + +install-bin: install-local $(BINDIR) @install -m 755 ct-ng $(BINDIR)/ct-ng -install-lib: $(LIBDIR) install-lib-main install-lib-samples +install-lib: install-local $(LIBDIR) install-lib-main install-lib-samples -install-lib-main: $(LIBDIR) +install-lib-main: install-local $(LIBDIR) @for src_dir in config kconfig patches scripts tools; do \ tar cf - --exclude=.svn $${src_dir} |(cd $(LIBDIR); tar xf -); \ done @@ -80,13 +88,13 @@ install-lib-main: $(LIBDIR) # Samples need a little love: # - change every occurence of CT_TOP_DIR to CT_LIB_DIR -install-lib-samples: $(LIBDIR) install-lib-main +install-lib-samples: install-local $(LIBDIR) install-lib-main @tar cf - --exclude=.svn samples |(cd $(LIBDIR); tar xf -) @for samp_file in $(LIBDIR)/samples/*/crosstool.config; do \ sed -r -i -e 's,\$$\{CT_TOP_DIR\},\$$\{CT_LIB_DIR\},g;' $${samp_file}; \ done -install-doc: $(DOCDIR) $(MANDIR) +install-doc: install-local $(DOCDIR) $(MANDIR) @for doc_file in LICENSES licenses.d COPYING CREDITS docs/overview.txt; do \ install -m 644 docs/overview.txt $(DOCDIR); \ done diff --git a/README b/README index 25394f59..5f03bc56 100644 --- a/README +++ b/README @@ -1,13 +1,15 @@ This is the README for crosstool-NG To get you started, just enter: - make help + ./configure --help -You can find a (terse and WIP) documentation in docs/. +You can find a (terse and WIP) documentation in docs/overview.txt. You can also point your browser to http://ymorin.is-a-geek.org/dokuwiki/projects/crosstool -If you need to send a bug report or a patch, please mail: +If you need to send a bug report or a patch, please send a mail with subject +prefixed with "[CT_NG]" to: yann.morin.1998 (at) anciens.enib.fr -with subject prefixed with "[CT_NG]" + +Aloha! diff --git a/configure b/configure index 0338441c..3ad96af2 100755 --- a/configure +++ b/configure @@ -4,15 +4,12 @@ VERSION=$(cat version) DATE=$(date +%Y%m%d) PREFIX_DEFAULT=/usr/local -BINDIR_DEFAULT="${PREFIX}/bin" -LIBDIR_DEFAULT="${PREFIX}/lib" -DOCDIR_DEFAULT="${PREFIX}/share/doc" -MANDIR_DEFAULT="${PREFIX}/share/man" BINDIR_set= LIBDIR_set= DOCDIR_set= MANDIR_set= +LOCAL_set= get_optval(){ local ret @@ -34,9 +31,9 @@ set_prefix() { PREFIX=$(get_optval "$1" "$2") ret=$? [ -z "${BINDIR_set}" ] && BINDIR="${PREFIX}/bin" - [ -z "${LIBDIR_set}" ] && LIBDIR="${PREFIX}/lib" - [ -z "${DOCDIR_set}" ] && DOCDIR="${PREFIX}/share/doc" - [ -z "${MANDIR_set}" ] && MANDIR="${PREFIX}/share/man" + [ -z "${LIBDIR_set}" ] && LIBDIR="${PREFIX}/lib/ct-ng-${VERSION}" + [ -z "${DOCDIR_set}" ] && DOCDIR="${PREFIX}/share/doc/ct-ng-${VERSION}" + [ -z "${MANDIR_set}" ] && MANDIR="${PREFIX}/share/man/man1" return ${ret} } @@ -82,8 +79,8 @@ Defaults for the options are specified in brackets. Configuration: -h, --help display this help and exit - --prefix=PREFIX install architecture-independent files in PREFIX - [${PREFIX_DEFAULT}] + --prefix=PREFIX install files in PREFIX [${PREFIX_DEFAULT}] + --local don't install, and use current directory By default, \`make install' will install all the files in \`${PREFIX_DEFAULT}/bin', \`${PREFIX_DEFAULT}/lib' etc. You can specify @@ -107,12 +104,20 @@ while [ $# -ne 0 ]; do --libdir*) set_libdir "$1" "$2" && shift || shift 2;; --docdir*) set_docdir "$1" "$2" && shift || shift 2;; --mandir*) set_mandir "$1" "$2" && shift || shift 2;; + --local) LOCAL_set=1; shift;; --help|-h) do_help; exit 0;; *) do_help; exit 1;; esac done -[ -z "${PREFIX}" ] && set_prefix --prefix "${PREFIX_DEFAULT}" +[ -z "${PREFIX}" ] && set_prefix "" "${PREFIX_DEFAULT}" +if [ "${LOCAL_set}" = "1" ]; then + set_prefix "" $(pwd) + set_bindir "" $(pwd) + set_libdir "" $(pwd) + set_docdir "" $(pwd)/docs + set_mandir "" $(pwd)/docs +fi sed -r -e "s,@@BINDIR@@,${BINDIR},g;" \ -e "s,@@LIBDIR@@,${LIBDIR},g;" \ @@ -120,4 +125,14 @@ sed -r -e "s,@@BINDIR@@,${BINDIR},g;" \ -e "s,@@MANDIR@@,${MANDIR},g;" \ -e "s,@@VERSION@@,${VERSION},g;" \ -e "s,@@DATE@@,${DATE},g;" \ - Makefile.in >Makefile + -e "s,@@LOCAL@@,${LOCAL_set},g;" \ + Makefile.in >Makefile + +cat <<__EOF__ +ct-ng configured as follows: + PREFIX="${PREFIX}" + BINDIR="${BINDIR}" + LIBDIR="${LIBDIR}" + DOCDIR="${DOCDIR}" + MANDIR="${MANDIR}" +__EOF__ diff --git a/ct-ng.in b/ct-ng.in index 11915d24..fc47ea7b 100644 --- a/ct-ng.in +++ b/ct-ng.in @@ -55,6 +55,7 @@ help-tail:: @echo @echo 'Execute "$(CT_NG) config" or "$(CT_NG) menuconfig" to configure ct-ng' @echo 'Execute "$(CT_NG)" or "$(CT_NG) all" to build all targets marked with [*]' + @echo 'See "man 1 ct-ng" for some help as well' # End help system