summaryrefslogtreecommitdiff
path: root/scripts
diff options
context:
space:
mode:
authorunknown <joerg@trift2.>2007-12-27 19:51:06 +0100
committerunknown <joerg@trift2.>2007-12-27 19:51:06 +0100
commit07aab86f5f1e25d25b1df2f43264048da86b509e (patch)
tree10b5e53f86ff852e9558d191f42cf7b909e1b5c7 /scripts
parent618cb7a81890f090b96461506571c1d17bb3db88 (diff)
downloadmariadb-git-07aab86f5f1e25d25b1df2f43264048da86b509e.tar.gz
scripts/make_binary_distribution.sh:
Fix the code to get the "libgcc" file name so that the failure of Intel's ICC to provide this information does not cause any problems. This fixes bug#33536 Option "--print-libgcc-file" does not work with ICC compiler scripts/make_binary_distribution.sh: The (old) code to get the "libgcc" file name does not really work when using Intel's ICC. ICC accepts the "--print-libgcc-file" option but ignores it, does not produce any output. However, ICC tricks automake into taking it for a GCC ("GXX" variable is set, see http://www.gnu.org/software/autoconf/manual/html_node/C_002b_002b-Compiler.html#C_002b_002b-Compiler and its discussion of the "AC_PROG_CXX" macro). There are two possible approaches: a) Check "$CC" or "$CXX" to tell ICC from GCC, and do not ask ICC for the "libgcc" file name. b) Just ask it, but protect that code so that its failure does not cause any damage. This patch takes the second route: 1) Put the call "@CC@ ... --print-libgcc-file" into a pipeline, followed by "|| true", so that (for the shell semantics) the command cannot fail. (ICC will exit non-zero because it is not given a source file.) 2) Explicitly redirect any error messages. 3) Do not use the compiler's return code but rather the (non)empty variable to check success. 4) Ensure that the contents really is a file before taking it as a file name. Item 1) is especially important when the tool gets a "set -e" (this happens in 5.1, currently) which would make the failing compiler call a fatal thing. This fixes bug#33536 Option "--print-libgcc-file" does not work with ICC compiler
Diffstat (limited to 'scripts')
-rw-r--r--scripts/make_binary_distribution.sh10
1 files changed, 6 insertions, 4 deletions
diff --git a/scripts/make_binary_distribution.sh b/scripts/make_binary_distribution.sh
index 917ac0a19c1..24a99df2248 100644
--- a/scripts/make_binary_distribution.sh
+++ b/scripts/make_binary_distribution.sh
@@ -322,11 +322,13 @@ BASE=$BASE2
#
if [ x"@GXX@" = x"yes" ] ; then
- gcclib=`@CC@ @CFLAGS@ --print-libgcc-file`
- if [ $? -ne 0 ] ; then
- echo "Warning: Couldn't find libgcc.a!"
- else
+ gcclib=`@CC@ @CFLAGS@ --print-libgcc-file 2>/dev/null` || true
+ if [ -z "$gcclib" ] ; then
+ echo "Warning: Compiler doesn't tell libgcc.a!"
+ elif [ -f "$gcclib" ] ; then
$CP $gcclib $BASE/lib/libmygcc.a
+ else
+ echo "Warning: Compiler result '$gcclib' not found / no file!"
fi
fi