use autoconf symbolic linking
authorPaolo Bonzini <pbonzini@redhat.com>
Mon, 1 Mar 2010 18:50:32 +0000 (13:50 -0500)
committerMathieu Desnoyers <mathieu.desnoyers@polymtl.ca>
Mon, 1 Mar 2010 18:50:32 +0000 (13:50 -0500)
Instead of copying.  This is less error-prone while developing and
lets Automake handle more stuff.

Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
Makefile.am
configure.ac
tests/Makefile.am

index 33c7b538b773c536c030931a70ad571d4aba8cfd..2d6c65bc0f0e2a46a0a878063cd2e009362f47f5 100644 (file)
@@ -38,16 +38,3 @@ liburcu_signal_la_CFLAGS = -DRCU_SIGNAL
 liburcu_bp_la_SOURCES = urcu-bp.c urcu-pointer.c $(COMPAT)
 
 liburcu_defer_la_SOURCES = urcu-defer.c $(COMPAT)
-
-$(top_srcdir)/*.h $(top_srcdir)/*.c: urcu/arch.h urcu/uatomic_arch.h
-
-urcu/arch.h: $(top_srcdir)/urcu/arch_@ARCHTYPE@.h
-       $(mkdir_p) $(top_builddir)/urcu
-       cp -f $(top_srcdir)/urcu/arch_@ARCHTYPE@.h $(top_builddir)/urcu/arch.h
-
-urcu/uatomic_arch.h: $(top_srcdir)/urcu/uatomic_arch_@ARCHTYPE@.h
-       $(mkdir_p) $(top_builddir)/urcu
-       cp -f $(top_srcdir)/urcu/uatomic_arch_@ARCHTYPE@.h $(top_builddir)/urcu/uatomic_arch.h
-
-clean-local:
-       rm -f urcu/arch.h urcu/uatomic_arch.h
index c7978318337f9e9637470fb40607d8622e7dc5ba..ab6f3a2920f5a5d25676d30728c0da2f67b8b501 100644 (file)
@@ -56,6 +56,14 @@ esac
 if test "$ARCHTYPE" = "unknown"; then
        AC_MSG_ERROR([Unable to detect the architecture.])
 fi
+UATOMICSRC=urcu/uatomic_arch_$ARCHTYPE.h
+ARCHSRC=urcu/arch_$ARCHTYPE.h
+if test "x$ARCHTYPE" != xx86 -a "x$ARCHTYPE" != xppc; then
+       APISRC=tests/api_gcc.h
+else
+       APISRC=tests/api_$ARCHTYPE.h
+fi
+
 AC_SUBST(ARCHTYPE)
 AC_SUBST(SUBARCHTYPE)
 
@@ -95,8 +103,6 @@ AC_TRY_COMPILE(
 
 AM_CONDITIONAL([COMPAT_FUTEX], [ test "x$compat_futex_test" = "x1" ])
 
-AM_CONDITIONAL([GCC_API], [test "x$ARCHTYPE" != xx86 -a "x$ARCHTYPE" != xppc])
-
 AM_CONDITIONAL([COMPAT_ARCH], [test "x$SUBARCHTYPE" = xx86compat ])
 
 [
@@ -204,6 +210,11 @@ AC_CHECK_FUNCS(
 
 CFLAGS=$saved_CFLAGS
 
+AC_CONFIG_LINKS([
+       urcu/arch.h:$ARCHSRC
+       urcu/uatomic_arch.h:$UATOMICSRC
+       tests/api.h:$APISRC
+])
 AC_CONFIG_FILES([
        Makefile
        tests/Makefile
index 02e0583c08c3a8f3be1d9081a1fabe390d894ac6..17b89db7bd9fa94754e8fcff8efd8c580e291aa6 100644 (file)
@@ -40,12 +40,6 @@ URCU_MB_LIB=$(top_builddir)/liburcu-mb.la
 URCU_SIGNAL_LIB=$(top_builddir)/liburcu-signal.la
 URCU_BP_LIB=$(top_builddir)/liburcu-bp.la
 
-if GCC_API
-APIHEADER=api_gcc.h
-else
-APIHEADER=api_@ARCHTYPE@.h
-endif
-
 EXTRA_DIST = $(top_srcdir)/tests/api_*.h
 
 
@@ -156,9 +150,3 @@ test_urcu_bp_dynamic_link_SOURCES = test_urcu_bp.c $(URCU_BP)
 test_urcu_bp_dynamic_link_CFLAGS = -DDYNAMIC_LINK_TEST $(AM_CFLAGS)
 
 urcutorture.c: api.h
-
-api.h: $(APIHEADER)
-       cp -f $(srcdir)/$(APIHEADER) api.h
-
-clean-local:
-       rm -f api.h
This page took 0.026599 seconds and 4 git commands to generate.