Fixed bug #945
authorSam Lantinga <slouken@libsdl.org>
Fri, 21 Jan 2011 12:43:25 -0800
changeset 50663afb71c202b2
parent 5065 7e4c7790700e
child 5067 61d53410eb41
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.
Makefile.in
configure.in
     1.1 --- a/Makefile.in	Fri Jan 21 11:23:19 2011 -0800
     1.2 +++ b/Makefile.in	Fri Jan 21 12:43:25 2011 -0800
     1.3 @@ -115,11 +115,6 @@
     1.4  
     1.5  .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)
     1.6  
     1.7 --include $(OBJECTS:.lo=.d)
     1.8 -@DEPENDS@
     1.9 -@VERSION_DEPENDS@
    1.10 -@SDLMAIN_DEPENDS@
    1.11 -
    1.12  $(objects)/$(TARGET): $(OBJECTS) $(VERSION_OBJECTS)
    1.13  	$(LIBTOOL) --mode=link $(CC) -o $@ $(OBJECTS) $(VERSION_OBJECTS) $(LDFLAGS) $(EXTRA_LDFLAGS) $(LT_LDFLAGS)
    1.14  
     2.1 --- a/configure.in	Fri Jan 21 11:23:19 2011 -0800
     2.2 +++ b/configure.in	Fri Jan 21 12:43:25 2011 -0800
     2.3 @@ -2727,6 +2727,7 @@
     2.4  \\$(objects)/\\2.lo: \\1/\\2.$EXT\\\\
     2.5  	\\$(LIBTOOL) --mode=compile \\$(CC) \\$(CFLAGS) \\$(EXTRA_CFLAGS) $DEPENDENCY_TRACKING_OPTIONS -c \\$< -o \\$@,g"`
     2.6  done
     2.7 +DEPENDS=`echo "$DEPENDS" | sed 's,\\$,\\\\$,g'`
     2.8  
     2.9  VERSION_OBJECTS=`echo $VERSION_SOURCES`
    2.10  VERSION_DEPENDS=`echo $VERSION_SOURCES`
    2.11 @@ -2734,6 +2735,7 @@
    2.12  VERSION_DEPENDS=`echo "$VERSION_DEPENDS" | sed "s,\\([[^ ]]*\\)/\\([[^ ]]*\\)\\.rc,\\\\
    2.13  \\$(objects)/\\2.o: \\1/\\2.rc\\\\
    2.14  	\\$(WINDRES) \\$< \\$@,g"`
    2.15 +VERSION_DEPENDS=`echo "$VERSION_DEPENDS" | sed 's,\\$,\\\\$,g'`
    2.16  
    2.17  SDLMAIN_OBJECTS=`echo $SDLMAIN_SOURCES`
    2.18  SDLMAIN_DEPENDS=`echo $SDLMAIN_SOURCES`
    2.19 @@ -2741,6 +2743,7 @@
    2.20  SDLMAIN_DEPENDS=`echo "$SDLMAIN_DEPENDS" | sed "s,\\([[^ ]]*\\)/\\([[^ ]]*\\)\\.c,\\\\
    2.21  \\$(objects)/\\2.o: \\1/\\2.c\\\\
    2.22  	\\$(LIBTOOL) --mode=compile \\$(CC) \\$(CFLAGS) \\$(EXTRA_CFLAGS) $DEPENDENCY_TRACKING_OPTIONS -c \\$< -o \\$@,g"`
    2.23 +SDLMAIN_DEPENDS=`echo "$SDLMAIN_DEPENDS" | sed 's,\\$,\\\\$,g'`
    2.24  
    2.25  # Set runtime shared library paths as needed
    2.26  
    2.27 @@ -2793,17 +2796,29 @@
    2.28  AC_SUBST(ac_aux_dir)
    2.29  AC_SUBST(INCLUDE)
    2.30  AC_SUBST(OBJECTS)
    2.31 -AC_SUBST(DEPENDS)
    2.32  AC_SUBST(VERSION_OBJECTS)
    2.33 -AC_SUBST(VERSION_DEPENDS)
    2.34  AC_SUBST(SDLMAIN_OBJECTS)
    2.35 -AC_SUBST(SDLMAIN_DEPENDS)
    2.36  AC_SUBST(BUILD_CFLAGS)
    2.37  AC_SUBST(EXTRA_CFLAGS)
    2.38  AC_SUBST(BUILD_LDFLAGS)
    2.39  AC_SUBST(EXTRA_LDFLAGS)
    2.40  AC_SUBST(WINDRES)
    2.41  
    2.42 -AC_OUTPUT([
    2.43 +AC_CONFIG_FILES([
    2.44      Makefile sdl-config SDL.spec sdl.pc
    2.45  ])
    2.46 +AC_CONFIG_COMMANDS([default],
    2.47 +                   [cat >>Makefile <<__EOF__
    2.48 +
    2.49 +# Build rules for objects
    2.50 +-include \$(OBJECTS:.lo=.d)
    2.51 +$DEPENDS
    2.52 +$VERSION_DEPENDS
    2.53 +$SDLMAIN_DEPENDS
    2.54 +__EOF__ 
    2.55 +], [
    2.56 +DEPENDS="$DEPENDS"
    2.57 +VERSION_DEPENDS="$VERSION_DEPENDS"
    2.58 +SDLMAIN_DEPENDS="$SDLMAIN_DEPENDS"
    2.59 +])
    2.60 +AC_OUTPUT