@@ -63,7 +63,12 @@ AC_CHECK_HEADERS(asm/ptrace_offsets.h asm/ptrace.h asm/vsyscall.h endian.h sys/e
6363 sys/types.h sys/procfs.h sys/ptrace.h sys/syscall.h byteswap.h elf.h \
6464 sys/elf.h link.h sys/link.h )
6565
66- CPPFLAGS="${CPPFLAGS} -D_GNU_SOURCE"
66+ dnl Set target-specific compile flags
67+ AS_CASE ( [ $target_os] ,
68+ [ *-gnu] , [ UNW_TARGET_CPPFLAGS="-D_GNU_SOURCE"] ,
69+ [ solaris*] , [ UNW_TARGET_CPPFLAGS="-D__EXTENSIONS__"]
70+ )
71+ AC_SUBST ( [ UNW_TARGET_CPPFLAGS] )
6772
6873AC_MSG_NOTICE ( [ --- Checking for available types ---] )
6974AC_CHECK_MEMBERS ( [ struct dl_phdr_info.dlpi_subs] ,,,[ #include <link.h>] )
@@ -385,12 +390,12 @@ AM_CONDITIONAL(USE_DWARF, [test x$use_dwarf = xyes])
385390AC_MSG_RESULT ( [ $use_dwarf] )
386391
387392AC_MSG_CHECKING ( [ whether to restrict build to remote support] )
388- if test x$target_arch != x$host_arch; then
389- CPPFLAGS="${CPPFLAGS} -DUNW_REMOTE_ONLY"
393+ AM_COND_IF( [ REMOTE_ONLY ] , [
394+ AC_SUBST ( [ UNW_REMOTE_CPPFLAGS ] , [ -DUNW_REMOTE_ONLY] )
390395 remote_only=yes
391- else
396+ ] , [
392397 remote_only=no
393- fi
398+ ] )
394399AC_MSG_RESULT ( [ $remote_only] )
395400
396401AC_MSG_CHECKING ( [ whether to load .debug_frame sections] )
@@ -480,14 +485,6 @@ if test x$GCC = xyes -a x$intel_compiler != xyes; then
480485fi
481486AC_MSG_RESULT ( [ $intel_compiler] )
482487
483- AC_MSG_CHECKING ( [ if building on Solaris then define __EXTENSIONS__ macro] )
484- if $OS_SOLARIS; then
485- CFLAGS="${CFLAGS} -D__EXTENSIONS__"
486- AC_MSG_RESULT ( [ yes] )
487- else
488- AC_MSG_RESULT ( [ no] )
489- fi
490-
491488AC_MSG_CHECKING ( [ for QCC compiler] )
492489AS_CASE ( [ $CC] , [ qcc*|QCC*] , [ qcc_compiler=yes] , [ qcc_compiler=no] )
493490AC_MSG_RESULT ( [ $qcc_compiler] )
0 commit comments