diff --git a/ChangeLog b/ChangeLog index a6804db67d..ecbc018f0c 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,80 @@ +Mon Oct 21 22:53:02 2002 Nobuyoshi Nakada + + * configure.in (XCFLAGS): CFLAGS to comile ruby itself. + + * configure.in (LIBEXT): suffix for static libraries. + + * configure.in (LIBPATHFLAG): switch template to specify library + path. + + * configure.in (LINK_SO): command to link shared objects. + + * configure.in (DEFFILE, ARCHFILE): miscellaneous system dependent + files. + + * configure.in (EXPORT_PREFIX): prefix to exported symbols on + Windows. + + * configure.in (COMMON_LIBS, COMMON_MACROS, COMMON_HEADERS): + libraries, macros and headers used in common. + + * configure.in (RUBYW_INSTALL_NAME, rubyw_install_name): GUI mode + excutable name. + + * Makefile.in (CFLAGS): append XCFLAGS. + + * Makefile.in (PREP): miscellaneous system dependent files. + + * Makefile.in (ruby.imp, ext/extinit.o): moved from ext/extmk.rb. + + * Makefile.in (fake.rb): CROSS_COMPILING keeps building platform. + + * Makefile.in (MAKEFILES): depend on *.in and config.status. + + * Makefile.in (parse.c): replace "y.tab.c" with actual name for + byacc. + + * ext/extmk.rb, lib/mkmf.rb: integrated. + + * ext/extmk.rb: propagate MFLAGS. + + * ext/extmk.rb (extmake): make dummy Makefile to clean even if no + Makefile is made. + + * lib/mkmf.rb (older): accept multiple file names and Time + objects. + + * lib/mkmf.rb (xsystem): split and qoute. + + * lib/mkmf.rb (cpp_include): make include directives. + + * lib/mkmf.rb (try_func): try wheather specified function is + available. + + * lib/mkmf.rb (install_files): default to site-install. + + * lib/mkmf.rb (checking_for): added. + + * lib/mkmf.rb (find_executable0): just find executable file with + no message. + + * lib/mkmf.rb (create_header): output header file is variable. + + * lib/mkmf.rb (create_makefile): separate sections. + + * lib/mkmf.rb (init_mkmf): initialize global variables. + + * win32/Makefile.sub, bcc32/Makefile.sub (CPP, AR): added. + + * bcc32/Makefile.sub (ARCH): fixed to i386. + + * win32/Makefile.sub, bcc32/Makefile.sub (miniruby): should not + link EXTOBJS. + + * ext/dl/extconf.rb: use try_cpp to cross compile. + + * ext/dl/extconf.rb: not modify files in source directory. + Fri Oct 18 23:11:21 2002 Nobuyoshi Nakada * parse.y (value_expr0): allow return/break/next/redo/retry in rhs diff --git a/Makefile.in b/Makefile.in index fec6198fb7..ebfed6861e 100644 --- a/Makefile.in +++ b/Makefile.in @@ -12,10 +12,20 @@ AUTOCONF = autoconf @SET_MAKE@ prefix = @prefix@ -CFLAGS = @CFLAGS@ +exec_prefix = @exec_prefix@ +bindir = @bindir@ +sbindir = @sbindir@ +libdir = @libdir@ +libexecdir = @libexecdir@ +arch = @arch@ +sitearch = @sitearch@ +sitedir = @sitedir@ + +CFLAGS = @CFLAGS@ @XCFLAGS@ CPPFLAGS = -I. -I$(srcdir) LDFLAGS = @STATIC@ $(CFLAGS) @LDFLAGS@ -XLDFLAGS = @XLDFLAGS@ +EXTLDFLAGS = +XLDFLAGS = @XLDFLAGS@ $(EXTLDFLAGS) EXTLIBS = LIBS = @LIBS@ $(EXTLIBS) MISSING = @LIBOBJS@ @ALLOCA@ @@ -28,6 +38,8 @@ RUBY_INSTALL_NAME=@RUBY_INSTALL_NAME@ RUBY_SO_NAME=@RUBY_SO_NAME@ EXEEXT = @EXEEXT@ PROGRAM=$(RUBY_INSTALL_NAME)$(EXEEXT) +RUBY = $(RUBY_INSTALL_NAME) +MINIRUBY = @MINIRUBY@ #### End of system configuration section. #### @@ -41,6 +53,9 @@ LIBRUBY_ALIASES= @LIBRUBY_ALIASES@ LIBRUBY = @LIBRUBY@ LIBRUBYARG = @LIBRUBYARG@ +PREP = @PREP@ @ARCHFILE@ +SETUP = + EXTOBJS = MAINOBJ = main.@OBJEXT@ @@ -83,14 +98,14 @@ OBJS = array.@OBJEXT@ \ version.@OBJEXT@ \ $(MISSING) -all: miniruby$(EXEEXT) @PREP@ rbconfig.rb $(LIBRUBY) - @@MINIRUBY@ $(srcdir)/ext/extmk.rb @EXTSTATIC@ +all: @MAKEFILES@ miniruby$(EXEEXT) rbconfig.rb $(LIBRUBY) + @$(MINIRUBY) $(srcdir)/ext/extmk.rb @EXTSTATIC@ $(MAKE) $(MFLAGS)$(MAKEFLAGS) miniruby$(EXEEXT): config.status $(LIBRUBY_A) $(MAINOBJ) dmyext.@OBJEXT@ @rm -f $@ $(PURIFY) $(CC) $(LDFLAGS) $(MAINOBJ) dmyext.@OBJEXT@ $(LIBRUBY_A) $(LIBS) -o $@ -$(PROGRAM): $(LIBRUBY) $(MAINOBJ) $(EXTOBJS) +$(PROGRAM): $(LIBRUBY) $(MAINOBJ) $(EXTOBJS) $(SETUP) miniruby$(EXEEXT) @rm -f $@ $(PURIFY) $(CC) $(LDFLAGS) $(XLDFLAGS) $(MAINLIBS) $(MAINOBJ) $(EXTOBJS) $(LIBRUBYARG) $(LIBS) -o $@ @@ -98,16 +113,22 @@ $(LIBRUBY_A): $(OBJS) dmyext.@OBJEXT@ @AR@ rcu $@ $(OBJS) dmyext.@OBJEXT@ @-@RANLIB@ $@ 2> /dev/null || true -$(LIBRUBY_SO): $(OBJS) dmyext.@OBJEXT@ miniruby$(EXEEXT) +$(LIBRUBY_SO): $(OBJS) dmyext.@OBJEXT@ miniruby$(EXEEXT) $(PREP) $(LDSHARED) $(DLDFLAGS) $(OBJS) dmyext.@OBJEXT@ $(SOLIBS) -o $@ - @-@MINIRUBY@ -e 'ARGV.each{|link| File.delete link if File.exist? link; \ + @-$(MINIRUBY) -e 'ARGV.each{|link| File.delete link if File.exist? link; \ File.symlink "$(LIBRUBY_SO)", link}' \ $(LIBRUBY_ALIASES) || true -install: rbconfig.rb - @MINIRUBY@ $(srcdir)/instruby.rb $(DESTDIR) +ruby.imp: $(LIBRUBY_A) + @@NM@ -Pgp $(LIBRUBY_A) | awk 'BEGIN{print "#!"}; $$2~/^[BD]$$/{print $$1}' | sort -u -o $@ +# $(MINIRUBY) $< $@ -clean-ext:; @-@MINIRUBY@ $(srcdir)/ext/extmk.rb clean 2> /dev/null || true +install: rbconfig.rb + $(MINIRUBY) $(srcdir)/instruby.rb --make=$(MAKE) $(MFLAGS)$(MAKEFLAGS) $(DESTDIR) + $(MINIRUBY) $(srcdir)/ext/extmk.rb $(MAKE) $(MFLAGS)$(MAKEFLAGS) DESTDIR=$(DESTDIR) install + +clean-ext: + @-$(MINIRUBY) $(srcdir)/ext/extmk.rb $(MAKE) $(MFLAGS)$(MAKEFLAGS) clean 2> /dev/null || true clean-local: @rm -f $(OBJS) $(MAINOBJ) $(LIBRUBY_A) $(LIBRUBY_SO) $(LIBRUBY_ALIASES) @@ -117,10 +138,10 @@ clean-local: clean: clean-ext clean-local distclean-ext: - @-@MINIRUBY@ $(srcdir)/ext/extmk.rb distclean 2> /dev/null || true + @-$(MINIRUBY) $(srcdir)/ext/extmk.rb $(MAKE) $(MFLAGS)$(MAKEFLAGS) distclean 2> /dev/null || true distclean-local: clean-local - @rm -f Makefile config.h rbconfig.rb + @rm -f @MAKEFILES@ config.h rbconfig.rb @rm -f ext/config.cache config.cache config.log config.status @rm -f *~ core *.core gmon.out y.tab.c y.output ruby.imp @@ -130,23 +151,37 @@ realclean: distclean @rm -f parse.c @rm -f lex.c -test: miniruby$(EXEEXT) rbconfig.rb +test: miniruby$(EXEEXT) rbconfig.rb $(PROGRAM) @./miniruby$(EXEEXT) $(srcdir)/rubytest.rb -rbconfig.rb: miniruby$(EXEEXT) $(srcdir)/mkconfig.rb config.status - @@MINIRUBY@ $(srcdir)/mkconfig.rb rbconfig.rb +rbconfig.rb: miniruby$(EXEEXT) $(srcdir)/mkconfig.rb config.status $(PREP) + @$(MINIRUBY) $(srcdir)/mkconfig.rb rbconfig.rb -fake.rb: miniruby$(EXEEXT) +fake.rb: miniruby$(EXEEXT) Makefile @echo ' \ class Object; \ + CROSS_COMPILING = RUBY_PLATFORM; \ remove_const :RUBY_PLATFORM; \ remove_const :RUBY_VERSION; \ RUBY_PLATFORM = "@arch@"; \ RUBY_VERSION = "@MAJOR@.@MINOR@.@TEENY@"; \ - CROSS_COMPILING = true; \ end \ ' > $@ +Makefile: $(srcdir)/Makefile.in + +.PRECIOUS: @MAKEFILES@ + +@MAKEFILES@: config.status + MAKE=$(MAKE) $(SHELL) ./config.status + @{ : $(MAKE); \ + echo "all:; -@rm -f conftest.mk"; \ + echo "conftest.mk: .force; @echo AUTO_REMAKE"; \ + echo ".force:"; \ + } > conftest.mk + @$(MAKE) -f conftest.mk | grep '^AUTO_REMAKE$$' >/dev/null 2>&1 || \ + { echo "Makefile updated, restart."; exit 1; } + config.status: $(srcdir)/configure $(SHELL) ./config.status --recheck @@ -159,9 +194,13 @@ $(srcdir)/configure: $(srcdir)/configure.in lex.c: keywords gperf -p -j1 -i 1 -g -o -t -N rb_reserved_word -k1,3,$$ $(srcdir)/keywords > lex.c -parse.c: parse.y +.y.c: $(YACC) $< - mv -f y.tab.c parse.c + sed '/^#/s|y\.tab\.c|$@|' y.tab.c > $@ + rm -f y.tab.c + +ext/extinit.@OBJEXT@: ext/extinit.c $(SETUP) + $(CC) $(CFLAGS) $(CPPFLAGS) @OUTFLAG@$@ -c ext/extinit.c acosh.@OBJEXT@: $(srcdir)/missing/acosh.c $(CC) -I. $(CFLAGS) $(CPPFLAGS) -c $(srcdir)/missing/acosh.c diff --git a/configure.in b/configure.in index 4e9d0c1be7..c5637dd8bc 100644 --- a/configure.in +++ b/configure.in @@ -161,6 +161,9 @@ cygwin*|mingw*) target_cpu=`echo $target_cpu | sed s/i.86/i386/` : ${enable_shared=yes} ;; +aix*) + AC_CHECK_TOOL(NM, nm, /usr/ccs/bin/nm, /usr/ccs/bin:$PATH) + ;; esac # by TOYODA Eizi @@ -651,6 +654,7 @@ AC_ARG_WITH(dln-a-out, *) with_dln_a_out=no;; esac], [with_dln_a_out=no]) +AC_SUBST(XCFLAGS)dnl AC_SUBST(XLDFLAGS)dnl AC_CACHE_CHECK(whether ELF binaries are produced, rb_cv_binary_elf, @@ -680,13 +684,13 @@ if test "$rb_cv_binary_elf" = yes; then fi case "$target_os" in - linux*) - if test "$rb_cv_binary_elf" = no; then - with_dln_a_out=yes - target_os=${target_os}-a_out - else - LDFLAGS="-rdynamic" - fi;; +linux*) + if test "$rb_cv_binary_elf" = no; then + with_dln_a_out=yes + target_os=${target_os}-a_out + else + LDFLAGS="-rdynamic" + fi;; netbsd*) if [[ "`$CC -dM -E -