1
0
Fork 0
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:
nobu 2002-10-21 14:17:44 +00:00
parent 8209f4fb71
commit b9ecdfaa3d
4 changed files with 239 additions and 71 deletions

View file

@ -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>
* parse.y (value_expr0): allow return/break/next/redo/retry in rhs

View file

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

View file

@ -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 <toyoda@npd.kishou.go.jp>
@ -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,7 +684,7 @@ if test "$rb_cv_binary_elf" = yes; then
fi
case "$target_os" in
linux*)
linux*)
if test "$rb_cv_binary_elf" = no; then
with_dln_a_out=yes
target_os=${target_os}-a_out
@ -696,6 +700,7 @@ netbsd*)
fi
;;
esac
LIBEXT=a
AC_SUBST(DLDFLAGS)dnl
@ -704,8 +709,10 @@ AC_SUBST(CCDLFLAGS)dnl
AC_SUBST(LDSHARED)dnl
AC_SUBST(DLEXT)dnl
AC_SUBST(DLEXT2)dnl
AC_SUBST(LIBEXT)dnl
STATIC=
LIBPATHFLAG=' -L%s'
if test "$with_dln_a_out" != yes; then
rb_cv_dlopen=unknown
@ -777,6 +784,7 @@ if test "$with_dln_a_out" != yes; then
netbsd*) LDSHARED='${CC} -shared'
if test "$rb_cv_binary_elf" = yes; then
LDFLAGS="-Wl,-export-dynamic"
LIBPATHFLAG=' -L%1$s -Wl,-R%1$s'
fi
rb_cv_dlopen=yes ;;
openbsd*) LDSHARED="ld -Bforcearchive -Bshareable"
@ -786,7 +794,7 @@ if test "$with_dln_a_out" != yes; then
rb_cv_dlopen=yes ;;
esac ;;
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 ;;
nextstep*) LDSHARED='cc -r -nostdlib'
LDFLAGS="-u libsys_s"
@ -813,6 +821,7 @@ if test "$with_dln_a_out" != yes; then
human*) DLDFLAGS=''
LDSHARED=''
LDFLAGS=''
LINK_SO='ar cru $@ $(OBJS)'
rb_cv_dlopen=yes ;;
beos*) case "$target_cpu" in
powerpc*)
@ -830,13 +839,16 @@ if test "$with_dln_a_out" != yes; then
LDFLAGS="-L/lib -L/usr/lib -L/usr/local/lib"
rb_cv_dlopen=yes;;
cygwin*|mingw*) : ${LDSHARED="${CC} -shared -s"}
LDFLAGS='-Wl,--stack,0x02000000'
XLDFLAGS='-Wl,--stack,0x02000000'
DLDFLAGS="${DLDFLAGS} "'$(DEFFILE)'
rb_cv_dlopen=yes ;;
hiuxmpp) LDSHARED='ld -r' ;;
*) LDSHARED='ld' ;;
esac
AC_MSG_RESULT($rb_cv_dlopen)
fi
AC_SUBST(LINK_SO)
AC_SUBST(LIBPATHFLAG)
dln_a_out_works=no
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)
fi
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
OBJEXT=o
setup=Setup.x68
@ -992,11 +1005,11 @@ if test "$prefix" = NONE; then
fi
if test "$fat_binary" = yes ; then
CFLAGS="$CFLAGS $ARCH_FLAG"
XCFLAGS="$ARCH_FLAG"
fi
if test x"$cross_compiling" = xyes; then
MINIRUBY="ruby -I`pwd` -rfake"
MINIRUBY="${RUBY-ruby} -I`pwd` -rfake"
PREP=fake.rb
else
MINIRUBY='./miniruby$(EXEEXT)'
@ -1008,7 +1021,7 @@ AC_SUBST(PREP)
FIRSTMAKEFILE=""
LIBRUBY_A='lib$(RUBY_INSTALL_NAME).a'
LIBRUBY='$(LIBRUBY_A)'
LIBRUBYARG='$(LIBRUBY_A)'
LIBRUBYARG='-l$(RUBY_INSTALL_NAME)'
SOLIBS=
case "$target_os" in
@ -1020,10 +1033,11 @@ case "$target_os" in
;;
esac
RUBY_SO_NAME='$(RUBY_INSTALL_NAME)'
LIBRUBY_LDSHARED=$LDSHARED
LIBRUBY_DLDFLAGS=$DLDFLAGS
LIBRUBY_SO='lib$(RUBY_INSTALL_NAME).so.$(MAJOR).$(MINOR).$(TEENY)'
LIBRUBY_ALIASES='lib$(RUBY_INSTALL_NAME).so'
LIBRUBY_SO='lib$(RUBY_SO_NAME).so.$(MAJOR).$(MINOR).$(TEENY)'
LIBRUBY_ALIASES='lib$(RUBY_SO_NAME).so'
ENABLE_SHARED=no
AC_ARG_ENABLE(shared,
@ -1031,7 +1045,7 @@ AC_ARG_ENABLE(shared,
[enable_shared=$enableval])
if test "$enable_shared" = 'yes'; then
LIBRUBY='$(LIBRUBY_SO)'
LIBRUBYARG='-L. -l$(RUBY_INSTALL_NAME)'
LIBRUBYARG='-l$(RUBY_SO_NAME)'
CFLAGS="$CFLAGS $CCDLFLAGS"
ENABLE_SHARED=yes
if test "$rb_cv_binary_elf" = yes; then
@ -1039,19 +1053,20 @@ if test "$enable_shared" = 'yes'; then
fi
case "$target_os" in
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*)
LIBRUBY_DLDFLAGS='-Wl,-soname,lib$(RUBY_INSTALL_NAME).so.$(MAJOR).$(MINOR)'
LIBRUBY_ALIASES='lib$(RUBY_INSTALL_NAME).so.$(MAJOR).$(MINOR) lib$(RUBY_INSTALL_NAME).so'
LIBRUBY_DLDFLAGS='-Wl,-soname,lib$(RUBY_SO_NAME).so.$(MAJOR).$(MINOR)'
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*)
LIBRUBY_DLDFLAGS='-Wl,-soname,lib$(RUBY_INSTALL_NAME).so.$(MAJOR).$(MINOR)'
LIBRUBY_ALIASES='lib$(RUBY_INSTALL_NAME).so.$(MAJOR).$(MINOR) lib$(RUBY_INSTALL_NAME).so'
LIBRUBY_DLDFLAGS='-Wl,-soname,lib$(RUBY_SO_NAME).so.$(MAJOR).$(MINOR)'
LIBRUBY_ALIASES='lib$(RUBY_SO_NAME).so.$(MAJOR).$(MINOR) lib$(RUBY_SO_NAME).so'
;;
freebsd*)
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
LIBRUBY_SO="$LIBRUBY_SO.\$(TEENY)"
LIBRUBY_ALIASES=''
@ -1059,11 +1074,11 @@ if test "$enable_shared" = 'yes'; then
;;
netbsd*)
SOLIBS='$(LIBS)'
LIBRUBY_SO='lib$(RUBY_INSTALL_NAME).so.$(MAJOR)$(MINOR).$(TEENY)'
LIBRUBY_DLDFLAGS='-Wl,-soname,lib$(RUBY_INSTALL_NAME).so.$(MAJOR)$(MINOR)'
LIBRUBYARG='-Wl,-R -Wl,${prefix}/lib -L${prefix}/lib -L. -l$(RUBY_INSTALL_NAME)'
LIBRUBY_SO='lib$(RUBY_SO_NAME).so.$(MAJOR)$(MINOR).$(TEENY)'
LIBRUBY_DLDFLAGS='-Wl,-soname,lib$(RUBY_SO_NAME).so.$(MAJOR)$(MINOR)'
LIBRUBYARG='-Wl,-R -Wl,${libdir} -L${libdir} -L. -l$(RUBY_SO_NAME)'
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
LIBRUBY_ALIASES=""
fi
@ -1072,12 +1087,12 @@ if test "$enable_shared" = 'yes'; then
SOLIBS='$(LIBS)'
;;
solaris*)
XLDFLAGS='-R${prefix}/lib'
XLDFLAGS='-R${libdir}'
;;
hpux*)
XLDFLAGS='-Wl,+s,+b,$(prefix)/lib'
LIBRUBY_SO='lib$(RUBY_INSTALL_NAME).sl.$(MAJOR).$(MINOR).$(TEENY)'
LIBRUBY_ALIASES='lib$(RUBY_INSTALL_NAME).sl.$(MAJOR).$(MINOR) lib$(RUBY_INSTALL_NAME).sl'
XLDFLAGS='-Wl,+s,+b,$(libdir)'
LIBRUBY_SO='lib$(RUBY_SO_NAME).sl.$(MAJOR).$(MINOR).$(TEENY)'
LIBRUBY_ALIASES='lib$(RUBY_SO_NAME).sl.$(MAJOR).$(MINOR) lib$(RUBY_SO_NAME).sl'
;;
aix*)
if test "$GCC" = yes; then
@ -1086,8 +1101,9 @@ if test "$enable_shared" = 'yes'; then
else
LIBRUBY_LDSHARED='/usr/ccs/bin/ld'
LIBRUBY_DLDFLAGS='-bE:ruby.imp -bM:SRE -bnoentry'
ARCHFILE="ruby.imp"
fi
LIBRUBYARG='-L${prefix}/lib -Wl,lib$(RUBY_INSTALL_NAME).so'
LIBRUBYARG='-L${libdir} -Wl,lib$(RUBY_SO_NAME).so'
SOLIBS='-lm -lc'
;;
beos*)
@ -1098,15 +1114,17 @@ if test "$enable_shared" = 'yes'; then
esac
;;
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_DLDFLAGS='-install_name $(prefix)/lib/lib$(RUBY_INSTALL_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_DLDFLAGS='-install_name $(libdir)/lib$(RUBY_SO_NAME).dylib -current_version $(MAJOR).$(MINOR).$(TEENY) -compatibility_version $(MAJOR).$(MINOR)'
LIBRUBY_ALIASES='lib$(RUBY_SO_NAME).$(MAJOR).$(MINOR).dylib lib$(RUBY_SO_NAME).dylib'
;;
*)
;;
esac
fi
XLDFLAGS="$XLDFLAGS -L."
AC_SUBST(ARCHFILE)
case "$target_os" in
netbsd*)
@ -1151,6 +1169,7 @@ case "$target_os" in
esac
;;
cygwin*|mingw*)
EXPORT_PREFIX=' '
case "$target_os" in
cygwin*)
RUBY_SO_NAME=$target_os-'$(RUBY_INSTALL_NAME)'${MAJOR}${MINOR}
@ -1159,6 +1178,9 @@ case "$target_os" in
mingw*)
RUBY_SO_NAME=msvcrt-'$(RUBY_INSTALL_NAME)'${MAJOR}${MINOR}
AC_LIBOBJ([win32])
COMMON_LIBS=m
COMMON_MACROS="WIN32_LEAN_AND_MEAN="
COMMON_HEADERS="windows.h winsock.h"
CFLAGS="-DNT -D__NO_ISOCEXT $CFLAGS"
CCDLFLAGS=-DIMPORT ;;
esac
@ -1173,7 +1195,6 @@ case "$target_os" in
fi
LIBRUBY_ALIASES=''
LIBRUBY_A='lib$(RUBY_INSTALL_NAME)s.a'
LIBRUBYARG='-L. -l$(RUBY_SO_NAME)'
FIRSTMAKEFILE=GNUmakefile:cygwin/GNUmakefile.in
SOLIBS='$(LIBS)'
;;
@ -1184,6 +1205,8 @@ esac
AC_SUBST(LIBRUBY_LDSHARED)
AC_SUBST(LIBRUBY_DLDFLAGS)
AC_SUBST(RUBY_INSTALL_NAME)
AC_SUBST(rubyw_install_name)
AC_SUBST(RUBYW_INSTALL_NAME)
AC_SUBST(RUBY_SO_NAME)
AC_SUBST(LIBRUBY_A)
AC_SUBST(LIBRUBY_SO)
@ -1194,6 +1217,14 @@ AC_SUBST(SOLIBS)
AC_SUBST(DLDLIBS)
AC_SUBST(ENABLE_SHARED)
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=
test "$program_prefix" != NONE &&
@ -1204,6 +1235,12 @@ test "$program_suffix" != NONE &&
ri_suffix=$program_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
cygwin*|mingw*|*djgpp*|os2_emx*)
RUBY_LIB_PREFIX="/lib/ruby"

