open-src/util/util-macros/Makefile
changeset 963 7a4fced80e83
parent 962 c323b15ad103
child 970 272328fe1b4a
--- a/open-src/util/util-macros/Makefile	Fri Jun 11 06:38:19 2010 -0700
+++ b/open-src/util/util-macros/Makefile	Fri Jun 18 08:41:15 2010 -0700
@@ -61,10 +61,17 @@
 # Libtool versions before 2.2.2 fail to work with LD=cc in 64 bit builds, 
 # so install fixed libtool m4 macros here as well, so that modules that
 # run autoreconf get the fixed sources
-install_libtool_fix:
-	mkdir -p $(PROTODIR)$(X11_ACLOCAL_DIR)/
-	-rm -f $(PROTODIR)$(X11_ACLOCAL_DIR)/libtool.m4
+install_libtool_fix: $(TOOLS_ACLOCAL_DIR)/libtool.m4
+
+$(TOOLS_ACLOCAL_DIR)/libtool.m4: $(TOOLS_ACLOCAL_DIR) libtool-64.patch
+	-rm -f $(TOOLS_ACLOCAL_DIR)/libtool.m4
 	SYSTEM_ACLOCAL_DIR=$$($(ACLOCAL_PATH) --print-ac-dir) ; \
 	cp $${SYSTEM_ACLOCAL_DIR}/libtool.m4 \
-		$(PROTODIR)$(X11_ACLOCAL_DIR)/libtool.m4
-	gpatch -d $(PROTODIR)$(X11_ACLOCAL_DIR) < libtool-64.patch
+		$(TOOLS_ACLOCAL_DIR)/libtool.m4
+	gpatch -d $(TOOLS_ACLOCAL_DIR) < libtool-64.patch
+
+# autoreconf fails if the aclocal include directories don't exist yet
+$(AUTOCONF_TARGET): $(TOOLS_ACLOCAL_DIR) $(PROTODIR)$(X11_ACLOCAL_DIR)
+
+$(TOOLS_ACLOCAL_DIR) $(PROTODIR)$(X11_ACLOCAL_DIR):
+	mkdir -p $@