Support for generating dependency information with gcc 2.95.

This commit is contained in:
Moritz Bunkus 2004-11-24 14:16:40 +00:00
parent a2214b9266
commit b9a7ad6637
2 changed files with 35 additions and 2 deletions

View File

@ -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 \

View File

@ -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