Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
View | Details | Raw Unified | Return to bug 26390 | Differences between
and this patch

Collapse All | Expand All

(-)flag-o-matic.eclass (-1 / +24 lines)
Lines 33-39 Link Here
33
# Sets mcpu to v8 and uses the original value
33
# Sets mcpu to v8 and uses the original value
34
# as mtune if none specified.
34
# as mtune if none specified.
35
#
35
#
36
36
#### strip-unsupported-flags ####
37
# Strip C[XX]FLAGS of any flags not supported by
38
# installed version of gcc
37
39
38
# C[XX]FLAGS that we allow in strip-flags
40
# C[XX]FLAGS that we allow in strip-flags
39
ALLOWED_FLAGS="-O -O1 -O2 -mcpu -march -mtune -fstack-protector -pipe -g"
41
ALLOWED_FLAGS="-O -O1 -O2 -mcpu -march -mtune -fstack-protector -pipe -g"
Lines 187-189 Link Here
187
		done
189
		done
188
	fi
190
	fi
189
}
191
}
192
193
test_flag () {
194
        if gcc -S -xc $1 -o /dev/null /dev/null >/dev/null 2>&1; then
195
                echo "$1"
196
        fi
197
}
198
199
strip-unsupported-flags() {
200
        for x in ${CFLAGS}
201
        do
202
                NEW_CFLAGS=${NEW_CFLAGS}" ""`test_flag ${x}`"
203
        done
204
205
        for x in ${CXXFLAGS}
206
        do
207
                NEW_CXXFLAGS=${NEW_CXXFLAGS}" ""`test_flag ${x}`"
208
        done
209
210
        CFLAGS="${NEW_CFLAGS}"
211
        CXXFLAGS="${NEW_CXXFLAGS}"
212
}

Return to bug 26390