summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorYann E. MORIN" <yann.morin.1998@anciens.enib.fr>2007-07-01 21:21:11 (GMT)
committerYann E. MORIN" <yann.morin.1998@anciens.enib.fr>2007-07-01 21:21:11 (GMT)
commit1bb07c805cee0c74fd522e9e56c25e58a2bb54e9 (patch)
treece1004129a98e68f55e3f2ef3d65e018ffe22497
parente9e6759672f614626561715ccc503534c3ac72eb (diff)
Fix running without installing.
Update README. Point help to the man page.
-rw-r--r--Makefile.in24
-rw-r--r--README10
-rwxr-xr-xconfigure37
-rw-r--r--ct-ng.in1
4 files changed, 49 insertions, 23 deletions
diff --git a/Makefile.in b/Makefile.in
index 7c63232..001963b 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 25394f5..5f03bc5 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 0338441..3ad96af 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 11915d2..fc47ea7 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