From bf4cdfefc4574f2bc59463022578d758bbd29e11 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Henrik=20Grubbstr=C3=B6m=20=28Grubba=29?= <grubba@grubba.org> Date: Mon, 14 Feb 2011 13:42:35 +0100 Subject: [PATCH] Improved support for modules needing C++ compilers. --- .gitattributes | 1 - src/Makefile.in | 1 + src/configure.in | 10 +++++++++- src/make_variables.in | 6 ++++-- src/modules/common_module_makefile.in | 2 +- 5 files changed, 15 insertions(+), 5 deletions(-) diff --git a/.gitattributes b/.gitattributes index 58ccb76333..52b9d51d91 100644 --- a/.gitattributes +++ b/.gitattributes @@ -317,7 +317,6 @@ testfont binary /src/main.c foreign_ident /src/main.h foreign_ident /src/make_banner.pike foreign_ident -/src/make_variables.in foreign_ident /src/mapping.c foreign_ident /src/mapping.h foreign_ident /src/mklibpike.pike foreign_ident diff --git a/src/Makefile.in b/src/Makefile.in index 0324eea56d..efe73aab0c 100644 --- a/src/Makefile.in +++ b/src/Makefile.in @@ -103,6 +103,7 @@ CFLAGS=$(PREFLAGS) $(OTHERFLAGS) SMARTLINK=@SMARTLINK@ REALCC=@REALCC@ CC=@CC@ +CXX=@CXX@ CPP=@CPP@ GDB=gdb diff --git a/src/configure.in b/src/configure.in index 60171d4483..f8d6ae77f9 100644 --- a/src/configure.in +++ b/src/configure.in @@ -931,9 +931,17 @@ fi # force_smartlink_script_only CC="$SMARTLINK $REALCC" pike_cv_prog_CC="$CC" +# Check if there's a C++ compiler. +AC_PROG_CXX +# Strip smartlink from $CXX +REALCXX="`echo $CXX|sed -e 's/.*smartlink //'`" +CXX="$SMARTLINK $REALCXX" +pike_cv_prog_CXX="$CXX" + AC_SUBST(SMARTLINK) AC_SUBST(REALCC) -export REALCC SMARTLINK +AC_SUBST(REALCXX) +export REALCC REALCXX SMARTLINK AC_MSG_CHECKING([for a fallback compiler]) # Strip smartlink from $FALLBACK_CC diff --git a/src/make_variables.in b/src/make_variables.in index 41baa09e79..ec65a40e67 100644 --- a/src/make_variables.in +++ b/src/make_variables.in @@ -1,6 +1,8 @@ # -*- Makefile -*- # -# $Id: make_variables.in,v 1.30 2008/03/05 21:32:14 grubba Exp $ +# $Id$ +# +# Start of make_variables.in # # Note: This template is actually used only for make_variables in the # subdirectories; the one created in the build base dir is just an @@ -21,7 +23,7 @@ # core configure script (e.g. through "make force_configure" in the # top directory). @propagated_variables@ -#propagated_variables: CC CPP MOD_LDSHARED AR INSTALL +#propagated_variables: CC CXX CPP MOD_LDSHARED AR INSTALL #propagated_variables: BASE_CFLAGS BASE_CPPFLAGS CCSHARED BASE_LDFLAGS #propagated_variables: OPTIMIZE WARN PROFIL #propagated_variables: LDSHARED_MODULE_REQS diff --git a/src/modules/common_module_makefile.in b/src/modules/common_module_makefile.in index 6832b3a1cc..27912fc35d 100644 --- a/src/modules/common_module_makefile.in +++ b/src/modules/common_module_makefile.in @@ -116,7 +116,7 @@ $(MODULE_ARCHIVES) ThisIsAPhonyTargetBlaBlaBla: force if test x"@noopt_retry@" = xyes ; then \ echo "WARNING: Compiler failure! Trying without optimization!" >&2;\ echo "$(CXX) $(PREFLAGS) $(CFLAGS) -c $< -o $@" >$@.fail ;\ - if NO_ULIMIT=yes $(CC) $(PREFLAGS) $(NOOPT_CFLAGS) -c $< -o $@ ; then : ; else \ + if NO_ULIMIT=yes $(CXX) $(PREFLAGS) $(NOOPT_CFLAGS) -c $< -o $@ ; then : ; else \ status=$$?; \ echo "Compilation command was:" >&2;\ echo "$(CXX) $(PREFLAGS) $(NOOPT_CFLAGS) -c $< -o $@" >&2 ;\ -- GitLab