changeset 5066:3afb71c202b2

Fixed bug #945 The configure script was breaking the substitutions into multiple fragments, breaking them across the substitution for the build rules. This of course totally hosed the process. I switched to using a more modern usage of AC_OUTPUT and added a post-process step that appends the build rules to the Makefile.
author Sam Lantinga <slouken@libsdl.org>
date Fri, 21 Jan 2011 12:43:25 -0800
parents 7e4c7790700e
children 61d53410eb41
files Makefile.in configure.in
diffstat 2 files changed, 19 insertions(+), 9 deletions(-) [+]
line wrap: on
line diff
--- a/Makefile.in	Fri Jan 21 11:23:19 2011 -0800
+++ b/Makefile.in	Fri Jan 21 12:43:25 2011 -0800
@@ -115,11 +115,6 @@
 
 .PHONY: all update-revision install install-bin install-hdrs install-lib install-data uninstall uninstall-bin uninstall-hdrs uninstall-lib uninstall-data clean distclean dist $(OBJECTS:.lo=.d)
 
--include $(OBJECTS:.lo=.d)
-@DEPENDS@
-@VERSION_DEPENDS@
-@SDLMAIN_DEPENDS@
-
 $(objects)/$(TARGET): $(OBJECTS) $(VERSION_OBJECTS)
 	$(LIBTOOL) --mode=link $(CC) -o $@ $(OBJECTS) $(VERSION_OBJECTS) $(LDFLAGS) $(EXTRA_LDFLAGS) $(LT_LDFLAGS)
 
--- a/configure.in	Fri Jan 21 11:23:19 2011 -0800
+++ b/configure.in	Fri Jan 21 12:43:25 2011 -0800
@@ -2727,6 +2727,7 @@
 \\$(objects)/\\2.lo: \\1/\\2.$EXT\\\\
 	\\$(LIBTOOL) --mode=compile \\$(CC) \\$(CFLAGS) \\$(EXTRA_CFLAGS) $DEPENDENCY_TRACKING_OPTIONS -c \\$< -o \\$@,g"`
 done
+DEPENDS=`echo "$DEPENDS" | sed 's,\\$,\\\\$,g'`
 
 VERSION_OBJECTS=`echo $VERSION_SOURCES`
 VERSION_DEPENDS=`echo $VERSION_SOURCES`
@@ -2734,6 +2735,7 @@
 VERSION_DEPENDS=`echo "$VERSION_DEPENDS" | sed "s,\\([[^ ]]*\\)/\\([[^ ]]*\\)\\.rc,\\\\
 \\$(objects)/\\2.o: \\1/\\2.rc\\\\
 	\\$(WINDRES) \\$< \\$@,g"`
+VERSION_DEPENDS=`echo "$VERSION_DEPENDS" | sed 's,\\$,\\\\$,g'`
 
 SDLMAIN_OBJECTS=`echo $SDLMAIN_SOURCES`
 SDLMAIN_DEPENDS=`echo $SDLMAIN_SOURCES`
@@ -2741,6 +2743,7 @@
 SDLMAIN_DEPENDS=`echo "$SDLMAIN_DEPENDS" | sed "s,\\([[^ ]]*\\)/\\([[^ ]]*\\)\\.c,\\\\
 \\$(objects)/\\2.o: \\1/\\2.c\\\\
 	\\$(LIBTOOL) --mode=compile \\$(CC) \\$(CFLAGS) \\$(EXTRA_CFLAGS) $DEPENDENCY_TRACKING_OPTIONS -c \\$< -o \\$@,g"`
+SDLMAIN_DEPENDS=`echo "$SDLMAIN_DEPENDS" | sed 's,\\$,\\\\$,g'`
 
 # Set runtime shared library paths as needed
 
@@ -2793,17 +2796,29 @@
 AC_SUBST(ac_aux_dir)
 AC_SUBST(INCLUDE)
 AC_SUBST(OBJECTS)
-AC_SUBST(DEPENDS)
 AC_SUBST(VERSION_OBJECTS)
-AC_SUBST(VERSION_DEPENDS)
 AC_SUBST(SDLMAIN_OBJECTS)
-AC_SUBST(SDLMAIN_DEPENDS)
 AC_SUBST(BUILD_CFLAGS)
 AC_SUBST(EXTRA_CFLAGS)
 AC_SUBST(BUILD_LDFLAGS)
 AC_SUBST(EXTRA_LDFLAGS)
 AC_SUBST(WINDRES)
 
-AC_OUTPUT([
+AC_CONFIG_FILES([
     Makefile sdl-config SDL.spec sdl.pc
 ])
+AC_CONFIG_COMMANDS([default],
+                   [cat >>Makefile <<__EOF__
+
+# Build rules for objects
+-include \$(OBJECTS:.lo=.d)
+$DEPENDS
+$VERSION_DEPENDS
+$SDLMAIN_DEPENDS
+__EOF__ 
+], [
+DEPENDS="$DEPENDS"
+VERSION_DEPENDS="$VERSION_DEPENDS"
+SDLMAIN_DEPENDS="$SDLMAIN_DEPENDS"
+])
+AC_OUTPUT