>> +# @FUNCTION: tc-enables-pie >> +# @RETURN: Truth if the current compiler generates position-independent code (PIC) which can be linked into executables >> +# @DESCRIPTION: >> +# Return truth if the current compiler generates position-independent code (PIC) >> +# which can be linked into executables. >> +tc-enables-pie() { >> + $($(tc-getCC) ${CPPFLAGS} ${CFLAGS} -E -P - <<-EOF 2> /dev/null >> + #if defined(__PIE__) >> + true >> + #else >> + false >> + #endif >> + EOF >> + ) > > Looks quite horrible. Why can't you just compare the output against > a value instead of randomly executing it? Because we have to execute the compiler anyway and this is the quickest way of getting the answer we need. Further, piping an unfiltered output (e.g. -E -dM -x c) through grep is by no means prettier. Best, Matthias