View file

@ -3,7 +3,7 @@
require File.dirname($0)+"/lib/ftools"
rbconfig_rb = ARGV[0] || 'rbconfig.rb'
srcdir = $srcdir if $srcdir
srcdir = $srcdir || '.'
File.makedirs(File.dirname(rbconfig_rb), true)
version = RUBY_VERSION
@ -23,10 +23,8 @@ module Config
# 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_others = []
has_srcdir = false
has_version = false
File.foreach "config.status" do |line|
next if /^#/ =~ line
@ -49,19 +47,33 @@ File.foreach "config.status" do |line|
end
has_version = true if name == "MAJOR"
elsif /^(?:ac_given_)?srcdir=(.*)/ =~ line
v_fast << " CONFIG[\"srcdir\"] = \"" + File.expand_path($1) + "\"\n"
has_srcdir = true
srcdir = $1
elsif /^ac_given_INSTALL=(.*)/ =~ line
v_fast << " CONFIG[\"INSTALL\"] = " + $1 + "\n"
end
# break if /^CEOF/
end
if not has_srcdir
v_fast << " CONFIG[\"srcdir\"] = \"" + File.expand_path(srcdir || '.') + "\"\n"
srcdir = File.expand_path(srcdir)
v_fast.unshift(" CONFIG[\"srcdir\"] = \"" + srcdir + "\"\n")
v_fast.collect! do |x|
if /"prefix"/ === x
x.sub(/= (.*)/, '= (TOPDIR || DESTDIR + \1)')
else
x
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+)/) {
print " CONFIG[\"MAJOR\"] = \"" + $1 + "\"\n"
print " CONFIG[\"MINOR\"] = \"" + $2 + "\"\n"
@ -69,11 +81,10 @@ if not has_version
}
end
v_fast.collect! do |x|
if /"prefix"/ === x
prefix = Regexp.quote('/lib/ruby/' + RUBY_VERSION.sub(/\.\d+$/, '') + '/' + RUBY_PLATFORM)
puts " TOPDIR = File.dirname(__FILE__).sub!(%r'#{prefix}\\Z', '')"
x.sub(/= (.*)/, '= (TOPDIR || DESTDIR + \1)')
dest = drive ? /= \"(?!\$[\(\{])(?:[a-z]:)?/i : /= \"(?!\$[\(\{])/
v_others.collect! do |x|
if /^\s*CONFIG\["(?!abs_|old)[a-z]+(?:_prefix|dir)"]/ === x
x.sub(dest, '= "$(DESTDIR)')
else
x
end
@ -97,10 +108,14 @@ print <<EOS
CONFIG["compile_dir"] = "#{Dir.pwd}"
MAKEFILE_CONFIG = {}
CONFIG.each{|k,v| MAKEFILE_CONFIG[k] = v.dup}
def Config::expand(val)
val.gsub!(/\\$\\(([^()]+)\\)|\\$\\{([^{}]+)\\}/) do |var|
if key = CONFIG[$1 || $2]
Config::expand(key)
def Config::expand(val, config = CONFIG)
val.gsub!(/\\$\\$|\\$\\(([^()]+)\\)|\\$\\{([^{}]+)\\}/) do |var|
if !(v = $1 || $2)
'$'
elsif key = config[v]
config[v] = false
Config::expand(key, config)
config[v] = key
else
var
end