libunwind-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Libunwind-devel] [PATCH 1/7] ppc32: ppc64: use AC_COMPILE_IFELSE to


From: Tommi Rantala
Subject: Re: [Libunwind-devel] [PATCH 1/7] ppc32: ppc64: use AC_COMPILE_IFELSE to test __powerpc64__ macro for ppc64
Date: Wed, 5 Sep 2012 09:24:23 +0300

2012/9/4 Cody P Schafer <address@hidden>:
> powerpc64 compilers on RHEL 6.3 (and my own built locally) do not
> default to 32bit. Actually check for the bit mode.
> ---
>  configure.in | 15 ++++++++-------
>  1 file changed, 8 insertions(+), 7 deletions(-)
>
> diff --git a/configure.in b/configure.in
> index 081ccee..917a2c9 100644
> --- a/configure.in
> +++ b/configure.in
> @@ -71,12 +71,7 @@ dnl Checks for library functions.
>  AC_FUNC_MEMCMP
>  AC_CHECK_FUNCS(dl_iterate_phdr dl_phdr_removals_counter dlmodinfo getunwind \
>                 ttrace mincore)
> -is_gcc_m64() {
> - if test `echo $CFLAGS | grep "\-m64" -c` -eq 1 ; then echo ppc64;
> - else
> -  if test `echo $CC | grep "\-m64" -c` -eq 1 ; then echo ppc64; else echo 
> ppc32; fi;
> - fi;
> -}
> +
>

Sorry for nitpicking, but do we want two empty lines here?

The patch looks otherwise good, grepping CFLAGS and CC was horrible.

>  is_gcc_altivec() {
>   if test `echo $CFLAGS | grep "\-maltivec" -c` -eq 1 ; then echo has_altivec;
> @@ -94,13 +89,19 @@ else
>    AC_MSG_RESULT([no])
>  fi
>
> +AC_COMPILE_IFELSE([AC_LANG_SOURCE([[
> +#ifndef __powerpc64__
> +# error choke
> +#endif
> +]])], [ppc_bits=64], [ppc_bits=32])
> +
>  get_arch() {
>   case "$1" in
>    arm*) echo arm;;
>    i?86) echo x86;;
>    hppa*) echo hppa;;
>    mips*) echo mips;;
> -  powerpc*) is_gcc_m64;;
> +  powerpc*) echo ppc$ppc_bits;;
>    amd64) echo x86_64;;
>    *) echo $1;;
>   esac
> --
> 1.7.11.3
>
>
> _______________________________________________
> Libunwind-devel mailing list
> address@hidden
> https://lists.nongnu.org/mailman/listinfo/libunwind-devel



reply via email to

[Prev in Thread] Current Thread [Next in Thread]