Skip to content

Commit be0b15d

Browse files
committed
Replace defining CPPFLAGS in configure.ac
Replaced defining the user variable CPPFLAGS in configure.ac with UNW_REMOTE_CPPFLAGS and UNW_TARGET_CPPFLAGS.
1 parent 6aa693e commit be0b15d

File tree

3 files changed

+18
-15
lines changed

3 files changed

+18
-15
lines changed

configure.ac

Lines changed: 10 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -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

6873
AC_MSG_NOTICE([--- Checking for available types ---])
6974
AC_CHECK_MEMBERS([struct dl_phdr_info.dlpi_subs],,,[#include <link.h>])
@@ -385,12 +390,12 @@ AM_CONDITIONAL(USE_DWARF, [test x$use_dwarf = xyes])
385390
AC_MSG_RESULT([$use_dwarf])
386391

387392
AC_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+
])
394399
AC_MSG_RESULT([$remote_only])
395400

396401
AC_MSG_CHECKING([whether to load .debug_frame sections])
@@ -480,14 +485,6 @@ if test x$GCC = xyes -a x$intel_compiler != xyes; then
480485
fi
481486
AC_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-
491488
AC_MSG_CHECKING([for QCC compiler])
492489
AS_CASE([$CC], [qcc*|QCC*], [qcc_compiler=yes], [qcc_compiler=no])
493490
AC_MSG_RESULT([$qcc_compiler])

src/Makefile.am

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1243,7 +1243,10 @@ libunwind_la_LDFLAGS = $(COMMON_SO_LDFLAGS) -XCClinker -nostdlib \
12431243
libunwind_la_LIBADD += -lc $(LIBCRTS)
12441244
libunwind_la_LIBADD += $(LIBLZMA) $(LIBZ)
12451245

1246-
AM_CPPFLAGS = $(UNW_DEBUG_CPPFLAGS) -I$(top_srcdir)/include -I$(top_srcdir)/include/tdep-$(arch) -I.
1246+
AM_CPPFLAGS = $(UNW_DEBUG_CPPFLAGS) \
1247+
$(UNW_REMOTE_CPPFLAGS) \
1248+
$(UNW_TARGET_CPPFLAGS) \
1249+
-I$(top_srcdir)/include -I$(top_srcdir)/include/tdep-$(arch) -I.
12471250
noinst_HEADERS += unwind/unwind-internal.h
12481251

12491252
EXTRA_DIST = $(libunwind_la_EXTRAS_ia64)

tests/Makefile.am

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,10 @@
2929
# Test binaries and scripts get installed here
3030
testdir = ${pkglibexecdir}
3131

32-
AM_CPPFLAGS = $(UNW_DEBUG_CPPFLAGS) -I$(top_srcdir)/include -I$(top_srcdir)/include/tdep-$(arch) -I$(top_srcdir)/src
32+
AM_CPPFLAGS = $(UNW_DEBUG_CPPFLAGS) \
33+
$(UNW_REMOTE_CPPFLAGS) \
34+
$(UNW_TARGET_CPPFLAGS) \
35+
-I$(top_srcdir)/include -I$(top_srcdir)/include/tdep-$(arch) -I$(top_srcdir)/src
3336
AM_CFLAGS = -fno-optimize-sibling-calls
3437

3538
LOG_DRIVER = $(SHELL) $(UNW_TESTDRIVER)

0 commit comments

Comments
 (0)