Thanks, Jens, this helped me come up with a short pattern for flag
availability detection, which I've now committed in r34280.
On Wed, Nov 19, 2008 at 05:27, Jens Seidel <jensseidel_at_users.sf.net> wrote:
> On Tue, Nov 18, 2008 at 10:19:11PM -0800, Greg Stein wrote:
>> Okay. Seems like I'll need to add some extra work to detect versions
>> of GCC and add different flags based on that. I'll scrounge around the
>> autoconf pages to see if there is an easy mechanism for that.
>
> I had this problem in the past too and tried to parse g++ --version. This
> failed on various distributions because of vendor strings (e.g. Debian)
> in the output.
>
> I solved it by using:
> if test x$GXX = xyes; then
> AC_LANG_PUSH(C++)
> # Use -Wextra or the older -W ?
> CXXFLAGSold="$CXXFLAGS"
> CXXFLAGS="-Wextra $CXXFLAGS"
> AC_COMPILE_IFELSE([AC_LANG_SOURCE([[]])],,
> [CXXFLAGS="-W $CXXFLAGSold"
> AC_COMPILE_IFELSE([AC_LANG_SOURCE([[]])],,CXXFLAGS="$CXXFLAGSold")])
> fi
>
> So I just tested whether an empty file can be compiled and changed the compiler
> flags if not.
>
> Jens
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: dev-unsubscribe_at_subversion.tigris.org
> For additional commands, e-mail: dev-help_at_subversion.tigris.org
>
>
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe_at_subversion.tigris.org
For additional commands, e-mail: dev-help_at_subversion.tigris.org
Received on 2008-11-20 08:28:31 CET