Fixed bug #945
authorSam Lantinga <slouken@libsdl.org>
Fri, 21 Jan 2011 12:43:35 -0800
changeset 49755499f7b054d
parent 496 965e6d675595
child 498 6b61e6dc35b4
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	Tue Jan 18 12:08:55 2011 -0800
     1.2 +++ b/Makefile.in	Fri Jan 21 12:43:35 2011 -0800
     1.3 @@ -62,16 +62,6 @@
     1.4  
     1.5  .PHONY: all install install-hdrs install-lib install-bin uninstall uninstall-hdrs uninstall-lib uninstall-bin clean distclean dist
     1.6  
     1.7 --include $(OBJECTS:.lo=.d)
     1.8 -@DEPENDS@
     1.9 -@VERSION_DEPENDS@
    1.10 -
    1.11 --include $(PLAYWAVE_OBJECTS:.lo=.d)
    1.12 -@PLAYWAVE_DEPENDS@
    1.13 -
    1.14 --include $(PLAYMUS_OBJECTS:.lo=.d)
    1.15 -@PLAYMUS_DEPENDS@
    1.16 -
    1.17  $(objects)/$(TARGET): $(OBJECTS) $(VERSION_OBJECTS)
    1.18  	$(LIBTOOL) --mode=link $(CC) -o $@ $(OBJECTS) $(VERSION_OBJECTS) $(LDFLAGS) $(EXTRA_LDFLAGS) $(LT_LDFLAGS)
    1.19  
     2.1 --- a/configure.in	Tue Jan 18 12:08:55 2011 -0800
     2.2 +++ b/configure.in	Fri Jan 21 12:43:35 2011 -0800
     2.3 @@ -612,6 +612,7 @@
     2.4  	\$(LIBTOOL) --mode=compile \$(CXX) \$(CFLAGS) \$(EXTRA_CFLAGS) '"$DEPENDENCY_TRACKING_OPTIONS"' -c \$< -o \$@,g'`
     2.5  OBJECTS="$OBJECTS $OBJECTS_CXX"
     2.6  DEPENDS="$DEPENDS $DEPENDS_CXX"
     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 @@ -619,6 +620,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  PLAYWAVE_SOURCES="$srcdir/playwave.c"
    2.18  PLAYWAVE_OBJECTS=`echo $PLAYWAVE_SOURCES`
    2.19 @@ -627,6 +629,7 @@
    2.20  PLAYWAVE_DEPENDS=`echo "$PLAYWAVE_DEPENDS" | sed 's,\([[^ ]]*\)/\([[^ ]]*\)\.c,\\
    2.21  $(objects)/\2.lo: \1/\2.c\\
    2.22  	\$(LIBTOOL) --mode=compile \$(CC) \$(CFLAGS) \$(EXTRA_CFLAGS) '"$DEPENDENCY_TRACKING_OPTIONS"' -c \$< -o \$@,g'`
    2.23 +PLAYWAVE_DEPENDS=`echo "$PLAYWAVE_DEPENDS" | sed 's,\\$,\\\\$,g'`
    2.24  
    2.25  PLAYMUS_SOURCES="$srcdir/playmus.c"
    2.26  PLAYMUS_OBJECTS=`echo $PLAYMUS_SOURCES`
    2.27 @@ -635,17 +638,14 @@
    2.28  PLAYMUS_DEPENDS=`echo "$PLAYMUS_DEPENDS" | sed 's,\([[^ ]]*\)/\([[^ ]]*\)\.c,\\
    2.29  $(objects)/\2.lo: \1/\2.c\\
    2.30  	\$(LIBTOOL) --mode=compile \$(CC) \$(CFLAGS) \$(EXTRA_CFLAGS) '"$DEPENDENCY_TRACKING_OPTIONS"' -c \$< -o \$@,g'`
    2.31 +PLAYMUS_DEPENDS=`echo "$PLAYMUS_DEPENDS" | sed 's,\\$,\\\\$,g'`
    2.32  
    2.33  dnl Expand the sources and objects needed to build the library
    2.34  AC_SUBST(ac_aux_dir)
    2.35  AC_SUBST(OBJECTS)
    2.36 -AC_SUBST(DEPENDS)
    2.37  AC_SUBST(VERSION_OBJECTS)
    2.38 -AC_SUBST(VERSION_DEPENDS)
    2.39  AC_SUBST(PLAYWAVE_OBJECTS)
    2.40 -AC_SUBST(PLAYWAVE_DEPENDS)
    2.41  AC_SUBST(PLAYMUS_OBJECTS)
    2.42 -AC_SUBST(PLAYMUS_DEPENDS)
    2.43  AC_SUBST(BUILD_CFLAGS)
    2.44  AC_SUBST(EXTRA_CFLAGS)
    2.45  AC_SUBST(BUILD_LDFLAGS)
    2.46 @@ -657,5 +657,28 @@
    2.47  AC_SUBST(SDL_LIBS)
    2.48  
    2.49  AC_OUTPUT([
    2.50 +])
    2.51 +AC_CONFIG_FILES([
    2.52      Makefile SDL_mixer.spec SDL_mixer.qpg SDL_mixer.pc
    2.53  ])
    2.54 +AC_CONFIG_COMMANDS([default],
    2.55 +                   [cat >>Makefile <<__EOF__
    2.56 +
    2.57 +# Build rules for objects
    2.58 +-include \$(OBJECTS:.lo=.d)
    2.59 +$DEPENDS
    2.60 +$VERSION_DEPENDS
    2.61 +
    2.62 +-include \$(PLAYWAVE_OBJECTS:.lo=.d)
    2.63 +$PLAYWAVE_DEPENDS
    2.64 +
    2.65 +-include \$(PLAYMUS_OBJECTS:.lo=.d)
    2.66 +$PLAYMUS_DEPENDS
    2.67 +__EOF__ 
    2.68 +], [
    2.69 +DEPENDS="$DEPENDS"
    2.70 +VERSION_DEPENDS="$VERSION_DEPENDS"
    2.71 +PLAYWAVE_DEPENDS="$PLAYWAVE_DEPENDS"
    2.72 +PLAYMUS_DEPENDS="$PLAYMUS_DEPENDS"
    2.73 +])
    2.74 +AC_OUTPUT