[Olsr-cvs] olsrd-current ld-warnings,NONE,1.1

Bernd Petrovitsch (spam-protected)
Thu Dec 6 21:10:21 CET 2007


Update of /cvsroot/olsrd/olsrd-current
In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv27948

Added Files:
	ld-warnings 
Log Message:
* similar to gcc-warnings but for linker options

--- NEW FILE: ld-warnings ---
#!/bin/sh
#
# We expect warning options for gcc as arguments and return the ones which are
# accepted by the given gcc.
#
# $Id: ld-warnings,v 1.1 2007/12/06 20:10:19 bernd67 Exp $

set -ue
#set -vx

# make sure we do not use some locale ....
export LANG=C LC_ALL=C LC_COLLATE=C LC_CTYPE=C LC_MESSAGES=C LC_NUMERIC=C

OPTS=""
for param; do
    case "$param" in
    -[fWm]?*) OPTS="$OPTS $param";;
    *)        echo "Ignoring $param" >&2
    esac
done

testcompile() {
    $CC $OPTS -x c - 2>&1 <<- EOF
       int main(void) {
           return 0;
       }
EOF
}

parsetest() {
    while read error; do 
        case "$error" in
        *ld:\ unrecognized\ *option\ \'*)
            opt="${error#*\'}"
            opt="${opt%\'*}"
            OPTS="${OPTS//-Wl,$opt}"
            ;;
       esac
    done
    echo $OPTS
}

testcompile | parsetest

exit 0





More information about the Olsr-cvs mailing list