diff --git a/.gitignore b/.gitignore index 1bdd197d..d12732a7 100644 --- a/.gitignore +++ b/.gitignore @@ -9,6 +9,7 @@ config.status !ct-ng.in paths.* !paths.in +config/configure.in config/gen/ .config diff --git a/Makefile.in b/Makefile.in index 4980346f..0cec7375 100644 --- a/Makefile.in +++ b/Makefile.in @@ -145,7 +145,7 @@ install: build real-install clean: $(patsubst %,clean-%,$(TARGETS)) distclean: clean - $(call __silent_rm,Makefile config/configure.in) + $(call __silent_rm,Makefile kconfig/Makefile config/configure.in) mrproper: distclean $(call __silent_rmdir,autom4te.cache config/gen) @@ -164,7 +164,6 @@ build-bin: $(PROG_NAME) \ scripts/crosstool-NG.sh \ scripts/saveSample.sh \ scripts/showConfig.sh - $(call __silent,CHMOD,$^)chmod 755 $^ build-lib: paths.mk \ paths.sh @@ -274,7 +273,7 @@ install-lib: $(DESTDIR)$(libdir) \ LIB_SUB_DIR := config contrib patches scripts $(patsubst %,install-lib-%-copy,$(LIB_SUB_DIR)): install-lib-%-copy: $(DESTDIR)$(libdir) - $(call __silent,INSTDIR,$*)tar cf - --exclude='*.sh.in' --exclude='*.in.in' $* \ + $(call __silent,INSTDIR,$*)tar cf - --exclude='*.sh.in' --exclude='*.in.in' --exclude=.gitignore $* \ |(cd "$(DESTDIR)$(libdir)"; tar xf -) # Dependency-only by default. diff --git a/config/.gitignore b/config/.gitignore deleted file mode 100644 index b249ba2d..00000000 --- a/config/.gitignore +++ /dev/null @@ -1 +0,0 @@ -configure.in diff --git a/configure.ac b/configure.ac index 869226c1..4f7d3d32 100644 --- a/configure.ac +++ b/configure.ac @@ -371,6 +371,8 @@ ACX_SET_KCONFIG_OPTION([svn]) AC_CHECK_PROGS([git], [git]) ACX_SET_KCONFIG_OPTION([git]) +AC_CHECK_PROGS([DPKG_BUILDFLAGS], [dpkg-buildflags]) + #-------------------------------------------------------------------- # Now, for some fun... #-------------------------------------------------------------------- @@ -465,5 +467,5 @@ AS_IF( #-------------------------------------------------------------------- # Finally, generate the output file(s) #-------------------------------------------------------------------- -AC_CONFIG_FILES([Makefile config/configure.in]) +AC_CONFIG_FILES([Makefile kconfig/Makefile config/configure.in]) AC_OUTPUT diff --git a/ct-ng.in b/ct-ng.in index 09ba89ca..cf2edd1a 100644 --- a/ct-ng.in +++ b/ct-ng.in @@ -140,10 +140,10 @@ show-tuple: .config # Actual build source: .config - $(SILENT)CT_SOURCE=y $(CT_LIB_DIR)/scripts/crosstool-NG.sh + $(SILENT)CT_SOURCE=y $(bash) $(CT_LIB_DIR)/scripts/crosstool-NG.sh build: .config - $(SILENT)$(CT_LIB_DIR)/scripts/crosstool-NG.sh + $(SILENT)$(bash) $(CT_LIB_DIR)/scripts/crosstool-NG.sh build.%: $(SILENT)$(MAKE) -rf $(CT_NG) build CT_JOBS=$* diff --git a/debian/.gitignore b/debian/.gitignore new file mode 100644 index 00000000..fcb77d2d --- /dev/null +++ b/debian/.gitignore @@ -0,0 +1,6 @@ +.debhelper +*.log +*.substvars +crosstool-ng +debhelper-build-stamp +files diff --git a/debian/rules b/debian/rules index 93152848..b8fd445b 100755 --- a/debian/rules +++ b/debian/rules @@ -19,7 +19,7 @@ include /usr/share/dpkg/default.mk # main packaging script based on dh7 syntax %: - MAKELEVEL=0 dh $@ --with autotools-dev + MAKELEVEL=0 dh $@ # Make sure we call ./bootstrap before running dh_auto_configure override_dh_auto_configure: @@ -29,4 +29,7 @@ override_dh_auto_configure: #Make sure to include bash completion file in the package override_dh_auto_install: MAKELEVEL=0 dh_auto_install - install -D ct-ng.comp $$(pwd)/debian/crosstool-ng/etc/bash_completion.d/ct-ng.comp + install -D -m 0644 ct-ng.comp $$(pwd)/debian/crosstool-ng/usr/share/bash-completion/completions/ct-ng.comp + +override_dh_update_autotools_config: + @: diff --git a/docs/ct-ng.1.in b/docs/ct-ng.1.in index 65a0b0e6..4630f30c 100644 --- a/docs/ct-ng.1.in +++ b/docs/ct-ng.1.in @@ -1,21 +1,21 @@ -." crosstool-NG man page -." Copyright 2007 Yann E. MORIN -." Licensed under the Creative Commons BY-SA, v2.5 -." -." Beautifying URLs +.\" crosstool-NG man page +.\" Copyright 2007 Yann E. MORIN +.\" Licensed under the Creative Commons BY-SA, v2.5 +.\" +.\" Beautifying URLs .mso www.tmac -." +.\" .TH crosstool-NG 1 "@@CT_DATE@@" "version @@CT_VERSION@@" "User Commands" -." -." +.\" +.\" .SH NAME @@CT_PROG_NAME@@, crosstool-NG \- Build cross-toolchains -." -." +.\" +.\" .SH SYNOPSIS .B @@CT_PROG_NAME@@ ACTION -." -." +.\" +.\" .SH DESCRIPTION Building a cross-toolchain can be a real pain. .PP @@ -23,27 +23,28 @@ Building a cross-toolchain can be a real pain. makes it easy to build cross-toolchains, and allows you to take all the juice out of your target by configuring the different components of the toolchain according to the targeted processor. -." -." +.\" +.\" .SH ACTIONS -Here are the most commonly used actions. For other actions, please see -.I "@@CT_DOCDIR@@/0 - Table of content.txt" +Here are the most commonly used actions. For other actions, please see the +documentation in +.I @@CT_DOCDIR@@ .TP .B help Prints a little help text. -." +.\" .TP .B menuconfig Configures .B crosstool-NG using a configurator menu very similar to that of the Linux kernel. -." +.\" .TP .B oldconfig Apply options found in an existing .I .config file, and ask for newer options if there are any. -." +.\" .TP .B saveconfig Save the current @@ -51,14 +52,10 @@ Save the current configuration, and associated components' config files, into a sample. Samples are saved in their own sub-directory, named after the target's tuple, in the .I samples -sub-directory of the current directory. -If that was not clear: -.I `pwd`/samples/${CT_TARGET}/ - -Samples can be later recalled by calling +sub-directory of the current directory. Samples can be later recalled by calling .B @@CT_PROG_NAME@@ with the target tuple they represent. -." +.\" .TP .B savedefconfig Save the current configuration to a mini-defconfig file, that contains only @@ -85,7 +82,7 @@ is saved. Config files for the components are saved. Use .B saveconfig for that -." +.\" .TP .B defconfig Configure @@ -99,17 +96,17 @@ unless the variable is set, in which case the mini-defconfig will be read from the file referenced by .B $DEFCONFIG -." +.\" .TP .B build Builds the configured toolchain. -." +.\" .TP .B clean Remove files generated by .B crosstool-NG for itself (these are mostly the configurators' binaries). -." +.\" .TP .B distclean Same as @@ -118,14 +115,14 @@ Same as .I .config configuration file. The generated toolchain is left untouched, as well as samples which are not removed. -." +.\" .TP .B regtest Calls the .B crosstool-NG regression test suite. All samples are build, and the regression test suite is run against every one of them. -." +.\" .TP .B updatetools Updates the @@ -135,7 +132,7 @@ and scripts. These scripts are used by .B crosstool-NG to canonicalise the machines' name (host, build and target machines). -." +.\" .SH ENVIRONMENT .TP .B STOP, RESTART @@ -144,7 +141,7 @@ step, a previous build should have run at least to that step, or further. The list of steps is viewable with the action .BR list-steps . -." +.\" .SH EXIT VALUE The .B @@CT_PROG_NAME@@ @@ -153,19 +150,7 @@ frontend is in fact a script. See the man page for .BR make (1) to have the meaning of the exit values. -." -.SH BUGS -As of today (@@CT_DATE@@), building tarballs is broken. It is difficult to -foresee how all parts of -.B crosstool-NG -are going to be installed. Each part is needed to build a tarball, as it -contains all that is needed to rebuild the toolchain from scratch: toolchain -components' sources, -.B crosstool-NG -configuration, but also all -.B crosstool-NG -scripts. -." +.\" .SH SECURITY .B Don't run as root! Great care has been taken to avoid mistakes, but bug-free programs don't @@ -179,15 +164,13 @@ entire important directories could be removed (eg. although .B crosstool-NG will refuse to install toolchains in some well known critical directories. -." +.\" .SH AUTHORS -Please consult the file -.I @@CT_DOCDIR@@/A - Credits.txt -for a list of contributors. -." +Yann E. MORIN and a lot of contributors. +.\" .SH SEE ALSO You can find more in-depth documentation in -.IR "@@CT_DOCDIR@@/0 - Table of content.txt" . +.IR "@@CT_DOCDIR@@" . Please have a look at the .URL "http://www.kegel.com/crosstool" "original crosstool" " by Daniel KEGEL" diff --git a/kconfig/.gitignore b/kconfig/.gitignore index 7f79a8d4..473d1748 100644 --- a/kconfig/.gitignore +++ b/kconfig/.gitignore @@ -6,3 +6,4 @@ zconf.lex.c zconf.hash.c zconf.tab.c *.exe +Makefile diff --git a/kconfig/Makefile b/kconfig/Makefile.in similarity index 90% rename from kconfig/Makefile rename to kconfig/Makefile.in index 4a33ac8f..403d04b3 100644 --- a/kconfig/Makefile +++ b/kconfig/Makefile.in @@ -15,6 +15,12 @@ CFLAGS = -DCONFIG_=\"CT_\" -DPACKAGE="\"crosstool-NG $(VERSION)\"" \ -DGPERF_LEN_TYPE="$(gperf_len_type)" LDFLAGS = $(INTL_LIBS) +ifneq (@DPKG_BUILDFLAGS@,) +CFLAGS += $(shell @DPKG_BUILDFLAGS@ --get CPPFLAGS) \ + $(shell @DPKG_BUILDFLAGS@ --get CFLAGS) +LDFLAGS += $(shell @DPKG_BUILDFLAGS@ --get LDFLAGS) +endif + # Compiler flags to use gettext ifeq ($(gettext),) INTL_CFLAGS = -Wno-format-security -DKBUILD_NO_NLS @@ -103,8 +109,11 @@ conf: $(COMMON_OBJ) $(conf_OBJ) # Installation install: $(patsubst %,install-%,$(PROGS)) install-kconfig.mk -install-%: % - $(call __silent,INSTALL,$<)install $< $(DESTDIR)/$< +$(patsubst %,install-%,$(PROGS)): install-%: % + $(call __silent,INSTALL,$<)install -m 0755 $< $(DESTDIR)/$< + +install-kconfig.mk: kconfig.mk + $(call __silent,INSTALL,$<)install -m 0644 $< $(DESTDIR)/$< #----------------------------------------------------------- # Cleaning up the mess... diff --git a/patches/glibc/ports-2.12.1/170-localedef-fix-trampoline.patch b/patches/glibc/ports-2.12.1/170-localedef-fix-trampoline.patch index 0e058441..fb0881d2 100644 --- a/patches/glibc/ports-2.12.1/170-localedef-fix-trampoline.patch +++ b/patches/glibc/ports-2.12.1/170-localedef-fix-trampoline.patch @@ -1,5 +1,3 @@ -#! /bin/sh -e - # DP: Description: Fix localedef segfault when run under exec-shield, # PaX or similar. (#231438, #198099) # DP: Dpatch Author: James Troup @@ -7,20 +5,6 @@ # DP: Upstream status: Unknown # DP: Status Details: Unknown # DP: Date: 2004-03-16 - -if [ $# -ne 2 ]; then - echo >&2 "`basename $0`: script expects -patch|-unpatch as argument" - exit 1 -fi -case "$1" in - -patch) patch -d "$2" -f --no-backup-if-mismatch -p1 < $0;; - -unpatch) patch -d "$2" -f --no-backup-if-mismatch -R -p1 < $0;; - *) - echo >&2 "`basename $0`: script expects -patch|-unpatch as argument" - exit 1 -esac -exit 0 - diff -durN glibc-2.12.1.orig/locale/programs/3level.h glibc-2.12.1/locale/programs/3level.h --- glibc-2.12.1.orig/locale/programs/3level.h 2007-07-16 02:54:59.000000000 +0200 +++ glibc-2.12.1/locale/programs/3level.h 2009-11-13 00:49:56.000000000 +0100 diff --git a/patches/glibc/ports-2.13/170-localedef-fix-trampoline.patch b/patches/glibc/ports-2.13/170-localedef-fix-trampoline.patch index 4784a07b..3cc65597 100644 --- a/patches/glibc/ports-2.13/170-localedef-fix-trampoline.patch +++ b/patches/glibc/ports-2.13/170-localedef-fix-trampoline.patch @@ -1,5 +1,3 @@ -#! /bin/sh -e - # DP: Description: Fix localedef segfault when run under exec-shield, # PaX or similar. (#231438, #198099) # DP: Dpatch Author: James Troup @@ -7,20 +5,6 @@ # DP: Upstream status: Unknown # DP: Status Details: Unknown # DP: Date: 2004-03-16 - -if [ $# -ne 2 ]; then - echo >&2 "`basename $0`: script expects -patch|-unpatch as argument" - exit 1 -fi -case "$1" in - -patch) patch -d "$2" -f --no-backup-if-mismatch -p1 < $0;; - -unpatch) patch -d "$2" -f --no-backup-if-mismatch -R -p1 < $0;; - *) - echo >&2 "`basename $0`: script expects -patch|-unpatch as argument" - exit 1 -esac -exit 0 - diff -durN glibc-2.13.orig/locale/programs/3level.h glibc-2.13/locale/programs/3level.h --- glibc-2.13.orig/locale/programs/3level.h 2007-07-16 02:54:59.000000000 +0200 +++ glibc-2.13/locale/programs/3level.h 2009-11-13 00:49:56.000000000 +0100 diff --git a/patches/glibc/ports-2.14.1/170-localedef-fix-trampoline.patch b/patches/glibc/ports-2.14.1/170-localedef-fix-trampoline.patch index 4784a07b..3cc65597 100644 --- a/patches/glibc/ports-2.14.1/170-localedef-fix-trampoline.patch +++ b/patches/glibc/ports-2.14.1/170-localedef-fix-trampoline.patch @@ -1,5 +1,3 @@ -#! /bin/sh -e - # DP: Description: Fix localedef segfault when run under exec-shield, # PaX or similar. (#231438, #198099) # DP: Dpatch Author: James Troup @@ -7,20 +5,6 @@ # DP: Upstream status: Unknown # DP: Status Details: Unknown # DP: Date: 2004-03-16 - -if [ $# -ne 2 ]; then - echo >&2 "`basename $0`: script expects -patch|-unpatch as argument" - exit 1 -fi -case "$1" in - -patch) patch -d "$2" -f --no-backup-if-mismatch -p1 < $0;; - -unpatch) patch -d "$2" -f --no-backup-if-mismatch -R -p1 < $0;; - *) - echo >&2 "`basename $0`: script expects -patch|-unpatch as argument" - exit 1 -esac -exit 0 - diff -durN glibc-2.13.orig/locale/programs/3level.h glibc-2.13/locale/programs/3level.h --- glibc-2.13.orig/locale/programs/3level.h 2007-07-16 02:54:59.000000000 +0200 +++ glibc-2.13/locale/programs/3level.h 2009-11-13 00:49:56.000000000 +0100 diff --git a/patches/glibc/ports-2.14/170-localedef-fix-trampoline.patch b/patches/glibc/ports-2.14/170-localedef-fix-trampoline.patch index 4784a07b..3cc65597 100644 --- a/patches/glibc/ports-2.14/170-localedef-fix-trampoline.patch +++ b/patches/glibc/ports-2.14/170-localedef-fix-trampoline.patch @@ -1,5 +1,3 @@ -#! /bin/sh -e - # DP: Description: Fix localedef segfault when run under exec-shield, # PaX or similar. (#231438, #198099) # DP: Dpatch Author: James Troup @@ -7,20 +5,6 @@ # DP: Upstream status: Unknown # DP: Status Details: Unknown # DP: Date: 2004-03-16 - -if [ $# -ne 2 ]; then - echo >&2 "`basename $0`: script expects -patch|-unpatch as argument" - exit 1 -fi -case "$1" in - -patch) patch -d "$2" -f --no-backup-if-mismatch -p1 < $0;; - -unpatch) patch -d "$2" -f --no-backup-if-mismatch -R -p1 < $0;; - *) - echo >&2 "`basename $0`: script expects -patch|-unpatch as argument" - exit 1 -esac -exit 0 - diff -durN glibc-2.13.orig/locale/programs/3level.h glibc-2.13/locale/programs/3level.h --- glibc-2.13.orig/locale/programs/3level.h 2007-07-16 02:54:59.000000000 +0200 +++ glibc-2.13/locale/programs/3level.h 2009-11-13 00:49:56.000000000 +0100 diff --git a/patches/glibc/ports-2.15/170-localedef-fix-trampoline.patch b/patches/glibc/ports-2.15/170-localedef-fix-trampoline.patch index 4784a07b..3cc65597 100644 --- a/patches/glibc/ports-2.15/170-localedef-fix-trampoline.patch +++ b/patches/glibc/ports-2.15/170-localedef-fix-trampoline.patch @@ -1,5 +1,3 @@ -#! /bin/sh -e - # DP: Description: Fix localedef segfault when run under exec-shield, # PaX or similar. (#231438, #198099) # DP: Dpatch Author: James Troup @@ -7,20 +5,6 @@ # DP: Upstream status: Unknown # DP: Status Details: Unknown # DP: Date: 2004-03-16 - -if [ $# -ne 2 ]; then - echo >&2 "`basename $0`: script expects -patch|-unpatch as argument" - exit 1 -fi -case "$1" in - -patch) patch -d "$2" -f --no-backup-if-mismatch -p1 < $0;; - -unpatch) patch -d "$2" -f --no-backup-if-mismatch -R -p1 < $0;; - *) - echo >&2 "`basename $0`: script expects -patch|-unpatch as argument" - exit 1 -esac -exit 0 - diff -durN glibc-2.13.orig/locale/programs/3level.h glibc-2.13/locale/programs/3level.h --- glibc-2.13.orig/locale/programs/3level.h 2007-07-16 02:54:59.000000000 +0200 +++ glibc-2.13/locale/programs/3level.h 2009-11-13 00:49:56.000000000 +0100 diff --git a/patches/glibc/ports-2.16.0/170-localedef-fix-trampoline.patch b/patches/glibc/ports-2.16.0/170-localedef-fix-trampoline.patch index 4784a07b..3cc65597 100644 --- a/patches/glibc/ports-2.16.0/170-localedef-fix-trampoline.patch +++ b/patches/glibc/ports-2.16.0/170-localedef-fix-trampoline.patch @@ -1,5 +1,3 @@ -#! /bin/sh -e - # DP: Description: Fix localedef segfault when run under exec-shield, # PaX or similar. (#231438, #198099) # DP: Dpatch Author: James Troup @@ -7,20 +5,6 @@ # DP: Upstream status: Unknown # DP: Status Details: Unknown # DP: Date: 2004-03-16 - -if [ $# -ne 2 ]; then - echo >&2 "`basename $0`: script expects -patch|-unpatch as argument" - exit 1 -fi -case "$1" in - -patch) patch -d "$2" -f --no-backup-if-mismatch -p1 < $0;; - -unpatch) patch -d "$2" -f --no-backup-if-mismatch -R -p1 < $0;; - *) - echo >&2 "`basename $0`: script expects -patch|-unpatch as argument" - exit 1 -esac -exit 0 - diff -durN glibc-2.13.orig/locale/programs/3level.h glibc-2.13/locale/programs/3level.h --- glibc-2.13.orig/locale/programs/3level.h 2007-07-16 02:54:59.000000000 +0200 +++ glibc-2.13/locale/programs/3level.h 2009-11-13 00:49:56.000000000 +0100 diff --git a/samples/samples.mk b/samples/samples.mk index ce7e7c98..ecd8a158 100644 --- a/samples/samples.mk +++ b/samples/samples.mk @@ -43,7 +43,7 @@ help-env:: PHONY += show-config show-config: .config @cp .config .config.sample - @$(CT_LIB_DIR)/scripts/showSamples.sh -v current + @$(bash) $(CT_LIB_DIR)/scripts/showSamples.sh -v current @rm -f .config.sample # Prints the details of a sample @@ -52,7 +52,7 @@ $(patsubst %,show-%,$(CT_SAMPLES)): show-%: @KCONFIG_CONFIG=$$(pwd)/.config.sample \ $(CONF) --defconfig=$(call sample_dir,$*)/crosstool.config \ $(KCONFIG_TOP) >/dev/null - @$(CT_LIB_DIR)/scripts/showSamples.sh -v $* + @$(bash) $(CT_LIB_DIR)/scripts/showSamples.sh -v $* @rm -f .config.sample # Prints the details of all samples @@ -76,7 +76,7 @@ $(patsubst %,list-%,$(CT_SAMPLES)): list-%: @KCONFIG_CONFIG=$$(pwd)/.config.sample \ $(CONF) --defconfig=$(call sample_dir,$*)/crosstool.config \ $(KCONFIG_TOP) >/dev/null - @$(CT_LIB_DIR)/scripts/showSamples.sh $* + @$(bash) $(CT_LIB_DIR)/scripts/showSamples.sh $* @rm -f .config.sample PHONY += list-samples-short @@ -114,16 +114,16 @@ PHONY += wiki-samples wiki-samples: wiki-samples-pre $(patsubst %,wiki-%,$(CT_SAMPLES)) wiki-samples-post wiki-samples-pre: FORCE - $(SILENT)$(CT_LIB_DIR)/scripts/showSamples.sh -w + $(SILENT)$(bash) $(CT_LIB_DIR)/scripts/showSamples.sh -w wiki-samples-post: FORCE - $(SILENT)$(CT_LIB_DIR)/scripts/showSamples.sh -W $(CT_SAMPLES) + $(SILENT)$(bash) $(CT_LIB_DIR)/scripts/showSamples.sh -W $(CT_SAMPLES) $(patsubst %,wiki-%,$(CT_SAMPLES)): wiki-%: $(SILENT)KCONFIG_CONFIG=$$(pwd)/.config.sample \ $(CONF) --defconfig=$(call sample_dir,$*)/crosstool.config \ $(KCONFIG_TOP) >/dev/null - $(SILENT)$(CT_LIB_DIR)/scripts/showSamples.sh -w $* + $(SILENT)$(bash) $(CT_LIB_DIR)/scripts/showSamples.sh -w $* $(SILENT)rm -f .config.sample # ---------------------------------------------------------- @@ -136,7 +136,7 @@ samples: # Save a sample saveconfig: .config samples - $(SILENT)$(CT_LIB_DIR)/scripts/saveSample.sh + $(SILENT)$(bash) $(CT_LIB_DIR)/scripts/saveSample.sh # The 'sample_dir' function prints the directory in which the sample is, # searching first in local samples, then in global samples diff --git a/scripts/build/companion_libs/210-expat.sh b/scripts/build/companion_libs/210-expat.sh old mode 100755 new mode 100644 diff --git a/scripts/saveSample.sh.in b/scripts/saveSample.sh.in index 2eb1f40a..d9d999c9 100644 --- a/scripts/saveSample.sh.in +++ b/scripts/saveSample.sh.in @@ -1,5 +1,3 @@ -#!@@CT_bash@@ - # This script is responsible for saving the current configuration into a # sample to be used later on as a pre-configured target. diff --git a/scripts/showConfig.sh.in b/scripts/showConfig.sh.in index b4399959..9031b3cd 100644 --- a/scripts/showConfig.sh.in +++ b/scripts/showConfig.sh.in @@ -1,5 +1,3 @@ -#!@@CT_bash@@ - # What we need: # - the .config file diff --git a/scripts/showSamples.sh b/scripts/showSamples.sh old mode 100755 new mode 100644 index e60e29fc..1e5d50bd --- a/scripts/showSamples.sh +++ b/scripts/showSamples.sh @@ -1,6 +1,3 @@ -#!/bin/sh -# Yes, this is supposed to be a POSIX-compliant shell script. - # Parses all samples on the command line, and for each of them, prints # the versions of the main tools