From f991935ec67e4425d3be03b935e0ceb29cf5f88d Mon Sep 17 00:00:00 2001 From: "Dr. Werner Fink" Date: Thu, 24 Jun 2010 10:48:50 +0000 Subject: [PATCH] . OBS-URL: https://build.opensuse.org/package/show/Base:System/bash?expand=0&rev=40 --- bash.spec | 26 +++++++++++++++++++++----- 1 file changed, 21 insertions(+), 5 deletions(-) diff --git a/bash.spec b/bash.spec index 70b6fd84..b21bae1c 100644 --- a/bash.spec +++ b/bash.spec @@ -347,13 +347,29 @@ cd ../readline-%{rl_vers} cflags () { local flag=$1; shift - case "${RPM_OPT_FLAGS}" in + local var=$1; shift + test -n "${flag}" -a -n "${var}" || return + case "${!var}" in *${flag}*) return esac - if test -n "$1" && gcc -Werror $flag -S -o /dev/null -xc /dev/null > /dev/null 2>&1 ; then - local var=$1; shift - eval $var=\${$var:+\$$var\ }$flag - fi + case "$flag" in + -Wl,*) + set -o noclobber + echo 'int main () { return 0; }' > ldtest.c + if ${CC:-gcc} -Werror $flag -o /dev/null -xc ldtest.c > /dev/null 2>&1 ; then + eval $var=\${$var:+\$$var\ }$flag + fi + set +o noclobber + rm -f ldtest.c + ;; + *) + if ${CC:-gcc} -Werror $flag -S -o /dev/null -xc /dev/null > /dev/null 2>&1 ; then + eval $var=\${$var:+\$$var\ }$flag + fi + if ${CXX:-g++} -Werror $flag -S -o /dev/null -xc++ /dev/null > /dev/null 2>&1 ; then + eval $var=\${$var:+\$$var\ }$flag + fi + esac } echo 'int main () { return !(sizeof(void*) >= 8); }' | gcc -x c -o test64 - if ./test64 ; then