From b9a7ad66374d7ffa8574ab4cc32e7f8a99781834 Mon Sep 17 00:00:00 2001 From: Moritz Bunkus Date: Wed, 24 Nov 2004 14:16:40 +0000 Subject: [PATCH] Support for generating dependency information with gcc 2.95. --- Makefile.in | 13 ++++++++++++- configure.in | 24 +++++++++++++++++++++++- 2 files changed, 35 insertions(+), 2 deletions(-) diff --git a/Makefile.in b/Makefile.in index e5e6ee787..cb1c34a8d 100644 --- a/Makefile.in +++ b/Makefile.in @@ -53,6 +53,7 @@ install_sh_PROGRAM = $(install_sh) -c install_sh_SCRIPT = $(install_sh) -c INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_HEADER = $(INSTALL_DATA) +GCC_DEP_STYLE = @GCC_DEP_STYLE@ # Variable stuff as set by configure BZ2_LIBS = @BZ2_LIBS@ @@ -221,12 +222,22 @@ depend: @echo Calculating dependecies: @rm -f .depend @touch .depend +ifeq (v2,$(GCC_DEP_STYLE)) + @for i in $(ALL_SOURCES); do \ + o="`dirname "$$i"`/" ; \ + echo ' CXX -MM '$$i ; \ + $(CXX) $(CXXFLAGS) $(INCLUDES) $(SYSTEM_INCLUDES) -MM $$i | \ + awk 'BEGIN { pfx="'$$o'" } { print pfx $$0 ; pfx="" }' \ + >> .depend ; \ + done +else @for i in $(ALL_SOURCES); do \ o="`echo $$i | sed -e 's/\.c$$/.o/' -e 's/\.cpp$$/.o/'`" ; \ - echo ' ' $$i: $$o ; \ + echo ' CXX -MM '$$i ; \ $(CXX) $(CXXFLAGS) $(INCLUDES) $(SYSTEM_INCLUDES) -MM \ -MT $$o $$i >> .depend ; \ done +endif update-po: xgettext --keyword=_ --keyword=N_ --default-domain=mkvtoolnix \ diff --git a/configure.in b/configure.in index 9db39da55..26679a43f 100644 --- a/configure.in +++ b/configure.in @@ -160,12 +160,34 @@ AC_SUBST(PROFILING_LIBS) AC_SUBST(OPTIMIZATION_CFLAGS) +dnl +dnl Check the gcc version for the genreation of dependecy information +dnl +AC_CACHE_CHECK([gcc version], + [ac_cv_gcc_version],[ + ac_cv_gcc_version="`$CXX -dumpversion`" + ]) + +case "$ac_cv_gcc_version" in + 2.*) + GCC_DEP_STYLE=v2 + ;; + 3.*) + GCC_DEP_STYLE=v3 + ;; + *) + GCC_DEP_STYLE=v3 + ;; +esac + +AC_SUBST(GCC_DEP_STYLE) + dnl dnl Check for mingw dnl AC_CACHE_CHECK([if being compiled with mingw32], [ac_cv_mingw32],[ - if test "x`gcc --version | grep -i mingw`" = "x" ; then + if test "x`$CXX --version | grep -i mingw`" = "x" ; then ac_cv_mingw32=no else ac_cv_mingw32=yes