1
0
Fork 0
mirror of https://github.com/ruby/ruby.git synced 2022-11-09 12:17:21 -05:00

* 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
This commit is contained in:
nagai 2005-01-31 04:17:23 +00:00
parent 75b202c933
commit dbe83e69d8
8 changed files with 91 additions and 66 deletions

View file

@ -1,3 +1,17 @@
Mon Jan 31 13:16:39 2005 Hidetoshi NAGAI <nagai@ai.kyutech.ac.jp>
* 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 <nagai@ai.kyutech.ac.jp> Mon Jan 31 13:13:35 2005 Hidetoshi NAGAI <nagai@ai.kyutech.ac.jp>
* ext/tk/tcltklib.c: add invalid namespace check * ext/tk/tcltklib.c: add invalid namespace check

View file

@ -1,3 +1,2 @@
tcltklib.o: tcltklib.c $(hdrdir)/ruby.h $(topdir)/config.h $(hdrdir)/defines.h 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 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

View file

@ -265,6 +265,7 @@ if mac_need_framework ||
$LDFLAGS += ' -framework Tk -framework Tcl' $LDFLAGS += ' -framework Tk -framework Tcl'
end end
if stubs or pthread_check if stubs or pthread_check
# create Makefile # create Makefile
@ -276,78 +277,40 @@ if mac_need_framework ||
$INSTALLFILES = [] $INSTALLFILES = []
end end
cleanings_bup = CLEANINGS.dup
if $objs
objs_bup = $objs.dup
else
objs_bup = nil
$objs = []
end
# for SUPPORT_STATUS # for SUPPORT_STATUS
$INSTALLFILES << ["lib/tkextlib/SUPPORT_STATUS", "$(RUBYLIBDIR)", "lib"] $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
create_makefile("tcltklib") create_makefile("tcltklib")
# reset # reset
$INSTALLFILES = installfiles_bup $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
end end

43
ext/tk/make-tkutil Normal file
View file

@ -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)

3
ext/tk/tkutil/.cvsignore Normal file
View file

@ -0,0 +1,3 @@
Makefile
*.log
*.def

1
ext/tk/tkutil/depend Normal file
View file

@ -0,0 +1 @@
tkutil.o: tkutil.c $(hdrdir)/ruby.h $(topdir)/config.h $(hdrdir)/defines.h

2
ext/tk/tkutil/subconf.rb Normal file
View file

@ -0,0 +1,2 @@
require 'mkmf'
create_makefile('tkutil')