summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authornobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2005-04-20 21:45:43 +0000
committernobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2005-04-20 21:45:43 +0000
commitdbbfbc5a21dec443bd0234f89d739129cff4d0a5 (patch)
treeffc894cde7f7ca1a2ab6ef1898a294221c98e73a
parent756a1c457e8b5243c6fb09fa0aa8c71f5ca78646 (diff)
downloadruby-dbbfbc5a21dec443bd0234f89d739129cff4d0a5.tar.gz
* configure.in, lib/mkmf.rb, {bcc32,win32,wince}/Makefile.sub: improve
C++ support. [ruby-dev:26089] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@8371 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
-rw-r--r--ChangeLog5
-rw-r--r--bcc32/Makefile.sub5
-rw-r--r--configure.in18
-rw-r--r--lib/mkmf.rb8
-rw-r--r--win32/Makefile.sub5
-rw-r--r--wince/Makefile.sub5
6 files changed, 44 insertions, 2 deletions
diff --git a/ChangeLog b/ChangeLog
index 9761b718e8..adce8b8807 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,8 +1,11 @@
-Thu Apr 21 06:44:10 2005 Nobuyoshi Nakada <nobu@ruby-lang.org>
+Thu Apr 21 06:45:28 2005 Nobuyoshi Nakada <nobu@ruby-lang.org>
* ruby.c (ruby_incpush_expand, proc_options): expand relative path
given with -I option. [ruby-dev:26090]
+ * configure.in, lib/mkmf.rb, {bcc32,win32,wince}/Makefile.sub: improve
+ C++ support. [ruby-dev:26089]
+
Thu Apr 21 01:53:09 2005 Minero Aoki <aamine@loveruby.net>
* lib/net/http.rb: add rdoc.
diff --git a/bcc32/Makefile.sub b/bcc32/Makefile.sub
index 17db6937e8..2005c2626a 100644
--- a/bcc32/Makefile.sub
+++ b/bcc32/Makefile.sub
@@ -120,6 +120,9 @@ CFLAGS = -q -tWR -tWC $(DEBUGFLAGS) $(OPTFLAGS) $(PROCESSOR_FLAG) -w- -wsus -wcp
!ifndef CPPFLAGS
CPPFLAGS = -I. -I$(srcdir) -I$(srcdir)missing
!endif
+!ifndef CXXFLAGS
+CXXFLAGS = $(CFLAGS)
+!endif
!ifndef LDFLAGS
LDFLAGS = -S:$(STACK)
!endif
@@ -326,6 +329,8 @@ s,@target_vendor@,pc,;t t
s,@target_os@,$(OS),;t t
s,@CC@,$(CC),;t t
s,@CPP@,cpp32,;t t
+s,@CXX@,$$(CC),;t t
+s,@LD@,$(LD),;t t
s,@YACC@,$(YACC),;t t
s,@RANLIB@,,;t t
s,@AR@,$(AR),;t t
diff --git a/configure.in b/configure.in
index be313d5989..2abe9454e3 100644
--- a/configure.in
+++ b/configure.in
@@ -147,6 +147,7 @@ if test x"${build}" != x"${host}"; then
AC_CHECK_TOOL(CC, gcc)
fi
AC_PROG_CC
+AC_PROG_CXX
AC_PROG_GCC_TRADITIONAL
RUBY_PROG_GNU_LD
@@ -800,6 +801,7 @@ AC_SUBST(ARCH_FLAG)dnl
AC_SUBST(STATIC)dnl
AC_SUBST(CCDLFLAGS)dnl
AC_SUBST(LDSHARED)dnl
+AC_SUBST(LDSHAREDXX)dnl
AC_SUBST(DLEXT)dnl
AC_SUBST(DLEXT2)dnl
AC_SUBST(LIBEXT)dnl
@@ -951,6 +953,22 @@ if test "$with_dln_a_out" != yes; then
RPATHFLAG=" -Wl,-R'%1\$-s'"
fi
fi
+if test "${LDSHAREDXX}" = ""; then
+ case "${LDSHARED}" in
+ *'$(CC)'*)
+ LDSHAREDXX=`echo "${LDSHARED}" | sed 's/\$(CC)/$(CXX)/'`
+ ;;
+ *'${CC}'*)
+ LDSHAREDXX=`echo "${LDSHARED}" | sed 's/\${CC}/${CXX}/'`
+ ;;
+ *$CC*)
+ LDSHAREDXX=`echo "${LDSHARED}" | sed "s|$CC|$CXX|"`
+ ;;
+ ld" "*)
+ ;;
+ esac
+fi
+
AC_SUBST(LINK_SO)
AC_SUBST(LIBPATHFLAG)
AC_SUBST(RPATHFLAG)
diff --git a/lib/mkmf.rb b/lib/mkmf.rb
index 3476dcdf48..86c01393e3 100644
--- a/lib/mkmf.rb
+++ b/lib/mkmf.rb
@@ -867,6 +867,7 @@ VPATH = #{vpath.join(CONFIG['PATH_SEPARATOR'])}
end
mk << %{
CC = #{CONFIG['CC']}
+CXX = #{CONFIG['CXX']}
LIBRUBY = #{CONFIG['LIBRUBY']}
LIBRUBY_A = #{CONFIG['LIBRUBY_A']}
LIBRUBYARG_SHARED = #$LIBRUBYARG_SHARED
@@ -877,6 +878,7 @@ CPPFLAGS = -I. -I$(topdir) -I$(hdrdir) -I$(srcdir) #{$defs.join(" ")} #{$CPPFLAG
CXXFLAGS = $(CFLAGS) #{CONFIG['CXXFLAGS']}
DLDFLAGS = #$LDFLAGS #$DLDFLAGS #$ARCH_FLAG
LDSHARED = #{CONFIG['LDSHARED']}
+LDSHAREDXX = #{config_string('LDSHAREDXX') || '$(LDSHARED)'}
AR = #{CONFIG['AR']}
EXEEXT = #{CONFIG['EXEEXT']}
@@ -1086,7 +1088,11 @@ site-install-rb: install-rb
mfile.print "$(DLLIB): ", (makedef ? "$(DEFFILE) " : ""), "$(OBJS)\n\t"
mfile.print "@-$(RM) $@\n\t"
mfile.print "@-$(MAKEDIRS) $(@D)\n\t" if $extout
- mfile.print LINK_SO, "\n\n"
+ link_so = LINK_SO
+ if srcs.any?(&%r"\.(?:#{CXX_EXT.join('|')})\z".method(:===))
+ link_so = link_so.sub(/\bLDSHARED\b/, '\&XX')
+ end
+ mfile.print link_so, "\n\n"
unless $static.nil?
mfile.print "$(STATIC_LIB): $(OBJS)\n\t"
mfile.print "$(AR) #{config_string('ARFLAGS') || 'cru '}$@ $(OBJS)"
diff --git a/win32/Makefile.sub b/win32/Makefile.sub
index f29eb57830..fcebd80a85 100644
--- a/win32/Makefile.sub
+++ b/win32/Makefile.sub
@@ -116,6 +116,9 @@ CFLAGS = -MD $(DEBUGFLAGS) $(OPTFLAGS) $(PROCESSOR_FLAG)
!if !defined(CPPFLAGS)
CPPFLAGS = -I. -I$(srcdir) -I$(srcdir)/missing
!endif
+!if !defined(CXXFLAGS)
+CXXFLAGS = $(CFLAGS)
+!endif
!if !defined(LDFLAGS)
LDFLAGS = -link -incremental:no -debug -opt:ref -opt:icf
!endif
@@ -341,6 +344,8 @@ s,@target_vendor@,pc,;t t
s,@target_os@,$(OS),;t t
s,@CC@,$(CC),;t t
s,@CPP@,$(CPP),;t t
+s,@CXX@,$$(CC),;t t
+s,@LD@,$$(CC),;t t
s,@YACC@,$(YACC),;t t
s,@RANLIB@,,;t t
s,@AR@,$(AR),;t t
diff --git a/wince/Makefile.sub b/wince/Makefile.sub
index 77a47ff8f0..e1d7de68f7 100644
--- a/wince/Makefile.sub
+++ b/wince/Makefile.sub
@@ -114,6 +114,9 @@ CPPFLAGS = -I. -I$(srcdir) -I$(srcdir)/missing -I$(srcdir)/wince \
-DFILENAME_MAX=MAX_PATH -DTLS_OUT_OF_INDEXES=0xFFFFFFFF \
-DBUFSIZ=512 -D_UNICODE -DUNICODE
!endif
+!if !defined(CXXFLAGS)
+CXXFLAGS = $(CFLAGS)
+!endif
!if !defined(LDFLAGS)
LDFLAGS = -link -incremental:yes -pdb:none -machine:$(MACHINE) -subsystem:$(SUBSYSTEM)
!endif
@@ -349,6 +352,8 @@ s,@target_vendor@,pc,;t t
s,@target_os@,$(OS),;t t
s,@CC@,$(CC),;t t
s,@CPP@,$(CPP),;t t
+s,@CXX@,$$(CC),;t t
+s,@LD@,$$(CC),;t t
s,@YACC@,$(YACC),;t t
s,@RANLIB@,,;t t
s,@AR@,$(AR),;t t