Navigation Menu

Skip to content

Commit

Permalink
Fixed bug #945
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
slouken committed Jan 21, 2011
1 parent 08e18ca commit 31fdc5b
Show file tree
Hide file tree
Showing 2 changed files with 27 additions and 14 deletions.
10 changes: 0 additions & 10 deletions Makefile.in
Expand Up @@ -62,16 +62,6 @@ $(objects):

.PHONY: all install install-hdrs install-lib install-bin uninstall uninstall-hdrs uninstall-lib uninstall-bin clean distclean dist

-include $(OBJECTS:.lo=.d)
@DEPENDS@
@VERSION_DEPENDS@

-include $(PLAYWAVE_OBJECTS:.lo=.d)
@PLAYWAVE_DEPENDS@

-include $(PLAYMUS_OBJECTS:.lo=.d)
@PLAYMUS_DEPENDS@

$(objects)/$(TARGET): $(OBJECTS) $(VERSION_OBJECTS)
$(LIBTOOL) --mode=link $(CC) -o $@ $(OBJECTS) $(VERSION_OBJECTS) $(LDFLAGS) $(EXTRA_LDFLAGS) $(LT_LDFLAGS)

Expand Down
31 changes: 27 additions & 4 deletions configure.in
Expand Up @@ -612,13 +612,15 @@ $(objects)/\2.lo: \1/\2.cpp\\
\$(LIBTOOL) --mode=compile \$(CXX) \$(CFLAGS) \$(EXTRA_CFLAGS) '"$DEPENDENCY_TRACKING_OPTIONS"' -c \$< -o \$@,g'`
OBJECTS="$OBJECTS $OBJECTS_CXX"
DEPENDS="$DEPENDS $DEPENDS_CXX"
DEPENDS=`echo "$DEPENDS" | sed 's,\\$,\\\\$,g'`

VERSION_OBJECTS=`echo $VERSION_SOURCES`
VERSION_DEPENDS=`echo $VERSION_SOURCES`
VERSION_OBJECTS=`echo "$VERSION_OBJECTS" | sed 's,[[^ ]]*/\([[^ ]]*\)\.rc,$(objects)/\1.o,g'`
VERSION_DEPENDS=`echo "$VERSION_DEPENDS" | sed 's,\([[^ ]]*\)/\([[^ ]]*\)\.rc,\\
$(objects)/\2.o: \1/\2.rc\\
\$(WINDRES) \$< \$@,g'`
VERSION_DEPENDS=`echo "$VERSION_DEPENDS" | sed 's,\\$,\\\\$,g'`

PLAYWAVE_SOURCES="$srcdir/playwave.c"
PLAYWAVE_OBJECTS=`echo $PLAYWAVE_SOURCES`
Expand All @@ -627,6 +629,7 @@ PLAYWAVE_OBJECTS=`echo "$PLAYWAVE_OBJECTS" | sed 's,[[^ ]]*/\([[^ ]]*\)\.c,$(obj
PLAYWAVE_DEPENDS=`echo "$PLAYWAVE_DEPENDS" | sed 's,\([[^ ]]*\)/\([[^ ]]*\)\.c,\\
$(objects)/\2.lo: \1/\2.c\\
\$(LIBTOOL) --mode=compile \$(CC) \$(CFLAGS) \$(EXTRA_CFLAGS) '"$DEPENDENCY_TRACKING_OPTIONS"' -c \$< -o \$@,g'`
PLAYWAVE_DEPENDS=`echo "$PLAYWAVE_DEPENDS" | sed 's,\\$,\\\\$,g'`

PLAYMUS_SOURCES="$srcdir/playmus.c"
PLAYMUS_OBJECTS=`echo $PLAYMUS_SOURCES`
Expand All @@ -635,17 +638,14 @@ PLAYMUS_OBJECTS=`echo "$PLAYMUS_OBJECTS" | sed 's,[[^ ]]*/\([[^ ]]*\)\.c,$(objec
PLAYMUS_DEPENDS=`echo "$PLAYMUS_DEPENDS" | sed 's,\([[^ ]]*\)/\([[^ ]]*\)\.c,\\
$(objects)/\2.lo: \1/\2.c\\
\$(LIBTOOL) --mode=compile \$(CC) \$(CFLAGS) \$(EXTRA_CFLAGS) '"$DEPENDENCY_TRACKING_OPTIONS"' -c \$< -o \$@,g'`
PLAYMUS_DEPENDS=`echo "$PLAYMUS_DEPENDS" | sed 's,\\$,\\\\$,g'`

dnl Expand the sources and objects needed to build the library
AC_SUBST(ac_aux_dir)
AC_SUBST(OBJECTS)
AC_SUBST(DEPENDS)
AC_SUBST(VERSION_OBJECTS)
AC_SUBST(VERSION_DEPENDS)
AC_SUBST(PLAYWAVE_OBJECTS)
AC_SUBST(PLAYWAVE_DEPENDS)
AC_SUBST(PLAYMUS_OBJECTS)
AC_SUBST(PLAYMUS_DEPENDS)
AC_SUBST(BUILD_CFLAGS)
AC_SUBST(EXTRA_CFLAGS)
AC_SUBST(BUILD_LDFLAGS)
Expand All @@ -657,5 +657,28 @@ AC_SUBST(SDL_CFLAGS)
AC_SUBST(SDL_LIBS)

AC_OUTPUT([
])
AC_CONFIG_FILES([
Makefile SDL_mixer.spec SDL_mixer.qpg SDL_mixer.pc
])
AC_CONFIG_COMMANDS([default],
[cat >>Makefile <<__EOF__

# Build rules for objects
-include \$(OBJECTS:.lo=.d)
$DEPENDS
$VERSION_DEPENDS

-include \$(PLAYWAVE_OBJECTS:.lo=.d)
$PLAYWAVE_DEPENDS

-include \$(PLAYMUS_OBJECTS:.lo=.d)
$PLAYMUS_DEPENDS
__EOF__
], [
DEPENDS="$DEPENDS"
VERSION_DEPENDS="$VERSION_DEPENDS"
PLAYWAVE_DEPENDS="$PLAYWAVE_DEPENDS"
PLAYMUS_DEPENDS="$PLAYMUS_DEPENDS"
])
AC_OUTPUT

0 comments on commit 31fdc5b

Please sign in to comment.