aboutsummaryrefslogtreecommitdiffstats
path: root/scripts/gcc-version.sh
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@woody.linux-foundation.org>2007-07-19 17:28:19 -0400
committerLinus Torvalds <torvalds@woody.linux-foundation.org>2007-07-19 17:28:19 -0400
commitefffbeee5bc4168059683714b300d307f5193d69 (patch)
tree7fde51080f4534a86bfa27a430aaf7ef2bb8ef92 /scripts/gcc-version.sh
parent40b42f1ebf653cd72c32eb1a1a0b9fea2dfbfd7d (diff)
parentb824325443bb010689d22262c6a4e0feb63bad56 (diff)
Merge git://git.kernel.org/pub/scm/linux/kernel/git/sam/kbuild
* git://git.kernel.org/pub/scm/linux/kernel/git/sam/kbuild: (33 commits) xtensa: use DATA_DATA in xtensa powerpc: add missing DATA_DATA to powerpc cris: use DATA_DATA in cris kallsyms: remove usage of memmem and _GNU_SOURCE from scripts/kallsyms.c kbuild: use -fno-optimize-sibling-calls unconditionally kconfig: reset generated values only if Kconfig and .config agree. kbuild: fix the warning when running make tags kconfig: strip 'CONFIG_' automatically in kernel configuration search kbuild: use POSIX BRE in headers install target Whitelist references from __dbe_table to .init modpost white list pattern adjustment kbuild: do section mismatch check on full vmlinux kbuild: whitelist references from variables named _timer to .init.text kbuild: remove hardcoded _logo names from modpost kbuild: remove hardcoded apic_es7000 from modpost kbuild: warn about references from .init.text to .exit.text kbuild: consolidate section checks kbuild: refactor code in modpost to improve maintainability kbuild: ignore section mismatch warnings originating from .note section kbuild: .paravirtprobe section is obsolete, so modpost doesn't need to handle it ...
Diffstat (limited to 'scripts/gcc-version.sh')
-rw-r--r--scripts/gcc-version.sh15
1 files changed, 12 insertions, 3 deletions
diff --git a/scripts/gcc-version.sh b/scripts/gcc-version.sh
index bb4fbeab8320..8a1d1879c7ad 100644
--- a/scripts/gcc-version.sh
+++ b/scripts/gcc-version.sh
@@ -1,14 +1,23 @@
1#!/bin/sh 1#!/bin/sh
2# 2#
3# gcc-version gcc-command 3# gcc-version [-p] gcc-command
4# 4#
5# Prints the gcc version of `gcc-command' in a canonical 4-digit form 5# Prints the gcc version of `gcc-command' in a canonical 4-digit form
6# such as `0295' for gcc-2.95, `0303' for gcc-3.3, etc. 6# such as `0295' for gcc-2.95, `0303' for gcc-3.3, etc.
7# 7#
8# With the -p option, prints the patchlevel as well, for example `029503' for
9# gcc-2.95.3, `030301' for gcc-3.3.1, etc.
10#
11
12if [ $1 = "-p" ] ; then with_patchlevel=1; shift; fi
8 13
9compiler="$*" 14compiler="$*"
10 15
11MAJOR=$(echo __GNUC__ | $compiler -E -xc - | tail -n 1) 16MAJOR=$(echo __GNUC__ | $compiler -E -xc - | tail -n 1)
12MINOR=$(echo __GNUC_MINOR__ | $compiler -E -xc - | tail -n 1) 17MINOR=$(echo __GNUC_MINOR__ | $compiler -E -xc - | tail -n 1)
13printf "%02d%02d\\n" $MAJOR $MINOR 18if [ "x$with_patchlevel" != "x" ] ; then
14 19 PATCHLEVEL=$(echo __GNUC_PATCHLEVEL__ | $compiler -E -xc - | tail -n 1)
20 printf "%02d%02d%02d\\n" $MAJOR $MINOR $PATCHLEVEL
21else
22 printf "%02d%02d\\n" $MAJOR $MINOR
23fi