なかだです。

C++を含む拡張ライブラリに対応してみました。have_funcなどもC++対
応版が必要じゃないかという気はするのですが。


Index: configure.in =================================================================== RCS file: /cvs/ruby/src/ruby/configure.in,v retrieving revision 1.273 diff -U2 -p -r1.273 configure.in --- configure.in 16 Apr 2005 06:27:14 -0000 1.273 +++ configure.in 20 Apr 2005 00:57:10 -0000 @@ -148,4 +148,5 @@ if test x"${build}" != x"${host}"; then fi AC_PROG_CC +AC_PROG_CXX AC_PROG_GCC_TRADITIONAL @@ -801,4 +802,5 @@ AC_SUBST(STATIC)dnl AC_SUBST(CCDLFLAGS)dnl AC_SUBST(LDSHARED)dnl +AC_SUBST(LDSHAREDXX)dnl AC_SUBST(DLEXT)dnl AC_SUBST(DLEXT2)dnl @@ -952,4 +954,20 @@ if test "$with_dln_a_out" != yes; then 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) Index: bcc32/Makefile.sub =================================================================== RCS file: /cvs/ruby/src/ruby/bcc32/Makefile.sub,v retrieving revision 1.74 diff -U2 -p -r1.74 Makefile.sub --- bcc32/Makefile.sub 20 Apr 2005 15:08:07 -0000 1.74 +++ bcc32/Makefile.sub 20 Apr 2005 15:09:13 -0000 @@ -121,4 +121,7 @@ CFLAGS = -q -tWR -tWC $(DEBUGFLAGS) $(OP CPPFLAGS = -I. -I$(srcdir) -I$(srcdir)missing !endif +!ifndef CXXFLAGS +CXXFLAGS = $(CFLAGS) +!endif !ifndef LDFLAGS LDFLAGS = -S:$(STACK) @@ -327,4 +330,6 @@ 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 Index: lib/mkmf.rb =================================================================== RCS file: /cvs/ruby/src/ruby/lib/mkmf.rb,v retrieving revision 1.218 diff -U2 -p -r1.218 mkmf.rb --- lib/mkmf.rb 20 Apr 2005 15:08:07 -0000 1.218 +++ lib/mkmf.rb 20 Apr 2005 15:09:13 -0000 @@ -868,4 +868,5 @@ VPATH = #{vpath.join(CONFIG['PATH_SEPARA mk << %{ CC = #{CONFIG['CC']} +CXX = #{CONFIG['CXX']} LIBRUBY = #{CONFIG['LIBRUBY']} LIBRUBY_A = #{CONFIG['LIBRUBY_A']} @@ -878,4 +879,5 @@ CXXFLAGS = $(CFLAGS) #{CONFIG['CXXFLAGS' DLDFLAGS = #$LDFLAGS #$DLDFLAGS #$ARCH_FLAG LDSHARED = #{CONFIG['LDSHARED']} +LDSHAREDXX = #{config_string('LDSHAREDXX') || '$(LDSHARED)'} AR = #{CONFIG['AR']} EXEEXT = #{CONFIG['EXEEXT']} @@ -1087,5 +1089,9 @@ site-install-rb: install-rb 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" Index: win32/Makefile.sub =================================================================== RCS file: /cvs/ruby/src/ruby/win32/Makefile.sub,v retrieving revision 1.90 diff -U2 -p -r1.90 Makefile.sub --- win32/Makefile.sub 20 Apr 2005 15:08:08 -0000 1.90 +++ win32/Makefile.sub 20 Apr 2005 15:09:13 -0000 @@ -117,4 +117,7 @@ CFLAGS = -MD $(DEBUGFLAGS) $(OPTFLAGS) $ 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 @@ -342,4 +345,6 @@ 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 Index: wince/Makefile.sub =================================================================== RCS file: /cvs/ruby/src/ruby/wince/Makefile.sub,v retrieving revision 1.35 diff -U2 -p -r1.35 Makefile.sub --- wince/Makefile.sub 20 Apr 2005 15:08:08 -0000 1.35 +++ wince/Makefile.sub 20 Apr 2005 15:09:13 -0000 @@ -115,4 +115,7 @@ CPPFLAGS = -I. -I$(srcdir) -I$(srcdir)/m -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) @@ -350,4 +353,6 @@ 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
-- --- 僕の前にBugはない。 --- 僕の後ろにBugはできる。 中田 伸悦