diff --git a/Makefile.in b/Makefile.in index fd0a097bd1..d5656ac1ac 100644 --- a/Makefile.in +++ b/Makefile.in @@ -53,6 +53,7 @@ arch_hdrdir = $(EXTOUT)/include/$(arch) VPATH = $(arch_hdrdir)/ruby:$(hdrdir)/ruby:$(srcdir):$(srcdir)/enc:$(srcdir)/missing empty = +CC_VERSION = @CC_VERSION@ OUTFLAG = @OUTFLAG@$(empty) COUTFLAG = @COUTFLAG@$(empty) ARCH_FLAG = @ARCH_FLAG@ diff --git a/common.mk b/common.mk index df6ab53935..7e1ea27d37 100644 --- a/common.mk +++ b/common.mk @@ -159,6 +159,7 @@ showflags: " DLDFLAGS = $(DLDFLAGS)" \ " SOLIBS = $(SOLIBS)" \ $(MESSAGE_END) + -@$(CC_VERSION) .PHONY: showconfig showconfig: diff --git a/configure.in b/configure.in index 06af58e8b5..599775ba65 100644 --- a/configure.in +++ b/configure.in @@ -422,6 +422,13 @@ RUBY_CPPOUTFILE AC_SUBST(OUTFLAG) AC_SUBST(COUTFLAG) +cc_version_option= +for option in --version -v -V -qversion; do + $CC $option > /dev/null 2>&1 || continue + cc_version='$(CC) '$option +done +AC_SUBST(CC_VERSION, $cc_version) + RUBY_UNIVERSAL_ARCH if test "$target_cpu" != "$host_cpu" -a "$GCC" = yes -a "$cross_compiling" = no -a "$universal_binary" = no; then RUBY_DEFAULT_ARCH("$target_cpu")