From dbe83e69d8e05ba1f82f68102da0eb7bd6136761 Mon Sep 17 00:00:00 2001 From: nagai Date: Mon, 31 Jan 2005 04:17:23 +0000 Subject: [PATCH] * ext/tk/extconf.rb: add tkutil configuration step (remove old schema) * ext/tk/depend: remove the information of tkutil * ext/tk/make-tkutil: sub-part of Makefile to compile tkutil * ext/tk/tkutil/tkutil.c: move tkutil.c to subdirectory * ext/tk/tkutil/subconf.rb: configuration file for tkutil.c * ext/tk/tkutil/depend: ditto git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@7852 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- ChangeLog | 14 ++++++ ext/tk/depend | 1 - ext/tk/extconf.rb | 93 +++++++++++------------------------- ext/tk/make-tkutil | 43 +++++++++++++++++ ext/tk/tkutil/.cvsignore | 3 ++ ext/tk/tkutil/depend | 1 + ext/tk/tkutil/subconf.rb | 2 + ext/tk/{ => tkutil}/tkutil.c | 0 8 files changed, 91 insertions(+), 66 deletions(-) create mode 100644 ext/tk/make-tkutil create mode 100644 ext/tk/tkutil/.cvsignore create mode 100644 ext/tk/tkutil/depend create mode 100644 ext/tk/tkutil/subconf.rb rename ext/tk/{ => tkutil}/tkutil.c (100%) diff --git a/ChangeLog b/ChangeLog index 4eb9e422e5..6f20f1e3ec 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,17 @@ +Mon Jan 31 13:16:39 2005 Hidetoshi NAGAI + + * ext/tk/extconf.rb: add tkutil configuration step (remove old schema) + + * ext/tk/depend: remove the information of tkutil + + * ext/tk/make-tkutil: sub-part of Makefile to compile tkutil + + * ext/tk/tkutil/tkutil.c: move tkutil.c to subdirectory + + * ext/tk/tkutil/subconf.rb: configuration file for tkutil.c + + * ext/tk/tkutil/depend: ditto + Mon Jan 31 13:13:35 2005 Hidetoshi NAGAI * ext/tk/tcltklib.c: add invalid namespace check diff --git a/ext/tk/depend b/ext/tk/depend index 95d5527e61..2cd9c400f7 100644 --- a/ext/tk/depend +++ b/ext/tk/depend @@ -1,3 +1,2 @@ tcltklib.o: tcltklib.c $(hdrdir)/ruby.h $(topdir)/config.h $(hdrdir)/defines.h stubs.o: stubs.c $(hdrdir)/ruby.h $(topdir)/config.h $(hdrdir)/defines.h -tkutil.o: tkutil.c $(hdrdir)/ruby.h $(topdir)/config.h $(hdrdir)/defines.h diff --git a/ext/tk/extconf.rb b/ext/tk/extconf.rb index 996aa6caeb..a677ea3a7c 100644 --- a/ext/tk/extconf.rb +++ b/ext/tk/extconf.rb @@ -265,6 +265,7 @@ if mac_need_framework || $LDFLAGS += ' -framework Tk -framework Tcl' end + if stubs or pthread_check # create Makefile @@ -276,78 +277,40 @@ if mac_need_framework || $INSTALLFILES = [] end - cleanings_bup = CLEANINGS.dup - - if $objs - objs_bup = $objs.dup - else - objs_bup = nil - $objs = [] - end - # for SUPPORT_STATUS $INSTALLFILES << ["lib/tkextlib/SUPPORT_STATUS", "$(RUBYLIBDIR)", "lib"] - # for tcltklib.so - $objs << "stubs.o" << "tcltklib.o" - - # for tkutil.so - mk_tkutil = "\n\n" - mk_tkutil << "OBJS2 = tkutil.#{$OBJEXT}\n" - mk_tkutil << "TARGET2 = tkutil\n" - mk_tkutil << "DLLIB2 = $(TARGET2).#{CONFIG['DLEXT']}\n" - mk_tkutil << "STATIC_LIB2 = $(TARGET2).#{$LIBEXT}\n" - mk_tkutil << "\n" - mk_tkutil << 'CLEANLIBS2 = "$(TARGET2).{lib,exp,il?,tds,map}" $(DLLIB2)' - mk_tkutil << "\n\n" - mk_tkutil << "all: $(DLLIB2)\n" - mk_tkutil << "static: $(STATIC_LIB2)\n" - mk_tkutil << "\n" - - mk_tkutil << CLEANINGS.sub(/\$\(CLEANLIBS\)/, "$(CLEANLIBS) $(CLEANLIBS2)") - mk_tkutil << "\n\n" - - DLDFLAGS2 = "#$LDFLAGS #$DLDFLAGS #$ARCH_FLAG".gsub(/\$\(DEFFILE\)/, '$(DEFFILE2)') - mk_tkutil << "DLDFLAGS2 = #{DLDFLAGS2}\n" - mk_tkutil << "DEFFILE2 = $(TARGET2)-$(arch).def\n" if EXPORT_PREFIX - mk_tkutil << "\n" - - mk_tkutil << "$(DLLIB2): #{EXPORT_PREFIX ? '$(DEFFILE2) ':''}$(OBJS2)\n\t" - mk_tkutil << "@-$(RM) $@\n\t" - mk_tkutil << "@-$(RM) $(TARGET2).lib\n\t" if $mswin - - LINK_SO2 = LINK_SO.gsub(/\$\(DLLIB\)/, '$(DLLIB2)').gsub(/\$\(OBJS\)/, '$(OBJS2)').gsub(/\$\(DLDFLAGS\)/, '$(DLDFLAGS2)').gsub(/\$\(DEFFILE\)/, '$(DEFFILE2)') - mk_tkutil << LINK_SO2 - - mk_tkutil << "\n\n" - unless $static.nil? - mk_tkutil << "$(STATIC_LIB2): $(OBJS2)\n\t" - mk_tkutil << "$(AR) #{config_string('ARFLAGS') || 'cru '}$@ $(OBJS2)" - if ranlib = config_string('RANLIB') - mk_tkutil << "\n\t@-#{ranlib} $(DLLIB2) 2> /dev/null || true" - end - end - mk_tkutil << "\n\n" - - if EXPORT_PREFIX - mk_tkutil << "$(DEFFILE2):\n" - mk_tkutil << %Q!\t$(RUBY) -e "puts 'EXPORTS', '#{EXPORT_PREFIX}Init_$(TARGET2)'" > $@\n! - mk_tkutil << "\n\n" - end - mk_tkutil << "\n" - - mk_tkutil << "install: $(RUBYARCHDIR)/$(DLLIB2)\n" - mk_tkutil << "$(RUBYARCHDIR)/$(DLLIB2): $(DLLIB2) $(RUBYARCHDIR)\n" - mk_tkutil << "\t@$(INSTALL_PROG) $(DLLIB2) $(RUBYARCHDIR)\n" - - CLEANINGS.replace(mk_tkutil) - # create create_makefile("tcltklib") # reset $INSTALLFILES = installfiles_bup - CLEANINGS.replace(cleanings_bup) - $objs = objs_bup + + # add rules for tkutil + File::open('Makefile', 'a'){|mfile| + File::open('make-tkutil', 'r'){|dfile| + mfile.print "\n###\n" + while line = dfile.gets() + mfile.print line + end + } + } + + # create tkutil/Makefile + Dir.chdir 'tkutil' + if $extout || $extmk + $srcdir = '../' << $srcdir << '/tkutil' + $topdir = '../' << $topdir + $hdrdir = '../' << $hdrdir + $objs = nil + $defs = [] + Config::CONFIG["srcdir"] = $srcdir + else + puts "entering directory `tkutil'" + end + rm_f './Makefile' + init_mkmf + load 'subconf.rb' + Dir.chdir '..' end end diff --git a/ext/tk/make-tkutil b/ext/tk/make-tkutil new file mode 100644 index 0000000000..a7884efdd7 --- /dev/null +++ b/ext/tk/make-tkutil @@ -0,0 +1,43 @@ +all: all-tkutil +all-tkutil: + @(cd tkutil; $(MAKE) all) + +static: static-tkutil +static-tkutil: + @(cd tkutil; $(MAKE) static) + +clean: clean-tkutil +clean-tkutil: + @(cd tkutil; $(MAKE) clean) + +distclean: distclean-tkutil +distclean-tkutil: + @(cd tkutil; $(MAKE) distclean) + +realclean: realclean-tkutil +realclean-tkutil: + @(cd tkutil; $(MAKE) realclean) + +install: install-tkutil +install-tkutil: + @(cd tkutil; $(MAKE) install) + +install-so: install-tkutil-so +install-tkutil-so: + @(cd tkutil; $(MAKE) install-so) + +install-rb: install-tkutil-rb +install-tkutil-rb: + @(cd tkutil; $(MAKE) install-rb) + +site-install: site-install-tkutil +site-install-tkutil: + @(cd tkutil; $(MAKE) site-install) + +site-install-so: site-install-tkutil-so +site-install-tkutil-so: + @(cd tkutil; $(MAKE) site-install-so) + +site-install-rb: site-install-tkutil-rb +site-install-tkutil-rb: + @(cd tkutil; $(MAKE) site-install-rb) diff --git a/ext/tk/tkutil/.cvsignore b/ext/tk/tkutil/.cvsignore new file mode 100644 index 0000000000..90c83ed9b1 --- /dev/null +++ b/ext/tk/tkutil/.cvsignore @@ -0,0 +1,3 @@ +Makefile +*.log +*.def diff --git a/ext/tk/tkutil/depend b/ext/tk/tkutil/depend new file mode 100644 index 0000000000..fd63e230f0 --- /dev/null +++ b/ext/tk/tkutil/depend @@ -0,0 +1 @@ +tkutil.o: tkutil.c $(hdrdir)/ruby.h $(topdir)/config.h $(hdrdir)/defines.h diff --git a/ext/tk/tkutil/subconf.rb b/ext/tk/tkutil/subconf.rb new file mode 100644 index 0000000000..5ff0bc1e67 --- /dev/null +++ b/ext/tk/tkutil/subconf.rb @@ -0,0 +1,2 @@ +require 'mkmf' +create_makefile('tkutil') diff --git a/ext/tk/tkutil.c b/ext/tk/tkutil/tkutil.c similarity index 100% rename from ext/tk/tkutil.c rename to ext/tk/tkutil/tkutil.c