From f44f8124e0466dd9a18defe34159eb342ccfde1f Mon Sep 17 00:00:00 2001 From: Joshua Neuheisel Date: Sun, 8 Dec 2013 17:43:22 -0500 Subject: [PATCH] build: hide dtrace rules unless needed When using configure, there are situations where libuv will attempt to build uv-dtrace.h, even if it is configured with --disable-dtrace. For example, if libuv is first configured with dtrace enabled, then built, the .deps files will contain references to include/uv-dtrace.h. After a make clean and configure --disable-dtrace, the build will still attempt to create include/uv-dtrace.h and fail. make will see the dependency reference (which survives the make clean), use the rule (which is always added to the Makefile), and fail since DTRACE is not defined. This commit protects the rules to make uv-dtrace.h with the proper conditionals to ensure the rules are not written if --disable-dtrace is chosen. Fix #963. --- Makefile.am | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/Makefile.am b/Makefile.am index 40c5ed18..61e2f201 100644 --- a/Makefile.am +++ b/Makefile.am @@ -272,10 +272,13 @@ pkgconfigdir = $(libdir)/pkgconfig pkgconfig_DATA = @PACKAGE_NAME@.pc endif -SUFFIXES = .d - +if HAVE_DTRACE include/uv-dtrace.h: src/unix/uv-dtrace.d $(AM_V_GEN)$(DTRACE) $(DTRACEFLAGS) -h -xnolibs -s $< -o $(top_srcdir)/$@ +endif + +if DTRACE_NEEDS_OBJECTS +SUFFIXES = .d src/unix/uv-dtrace.o: src/unix/uv-dtrace.d ${libuv_la_OBJECTS} @@ -291,3 +294,4 @@ src/unix/uv-dtrace.o: src/unix/uv-dtrace.d ${libuv_la_OBJECTS} "pic_object='uv-dtrace.o'" \ "non_pic_object='uv-dtrace.o'" \ > ${top_builddir}/uv-dtrace.lo +endif