Skip to content

Commit

Permalink
Replace clobber of CFLAGS in configure.ac
Browse files Browse the repository at this point in the history
Replaced the clobbering of the user variable CFLAGS in configure.ac with
UNW_EXTRA_CFLAGS.
  • Loading branch information
bregma committed Apr 19, 2024
1 parent be0b15d commit 8428e1f
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 11 deletions.
16 changes: 10 additions & 6 deletions configure.ac
Original file line number Diff line number Diff line change
Expand Up @@ -476,14 +476,18 @@ AC_SUBST([LIBZ])
AM_CONDITIONAL(HAVE_ZLIB, test x$enable_zlibdebuginfo = xyes)

AC_MSG_CHECKING([for Intel compiler])
AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[]], [[#ifndef __INTEL_COMPILER
#error choke me
#endif]])],[intel_compiler=yes],[intel_compiler=no])

AC_COMPILE_IFELSE([AC_LANG_PROGRAM(
[],
[#ifndef __INTEL_COMPILER
#error choke me
#endif
])],
[intel_compiler=yes],
[intel_compiler=no])
AC_MSG_RESULT([$intel_compiler])
if test x$GCC = xyes -a x$intel_compiler != xyes; then
CFLAGS="${CFLAGS} -fexceptions -Wall -Wsign-compare"
AC_SUBST([UNW_EXTRA_CFLAGS],["-fexceptions -Wall -Wsign-compare"])
fi
AC_MSG_RESULT([$intel_compiler])

AC_MSG_CHECKING([for QCC compiler])
AS_CASE([$CC], [qcc*|QCC*], [qcc_compiler=yes], [qcc_compiler=no])
Expand Down
10 changes: 6 additions & 4 deletions src/Makefile.am
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,12 @@ SOVERSION=9:0:1 # See comments at end of file.
SETJMP_SO_VERSION=0:0:0
COREDUMP_SO_VERSION=0:0:0

AM_CPPFLAGS = $(UNW_DEBUG_CPPFLAGS) \
$(UNW_REMOTE_CPPFLAGS) \
$(UNW_TARGET_CPPFLAGS) \
-I$(top_srcdir)/include -I$(top_srcdir)/include/tdep-$(arch) -I.
AM_CFLAGS = $(UNW_EXTRA_CFLAGS)

#
# Don't link with start-files since we don't use any constructors/destructors:
#
Expand Down Expand Up @@ -1243,10 +1249,6 @@ libunwind_la_LDFLAGS = $(COMMON_SO_LDFLAGS) -XCClinker -nostdlib \
libunwind_la_LIBADD += -lc $(LIBCRTS)
libunwind_la_LIBADD += $(LIBLZMA) $(LIBZ)

AM_CPPFLAGS = $(UNW_DEBUG_CPPFLAGS) \
$(UNW_REMOTE_CPPFLAGS) \
$(UNW_TARGET_CPPFLAGS) \
-I$(top_srcdir)/include -I$(top_srcdir)/include/tdep-$(arch) -I.
noinst_HEADERS += unwind/unwind-internal.h

EXTRA_DIST = $(libunwind_la_EXTRAS_ia64)
Expand Down
2 changes: 1 addition & 1 deletion tests/Makefile.am
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ AM_CPPFLAGS = $(UNW_DEBUG_CPPFLAGS) \
$(UNW_REMOTE_CPPFLAGS) \
$(UNW_TARGET_CPPFLAGS) \
-I$(top_srcdir)/include -I$(top_srcdir)/include/tdep-$(arch) -I$(top_srcdir)/src
AM_CFLAGS = -fno-optimize-sibling-calls
AM_CFLAGS = $(UNW_EXTRA_CFLAGS) -fno-optimize-sibling-calls

LOG_DRIVER = $(SHELL) $(UNW_TESTDRIVER)

Expand Down

0 comments on commit 8428e1f

Please sign in to comment.