From 50fd36027a084e0a39b4fa6fc8e49bb1ae044c8a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Remko=20Tron=C3=A7on?= Date: Sat, 6 Jun 2009 21:18:22 +0200 Subject: Use separate "MM" variable for make dependency generation tool. On Windows, the compiler cannot be used as a make dependency generation. Make it possible to specify a different tool (e.g. GCC) for dependency generation through the MM variable. diff --git a/Makefile b/Makefile index 451d98e..f590b59 100644 --- a/Makefile +++ b/Makefile @@ -79,13 +79,13 @@ endif endif %.dep: %.cpp - $(QUIET_MM)$(CXX) -MM -MG -MT $(basename $@).o $(filter-out -arch armv6 -arch i386 -arch ppc,$(CXXFLAGS)) $< > $@ + $(QUIET_MM)$(MM) -MM -MG -MT $(basename $@).o $(CPPFLAGS) $(filter-out -arch armv6 -arch i386 -arch ppc,$(CXXFLAGS)) $< > $@ %.dep: %.c - $(QUIET_MM)$(CC) -MM -MG -MT $(basename $@).o $(filter-out -arch armv6 -arch i386 -arch ppc,$(CFLAGS)) $< > $@ + $(QUIET_MM)$(MM) -MM -MG -MT $(basename $@).o $(CPPFLAGS) $(filter-out -arch armv6 -arch i386 -arch ppc,$(CFLAGS)) $< > $@ %.dep: %.mm - $(QUIET_MM)$(CC) -MM -MG -MT $(basename $@).o $(filter-out -arch armv6 -arch i386 -arch ppc,$(CXXFLAGS)) $< > $@ + $(QUIET_MM)$(CC) -MM -MG -MT $(basename $@).o $(CPPFLAGS) $(filter-out -arch armv6 -arch i386 -arch ppc,$(CXXFLAGS)) $< > $@ %.o: %.c $(QUIET_CC)$(CC) -c $< -o $@ $(CPPFLAGS) $(CFLAGS) diff --git a/Makefile.config.in b/Makefile.config.in index c71334d..54ed018 100644 --- a/Makefile.config.in +++ b/Makefile.config.in @@ -3,6 +3,7 @@ ################################################################################ @SET_MAKE@ +MM=@MM@ CXX=@CONFIG_CXX@ CXXFLAGS=@CONFIG_CXXFLAGS@ CC=@CONFIG_CC@ diff --git a/configure.in b/configure.in index 5866b63..f1ee664 100644 --- a/configure.in +++ b/configure.in @@ -98,6 +98,22 @@ fi # Checks for programs and sets default compiler options. ################################################################################ +# On windows, use some smart defaults for the compiler +case $host in + *-*-cygwin* | *-mingw32*) + if test -z "$CC"; then + CC="autoconf/cccl" + fi + if test -z "$CXX"; then + CXX="autoconf/cccl" + fi + if test -z "$MM"; then + MM="gcc" + fi + ;; + *) +esac + AC_PROG_CC AC_PROG_CXX AC_GNU_SOURCE @@ -106,6 +122,9 @@ AC_PROG_INSTALL #AC_SYS_LARGEFILE CONFIG_CC="$CC" CONFIG_CXX="$CXX" +if test -z "$MM"; then + MM="$CC" +fi # Expat AX_LIB_EXPAT() @@ -171,6 +190,7 @@ AC_SUBST(HAVE_EXPAT) AC_SUBST(CONFIG_CXX) AC_SUBST(CONFIG_CXXFLAGS) AC_SUBST(CONFIG_CC) +AC_SUBST(MM) AC_SUBST(CONFIG_CFLAGS) AC_SUBST(CONFIG_LDFLAGS) AC_SUBST(CONFIG_LIBS) -- cgit v0.10.2-6-g49f6