mirror of
https://github.com/ruby/ruby.git
synced 2022-11-09 12:17:21 -05:00
* 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. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@2977 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
parent
8209f4fb71
commit
b9ecdfaa3d
4 changed files with 239 additions and 71 deletions
77
ChangeLog
77
ChangeLog
|
@ -1,3 +1,80 @@
|
||||||
|
Mon Oct 21 22:53:02 2002 Nobuyoshi Nakada <nobu.nokada@softhome.net>
|
||||||
|
|
||||||
|
* 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 <nobu.nokada@softhome.net>
|
Fri Oct 18 23:11:21 2002 Nobuyoshi Nakada <nobu.nokada@softhome.net>
|
||||||
|
|
||||||
* parse.y (value_expr0): allow return/break/next/redo/retry in rhs
|
* parse.y (value_expr0): allow return/break/next/redo/retry in rhs
|
||||||
|
|
77
Makefile.in
77
Makefile.in
|
@ -12,10 +12,20 @@ AUTOCONF = autoconf
|
||||||
@SET_MAKE@
|
@SET_MAKE@
|
||||||
|
|
||||||
prefix = @prefix@
|
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)
|
CPPFLAGS = -I. -I$(srcdir)
|
||||||
LDFLAGS = @STATIC@ $(CFLAGS) @LDFLAGS@
|
LDFLAGS = @STATIC@ $(CFLAGS) @LDFLAGS@
|
||||||
XLDFLAGS = @XLDFLAGS@
|
EXTLDFLAGS =
|
||||||
|
XLDFLAGS = @XLDFLAGS@ $(EXTLDFLAGS)
|
||||||
EXTLIBS =
|
EXTLIBS =
|
||||||
LIBS = @LIBS@ $(EXTLIBS)
|
LIBS = @LIBS@ $(EXTLIBS)
|
||||||
MISSING = @LIBOBJS@ @ALLOCA@
|
MISSING = @LIBOBJS@ @ALLOCA@
|
||||||
|
@ -28,6 +38,8 @@ RUBY_INSTALL_NAME=@RUBY_INSTALL_NAME@
|
||||||
RUBY_SO_NAME=@RUBY_SO_NAME@
|
RUBY_SO_NAME=@RUBY_SO_NAME@
|
||||||
EXEEXT = @EXEEXT@
|
EXEEXT = @EXEEXT@
|
||||||
PROGRAM=$(RUBY_INSTALL_NAME)$(EXEEXT)
|
PROGRAM=$(RUBY_INSTALL_NAME)$(EXEEXT)
|
||||||
|
RUBY = $(RUBY_INSTALL_NAME)
|
||||||
|
MINIRUBY = @MINIRUBY@
|
||||||
|
|
||||||
#### End of system configuration section. ####
|
#### End of system configuration section. ####
|
||||||
|
|
||||||
|
@ -41,6 +53,9 @@ LIBRUBY_ALIASES= @LIBRUBY_ALIASES@
|
||||||
LIBRUBY = @LIBRUBY@
|
LIBRUBY = @LIBRUBY@
|
||||||
LIBRUBYARG = @LIBRUBYARG@
|
LIBRUBYARG = @LIBRUBYARG@
|
||||||
|
|
||||||
|
PREP = @PREP@ @ARCHFILE@
|
||||||
|
SETUP =
|
||||||
|
|
||||||
EXTOBJS =
|
EXTOBJS =
|
||||||
|
|
||||||
MAINOBJ = main.@OBJEXT@
|
MAINOBJ = main.@OBJEXT@
|
||||||
|
@ -83,14 +98,14 @@ OBJS = array.@OBJEXT@ \
|
||||||
version.@OBJEXT@ \
|
version.@OBJEXT@ \
|
||||||
$(MISSING)
|
$(MISSING)
|
||||||
|
|
||||||
all: miniruby$(EXEEXT) @PREP@ rbconfig.rb $(LIBRUBY)
|
all: @MAKEFILES@ miniruby$(EXEEXT) rbconfig.rb $(LIBRUBY)
|
||||||
@@MINIRUBY@ $(srcdir)/ext/extmk.rb @EXTSTATIC@
|
@$(MINIRUBY) $(srcdir)/ext/extmk.rb @EXTSTATIC@ $(MAKE) $(MFLAGS)$(MAKEFLAGS)
|
||||||
|
|
||||||
miniruby$(EXEEXT): config.status $(LIBRUBY_A) $(MAINOBJ) dmyext.@OBJEXT@
|
miniruby$(EXEEXT): config.status $(LIBRUBY_A) $(MAINOBJ) dmyext.@OBJEXT@
|
||||||
@rm -f $@
|
@rm -f $@
|
||||||
$(PURIFY) $(CC) $(LDFLAGS) $(MAINOBJ) dmyext.@OBJEXT@ $(LIBRUBY_A) $(LIBS) -o $@
|
$(PURIFY) $(CC) $(LDFLAGS) $(MAINOBJ) dmyext.@OBJEXT@ $(LIBRUBY_A) $(LIBS) -o $@
|
||||||
|
|
||||||
$(PROGRAM): $(LIBRUBY) $(MAINOBJ) $(EXTOBJS)
|
$(PROGRAM): $(LIBRUBY) $(MAINOBJ) $(EXTOBJS) $(SETUP) miniruby$(EXEEXT)
|
||||||
@rm -f $@
|
@rm -f $@
|
||||||
$(PURIFY) $(CC) $(LDFLAGS) $(XLDFLAGS) $(MAINLIBS) $(MAINOBJ) $(EXTOBJS) $(LIBRUBYARG) $(LIBS) -o $@
|
$(PURIFY) $(CC) $(LDFLAGS) $(XLDFLAGS) $(MAINLIBS) $(MAINOBJ) $(EXTOBJS) $(LIBRUBYARG) $(LIBS) -o $@
|
||||||
|
|
||||||
|
@ -98,16 +113,22 @@ $(LIBRUBY_A): $(OBJS) dmyext.@OBJEXT@
|
||||||
@AR@ rcu $@ $(OBJS) dmyext.@OBJEXT@
|
@AR@ rcu $@ $(OBJS) dmyext.@OBJEXT@
|
||||||
@-@RANLIB@ $@ 2> /dev/null || true
|
@-@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 $@
|
$(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}' \
|
File.symlink "$(LIBRUBY_SO)", link}' \
|
||||||
$(LIBRUBY_ALIASES) || true
|
$(LIBRUBY_ALIASES) || true
|
||||||
|
|
||||||
install: rbconfig.rb
|
ruby.imp: $(LIBRUBY_A)
|
||||||
@MINIRUBY@ $(srcdir)/instruby.rb $(DESTDIR)
|
@@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:
|
clean-local:
|
||||||
@rm -f $(OBJS) $(MAINOBJ) $(LIBRUBY_A) $(LIBRUBY_SO) $(LIBRUBY_ALIASES)
|
@rm -f $(OBJS) $(MAINOBJ) $(LIBRUBY_A) $(LIBRUBY_SO) $(LIBRUBY_ALIASES)
|
||||||
|
@ -117,10 +138,10 @@ clean-local:
|
||||||
clean: clean-ext clean-local
|
clean: clean-ext clean-local
|
||||||
|
|
||||||
distclean-ext:
|
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
|
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 ext/config.cache config.cache config.log config.status
|
||||||
@rm -f *~ core *.core gmon.out y.tab.c y.output ruby.imp
|
@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 parse.c
|
||||||
@rm -f lex.c
|
@rm -f lex.c
|
||||||
|
|
||||||
test: miniruby$(EXEEXT) rbconfig.rb
|
test: miniruby$(EXEEXT) rbconfig.rb $(PROGRAM)
|
||||||
@./miniruby$(EXEEXT) $(srcdir)/rubytest.rb
|
@./miniruby$(EXEEXT) $(srcdir)/rubytest.rb
|
||||||
|
|
||||||
rbconfig.rb: miniruby$(EXEEXT) $(srcdir)/mkconfig.rb config.status
|
rbconfig.rb: miniruby$(EXEEXT) $(srcdir)/mkconfig.rb config.status $(PREP)
|
||||||
@@MINIRUBY@ $(srcdir)/mkconfig.rb rbconfig.rb
|
@$(MINIRUBY) $(srcdir)/mkconfig.rb rbconfig.rb
|
||||||
|
|
||||||
fake.rb: miniruby$(EXEEXT)
|
fake.rb: miniruby$(EXEEXT) Makefile
|
||||||
@echo ' \
|
@echo ' \
|
||||||
class Object; \
|
class Object; \
|
||||||
|
CROSS_COMPILING = RUBY_PLATFORM; \
|
||||||
remove_const :RUBY_PLATFORM; \
|
remove_const :RUBY_PLATFORM; \
|
||||||
remove_const :RUBY_VERSION; \
|
remove_const :RUBY_VERSION; \
|
||||||
RUBY_PLATFORM = "@arch@"; \
|
RUBY_PLATFORM = "@arch@"; \
|
||||||
RUBY_VERSION = "@MAJOR@.@MINOR@.@TEENY@"; \
|
RUBY_VERSION = "@MAJOR@.@MINOR@.@TEENY@"; \
|
||||||
CROSS_COMPILING = true; \
|
|
||||||
end \
|
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
|
config.status: $(srcdir)/configure
|
||||||
$(SHELL) ./config.status --recheck
|
$(SHELL) ./config.status --recheck
|
||||||
|
|
||||||
|
@ -159,9 +194,13 @@ $(srcdir)/configure: $(srcdir)/configure.in
|
||||||
lex.c: keywords
|
lex.c: keywords
|
||||||
gperf -p -j1 -i 1 -g -o -t -N rb_reserved_word -k1,3,$$ $(srcdir)/keywords > lex.c
|
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) $<
|
$(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
|
acosh.@OBJEXT@: $(srcdir)/missing/acosh.c
|
||||||
$(CC) -I. $(CFLAGS) $(CPPFLAGS) -c $(srcdir)/missing/acosh.c
|
$(CC) -I. $(CFLAGS) $(CPPFLAGS) -c $(srcdir)/missing/acosh.c
|
||||||
|
|
107
configure.in
107
configure.in
|
@ -161,6 +161,9 @@ cygwin*|mingw*)
|
||||||
target_cpu=`echo $target_cpu | sed s/i.86/i386/`
|
target_cpu=`echo $target_cpu | sed s/i.86/i386/`
|
||||||
: ${enable_shared=yes}
|
: ${enable_shared=yes}
|
||||||
;;
|
;;
|
||||||
|
aix*)
|
||||||
|
AC_CHECK_TOOL(NM, nm, /usr/ccs/bin/nm, /usr/ccs/bin:$PATH)
|
||||||
|
;;
|
||||||
esac
|
esac
|
||||||
|
|
||||||
# by TOYODA Eizi <toyoda@npd.kishou.go.jp>
|
# by TOYODA Eizi <toyoda@npd.kishou.go.jp>
|
||||||
|
@ -651,6 +654,7 @@ AC_ARG_WITH(dln-a-out,
|
||||||
*) with_dln_a_out=no;;
|
*) with_dln_a_out=no;;
|
||||||
esac], [with_dln_a_out=no])
|
esac], [with_dln_a_out=no])
|
||||||
|
|
||||||
|
AC_SUBST(XCFLAGS)dnl
|
||||||
AC_SUBST(XLDFLAGS)dnl
|
AC_SUBST(XLDFLAGS)dnl
|
||||||
|
|
||||||
AC_CACHE_CHECK(whether ELF binaries are produced, rb_cv_binary_elf,
|
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
|
fi
|
||||||
|
|
||||||
case "$target_os" in
|
case "$target_os" in
|
||||||
linux*)
|
linux*)
|
||||||
if test "$rb_cv_binary_elf" = no; then
|
if test "$rb_cv_binary_elf" = no; then
|
||||||
with_dln_a_out=yes
|
with_dln_a_out=yes
|
||||||
target_os=${target_os}-a_out
|
target_os=${target_os}-a_out
|
||||||
else
|
else
|
||||||
LDFLAGS="-rdynamic"
|
LDFLAGS="-rdynamic"
|
||||||
fi;;
|
fi;;
|
||||||
netbsd*)
|
netbsd*)
|
||||||
if [[ "`$CC -dM -E - </dev/null | grep __ELF__`" != "" ]]
|
if [[ "`$CC -dM -E - </dev/null | grep __ELF__`" != "" ]]
|
||||||
then
|
then
|
||||||
|
@ -696,6 +700,7 @@ netbsd*)
|
||||||
fi
|
fi
|
||||||
;;
|
;;
|
||||||
esac
|
esac
|
||||||
|
LIBEXT=a
|
||||||
|
|
||||||
AC_SUBST(DLDFLAGS)dnl
|
AC_SUBST(DLDFLAGS)dnl
|
||||||
|
|
||||||
|
@ -704,8 +709,10 @@ AC_SUBST(CCDLFLAGS)dnl
|
||||||
AC_SUBST(LDSHARED)dnl
|
AC_SUBST(LDSHARED)dnl
|
||||||
AC_SUBST(DLEXT)dnl
|
AC_SUBST(DLEXT)dnl
|
||||||
AC_SUBST(DLEXT2)dnl
|
AC_SUBST(DLEXT2)dnl
|
||||||
|
AC_SUBST(LIBEXT)dnl
|
||||||
|
|
||||||
STATIC=
|
STATIC=
|
||||||
|
LIBPATHFLAG=' -L%s'
|
||||||
|
|
||||||
if test "$with_dln_a_out" != yes; then
|
if test "$with_dln_a_out" != yes; then
|
||||||
rb_cv_dlopen=unknown
|
rb_cv_dlopen=unknown
|
||||||
|
@ -777,6 +784,7 @@ if test "$with_dln_a_out" != yes; then
|
||||||
netbsd*) LDSHARED='${CC} -shared'
|
netbsd*) LDSHARED='${CC} -shared'
|
||||||
if test "$rb_cv_binary_elf" = yes; then
|
if test "$rb_cv_binary_elf" = yes; then
|
||||||
LDFLAGS="-Wl,-export-dynamic"
|
LDFLAGS="-Wl,-export-dynamic"
|
||||||
|
LIBPATHFLAG=' -L%1$s -Wl,-R%1$s'
|
||||||
fi
|
fi
|
||||||
rb_cv_dlopen=yes ;;
|
rb_cv_dlopen=yes ;;
|
||||||
openbsd*) LDSHARED="ld -Bforcearchive -Bshareable"
|
openbsd*) LDSHARED="ld -Bforcearchive -Bshareable"
|
||||||
|
@ -786,7 +794,7 @@ if test "$with_dln_a_out" != yes; then
|
||||||
rb_cv_dlopen=yes ;;
|
rb_cv_dlopen=yes ;;
|
||||||
esac ;;
|
esac ;;
|
||||||
bsdi*) LDSHARED="ld -shared"
|
bsdi*) LDSHARED="ld -shared"
|
||||||
LDFLAGS='-rdynamic -Wl,-rpath,$(prefix)/lib/ruby/$(MAJOR).$(MINOR)/i386-bsdi4.0'
|
LDFLAGS='-rdynamic -Wl,-rpath,$(libdir)/ruby/$(MAJOR).$(MINOR)/i386-bsdi4.0'
|
||||||
rb_cv_dlopen=yes ;;
|
rb_cv_dlopen=yes ;;
|
||||||
nextstep*) LDSHARED='cc -r -nostdlib'
|
nextstep*) LDSHARED='cc -r -nostdlib'
|
||||||
LDFLAGS="-u libsys_s"
|
LDFLAGS="-u libsys_s"
|
||||||
|
@ -813,6 +821,7 @@ if test "$with_dln_a_out" != yes; then
|
||||||
human*) DLDFLAGS=''
|
human*) DLDFLAGS=''
|
||||||
LDSHARED=''
|
LDSHARED=''
|
||||||
LDFLAGS=''
|
LDFLAGS=''
|
||||||
|
LINK_SO='ar cru $@ $(OBJS)'
|
||||||
rb_cv_dlopen=yes ;;
|
rb_cv_dlopen=yes ;;
|
||||||
beos*) case "$target_cpu" in
|
beos*) case "$target_cpu" in
|
||||||
powerpc*)
|
powerpc*)
|
||||||
|
@ -830,13 +839,16 @@ if test "$with_dln_a_out" != yes; then
|
||||||
LDFLAGS="-L/lib -L/usr/lib -L/usr/local/lib"
|
LDFLAGS="-L/lib -L/usr/lib -L/usr/local/lib"
|
||||||
rb_cv_dlopen=yes;;
|
rb_cv_dlopen=yes;;
|
||||||
cygwin*|mingw*) : ${LDSHARED="${CC} -shared -s"}
|
cygwin*|mingw*) : ${LDSHARED="${CC} -shared -s"}
|
||||||
LDFLAGS='-Wl,--stack,0x02000000'
|
XLDFLAGS='-Wl,--stack,0x02000000'
|
||||||
|
DLDFLAGS="${DLDFLAGS} "'$(DEFFILE)'
|
||||||
rb_cv_dlopen=yes ;;
|
rb_cv_dlopen=yes ;;
|
||||||
hiuxmpp) LDSHARED='ld -r' ;;
|
hiuxmpp) LDSHARED='ld -r' ;;
|
||||||
*) LDSHARED='ld' ;;
|
*) LDSHARED='ld' ;;
|
||||||
esac
|
esac
|
||||||
AC_MSG_RESULT($rb_cv_dlopen)
|
AC_MSG_RESULT($rb_cv_dlopen)
|
||||||
fi
|
fi
|
||||||
|
AC_SUBST(LINK_SO)
|
||||||
|
AC_SUBST(LIBPATHFLAG)
|
||||||
|
|
||||||
dln_a_out_works=no
|
dln_a_out_works=no
|
||||||
if test "$ac_cv_header_a_out_h" = yes; then
|
if test "$ac_cv_header_a_out_h" = yes; then
|
||||||
|
@ -964,7 +976,8 @@ rb_cv_missing_fconvert=yes, rb_cv_missing_fconvert=no, rb_cv_missing_fconvert=no
|
||||||
AC_DEFINE(MISSING_FCONVERT)
|
AC_DEFINE(MISSING_FCONVERT)
|
||||||
fi
|
fi
|
||||||
AC_LIBOBJ([x68.o])
|
AC_LIBOBJ([x68.o])
|
||||||
CFLAGS="$CFLAGS -fansi-only -cc1-stack=262144 -cpp-stack=2694144"
|
CFLAGS="$CFLAGS -fansi-only"
|
||||||
|
XCFLAGS="-cc1-stack=262144 -cpp-stack=2694144"
|
||||||
EXEEXT=.x
|
EXEEXT=.x
|
||||||
OBJEXT=o
|
OBJEXT=o
|
||||||
setup=Setup.x68
|
setup=Setup.x68
|
||||||
|
@ -992,11 +1005,11 @@ if test "$prefix" = NONE; then
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if test "$fat_binary" = yes ; then
|
if test "$fat_binary" = yes ; then
|
||||||
CFLAGS="$CFLAGS $ARCH_FLAG"
|
XCFLAGS="$ARCH_FLAG"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if test x"$cross_compiling" = xyes; then
|
if test x"$cross_compiling" = xyes; then
|
||||||
MINIRUBY="ruby -I`pwd` -rfake"
|
MINIRUBY="${RUBY-ruby} -I`pwd` -rfake"
|
||||||
PREP=fake.rb
|
PREP=fake.rb
|
||||||
else
|
else
|
||||||
MINIRUBY='./miniruby$(EXEEXT)'
|
MINIRUBY='./miniruby$(EXEEXT)'
|
||||||
|
@ -1008,7 +1021,7 @@ AC_SUBST(PREP)
|
||||||
FIRSTMAKEFILE=""
|
FIRSTMAKEFILE=""
|
||||||
LIBRUBY_A='lib$(RUBY_INSTALL_NAME).a'
|
LIBRUBY_A='lib$(RUBY_INSTALL_NAME).a'
|
||||||
LIBRUBY='$(LIBRUBY_A)'
|
LIBRUBY='$(LIBRUBY_A)'
|
||||||
LIBRUBYARG='$(LIBRUBY_A)'
|
LIBRUBYARG='-l$(RUBY_INSTALL_NAME)'
|
||||||
SOLIBS=
|
SOLIBS=
|
||||||
|
|
||||||
case "$target_os" in
|
case "$target_os" in
|
||||||
|
@ -1020,10 +1033,11 @@ case "$target_os" in
|
||||||
;;
|
;;
|
||||||
esac
|
esac
|
||||||
|
|
||||||
|
RUBY_SO_NAME='$(RUBY_INSTALL_NAME)'
|
||||||
LIBRUBY_LDSHARED=$LDSHARED
|
LIBRUBY_LDSHARED=$LDSHARED
|
||||||
LIBRUBY_DLDFLAGS=$DLDFLAGS
|
LIBRUBY_DLDFLAGS=$DLDFLAGS
|
||||||
LIBRUBY_SO='lib$(RUBY_INSTALL_NAME).so.$(MAJOR).$(MINOR).$(TEENY)'
|
LIBRUBY_SO='lib$(RUBY_SO_NAME).so.$(MAJOR).$(MINOR).$(TEENY)'
|
||||||
LIBRUBY_ALIASES='lib$(RUBY_INSTALL_NAME).so'
|
LIBRUBY_ALIASES='lib$(RUBY_SO_NAME).so'
|
||||||
ENABLE_SHARED=no
|
ENABLE_SHARED=no
|
||||||
|
|
||||||
AC_ARG_ENABLE(shared,
|
AC_ARG_ENABLE(shared,
|
||||||
|
@ -1031,7 +1045,7 @@ AC_ARG_ENABLE(shared,
|
||||||
[enable_shared=$enableval])
|
[enable_shared=$enableval])
|
||||||
if test "$enable_shared" = 'yes'; then
|
if test "$enable_shared" = 'yes'; then
|
||||||
LIBRUBY='$(LIBRUBY_SO)'
|
LIBRUBY='$(LIBRUBY_SO)'
|
||||||
LIBRUBYARG='-L. -l$(RUBY_INSTALL_NAME)'
|
LIBRUBYARG='-l$(RUBY_SO_NAME)'
|
||||||
CFLAGS="$CFLAGS $CCDLFLAGS"
|
CFLAGS="$CFLAGS $CCDLFLAGS"
|
||||||
ENABLE_SHARED=yes
|
ENABLE_SHARED=yes
|
||||||
if test "$rb_cv_binary_elf" = yes; then
|
if test "$rb_cv_binary_elf" = yes; then
|
||||||
|
@ -1039,19 +1053,20 @@ if test "$enable_shared" = 'yes'; then
|
||||||
fi
|
fi
|
||||||
case "$target_os" in
|
case "$target_os" in
|
||||||
sunos4*)
|
sunos4*)
|
||||||
LIBRUBY_ALIASES='lib$(RUBY_INSTALL_NAME).so.$(MAJOR).$(MINOR) lib$(RUBY_INSTALL_NAME).so'
|
LIBRUBY_ALIASES='lib$(RUBY_SO_NAME).so.$(MAJOR).$(MINOR) lib$(RUBY_SO_NAME).so'
|
||||||
;;
|
;;
|
||||||
linux*)
|
linux*)
|
||||||
LIBRUBY_DLDFLAGS='-Wl,-soname,lib$(RUBY_INSTALL_NAME).so.$(MAJOR).$(MINOR)'
|
LIBRUBY_DLDFLAGS='-Wl,-soname,lib$(RUBY_SO_NAME).so.$(MAJOR).$(MINOR)'
|
||||||
LIBRUBY_ALIASES='lib$(RUBY_INSTALL_NAME).so.$(MAJOR).$(MINOR) lib$(RUBY_INSTALL_NAME).so'
|
LIBRUBY_ALIASES='lib$(RUBY_SO_NAME).so.$(MAJOR).$(MINOR) lib$(RUBY_SO_NAME).so'
|
||||||
|
test "$rb_cv_prog_gnu_ld" = yes && DLDFLAGS="$DLDFLAGS -Wl,-no-undefined"
|
||||||
;;
|
;;
|
||||||
gnu*)
|
gnu*)
|
||||||
LIBRUBY_DLDFLAGS='-Wl,-soname,lib$(RUBY_INSTALL_NAME).so.$(MAJOR).$(MINOR)'
|
LIBRUBY_DLDFLAGS='-Wl,-soname,lib$(RUBY_SO_NAME).so.$(MAJOR).$(MINOR)'
|
||||||
LIBRUBY_ALIASES='lib$(RUBY_INSTALL_NAME).so.$(MAJOR).$(MINOR) lib$(RUBY_INSTALL_NAME).so'
|
LIBRUBY_ALIASES='lib$(RUBY_SO_NAME).so.$(MAJOR).$(MINOR) lib$(RUBY_SO_NAME).so'
|
||||||
;;
|
;;
|
||||||
freebsd*)
|
freebsd*)
|
||||||
SOLIBS='$(LIBS)'
|
SOLIBS='$(LIBS)'
|
||||||
LIBRUBY_SO='lib$(RUBY_INSTALL_NAME).so.$(MAJOR)$(MINOR)'
|
LIBRUBY_SO='lib$(RUBY_SO_NAME).so.$(MAJOR)$(MINOR)'
|
||||||
if test "$rb_cv_binary_elf" != "yes" ; then
|
if test "$rb_cv_binary_elf" != "yes" ; then
|
||||||
LIBRUBY_SO="$LIBRUBY_SO.\$(TEENY)"
|
LIBRUBY_SO="$LIBRUBY_SO.\$(TEENY)"
|
||||||
LIBRUBY_ALIASES=''
|
LIBRUBY_ALIASES=''
|
||||||
|
@ -1059,11 +1074,11 @@ if test "$enable_shared" = 'yes'; then
|
||||||
;;
|
;;
|
||||||
netbsd*)
|
netbsd*)
|
||||||
SOLIBS='$(LIBS)'
|
SOLIBS='$(LIBS)'
|
||||||
LIBRUBY_SO='lib$(RUBY_INSTALL_NAME).so.$(MAJOR)$(MINOR).$(TEENY)'
|
LIBRUBY_SO='lib$(RUBY_SO_NAME).so.$(MAJOR)$(MINOR).$(TEENY)'
|
||||||
LIBRUBY_DLDFLAGS='-Wl,-soname,lib$(RUBY_INSTALL_NAME).so.$(MAJOR)$(MINOR)'
|
LIBRUBY_DLDFLAGS='-Wl,-soname,lib$(RUBY_SO_NAME).so.$(MAJOR)$(MINOR)'
|
||||||
LIBRUBYARG='-Wl,-R -Wl,${prefix}/lib -L${prefix}/lib -L. -l$(RUBY_INSTALL_NAME)'
|
LIBRUBYARG='-Wl,-R -Wl,${libdir} -L${libdir} -L. -l$(RUBY_SO_NAME)'
|
||||||
if test "$rb_cv_binary_elf" = yes; then # ELF platforms
|
if test "$rb_cv_binary_elf" = yes; then # ELF platforms
|
||||||
LIBRUBY_ALIASES='lib$(RUBY_INSTALL_NAME).so.$(MAJOR)$(MINOR) lib$(RUBY_INSTALL_NAME).so'
|
LIBRUBY_ALIASES='lib$(RUBY_SO_NAME).so.$(MAJOR)$(MINOR) lib$(RUBY_SO_NAME).so'
|
||||||
else # a.out platforms
|
else # a.out platforms
|
||||||
LIBRUBY_ALIASES=""
|
LIBRUBY_ALIASES=""
|
||||||
fi
|
fi
|
||||||
|
@ -1072,12 +1087,12 @@ if test "$enable_shared" = 'yes'; then
|
||||||
SOLIBS='$(LIBS)'
|
SOLIBS='$(LIBS)'
|
||||||
;;
|
;;
|
||||||
solaris*)
|
solaris*)
|
||||||
XLDFLAGS='-R${prefix}/lib'
|
XLDFLAGS='-R${libdir}'
|
||||||
;;
|
;;
|
||||||
hpux*)
|
hpux*)
|
||||||
XLDFLAGS='-Wl,+s,+b,$(prefix)/lib'
|
XLDFLAGS='-Wl,+s,+b,$(libdir)'
|
||||||
LIBRUBY_SO='lib$(RUBY_INSTALL_NAME).sl.$(MAJOR).$(MINOR).$(TEENY)'
|
LIBRUBY_SO='lib$(RUBY_SO_NAME).sl.$(MAJOR).$(MINOR).$(TEENY)'
|
||||||
LIBRUBY_ALIASES='lib$(RUBY_INSTALL_NAME).sl.$(MAJOR).$(MINOR) lib$(RUBY_INSTALL_NAME).sl'
|
LIBRUBY_ALIASES='lib$(RUBY_SO_NAME).sl.$(MAJOR).$(MINOR) lib$(RUBY_SO_NAME).sl'
|
||||||
;;
|
;;
|
||||||
aix*)
|
aix*)
|
||||||
if test "$GCC" = yes; then
|
if test "$GCC" = yes; then
|
||||||
|
@ -1086,8 +1101,9 @@ if test "$enable_shared" = 'yes'; then
|
||||||
else
|
else
|
||||||
LIBRUBY_LDSHARED='/usr/ccs/bin/ld'
|
LIBRUBY_LDSHARED='/usr/ccs/bin/ld'
|
||||||
LIBRUBY_DLDFLAGS='-bE:ruby.imp -bM:SRE -bnoentry'
|
LIBRUBY_DLDFLAGS='-bE:ruby.imp -bM:SRE -bnoentry'
|
||||||
|
ARCHFILE="ruby.imp"
|
||||||
fi
|
fi
|
||||||
LIBRUBYARG='-L${prefix}/lib -Wl,lib$(RUBY_INSTALL_NAME).so'
|
LIBRUBYARG='-L${libdir} -Wl,lib$(RUBY_SO_NAME).so'
|
||||||
SOLIBS='-lm -lc'
|
SOLIBS='-lm -lc'
|
||||||
;;
|
;;
|
||||||
beos*)
|
beos*)
|
||||||
|
@ -1098,15 +1114,17 @@ if test "$enable_shared" = 'yes'; then
|
||||||
esac
|
esac
|
||||||
;;
|
;;
|
||||||
darwin*)
|
darwin*)
|
||||||
LIBRUBY_SO='lib$(RUBY_INSTALL_NAME).$(MAJOR).$(MINOR).$(TEENY).dylib'
|
LIBRUBY_SO='lib$(RUBY_SO_NAME).$(MAJOR).$(MINOR).$(TEENY).dylib'
|
||||||
LIBRUBY_LDSHARED='cc -dynamiclib -undefined suppress -flat_namespace'
|
LIBRUBY_LDSHARED='cc -dynamiclib -undefined suppress -flat_namespace'
|
||||||
LIBRUBY_DLDFLAGS='-install_name $(prefix)/lib/lib$(RUBY_INSTALL_NAME).dylib -current_version $(MAJOR).$(MINOR).$(TEENY) -compatibility_version $(MAJOR).$(MINOR)'
|
LIBRUBY_DLDFLAGS='-install_name $(libdir)/lib$(RUBY_SO_NAME).dylib -current_version $(MAJOR).$(MINOR).$(TEENY) -compatibility_version $(MAJOR).$(MINOR)'
|
||||||
LIBRUBY_ALIASES='lib$(RUBY_INSTALL_NAME).$(MAJOR).$(MINOR).dylib lib$(RUBY_INSTALL_NAME).dylib'
|
LIBRUBY_ALIASES='lib$(RUBY_SO_NAME).$(MAJOR).$(MINOR).dylib lib$(RUBY_SO_NAME).dylib'
|
||||||
;;
|
;;
|
||||||
*)
|
*)
|
||||||
;;
|
;;
|
||||||
esac
|
esac
|
||||||
fi
|
fi
|
||||||
|
XLDFLAGS="$XLDFLAGS -L."
|
||||||
|
AC_SUBST(ARCHFILE)
|
||||||
|
|
||||||
case "$target_os" in
|
case "$target_os" in
|
||||||
netbsd*)
|
netbsd*)
|
||||||
|
@ -1151,6 +1169,7 @@ case "$target_os" in
|
||||||
esac
|
esac
|
||||||
;;
|
;;
|
||||||
cygwin*|mingw*)
|
cygwin*|mingw*)
|
||||||
|
EXPORT_PREFIX=' '
|
||||||
case "$target_os" in
|
case "$target_os" in
|
||||||
cygwin*)
|
cygwin*)
|
||||||
RUBY_SO_NAME=$target_os-'$(RUBY_INSTALL_NAME)'${MAJOR}${MINOR}
|
RUBY_SO_NAME=$target_os-'$(RUBY_INSTALL_NAME)'${MAJOR}${MINOR}
|
||||||
|
@ -1159,6 +1178,9 @@ case "$target_os" in
|
||||||
mingw*)
|
mingw*)
|
||||||
RUBY_SO_NAME=msvcrt-'$(RUBY_INSTALL_NAME)'${MAJOR}${MINOR}
|
RUBY_SO_NAME=msvcrt-'$(RUBY_INSTALL_NAME)'${MAJOR}${MINOR}
|
||||||
AC_LIBOBJ([win32])
|
AC_LIBOBJ([win32])
|
||||||
|
COMMON_LIBS=m
|
||||||
|
COMMON_MACROS="WIN32_LEAN_AND_MEAN="
|
||||||
|
COMMON_HEADERS="windows.h winsock.h"
|
||||||
CFLAGS="-DNT -D__NO_ISOCEXT $CFLAGS"
|
CFLAGS="-DNT -D__NO_ISOCEXT $CFLAGS"
|
||||||
CCDLFLAGS=-DIMPORT ;;
|
CCDLFLAGS=-DIMPORT ;;
|
||||||
esac
|
esac
|
||||||
|
@ -1173,7 +1195,6 @@ case "$target_os" in
|
||||||
fi
|
fi
|
||||||
LIBRUBY_ALIASES=''
|
LIBRUBY_ALIASES=''
|
||||||
LIBRUBY_A='lib$(RUBY_INSTALL_NAME)s.a'
|
LIBRUBY_A='lib$(RUBY_INSTALL_NAME)s.a'
|
||||||
LIBRUBYARG='-L. -l$(RUBY_SO_NAME)'
|
|
||||||
FIRSTMAKEFILE=GNUmakefile:cygwin/GNUmakefile.in
|
FIRSTMAKEFILE=GNUmakefile:cygwin/GNUmakefile.in
|
||||||
SOLIBS='$(LIBS)'
|
SOLIBS='$(LIBS)'
|
||||||
;;
|
;;
|
||||||
|
@ -1184,6 +1205,8 @@ esac
|
||||||
AC_SUBST(LIBRUBY_LDSHARED)
|
AC_SUBST(LIBRUBY_LDSHARED)
|
||||||
AC_SUBST(LIBRUBY_DLDFLAGS)
|
AC_SUBST(LIBRUBY_DLDFLAGS)
|
||||||
AC_SUBST(RUBY_INSTALL_NAME)
|
AC_SUBST(RUBY_INSTALL_NAME)
|
||||||
|
AC_SUBST(rubyw_install_name)
|
||||||
|
AC_SUBST(RUBYW_INSTALL_NAME)
|
||||||
AC_SUBST(RUBY_SO_NAME)
|
AC_SUBST(RUBY_SO_NAME)
|
||||||
AC_SUBST(LIBRUBY_A)
|
AC_SUBST(LIBRUBY_A)
|
||||||
AC_SUBST(LIBRUBY_SO)
|
AC_SUBST(LIBRUBY_SO)
|
||||||
|
@ -1194,6 +1217,14 @@ AC_SUBST(SOLIBS)
|
||||||
AC_SUBST(DLDLIBS)
|
AC_SUBST(DLDLIBS)
|
||||||
AC_SUBST(ENABLE_SHARED)
|
AC_SUBST(ENABLE_SHARED)
|
||||||
AC_SUBST(MAINLIBS)
|
AC_SUBST(MAINLIBS)
|
||||||
|
AC_SUBST(COMMON_LIBS)
|
||||||
|
AC_SUBST(COMMON_MACROS)
|
||||||
|
AC_SUBST(COMMON_HEADERS)
|
||||||
|
AC_SUBST(EXPORT_PREFIX)
|
||||||
|
|
||||||
|
MAKEFILES="Makefile `echo $FIRSTMAKEFILE | sed 's/:.*//'`"
|
||||||
|
MAKEFILES="`echo $MAKEFILES`"
|
||||||
|
AC_SUBST(MAKEFILES)
|
||||||
|
|
||||||
ri_prefix=
|
ri_prefix=
|
||||||
test "$program_prefix" != NONE &&
|
test "$program_prefix" != NONE &&
|
||||||
|
@ -1204,6 +1235,12 @@ test "$program_suffix" != NONE &&
|
||||||
ri_suffix=$program_suffix
|
ri_suffix=$program_suffix
|
||||||
|
|
||||||
RUBY_INSTALL_NAME="${ri_prefix}ruby${ri_suffix}"
|
RUBY_INSTALL_NAME="${ri_prefix}ruby${ri_suffix}"
|
||||||
|
case "$target_os" in
|
||||||
|
cygwin*|mingw*)
|
||||||
|
RUBYW_INSTALL_NAME="${ri_prefix}rubyw${ri_suffix}"
|
||||||
|
rubyw_install_name="$RUBYW_INSTALL_NAME"
|
||||||
|
;;
|
||||||
|
esac
|
||||||
case "$target_os" in
|
case "$target_os" in
|
||||||
cygwin*|mingw*|*djgpp*|os2_emx*)
|
cygwin*|mingw*|*djgpp*|os2_emx*)
|
||||||
RUBY_LIB_PREFIX="/lib/ruby"
|
RUBY_LIB_PREFIX="/lib/ruby"
|
||||||
|
|
49
mkconfig.rb
49
mkconfig.rb
|
@ -3,7 +3,7 @@
|
||||||
require File.dirname($0)+"/lib/ftools"
|
require File.dirname($0)+"/lib/ftools"
|
||||||
|
|
||||||
rbconfig_rb = ARGV[0] || 'rbconfig.rb'
|
rbconfig_rb = ARGV[0] || 'rbconfig.rb'
|
||||||
srcdir = $srcdir if $srcdir
|
srcdir = $srcdir || '.'
|
||||||
File.makedirs(File.dirname(rbconfig_rb), true)
|
File.makedirs(File.dirname(rbconfig_rb), true)
|
||||||
|
|
||||||
version = RUBY_VERSION
|
version = RUBY_VERSION
|
||||||
|
@ -23,10 +23,8 @@ module Config
|
||||||
# made to this file will be lost the next time ruby is built.
|
# made to this file will be lost the next time ruby is built.
|
||||||
]
|
]
|
||||||
|
|
||||||
print " DESTDIR = '' if not defined? DESTDIR\n CONFIG = {}\n"
|
|
||||||
v_fast = []
|
v_fast = []
|
||||||
v_others = []
|
v_others = []
|
||||||
has_srcdir = false
|
|
||||||
has_version = false
|
has_version = false
|
||||||
File.foreach "config.status" do |line|
|
File.foreach "config.status" do |line|
|
||||||
next if /^#/ =~ line
|
next if /^#/ =~ line
|
||||||
|
@ -49,19 +47,33 @@ File.foreach "config.status" do |line|
|
||||||
end
|
end
|
||||||
has_version = true if name == "MAJOR"
|
has_version = true if name == "MAJOR"
|
||||||
elsif /^(?:ac_given_)?srcdir=(.*)/ =~ line
|
elsif /^(?:ac_given_)?srcdir=(.*)/ =~ line
|
||||||
v_fast << " CONFIG[\"srcdir\"] = \"" + File.expand_path($1) + "\"\n"
|
srcdir = $1
|
||||||
has_srcdir = true
|
|
||||||
elsif /^ac_given_INSTALL=(.*)/ =~ line
|
elsif /^ac_given_INSTALL=(.*)/ =~ line
|
||||||
v_fast << " CONFIG[\"INSTALL\"] = " + $1 + "\n"
|
v_fast << " CONFIG[\"INSTALL\"] = " + $1 + "\n"
|
||||||
end
|
end
|
||||||
# break if /^CEOF/
|
# break if /^CEOF/
|
||||||
end
|
end
|
||||||
|
|
||||||
if not has_srcdir
|
srcdir = File.expand_path(srcdir)
|
||||||
v_fast << " CONFIG[\"srcdir\"] = \"" + File.expand_path(srcdir || '.') + "\"\n"
|
v_fast.unshift(" CONFIG[\"srcdir\"] = \"" + srcdir + "\"\n")
|
||||||
|
|
||||||
|
v_fast.collect! do |x|
|
||||||
|
if /"prefix"/ === x
|
||||||
|
x.sub(/= (.*)/, '= (TOPDIR || DESTDIR + \1)')
|
||||||
|
else
|
||||||
|
x
|
||||||
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
if not has_version
|
drive = File::PATH_SEPARATOR == ';'
|
||||||
|
|
||||||
|
prefix = Regexp.quote('/lib/ruby/' + RUBY_VERSION.sub(/\.\d+$/, '') + '/' + RUBY_PLATFORM)
|
||||||
|
print " TOPDIR = File.dirname(__FILE__).sub!(%r'#{prefix}\\Z', '')\n"
|
||||||
|
print " DESTDIR = ", (drive ? "TOPDIR && TOPDIR[/\\A[a-z]:/i] || " : ""), "'' unless defined? DESTDIR\n"
|
||||||
|
print " CONFIG = {}\n"
|
||||||
|
print " CONFIG[\"DESTDIR\"] = DESTDIR\n"
|
||||||
|
|
||||||
|
unless has_version
|
||||||
RUBY_VERSION.scan(/(\d+)\.(\d+)\.(\d+)/) {
|
RUBY_VERSION.scan(/(\d+)\.(\d+)\.(\d+)/) {
|
||||||
print " CONFIG[\"MAJOR\"] = \"" + $1 + "\"\n"
|
print " CONFIG[\"MAJOR\"] = \"" + $1 + "\"\n"
|
||||||
print " CONFIG[\"MINOR\"] = \"" + $2 + "\"\n"
|
print " CONFIG[\"MINOR\"] = \"" + $2 + "\"\n"
|
||||||
|
@ -69,11 +81,10 @@ if not has_version
|
||||||
}
|
}
|
||||||
end
|
end
|
||||||
|
|
||||||
v_fast.collect! do |x|
|
dest = drive ? /= \"(?!\$[\(\{])(?:[a-z]:)?/i : /= \"(?!\$[\(\{])/
|
||||||
if /"prefix"/ === x
|
v_others.collect! do |x|
|
||||||
prefix = Regexp.quote('/lib/ruby/' + RUBY_VERSION.sub(/\.\d+$/, '') + '/' + RUBY_PLATFORM)
|
if /^\s*CONFIG\["(?!abs_|old)[a-z]+(?:_prefix|dir)"]/ === x
|
||||||
puts " TOPDIR = File.dirname(__FILE__).sub!(%r'#{prefix}\\Z', '')"
|
x.sub(dest, '= "$(DESTDIR)')
|
||||||
x.sub(/= (.*)/, '= (TOPDIR || DESTDIR + \1)')
|
|
||||||
else
|
else
|
||||||
x
|
x
|
||||||
end
|
end
|
||||||
|
@ -97,10 +108,14 @@ print <<EOS
|
||||||
CONFIG["compile_dir"] = "#{Dir.pwd}"
|
CONFIG["compile_dir"] = "#{Dir.pwd}"
|
||||||
MAKEFILE_CONFIG = {}
|
MAKEFILE_CONFIG = {}
|
||||||
CONFIG.each{|k,v| MAKEFILE_CONFIG[k] = v.dup}
|
CONFIG.each{|k,v| MAKEFILE_CONFIG[k] = v.dup}
|
||||||
def Config::expand(val)
|
def Config::expand(val, config = CONFIG)
|
||||||
val.gsub!(/\\$\\(([^()]+)\\)|\\$\\{([^{}]+)\\}/) do |var|
|
val.gsub!(/\\$\\$|\\$\\(([^()]+)\\)|\\$\\{([^{}]+)\\}/) do |var|
|
||||||
if key = CONFIG[$1 || $2]
|
if !(v = $1 || $2)
|
||||||
Config::expand(key)
|
'$'
|
||||||
|
elsif key = config[v]
|
||||||
|
config[v] = false
|
||||||
|
Config::expand(key, config)
|
||||||
|
config[v] = key
|
||||||
else
|
else
|
||||||
var
|
var
|
||||||
end
|
end
|
||||||
|
|
Loading…
Reference in a new issue