Move dependency generation commands into configure.
authorDiego Biurrun <diego@biurrun.de>
Wed, 12 Mar 2008 23:30:35 +0000 (23:30 +0000)
committerDiego Biurrun <diego@biurrun.de>
Wed, 12 Mar 2008 23:30:35 +0000 (23:30 +0000)
This will allow specifying gcc-independent commands in the future.

Originally committed as revision 12426 to svn://svn.ffmpeg.org/ffmpeg/trunk

Makefile
common.mak
configure

index 93f8715..bd51432 100644 (file)
--- a/Makefile
+++ b/Makefile
@@ -223,11 +223,10 @@ depend dep: .depend .vhookdep
        $(MAKE-$(CONFIG_AVFILTER)) -C libavfilter depend
 
 .depend: $(SRCS) version.h
        $(MAKE-$(CONFIG_AVFILTER)) -C libavfilter depend
 
 .depend: $(SRCS) version.h
-       $(CC) -MM $(CFLAGS) $(filter-out %.h,$^) > $@
+       $(DEPEND_CMD) > $@
 
 
-# gcc stupidly only outputs the basename of targets with -MM
 .vhookdep: $(ALLHOOKS_SRCS) version.h
 .vhookdep: $(ALLHOOKS_SRCS) version.h
-       $(CC) -MM $(VHOOKCFLAGS) $(filter-out %.h,$^) | sed 's,^\([a-z]\),vhook/\1,' > $@
+       $(VHOOK_DEPEND_CMD) > $@
 
 $(DEP_LIBS): lib
 
 
 $(DEP_LIBS): lib
 
index b738619..359aa11 100644 (file)
@@ -61,9 +61,8 @@ $(SLIBNAME_WITH_MAJOR): $(OBJS)
 ALLHEADERS = $(subst $(LIBSRC)/,,$(wildcard $(LIBSRC)/*.h))
 checkheaders: $(filter-out %_template.ho,$(ALLHEADERS:.h=.ho))
 
 ALLHEADERS = $(subst $(LIBSRC)/,,$(wildcard $(LIBSRC)/*.h))
 checkheaders: $(filter-out %_template.ho,$(ALLHEADERS:.h=.ho))
 
-# gcc stupidly only outputs the basename of targets with -MM
 depend dep: $(SRCS)
 depend dep: $(SRCS)
-       $(CC) -MM $(CFLAGS) $^ | sed 's,[0-9a-z._-]*: \([a-z0-9]*/\).*,\1&,' > .depend
+       $(DEPEND_CMD) > .depend
 
 clean::
        rm -f *.o *~ *.a *.lib *.so *.so.* *.dylib *.dll \
 
 clean::
        rm -f *.o *~ *.a *.lib *.so *.so.* *.dylib *.dll \
index 32a3980..afcdca5 100755 (executable)
--- a/configure
+++ b/configure
@@ -934,6 +934,10 @@ SLIBNAME_WITH_VERSION='$(SLIBNAME).$(LIBVERSION)'
 SLIBNAME_WITH_MAJOR='$(SLIBNAME).$(LIBMAJOR)'
 LIB_INSTALL_EXTRA_CMD='$(RANLIB) "$(LIBDIR)/$(LIBNAME)"'
 
 SLIBNAME_WITH_MAJOR='$(SLIBNAME).$(LIBMAJOR)'
 LIB_INSTALL_EXTRA_CMD='$(RANLIB) "$(LIBDIR)/$(LIBNAME)"'
 
+# gcc stupidly only outputs the basename of targets with -MM
+DEPEND_CMD='$(CC) -MM $(CFLAGS) $(filter-out %.h,$^) | sed "s,[0-9a-z._-]*: \([a-z0-9]*/\).*,\1&,"'
+VHOOKDEPEND_CMD='$(CC) -MM $(VHOOKCFLAGS) $(filter-out %.h,$^) | sed "s,^\([a-z]\),vhook/\1,"'
+
 # find source path
 source_path="`dirname \"$0\"`"
 enable source_path_used
 # find source path
 source_path="`dirname \"$0\"`"
 enable source_path_used
@@ -1991,6 +1995,8 @@ echo "LIBNAME=$LIBNAME" >> config.mak
 echo "SLIBPREF=$SLIBPREF" >> config.mak
 echo "SLIBSUF=$SLIBSUF" >> config.mak
 echo "EXESUF=$EXESUF" >> config.mak
 echo "SLIBPREF=$SLIBPREF" >> config.mak
 echo "SLIBSUF=$SLIBSUF" >> config.mak
 echo "EXESUF=$EXESUF" >> config.mak
+echo "DEPEND_CMD=$DEPEND_CMD" >> config.mak
+echo "VHOOKDEPEND_CMD=$VHOOKDEPEND_CMD" >> config.mak
 
 if enabled bigendian; then
     echo "WORDS_BIGENDIAN=yes" >> config.mak
 
 if enabled bigendian; then
     echo "WORDS_BIGENDIAN=yes" >> config.mak