[AC_MSG_ERROR([The compiler does not support __attribute__ extensions])])
AX_PTHREAD(,[AC_MSG_ERROR([Could not configure pthreads support])])
-LIBS="$PTHREAD_LIBS $LIBS"
-CFLAGS="$CFLAGS $PTHREAD_CFLAGS"
-CC="$PTHREAD_CC"
# Checks for library functions.
AC_FUNC_MMAP
])
AS_IF([test "$host_cpu" = "armv7l"],[
- CFLAGS="$CFLAGS -mcpu=cortex-a9 -mtune=cortex-a9 -O1"
+ AM_CFLAGS="$AM_CFLAGS -mcpu=cortex-a9 -mtune=cortex-a9 -O1"
])
# ARM-specific checks
])
])
-DEFAULT_INCLUDES="-include config.h"
-AC_SUBST(DEFAULT_INCLUDES)
+AM_CPPFLAGS="-include config.h"
+AC_SUBST(AM_CPPFLAGS)
+
+AC_SUBST(AM_CFLAGS)
AC_CONFIG_LINKS([
include/urcu/arch.h:$ARCHSRC
echo "Examples: relative top_builddir path $(top_builddir)"; \
rel_build_subdir="../"; \
fi; \
- $(MAKE) -f dist-files/Makefile AM_CC="$(CC)" AM_CPPFLAGS="$(CPPFLAGS) -I$$rel_src_subdir/$(top_srcdir)/include/ -I$$rel_src_subdir/$(top_srcdir)/src/ -I$$rel_build_subdir$(top_builddir)/include/ -I$$rel_build_subdir$(top_builddir)/include/src/" AM_CFLAGS='$(CFLAGS)' AM_LDFLAGS='$(LDFLAGS) -L../../../src/.libs/ -Wl,-rpath "$(PWD)/../../src/.libs/"' $(AM_MAKEFLAGS) all;
+ $(MAKE) -f dist-files/Makefile CC="$(CC)" CPPFLAGS="$(CPPLAGS)" AM_CPPFLAGS="$(AM_CPPFLAGS) -I"$${rel_src_subdir}/$(top_srcdir)/include/" -I"$${rel_src_subdir}/$(top_srcdir)/src/" -I"$${rel_build_subdir}$(top_builddir)/include/" -I"$${rel_build_subdir}$(top_builddir)/include/src/"" CFLAGS="$(CFLAGS)" AM_CFLAGS="$(AM_CFLAGS) $(PTHREAD_CFLAGS)" LDFLAGS="$(LDFLAGS)" AM_LDFLAGS="$(AM_LDFLAGS) -L../../../src/.libs/ -Wl,-rpath "$(PWD)/../../src/.libs/"" $(AM_MAKEFLAGS) all;
clean-local:
@$(MAKE) -f dist-files/Makefile $(AM_MAKEFLAGS) clean; \
#
# This makefile is purposefully kept simple to support GNU and BSD make.
-ifdef AM_CC
-CC = $(AM_CC)
-endif
-CFLAGS = -g -O2 -Wall
+LOCAL_CFLAGS := -g -O2 -Wall
all: $(BINARY)
$(BINARY): $(OBJECTS)
- $(CC) $(CFLAGS) $(LDFLAGS) $(AM_CFLAGS) $(AM_LDFLAGS) \
+ $(CC) $(LOCAL_CFLAGS) $(AM_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) $(LDFLAGS) \
-o $@ $(OBJECTS) $(LIBS)
$(OBJECTS): $(SOURCES) $(DEPS)
- $(CC) $(CPPFLAGS) $(CFLAGS) $(AM_CPPFLAGS) $(AM_CFLAGS) \
+ $(CC) $(LOCAL_CFLAGS) $(AM_CFLAGS) $(CFLAGS) $(AM_CPPFLAGS) $(CPPFLAGS) \
-c -o $@ $(SOURCES)
.PHONY: clean
-AM_CPPFLAGS = -I$(top_srcdir)/include -I$(top_builddir)/include -I$(top_srcdir)/src
+AM_CPPFLAGS += -I$(top_srcdir)/include -I$(top_builddir)/include -I$(top_srcdir)/src
#Add the -version-info directly here since we are only building
# library that use the version-info
if USE_CYGWIN
AM_LDFLAGS+=-no-undefined
endif
-AM_CFLAGS=-Wall
+AM_CFLAGS+=-Wall
include_HEADERS = urcu.h urcu-bp.h urcu-call-rcu.h urcu-defer.h \
urcu-pointer.h urcu-qsbr.h urcu-flavor.h
liburcu_qsbr_la_LIBADD = liburcu-common.la
liburcu_mb_la_SOURCES = urcu.c urcu-pointer.c $(COMPAT)
-liburcu_mb_la_CFLAGS = -DRCU_MB
+liburcu_mb_la_CFLAGS = -DRCU_MB $(AM_CFLAGS)
liburcu_mb_la_LIBADD = liburcu-common.la
liburcu_signal_la_SOURCES = urcu.c urcu-pointer.c $(COMPAT)
-liburcu_signal_la_CFLAGS = -DRCU_SIGNAL
+liburcu_signal_la_CFLAGS = -DRCU_SIGNAL $(AM_CFLAGS)
liburcu_signal_la_LIBADD = liburcu-common.la
liburcu_bp_la_SOURCES = urcu-bp.c urcu-pointer.c $(COMPAT)
-AM_CFLAGS = -I$(top_srcdir)/include -I$(top_builddir)/include -I$(top_srcdir)/src -I$(top_srcdir)/tests/common -g
+AM_CFLAGS += $(PTHREAD_CFLAGS) -I$(top_srcdir)/include -I$(top_builddir)/include -I$(top_srcdir)/src -I$(top_srcdir)/tests/common -g
SCRIPT_LIST = common.sh \
run.sh \
-AM_CPPFLAGS = -I$(top_srcdir)/include -I$(top_builddir)/include -I$(top_srcdir)/src
+AM_CPPFLAGS += -I$(top_srcdir)/include -I$(top_builddir)/include -I$(top_srcdir)/src
noinst_HEADERS = cpuset.h thread-id.h
-AM_CFLAGS = -I$(top_srcdir)/include -I$(top_builddir)/include -I$(top_srcdir)/src -I$(top_srcdir)/tests/utils -I$(top_srcdir)/tests/common -g
+AM_CFLAGS += $(PTHREAD_CFLAGS) -I$(top_srcdir)/include -I$(top_builddir)/include -I$(top_srcdir)/src -I$(top_srcdir)/tests/utils -I$(top_srcdir)/tests/common -g
SCRIPT_LIST = run.sh
-AM_CFLAGS = -I$(top_srcdir)/include -I$(top_builddir)/include -I$(top_srcdir)/src -I$(top_srcdir)/tests/utils -I$(top_srcdir)/tests/common -g
+AM_CFLAGS += $(PTHREAD_CFLAGS) -I$(top_srcdir)/include -I$(top_builddir)/include -I$(top_srcdir)/src -I$(top_srcdir)/tests/utils -I$(top_srcdir)/tests/common -g
SCRIPT_LIST = test_loop run.sh unit_tests
-AM_CFLAGS = -I$(top_srcdir)/include -I$(top_builddir)/include -I$(top_srcdir)/src
+AM_CFLAGS += -I$(top_srcdir)/include -I$(top_builddir)/include -I$(top_srcdir)/src
noinst_LIBRARIES = libtap.a
libtap_a_SOURCES = tap.c tap.h