* 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@2974 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
parent
76e8a9e828
commit
e7ce523bb1
@ -1,6 +1,8 @@
|
||||
SHELL = $(COMSPEC)
|
||||
|
||||
#### Start of system configuration section. ####
|
||||
OS = bccwin32
|
||||
RT = $(OS)
|
||||
|
||||
## variables may be overridden by $(compile_dir)/Makefile
|
||||
!ifndef srcdir
|
||||
@ -18,7 +20,7 @@ RUBYW_INSTALL_NAME = $(RUBY_INSTALL_NAME:ruby=rubyw)
|
||||
RUBYW_INSTALL_NAME = $(RUBY_INSTALL_NAME)w
|
||||
!endif
|
||||
!ifndef RUBY_SO_NAME
|
||||
RUBY_SO_NAME = rubybcc
|
||||
RUBY_SO_NAME = $(RT)-$(RUBY_INSTALL_NAME)17
|
||||
!endif
|
||||
!ifndef icondirs
|
||||
!ifdef ICONDIRS
|
||||
@ -37,16 +39,27 @@ VPATH = $(srcdir):$(srcdir)/missing
|
||||
!ifndef CC
|
||||
CC = bcc32
|
||||
!endif
|
||||
!ifndef CPP
|
||||
CPP = cpp32
|
||||
!endif
|
||||
!ifndef RC
|
||||
RC = brcc32
|
||||
!endif
|
||||
!ifndef YACC
|
||||
YACC = byacc
|
||||
!endif
|
||||
!ifndef AR
|
||||
AR = tlib
|
||||
!endif
|
||||
|
||||
PURIFY =
|
||||
AUTOCONF = autoconf
|
||||
|
||||
!if !defined(PROCESSOR_ARCHITECTURE) || "$(PROCESSOR_ARCHITECTURE)" == "x86"
|
||||
!if !defined(PROCESSOR_ARCHITECTURE)
|
||||
PROCESSOR_ARCHITECTURE = x86
|
||||
!endif
|
||||
MACHINE = $(PROCESSOR_ARCHITECTURE)
|
||||
!if "$(PROCESSOR_ARCHITECTURE)" == "x86"
|
||||
!ifndef PROCESSOR_LEVEL
|
||||
PROCESSOR_LEVEL = 5
|
||||
!endif
|
||||
@ -55,7 +68,7 @@ PROCESSOR_LEVEL = 6
|
||||
!endif
|
||||
PROCESSOR_FLAG = -$(PROCESSOR_LEVEL)
|
||||
CPU = i$(PROCESSOR_LEVEL)86
|
||||
ARCH = i$(PROCESSOR_LEVEL)86
|
||||
ARCH = i386
|
||||
!else
|
||||
CPU = $(PROCESSOR_ARCHITECTURE)
|
||||
ARCH = $(PROCESSOR_ARCHITECTURE)
|
||||
@ -66,7 +79,6 @@ DEBUGFLAGS =
|
||||
!ifndef OPTFLAGS
|
||||
OPTFLAGS = -O
|
||||
!endif
|
||||
OS = bccwin32
|
||||
|
||||
!ifndef prefix
|
||||
prefix = /usr
|
||||
@ -75,44 +87,46 @@ prefix = /usr
|
||||
DESTDIR = $(prefix)
|
||||
!endif
|
||||
!ifndef CFLAGS
|
||||
CFLAGS = -DNT=1 $(DEBUGFLAGS) $(OPTFLAGS) $(PROCESSOR_FLAG) -w-aus -w-par -w-pro
|
||||
CFLAGS = -q -DNT=1 $(DEBUGFLAGS) $(OPTFLAGS) $(PROCESSOR_FLAG) -w-
|
||||
!endif
|
||||
!ifndef CPPFLAGS
|
||||
CPPFLAGS = -I. -I$(srcdir) -I$(srcdir)missing -DLIBRUBY_SO=\"$(LIBRUBY_SO)\"
|
||||
!endif
|
||||
!ifndef LDFLAGS
|
||||
LDFLAGS = $(CFLAGS)
|
||||
!endif
|
||||
!ifndef XLDFLAGS
|
||||
XLDFLAGS =
|
||||
LDFLAGS = -S:$(STACK)
|
||||
!endif
|
||||
!ifndef RFLAGS
|
||||
RFLAGS = -r
|
||||
RFLAGS = $(iconinc)
|
||||
!endif
|
||||
!ifndef EXTLIBS
|
||||
EXTLIBS = # cw32.lib
|
||||
EXTLIBS =
|
||||
!endif
|
||||
LIBS = $(EXTLIBS)
|
||||
LIBS = cw32.lib import32.lib ws2_32.lib $(EXTLIBS)
|
||||
MISSING = acosh.obj crypt.obj win32.obj
|
||||
|
||||
!ifndef STACK
|
||||
STACK = 0x2000000
|
||||
!endif
|
||||
|
||||
LDSHARED = ilink32.exe -S:$(STACK)
|
||||
LINK = $(LDSHARED) -Tpe C0X32.OBJ
|
||||
LINK_W = $(LDSHARED) -Tpe C0W32.OBJ
|
||||
LINK_SO = $(LDSHARED) -Tpd C0D32.OBJ
|
||||
LDOBJECTS = CW32.LIB IMPORT32.LIB $(MAINOBJ)
|
||||
XCFLAGS = -DRUBY_EXPORT
|
||||
|
||||
ARFLAGS = /a
|
||||
LD = ilink32 -q -Gn
|
||||
LDSHARED = $(LD)
|
||||
XLDFLAGS = -Tpe c0x32.obj
|
||||
WLDFLAGS = -Tpe c0w32.obj
|
||||
DLDFLAGS = -Tpd c0d32.obj
|
||||
LIBRUBY_LDSHARED = $(LDSHARED)
|
||||
LIBRUBY_DLDFLAGS = -Gi $(DLDFLAGS) $(EXTLDFLAGS)
|
||||
LDOBJECTS = $(MAINOBJ)
|
||||
|
||||
DLDFLAGS =
|
||||
SOLIBS =
|
||||
|
||||
EXEEXT = .exe
|
||||
PROGRAM=$(RUBY_INSTALL_NAME)$(EXEEXT)
|
||||
WPROGRAM=$(RUBYW_INSTALL_NAME)$(EXEEXT)
|
||||
RUBYDEF = $(RUBY_SO_NAME).def
|
||||
MINIRUBY=miniruby$(EXEEXT)
|
||||
MINIRUBY = .\miniruby$(EXEEXT)
|
||||
|
||||
ORGLIBPATH = $(LIB)
|
||||
|
||||
@ -168,7 +182,7 @@ OBJS = array.obj \
|
||||
|
||||
all: miniruby$(EXEEXT) rbconfig.rb \
|
||||
$(LIBRUBY) $(MISCLIBS)
|
||||
@.\miniruby$(EXEEXT) $(srcdir)ext/extmk.rb
|
||||
@.\miniruby$(EXEEXT) $(srcdir)ext/extmk.rb $(EXTSTATIC) $(MAKE) -$(MFLAGS)$(MAKEFLAGS)
|
||||
|
||||
ruby: $(PROGRAM)
|
||||
rubyw: $(WPROGRAM)
|
||||
@ -178,8 +192,8 @@ dll: $(LIBRUBY_SO)
|
||||
config: config.h config.status
|
||||
|
||||
config.h: Makefile $(srcdir)bcc32/Makefile.sub
|
||||
@echo Creating config.h
|
||||
type > $@ &&|
|
||||
@echo Creating $(@:.\=)
|
||||
@type > $@ &&|
|
||||
\#define HAVE_PROTOTYPES 1
|
||||
\#define HAVE_STDARG_PROTOTYPES 1
|
||||
/* \#define HAVE_ATTR_NORETURN 1 */
|
||||
@ -198,7 +212,7 @@ config.h: Makefile $(srcdir)bcc32/Makefile.sub
|
||||
/* \#define HAVE_SYS_PARAM_H 1 */
|
||||
/* \#define HAVE_SYS_WAIT_H 1 */
|
||||
\#define HAVE_STRING_H 1
|
||||
/* \#define HAVE_UTIME_H 1 */
|
||||
\#define HAVE_UTIME_H 1
|
||||
\#define HAVE_MEMORY_H 1
|
||||
/* \#define HAVE_ST_BLKSIZE 1 */
|
||||
\#define HAVE_ST_RDEV 1
|
||||
@ -262,9 +276,9 @@ config.h: Makefile $(srcdir)bcc32/Makefile.sub
|
||||
\#define HAVE_STRTOUL 1
|
||||
|
|
||||
|
||||
config.status: Makefile $(srcdir)bcc32/Makefile.sub $(MINIRUBY)
|
||||
@echo Creating config.status
|
||||
@$(MINIRUBY) -pe "~/@CFLAGS@/||$$_.sub!(/'$(CFLAGS)'/, '$$(CFLAGS)')" > $@ &&|
|
||||
config.status: Makefile $(srcdir)bcc32/Makefile.sub
|
||||
@echo Creating $@
|
||||
@type > $@ &&|
|
||||
# Generated automatically by Makefile.sub.
|
||||
s,@SHELL@,$$(COMSPEC),;t t
|
||||
s,@CFLAGS@,$(CFLAGS),;t t
|
||||
@ -272,7 +286,7 @@ s,@CPPFLAGS@,$(CPPFLAGS),;t t
|
||||
s,@CXXFLAGS@,$(CXXFLAGS),;t t
|
||||
s,@FFLAGS@,$(FFLAGS),;t t
|
||||
s,@LDFLAGS@,$(LDFLAGS),;t t
|
||||
s,@LIBS@,,;t t
|
||||
s,@LIBS@,$(LIBS),;t t
|
||||
s,@exec_prefix@,$${prefix},;t t
|
||||
s,@prefix@,,;t t
|
||||
s,@program_transform_name@,s,,,,;t t
|
||||
@ -307,7 +321,8 @@ s,@CC@,$(CC),;t t
|
||||
s,@CPP@,cpp32,;t t
|
||||
s,@YACC@,$(YACC),;t t
|
||||
s,@RANLIB@,rem,;t t
|
||||
s,@AR@,tlib -nologo,;t t
|
||||
s,@AR@,$(AR),;t t
|
||||
s,@ARFLAGS@,$(ARFLAGS),;t t
|
||||
s,@LN_S@,$(LN_S),;t t
|
||||
s,@SET_MAKE@,$(SET_MAKE),;t t
|
||||
s,@LIBOBJS@, acosh.obj crypt.obj win32.obj,;t t
|
||||
@ -316,19 +331,22 @@ s,@DEFAULT_KCODE@,$(DEFAULT_KCODE),;t t
|
||||
s,@EXEEXT@,.exe,;t t
|
||||
s,@OBJEXT@,obj,;t t
|
||||
s,@XLDFLAGS@,$(XLDFLAGS),;t t
|
||||
s,@DLDFLAGS@,$$(CFLAGS),;t t
|
||||
s,@DLDFLAGS@,$(DLDFLAGS),;t t
|
||||
s,@STATIC@,$(STATIC),;t t
|
||||
s,@CCDLFLAGS@,-DIMPORT,;t t
|
||||
s,@LDSHARED@,ilink32 -S:$(STACK) -Tpd,;t t
|
||||
s,@CCDLFLAGS@,,;t t
|
||||
s,@LDSHARED@,$(LDSHARED),;t t
|
||||
s,@DLEXT@,so,;t t
|
||||
s,@DLEXT2@,dll,;t t
|
||||
s,@LIBEXT@,lib,;t t
|
||||
s,@STRIP@,$(STRIP),;t t
|
||||
s,@EXTSTATIC@,$(EXTSTATIC),;t t
|
||||
s,@setup@,Setup,;t t
|
||||
s,@MINIRUBY@,$(MINIRUBY),;t t
|
||||
s,@LIBRUBY_LDSHARED@,$(LIBRUBY_LDSHARED),;t t
|
||||
s,@LIBRUBY_DLDFLAGS@,$(LIBRUBY_DLDFLAGS),;t t
|
||||
s,@LIBRUBY_LDSHARED@,$$(LDSHARED),;t t
|
||||
s,@LIBRUBY_DLDFLAGS@,-Gi $$(DLDFLAGS),;t t
|
||||
s,@RUBY_INSTALL_NAME@,$(RUBY_INSTALL_NAME),;t t
|
||||
s,@rubyw_install_name@,$(RUBYW_INSTALL_NAME),;t t
|
||||
s,@RUBYW_INSTALL_NAME@,$(RUBYW_INSTALL_NAME),;t t
|
||||
s,@RUBY_SO_NAME@,$(RUBY_SO_NAME),;t t
|
||||
s,@LIBRUBY_A@,lib$$(RUBY_INSTALL_NAME).lib,;t t
|
||||
s,@LIBRUBY_SO@,$$(RUBY_SO_NAME).dll,;t t
|
||||
@ -340,6 +358,16 @@ s,@DLDLIBS@,$(DLDLIBS),;t t
|
||||
s,@ENABLE_SHARED@,yes,;t t
|
||||
s,@OUTFLAG@,-o,;t t
|
||||
s,@CPPOUTFILE@,,;t t
|
||||
s,@LIBPATHFLAG@, -L%s,;t t
|
||||
s,@LIBARG@,%s.lib,;t t
|
||||
s,@LINK_SO@,$$(LDSHARED) $$(DLDFLAGS) $$(LIBPATH) $$(OBJS), $$@, nul, $$(LIBS) $$(LOCAL_LIBS), $$(DEFFILE), $$(RESFILE),;t t
|
||||
s,@COMPILE_C@,$$(CC) $$(CFLAGS) $$(CPPFLAGS) -c $$(<:/=\),;t t
|
||||
s,@COMPILE_CXX@,$$(CXX) $$(CXXFLAGS) $$(CPPFLAGS) -P -c $$(<:/=\),;t t
|
||||
s,@COMPILE_RULES@,{$$(srcdir)}.%s{}.%s: .%s.%s:,;t t
|
||||
s,@COMMON_LIBS@,m,;t t
|
||||
s,@COMMON_MACROS@,WIN32_LEAN_AND_MEAN;t t
|
||||
s,@COMMON_HEADERS@,winsock2.h windows.h,;t t
|
||||
s,@EXPORT_PREFIX@,_,;t t
|
||||
s,@arch@,$(ARCH)-$(OS),;t t
|
||||
s,@sitearch@,$(ARCH)-$(OS),;t t
|
||||
s,@sitedir@,$${prefix}/lib/ruby/site_ruby,;t t
|
||||
@ -349,43 +377,33 @@ s,@srcdir@,$(srcdir),;t t
|
||||
s,@top_srcdir@,$(srcdir),;t t
|
||||
|
|
||||
|
||||
#ext/extmk.rb: $(srcdir)ext/extmk.rb.in config.status
|
||||
# @echo Creating ext/extmk.rb
|
||||
# @.\miniruby$(EXEEXT) $(srcdir)ext/configsub.rb \
|
||||
# -srcdir=$(srcdir) \
|
||||
# -install_name=$(RUBY_INSTALL_NAME) \
|
||||
# -so_name=$(RUBY_SO_NAME) \
|
||||
# -output=$@ $(srcdir)ext/extmk.rb.in
|
||||
|
||||
miniruby$(EXEEXT): $(OBJS) $(MAINOBJ) $(EXTOBJS)
|
||||
@echo $(EXTOBJS)
|
||||
miniruby$(EXEEXT): $(LIBRUBY_A) $(MAINOBJ) dmyext.obj
|
||||
@echo $(LIBS)
|
||||
$(LINK) $(LDOBJECTS) $(EXTOBJS) $(OBJS) $(LIBS),$@
|
||||
$(LD) $(LDFLAGS) $(XLDFLAGS) $(MAINOBJ) dmyext.obj,$@,nul,$(LIBRUBY_A) $(LIBS)
|
||||
|
||||
$(PROGRAM): $(MAINOBJ) $(LIBRUBY_SO) $(RUBY_INSTALL_NAME).res
|
||||
$(LINK) $(LDOBJECTS),$@,,$(LIBRUBYARG),,$(RUBY_INSTALL_NAME).res
|
||||
$(LD) $(LDFLAGS) $(XLDFLAGS) $(MAINOBJ),$@,nul,$(LIBRUBYARG) $(LIBS),,$(RUBY_INSTALL_NAME).res
|
||||
|
||||
$(WPROGRAM): $(MAINOBJ) $(WINMAINOBJ) $(LIBRUBY_SO) $(RUBYW_INSTALL_NAME).res
|
||||
$(LINK_W) $(LDOBJECTS) $(WINMAINOBJ),$@,,$(LIBRUBYARG),,$(RUBYW_INSTALL_NAME).res
|
||||
$(LD) $(LDFLAGS) $(WLDFLAGS) $(MAINOBJ) $(WINMAINOBJ),$@,nul,$(LIBRUBYARG) $(LIBS),,$(RUBYW_INSTALL_NAME).res
|
||||
|
||||
$(LIBRUBY_A): $(OBJS) dmyext.obj
|
||||
$(LIBRUBY_A): $(OBJS)
|
||||
@-if exist $@ del $@
|
||||
tlib $@ /a @&&|
|
||||
$(OBJS) dmyext.obj
|
||||
|
|
||||
$(AR) $(ARFLAGS)$@ $(OBJS)
|
||||
|
||||
$(LIBRUBY): $(LIBRUBY_SO)
|
||||
implib $@ $(LIBRUBY_SO)
|
||||
|
||||
$(LIBRUBY_SO): $(LIBRUBY_A) $(EXTOBJS) $(RUBYDEF) $(RUBY_SO_NAME).res
|
||||
$(LINK_SO) $(LDOBJECTS) $(EXTOBJS) $(LIBS),$@,,$(LIBRUBY_A),$(RUBYDEF), $(RUBY_SO_NAME).res
|
||||
# $(LIBRUBY): $(LIBRUBY_SO)
|
||||
# implib $@ $(LIBRUBY_SO)
|
||||
|
||||
$(LIBRUBY_SO) $(LIBRUBY): $(LIBRUBY_A) dmyext.obj $(EXTOBJS) $(RUBYDEF) $(RUBY_SO_NAME).res
|
||||
@echo $(EXTOBJS)
|
||||
$(LIBRUBY_LDSHARED) $(LIBRUBY_DLDFLAGS) dmyext.obj,$(LIBRUBY_SO),nul,$(LIBRUBY_A) $(LIBS),$(RUBYDEF),$(RUBY_SO_NAME).res
|
||||
|
||||
$(RUBYDEF): $(LIBRUBY_A) miniruby$(EXEEXT)
|
||||
.\miniruby$(EXEEXT) $(srcdir)bcc32/mkexports.rb -output=$@ $(LIBRUBY_A)
|
||||
$(MINIRUBY) $(srcdir)bcc32/mkexports.rb -output=$@ $(LIBRUBY_A)
|
||||
|
||||
install: rbconfig.rb
|
||||
.\miniruby$(EXEEXT) $(srcdir)instruby.rb $(DESTDIR)
|
||||
$(MINIRUBY) $(srcdir)instruby.rb $(DESTDIR)
|
||||
$(MINIRUBY) $(srcdir)ext/extmk.rb $(MAKE) -$(MFLAGS)$(MAKEFLAGS) DESTDIR=$(DESTDIR) install
|
||||
|
||||
clean: clean-ext clean-local
|
||||
|
||||
@ -402,7 +420,7 @@ clean-local:
|
||||
@if exist *.il? del *.il?
|
||||
|
||||
clean-ext:
|
||||
@-.\miniruby$(EXEEXT) $(srcdir)ext/extmk.rb clean
|
||||
@-$(MINIRUBY) $(srcdir)ext/extmk.rb $(MAKE) -$(MFLAGS)$(MAKEFLAGS) clean
|
||||
|
||||
distclean: distclean-ext distclean-local
|
||||
|
||||
@ -425,7 +443,6 @@ distclean-local: clean-local
|
||||
@if exist *.ilk del *.ilk
|
||||
@if exist *.exp del *.exp
|
||||
@if exist $(RUBYDEF) del $(RUBYDEF)
|
||||
@if exist pub.def del pub.def
|
||||
@if exist $(RUBY_INSTALL_NAME).rc del $(RUBY_INSTALL_NAME).rc
|
||||
@if exist $(RUBYW_INSTALL_NAME).rc del $(RUBYW_INSTALL_NAME).rc
|
||||
@if exist $(RUBY_SO_NAME).rc del $(RUBY_SO_NAME).rc
|
||||
@ -437,26 +454,26 @@ distclean-local: clean-local
|
||||
@if exist miniruby$(EXEEXT) del miniruby$(EXEEXT)
|
||||
|
||||
distclean-ext:
|
||||
@-.\miniruby$(EXEEXT) $(srcdir)ext/extmk.rb distclean
|
||||
@-$(MINIRUBY) $(srcdir)ext/extmk.rb $(MAKE) -$(MFLAGS)$(MAKEFLAGS) distclean
|
||||
|
||||
realclean: distclean
|
||||
@if exist parse.c del parse.c
|
||||
@if exist lex.c del lex.c
|
||||
|
||||
test: miniruby$(EXEEXT)
|
||||
@.\miniruby$(EXEEXT) $(srcdir)rubytest.rb
|
||||
@$(MINIRUBY) $(srcdir)rubytest.rb
|
||||
|
||||
rbconfig.rb: miniruby$(EXEEXT) config.status
|
||||
@.\miniruby$(EXEEXT) $(srcdir)mkconfig.rb -srcdir=$(srcdir) \
|
||||
@$(MINIRUBY) $(srcdir)mkconfig.rb -srcdir=$(srcdir) \
|
||||
-install_name=$(RUBY_INSTALL_NAME) \
|
||||
-so_name=$(RUBY_SO_NAME) rbconfig.rb
|
||||
|
||||
$(RUBY_INSTALL_NAME).rc $(RUBYW_INSTALL_NAME).rc $(RUBY_SO_NAME).rc: rbconfig.rb
|
||||
@.\miniruby$(EXEEXT) $(srcdir)win32/resource.rb \
|
||||
@$(MINIRUBY) $(srcdir)win32/resource.rb \
|
||||
-ruby_name=$(RUBY_INSTALL_NAME) \
|
||||
-rubyw_name=$(RUBYW_INSTALL_NAME) \
|
||||
-so_name=$(RUBY_SO_NAME) \
|
||||
. $(icondirs) $(srcdir)/win32
|
||||
. $(icondirs) $(srcdir)win32
|
||||
|
||||
#config.status: $(srcdir)configure
|
||||
# $(SHELL) .config.status --recheck
|
||||
@ -466,10 +483,10 @@ $(RUBY_INSTALL_NAME).rc $(RUBYW_INSTALL_NAME).rc $(RUBY_SO_NAME).rc: rbconfig.rb
|
||||
.path.y = $(srcdir)
|
||||
|
||||
.c.obj:
|
||||
$(CC) $(CFLAGS) -I. $(CPPFLAGS) -c $(<:/=\)
|
||||
$(CC) $(CFLAGS) $(XCFLAGS) -I. $(CPPFLAGS) -c $(<:/=\)
|
||||
|
||||
.rc.res:
|
||||
$(RC) -I. -I$(<D) $(iconinc) -I$(srcdir)win32 $(RFLAGS) -fo$@ $(<:/=\)
|
||||
$(RC) $(RFLAGS) -I. -I$(<D) $(iconinc) -I$(srcdir)win32 $(RFLAGS) -fo$@ $(<:/=\)
|
||||
|
||||
.y.c:
|
||||
$(YACC) $(YFLAGS) $(<:\=/)
|
||||
|
@ -6,6 +6,27 @@
|
||||
echo> ~tmp~.mak ####
|
||||
echo>> ~tmp~.mak conf = %0
|
||||
echo>> ~tmp~.mak $(conf:\=/): nul
|
||||
echo>> ~tmp~.mak @del ~tmp~.mak
|
||||
echo>> ~tmp~.mak make -Dbcc32dir="$(@D)" -f$(@D)/setup.mak %1
|
||||
echo>> ~tmp~.mak @del ~tmp~.mak
|
||||
echo>> ~tmp~.mak @-$(MAKE) -l$(MAKEFLAGS) -f $(@D)setup.mak \
|
||||
:loop
|
||||
if "%1" == "" goto :end
|
||||
if "%1" == "--srcdir" goto :srcdir
|
||||
if "%1" == "srcdir" goto :srcdir
|
||||
if "%1" == "--target" goto :target
|
||||
if "%1" == "target" goto :target
|
||||
echo>> ~tmp~.mak "%1" \
|
||||
shift
|
||||
goto :loop
|
||||
:srcdir
|
||||
echo>> ~tmp~.mak "srcdir=%2" \
|
||||
shift
|
||||
shift
|
||||
goto :loop
|
||||
:target
|
||||
echo>> ~tmp~.mak "%2" \
|
||||
shift
|
||||
shift
|
||||
goto :loop
|
||||
:end
|
||||
echo>> ~tmp~.mak bcc32dir="$(@D)"
|
||||
make -s -f ~tmp~.mak
|
||||
|
@ -1,50 +1,81 @@
|
||||
# -*- makefile -*-
|
||||
|
||||
!if "$(bcc32dir)" == "bcc32/"
|
||||
!if "$(srcdir)" != ""
|
||||
bcc32dir = $(srcdir)bcc32/
|
||||
!elseif "$(bcc32dir)" == "bcc32/"
|
||||
srcdir = ./
|
||||
!elseif "$(bcc32dir)" == "../bcc32/"
|
||||
srcdir = ../
|
||||
!elseif "$(bcc32dir:/bcc32/=)/bcc32/" == "$(bcc32dir)"
|
||||
srcdir = $(bcc32dir:/bcc32/=/)
|
||||
!else
|
||||
srcdir = $(bcc32dir)../
|
||||
!endif
|
||||
|
||||
OS = bccwin32
|
||||
RT = $(OS)
|
||||
INCLUDE = !include
|
||||
APPEND = echo>>$(MAKEFILE)
|
||||
!ifdef MAKEFILE
|
||||
MAKE = $(MAKE) -f $(MAKEFILE)
|
||||
!else
|
||||
MAKEFILE = Makefile
|
||||
!endif
|
||||
|
||||
all: ext makefile
|
||||
all: Makefile
|
||||
Makefile: -prologue- -generic- -epilogue-
|
||||
i386-$(OS): -prologue- -i386- -epilogue-
|
||||
i486-$(OS): -prologue- -i486- -epilogue-
|
||||
i586-$(OS): -prologue- -i586- -epilogue-
|
||||
i686-$(OS): -prologue- -i686- -epilogue-
|
||||
alpha-$(OS): -prologue- -alpha- -epilogue-
|
||||
|
||||
makefile: make_s make_e
|
||||
-prologue-: nul
|
||||
@echo Creating $(MAKEFILE)
|
||||
@type > $(MAKEFILE) &&|
|
||||
\#\#\# Makefile for ruby $(OS) \#\#\#
|
||||
srcdir = $(srcdir:\=/)
|
||||
|
|
||||
|
||||
make_s:
|
||||
@if exist makefile @del makefile
|
||||
@echo ### makefile for ruby $(OS) ###> makefile
|
||||
@echo srcdir = $(srcdir:\=/)>> makefile
|
||||
@echo RUBY_INSTALL_NAME = ruby>> makefile
|
||||
@echo RUBY_SO_NAME = $(OS)_$$(RUBY_INSTALL_NAME)17>> makefile
|
||||
-generic-: nul
|
||||
!if defined(PROCESSOR_ARCHITECTURE) || defined(PROCESSOR_LEVEL)
|
||||
@type >> $(MAKEFILE) &&|
|
||||
!if defined(PROCESSOR_ARCHITECTURE)
|
||||
@$(APPEND) PROCESSOR_ARCHITECTURE = $(PROCESSOR_ARCHITECTURE)
|
||||
!endif
|
||||
!if defined(PROCESSOR_LEVEL)
|
||||
@$(APPEND) PROCESSOR_LEVEL = $(PROCESSOR_LEVEL)
|
||||
!endif
|
||||
|
||||
make_e:
|
||||
@echo !INCLUDE $$(srcdir)bcc32/makefile.sub>> makefile
|
||||
@echo type `make' to make ruby for bccwin32.
|
||||
|
|
||||
!endif
|
||||
|
||||
ext:
|
||||
@if not exist $@\* mkdir $@
|
||||
-alpha-: nul
|
||||
@$(APPEND) PROCESSOR_ARCHITECTURE = alpha
|
||||
-ix86-: nul
|
||||
@$(APPEND) PROCESSOR_ARCHITECTURE = x86
|
||||
|
||||
pl3:
|
||||
@echo PROCESSOR_LEVEL = 3 >> makefile
|
||||
-i386-: -ix86-
|
||||
@$(APPEND) PROCESSOR_LEVEL = 3
|
||||
-i486-: -ix86-
|
||||
@$(APPEND) PROCESSOR_LEVEL = 4
|
||||
-i586-: -ix86-
|
||||
@$(APPEND) PROCESSOR_LEVEL = 5
|
||||
-i686-: -ix86-
|
||||
@$(APPEND) PROCESSOR_LEVEL = 6
|
||||
|
||||
pl4:
|
||||
@echo PROCESSOR_LEVEL = 4 >> makefile
|
||||
|
||||
pl5:
|
||||
@echo PROCESSOR_LEVEL = 5 >> makefile
|
||||
|
||||
pl6:
|
||||
@echo PROCESSOR_LEVEL = 6 >> makefile
|
||||
|
||||
3: ext make_s pl3 make_e
|
||||
|
||||
4: ext make_s pl4 make_e
|
||||
|
||||
5: ext make_s pl5 make_e
|
||||
|
||||
6: ext make_s pl6 make_e
|
||||
-epilogue-: nul
|
||||
@type >> $(MAKEFILE) &&|
|
||||
|
||||
\# OS = $(OS)
|
||||
\# RT = $(RT)
|
||||
\# RUBY_INSTALL_NAME = ruby
|
||||
\# RUBY_SO_NAME = $$(RT)-$$(RUBY_INSTALL_NAME)17
|
||||
\# prefix = /usr
|
||||
\# CFLAGS = -q $$(DEBUGFLAGS) $$(OPTFLAGS) $$(PROCESSOR_FLAG) -w-
|
||||
\# CPPFLAGS = -I. -I$$(srcdir) -I$$(srcdir)missing -DLIBRUBY_SO=\"$$(LIBRUBY_SO)\"
|
||||
\# STACK = 0x2000000
|
||||
\# LDFLAGS = -S:$$(STACK)
|
||||
\# RFLAGS = $$(iconinc)
|
||||
\# EXTLIBS = cw32.lib import32.lib user32.lib kernel32.lib
|
||||
$(INCLUDE) $$(srcdir)bcc32/Makefile.sub
|
||||
|
|
||||
@echo type "`$(MAKE)'" to make ruby for $(OS).
|
||||
|
@ -27,7 +27,7 @@ $(LIBRUBY): $(LIBRUBY_SO)
|
||||
@WINDRES@ --include-dir . --include-dir $(<D) --include-dir $(srcdir)/win32 $< $@
|
||||
|
||||
$(RUBY_INSTALL_NAME).rc $(RUBYW_INSTALL_NAME).rc $(RUBY_SO_NAME).rc: rbconfig.rb
|
||||
@@MINIRUBY@ $(srcdir)/win32/resource.rb \
|
||||
@$(MINIRUBY) $(srcdir)/win32/resource.rb \
|
||||
-ruby_name=$(RUBY_INSTALL_NAME) -rubyw_name=$(RUBYW_INSTALL_NAME) \
|
||||
-so_name=$(RUBY_SO_NAME) \
|
||||
. $(icondirs) $(srcdir)/win32
|
||||
@ -40,9 +40,15 @@ $(WPROGRAM): $(RUBYW_INSTALL_NAME).res.@OBJEXT@
|
||||
|
||||
$(RUBYDEF): $(LIBRUBY_A)
|
||||
echo EXPORTS > $(RUBYDEF)
|
||||
@NM@ --extern-only --defined-only $(LIBRUBY_A) | \
|
||||
@MINIRUBY@ -ne 'puts $$1 if / [CDT] _(.*)$$/' >> $(RUBYDEF)
|
||||
@NM@ --extern-only --defined-only $(LIBRUBY_A) | sed -n 's/.* [CDT] _//p' >> $(RUBYDEF)
|
||||
|
||||
$(RUBY_EXP): $(RUBYDEF)
|
||||
@DLLWRAP@ --output-exp=$(RUBY_EXP) --output-lib=$(LIBRUBY) \
|
||||
--def=$(RUBYDEF) $(LIBRUBY_A) $(LIBS) -o $(PROGRAM)
|
||||
rm $(PROGRAM)
|
||||
|
||||
GNUmakefile: $(srcdir)/cygwin/GNUmakefile.in
|
||||
|
||||
ifeq (@target_os@,mingw32)
|
||||
$(OBJS) $(MAINOBJ): win32/win32.h
|
||||
endif
|
||||
|
@ -33,19 +33,25 @@ else
|
||||
end
|
||||
$with_dlstack = ! $with_asm
|
||||
|
||||
$with_type_int = try_run(<<EOF)
|
||||
int main(){ return sizeof(int) == sizeof(long); }
|
||||
$with_type_int = try_cpp(<<EOF)
|
||||
#include "config.h"
|
||||
#if SIZEOF_INT == SIZEOF_LONG
|
||||
#error int not needed
|
||||
#endif
|
||||
EOF
|
||||
|
||||
$with_type_float = try_run(<<EOF)
|
||||
int main(){ return sizeof(float) == sizeof(double); }
|
||||
$with_type_float = try_cpp(<<EOF)
|
||||
#include "config.h"
|
||||
#if SIZEOF_FLOAT == SIZEOF_DOUBLE
|
||||
#error float not needed
|
||||
#endif
|
||||
EOF
|
||||
|
||||
$with_type_voidp = try_run(<<EOF)
|
||||
int main(){
|
||||
return (sizeof(void *) == sizeof(long))
|
||||
|| (sizeof(void *) == sizeof(int));
|
||||
}
|
||||
$with_type_voidp = try_cpp(<<EOF)
|
||||
#include "config.h"
|
||||
#if SIZEOF_VOIDP == SIZEOF_INT || SIZEOF_VOIDP == SIZEOF_LONG
|
||||
#error void* not needed
|
||||
#endif
|
||||
EOF
|
||||
|
||||
$with_type_char = DLTYPE[CHAR][:sym]
|
||||
@ -176,21 +182,6 @@ $INSTALLFILES = [
|
||||
["dl.h", "$(archdir)$(target_prefix)", ""],
|
||||
]
|
||||
|
||||
if /bccwin32/ =~ RUBY_PLATFORM
|
||||
srcdir = $top_srcdir + "/ext/dl/"
|
||||
if !FileTest.exist?( srcdir+"dl.def.org" )
|
||||
File.copy( srcdir+"dl.def", srcdir+"dl.def.org" )
|
||||
open( srcdir+"dl.def.org" ){ |f|
|
||||
open( "dl.def", "w" ) { |g|
|
||||
g.print f.gets
|
||||
while line = f.gets
|
||||
g.print "_", line
|
||||
end
|
||||
}
|
||||
}
|
||||
end
|
||||
end
|
||||
|
||||
create_makefile('dl')
|
||||
rescue SystemExit
|
||||
# do nothing
|
||||
|
545
ext/extmk.rb
545
ext/extmk.rb
@ -1,4 +1,4 @@
|
||||
#! /usr/local/bin/ruby
|
||||
#! /usr/local/bin/ruby -s
|
||||
# -*- ruby -*-
|
||||
|
||||
$force_static = nil
|
||||
@ -9,24 +9,6 @@ $nodynamic = nil
|
||||
$extinit = nil
|
||||
$extobjs = nil
|
||||
|
||||
if ARGV[0] == 'static'
|
||||
$force_static = true
|
||||
ARGV.shift
|
||||
elsif ARGV[0] == 'install'
|
||||
$install = true
|
||||
$destdir = ARGV[1] || ''
|
||||
ARGV.shift
|
||||
elsif ARGV[0] == 'clean'
|
||||
$clean = "clean"
|
||||
ARGV.shift
|
||||
elsif ARGV[0] == 'distclean'
|
||||
$clean = "distclean"
|
||||
ARGV.shift
|
||||
elsif ARGV[0] == 'realclean'
|
||||
$clean = "realclean"
|
||||
ARGV.shift
|
||||
end
|
||||
|
||||
$extlist = []
|
||||
|
||||
$:.replace ["."]
|
||||
@ -37,350 +19,27 @@ srcdir = Config::CONFIG["srcdir"]
|
||||
$:.replace [srcdir, srcdir+"/lib", "."]
|
||||
|
||||
require 'mkmf'
|
||||
require 'find'
|
||||
require 'ftools'
|
||||
require 'shellwords'
|
||||
|
||||
$topdir = File.expand_path(".")
|
||||
$top_srcdir = srcdir
|
||||
|
||||
# avoid warning for $VERBOSE mode
|
||||
Object.class_eval do remove_method :create_makefile end
|
||||
|
||||
def create_makefile(target)
|
||||
$target = target
|
||||
if target.include?('/')
|
||||
target_prefix, target = File.split(target)
|
||||
target_prefix[0,0] = '/'
|
||||
else
|
||||
target_prefix = ""
|
||||
end
|
||||
rm_f "conftest*"
|
||||
if CONFIG["DLEXT"] == $OBJEXT
|
||||
libs = $libs.split
|
||||
for lib in libs
|
||||
lib.sub!(/-l(.*)/, %%"lib\\1.#{$LIBEXT}"%)
|
||||
end
|
||||
$defs.push(format("-DEXTLIB='%s'", libs.join(",")))
|
||||
end
|
||||
|
||||
$DLDFLAGS = CONFIG["DLDFLAGS"].dup
|
||||
if /linux/ =~ RUBY_PLATFORM and $configure_args['--enable-shared'] and CONFIG["GNU_LD"] == "yes"
|
||||
$DLDFLAGS << " -Wl,-no-undefined"
|
||||
end
|
||||
|
||||
if $configure_args['--enable-shared'] or CONFIG["LIBRUBY"] != CONFIG["LIBRUBY_A"]
|
||||
$libs = CONFIG["LIBRUBYARG"] + " " + $libs
|
||||
$LIBPATH.unshift $topdir
|
||||
end
|
||||
|
||||
defflag = ''
|
||||
if RUBY_PLATFORM =~ /cygwin|mingw/ and not $static
|
||||
if not File.exist? target + '.def'
|
||||
open(target + '.def', 'wb') do |f|
|
||||
f.print "EXPORTS\n", "Init_", target, "\n"
|
||||
end
|
||||
end
|
||||
defflag = target + ".def"
|
||||
elsif RUBY_PLATFORM =~ /bccwin32/
|
||||
deffile = target + '.def'
|
||||
if not File.exist? target + '.def'
|
||||
open(deffile, 'wb') do |f|
|
||||
f.print "EXPORTS\n", "_Init_", target, "\n"
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
if RUBY_PLATFORM =~ /mswin32|bccwin32/
|
||||
libpath = $LIBPATH.join(';')
|
||||
else
|
||||
$LIBPATH.each {|d| $DLDFLAGS << " -L" << d}
|
||||
if /netbsdelf/ =~ RUBY_PLATFORM
|
||||
$LIBPATH.each {|d| $DLDFLAGS << " -Wl,-R" + d unless d == $topdir}
|
||||
end
|
||||
end
|
||||
|
||||
$srcdir = File.join($top_srcdir,"ext",$mdir)
|
||||
mfile = open("Makefile", "w")
|
||||
mfile.binmode if /mingw/ =~ RUBY_PLATFORM
|
||||
mfile.printf <<EOL, if $static then "" else CONFIG["CCDLFLAGS"] end, $defs.join(" ")
|
||||
SHELL = /bin/sh
|
||||
|
||||
#### Start of system configuration section. ####
|
||||
|
||||
srcdir = #{$srcdir}
|
||||
VPATH = #{$srcdir}
|
||||
|
||||
topdir = #{$topdir}
|
||||
hdrdir = #{$top_srcdir}
|
||||
|
||||
CC = #{CONFIG['CC']}
|
||||
|
||||
CFLAGS = %s #{CFLAGS} #$CFLAGS
|
||||
CPPFLAGS = -I$(topdir) -I$(hdrdir) %s #$CPPFLAGS
|
||||
#{
|
||||
if /bccwin32/ =~ RUBY_PLATFORM
|
||||
"DLDFLAGS = #$LDFLAGS -L" + '"$(libdir:/=\\);$(topdir:/=\\)"' + "\n" +
|
||||
"LDSHARED = #{CONFIG['LDSHARED']}\n"
|
||||
else
|
||||
"DLDFLAGS = #$DLDFLAGS #$LDFLAGS\n" +
|
||||
"LDSHARED = #{CONFIG['LDSHARED']} #{defflag}\n"
|
||||
end
|
||||
}
|
||||
EOL
|
||||
mfile.puts "LIBPATH = #{libpath}" if libpath
|
||||
|
||||
mfile.puts ".SUFFIXES: .#{CONFIG['OBJEXT']}" unless #{CONFIG['OBJEXT']} == "o"
|
||||
|
||||
mfile.printf "\
|
||||
|
||||
RUBY_INSTALL_NAME = #{CONFIG['RUBY_INSTALL_NAME']}
|
||||
RUBY_SO_NAME = #{CONFIG['RUBY_SO_NAME']}
|
||||
ruby_version = #{Config::CONFIG["ruby_version"]}
|
||||
|
||||
prefix = #{CONFIG['prefix']}
|
||||
exec_prefix = #{CONFIG['exec_prefix']}
|
||||
libdir = #{CONFIG['libdir']}
|
||||
rubylibdir = $(libdir)/ruby/$(ruby_version)
|
||||
#pkglibdir = $(libdir)/$(RUBY_INSTALL_NAME)/#{CONFIG['MAJOR']}.#{CONFIG['MINOR']}
|
||||
pkglibdir = $(libdir)/ruby/#{CONFIG['MAJOR']}.#{CONFIG['MINOR']}
|
||||
archdir = $(pkglibdir)/#{CONFIG['arch']}
|
||||
target_prefix = #{target_prefix}
|
||||
#{CONFIG['SET_MAKE']}
|
||||
|
||||
#### End of system configuration section. ####
|
||||
|
||||
"
|
||||
mfile.printf "LOCAL_LIBS = %s %s\n", $LOCAL_LIBS, $local_flags
|
||||
if /bccwin32/ =~ RUBY_PLATFORM
|
||||
mfile.printf "LIBS = $(topdir:/=\\)\\%s\n", $libs
|
||||
else
|
||||
mfile.printf "LIBS = %s\n", $libs
|
||||
end
|
||||
mfile.printf "OBJS = "
|
||||
if !$objs then
|
||||
$objs = []
|
||||
for f in Dir["#{$top_srcdir}/ext/#{$mdir}/*.{#{SRC_EXT.join(%q{,})}}"]
|
||||
f = File.basename(f)
|
||||
f.sub!(/(#{SRC_EXT.join(%q{|})})$/, $OBJEXT)
|
||||
$objs.push f
|
||||
end
|
||||
else
|
||||
for i in $objs
|
||||
i.sub!(/\.o\z/, ".#{$OBJEXT}")
|
||||
end
|
||||
end
|
||||
mfile.printf $objs.join(" ")
|
||||
mfile.printf "\n"
|
||||
|
||||
if /bccwin32/ =~ RUBY_PLATFORM
|
||||
ruby_interpreter = '$(topdir:/=\)/miniruby' + CONFIG['EXEEXT']
|
||||
else
|
||||
ruby_interpreter = "$(topdir)/miniruby" + CONFIG['EXEEXT']
|
||||
if /nmake/i =~ $make
|
||||
ruby_interpreter = '$(topdir:/=\)\miniruby' + CONFIG['EXEEXT']
|
||||
end
|
||||
end
|
||||
if defined? CROSS_COMPILING
|
||||
ruby_interpreter = CONFIG['MINIRUBY']
|
||||
end
|
||||
|
||||
mfile.printf <<EOS
|
||||
TARGET = #{target}
|
||||
DLLIB = $(TARGET).#{$static ? $LIBEXT : CONFIG['DLEXT']}
|
||||
|
||||
RUBY = #{ruby_interpreter} -I$(topdir) -I$(hdrdir)/lib
|
||||
RM = $(RUBY) -rftools -e "File::rm_f(*ARGV.map do|x|Dir[x]end.flatten.uniq)"
|
||||
MAKEDIRS = $(RUBY) -r ftools -e 'File::makedirs(*ARGV)'
|
||||
INSTALL_PROG = $(RUBY) -r ftools -e 'File::install(ARGV[0], ARGV[1], 0555, true)'
|
||||
INSTALL_DATA = $(RUBY) -r ftools -e 'File::install(ARGV[0], ARGV[1], 0644, true)'
|
||||
|
||||
EXEEXT = CONFIG['EXEEXT']
|
||||
|
||||
all: $(DLLIB)
|
||||
|
||||
clean:
|
||||
@$(RM) *.#{$OBJEXT} *.so *.sl *.#{$LIBEXT} $(DLLIB)
|
||||
#{
|
||||
if /bccwin32/ =~ RUBY_PLATFORM
|
||||
" @$(RM) *.def *.ilc *.ild *.ilf *.ils *.map *.tds *.bak $(CLEANFILES)\n" +
|
||||
" @if exist $(target).def.org ren $(target).def.org $(target).def"
|
||||
else
|
||||
" @$(RM) *.ilk *.exp *.pdb *.bak $(CLEANFILES)"
|
||||
end
|
||||
}
|
||||
|
||||
distclean: clean
|
||||
@$(RM) Makefile extconf.h conftest.*
|
||||
@$(RM) core ruby$(EXEEXT) *~ $(DISTCLEANFILES)
|
||||
|
||||
realclean: distclean
|
||||
EOS
|
||||
|
||||
mfile.printf <<EOS
|
||||
|
||||
install:
|
||||
@$(MAKEDIRS) $(DESTDIR)$(libdir) $(DESTDIR)$(pkglibdir) $(DESTDIR)$(archdir)$(target_prefix)
|
||||
EOS
|
||||
unless $static
|
||||
mfile.printf "\
|
||||
@$(INSTALL_PROG) $(DLLIB) $(DESTDIR)$(archdir)$(target_prefix)/$(DLLIB)
|
||||
"
|
||||
end
|
||||
save_srcdir = Config::CONFIG['srcdir']
|
||||
Config::CONFIG['srcdir'] = $srcdir
|
||||
install_rb(mfile, '$(DESTDIR)$(rubylibdir)$(target_prefix)', '$(srcdir)')
|
||||
Config::CONFIG['srcdir'] = save_srcdir
|
||||
mfile.printf "\n"
|
||||
|
||||
unless /mswin32/ =~ RUBY_PLATFORM
|
||||
if /bccwin32/ =~ RUBY_PLATFORM
|
||||
src = '$(<:\\=/)'
|
||||
else
|
||||
src = '$<'
|
||||
end
|
||||
copt = cxxopt = ''
|
||||
else
|
||||
if /nmake/i =~ $make
|
||||
src = '$(<:\\=/)'
|
||||
else
|
||||
src = '$(subst /,\\\\,$<)'
|
||||
end
|
||||
copt = '-Tc'
|
||||
cxxopt = '-Tp'
|
||||
end
|
||||
unless /nmake/i =~ $make
|
||||
if /bccwin32/ =~ RUBY_PLATFORM
|
||||
mfile.print "
|
||||
{$(srcdir)}.cc{}.#{CONFIG['OBJEXT']}:
|
||||
$(CXX) $(CXXFLAGS) $(CPPFLAGS) -c #{cxxopt}#{src}
|
||||
{$(srcdir)}.cpp{}.#{CONFIG['OBJEXT']}:
|
||||
$(CXX) $(CXXFLAGS) $(CPPFLAGS) -c #{cxxopt}#{src}
|
||||
{$(srcdir)}.cxx{}.#{CONFIG['OBJEXT']}:
|
||||
$(CXX) $(CXXFLAGS) $(CPPFLAGS) -c #{cxxopt}#{src}
|
||||
{$(srcdir)}.c{}.#{CONFIG['OBJEXT']}:
|
||||
$(CC) $(CFLAGS) $(CPPFLAGS) -c #{copt}#{src}
|
||||
"
|
||||
end
|
||||
mfile.puts "
|
||||
.cc.#{CONFIG['OBJEXT']}:
|
||||
$(CXX) $(CXXFLAGS) $(CPPFLAGS) -c #{cxxopt}#{src}
|
||||
.cpp.#{CONFIG['OBJEXT']}:
|
||||
$(CXX) $(CXXFLAGS) $(CPPFLAGS) -c #{cxxopt}#{src}
|
||||
.cxx.#{CONFIG['OBJEXT']}:
|
||||
$(CXX) $(CXXFLAGS) $(CPPFLAGS) -c #{cxxopt}#{src}
|
||||
.C.#{CONFIG['OBJEXT']}:
|
||||
$(CXX) $(CXXFLAGS) $(CPPFLAGS) -c #{cxxopt}#{src}
|
||||
.c.#{CONFIG['OBJEXT']}:
|
||||
$(CC) $(CFLAGS) $(CPPFLAGS) -c #{copt}#{src}
|
||||
"
|
||||
else
|
||||
mfile.print "
|
||||
{$(srcdir)}.c{}.#{CONFIG['OBJEXT']}:
|
||||
$(CC) -I. -I$(<D) $(CFLAGS) $(CPPFLAGS) -c #{copt}#{src}
|
||||
.c.#{CONFIG['OBJEXT']}:
|
||||
$(CC) $(CFLAGS) $(CPPFLAGS) -c #{copt}#{src}
|
||||
{$(srcdir)}.cc{}.#{CONFIG['OBJEXT']}:
|
||||
$(CXX) -I. -I$(<D) $(CXXFLAGS) $(CPPFLAGS) -c #{cxxopt}#{src}
|
||||
.cc.#{CONFIG['OBJEXT']}:
|
||||
$(CXX) $(CXXFLAGS) $(CPPFLAGS) -c #{cxxopt}#{src}
|
||||
{$(srcdir)}.cpp{}.#{CONFIG['OBJEXT']}:
|
||||
$(CXX) -I. -I$(<D) $(CXXFLAGS) $(CPPFLAGS) -c #{cxxopt}#{src}
|
||||
.cpp.#{CONFIG['OBJEXT']}:
|
||||
$(CXX) $(CXXFLAGS) $(CPPFLAGS) -c #{cxxopt}#{src}
|
||||
{$(srcdir)}.cxx{}.#{CONFIG['OBJEXT']}:
|
||||
$(CXX) -I. -I$(<D) $(CXXFLAGS) $(CPPFLAGS) -c #{cxxopt}#{src}
|
||||
.cxx.#{CONFIG['OBJEXT']}:
|
||||
$(CXX) $(CXXFLAGS) $(CPPFLAGS) -c #{cxxopt}#{src}
|
||||
"
|
||||
end
|
||||
|
||||
if $static
|
||||
if CONFIG['AR'] =~ /^lib\b/i
|
||||
mfile.printf "\
|
||||
$(DLLIB): $(OBJS)
|
||||
#{CONFIG['AR']} /OUT:$(DLLIB) $(OBJS)
|
||||
"
|
||||
else
|
||||
mfile.printf "\
|
||||
$(DLLIB): $(OBJS)
|
||||
#{CONFIG['AR']} cru $(DLLIB) $(OBJS)
|
||||
@-#{CONFIG['RANLIB']} $(DLLIB) 2> /dev/null || true
|
||||
"
|
||||
end
|
||||
elsif CONFIG['DLEXT'] != $OBJEXT
|
||||
mfile.print "$(DLLIB): $(OBJS)\n"
|
||||
if /bccwin32/ =~ RUBY_PLATFORM
|
||||
mfile.print "\t$(LDSHARED) $(DLDFLAGS) C0D32.OBJ $(OBJS), $@,, CW32.LIB IMPORT32.LIB WS2_32.LIB $(LIBS), #{deffile}\n"
|
||||
else
|
||||
if /mswin32/ =~ RUBY_PLATFORM
|
||||
if /nmake/i =~ $make
|
||||
mfile.print "\tset LIB=$(LIBPATH:/=\\);$(LIB)\n"
|
||||
else
|
||||
mfile.print "\tenv LIB='$(subst /,\\\\,$(LIBPATH));$(LIB)' \\\n"
|
||||
end
|
||||
end
|
||||
mfile.print "\t$(LDSHARED) $(DLDFLAGS) #{OUTFLAG}$(DLLIB) $(OBJS) $(LIBS) $(LOCAL_LIBS)\n"
|
||||
end
|
||||
elsif RUBY_PLATFORM == "m68k-human"
|
||||
mfile.printf "\
|
||||
$(DLLIB): $(OBJS)
|
||||
ar cru $(DLLIB) $(OBJS)
|
||||
"
|
||||
else
|
||||
mfile.printf "\
|
||||
$(DLLIB): $(OBJS)
|
||||
ld $(DLDFLAGS) -r -o $(DLLIB) $(OBJS)
|
||||
"
|
||||
end
|
||||
|
||||
if File.exist?("#{$srcdir}/depend")
|
||||
dfile = open("#{$srcdir}/depend", "r")
|
||||
mfile.printf "###\n"
|
||||
while line = dfile.gets()
|
||||
line.gsub!(/\.o\b/, ".#{$OBJEXT}")
|
||||
if /bccwin32/ =~ RUBY_PLATFORM
|
||||
line.gsub!(/(\s)([^\s\/]+\.[ch])/, '\1{$(srcdir)}\2')
|
||||
else
|
||||
line.gsub!(/(\s)([^\s\/]+\.[ch])/, '\1{$(srcdir)}\2') if /nmake/i =~ $make
|
||||
end
|
||||
mfile.printf "%s", line.gsub(/\$\(hdrdir\)\/config.h/, '$(topdir)/config.h')
|
||||
end
|
||||
dfile.close
|
||||
end
|
||||
mfile.close
|
||||
end
|
||||
$hdrdir = $top_srcdir
|
||||
|
||||
def extmake(target)
|
||||
print "#{$message} #{target}\n"
|
||||
$stdout.flush
|
||||
if $force_static or $static_ext[target]
|
||||
$static = target
|
||||
else
|
||||
$static = false
|
||||
end
|
||||
|
||||
unless $install or $clean
|
||||
unless $ignore
|
||||
return if $nodynamic and not $static
|
||||
end
|
||||
|
||||
$OBJEXT = CONFIG['OBJEXT']
|
||||
$LIBEXT = "a"
|
||||
$objs = nil
|
||||
$libs = CONFIG['DLDLIBS'].dup
|
||||
$local_flags = ""
|
||||
if /mswin32/ =~ RUBY_PLATFORM
|
||||
$LIBEXT = "lib"
|
||||
$local_flags = "-link /INCREMENTAL:no /EXPORT:Init_$(TARGET)"
|
||||
elsif /bccwin32/ =~ RUBY_PLATFORM
|
||||
$LIBEXT = "lib"
|
||||
end
|
||||
$LOCAL_LIBS = "" # to be assigned in extconf.rb
|
||||
$CFLAGS = ""
|
||||
$CPPFLAGS = CONFIG['CPPFLAGS']
|
||||
$LDFLAGS = ""
|
||||
$LIBPATH = [$libdir]
|
||||
$INCFLAGS = "-I#{$topdir}"
|
||||
|
||||
dir_config("opt")
|
||||
init_mkmf
|
||||
|
||||
begin
|
||||
dir = Dir.pwd
|
||||
@ -388,164 +47,176 @@ def extmake(target)
|
||||
Dir.chdir target
|
||||
$target = target
|
||||
$mdir = target
|
||||
unless $install or $clean
|
||||
if $static_ext.size > 0 ||
|
||||
!File.exist?("./Makefile") ||
|
||||
older("./Makefile", $setup) ||
|
||||
older("./Makefile", "#{$top_srcdir}/ext/extmk.rb") ||
|
||||
older("./Makefile", "#{$top_srcdir}/ext/#{target}/makefile.rb") ||
|
||||
older("./Makefile", "#{$top_srcdir}/ext/#{target}/extconf.rb")
|
||||
$srcdir = File.join($top_srcdir, "ext", $mdir)
|
||||
unless $ignore
|
||||
if $static ||
|
||||
older("./Makefile", *MTIMES + %w"#{$srcdir}/makefile.rb #{$srcdir}/extconf.rb")
|
||||
then
|
||||
$defs = []
|
||||
Logging::logfile 'mkmf.log'
|
||||
if File.exist?("#{$top_srcdir}/ext/#{target}/makefile.rb")
|
||||
load "#{$top_srcdir}/ext/#{target}/makefile.rb"
|
||||
elsif File.exist?("#{$top_srcdir}/ext/#{target}/extconf.rb")
|
||||
load "#{$top_srcdir}/ext/#{target}/extconf.rb"
|
||||
Config::CONFIG["srcdir"] = $srcdir
|
||||
if File.exist?("#{$srcdir}/makefile.rb")
|
||||
load "#{$srcdir}/makefile.rb"
|
||||
elsif File.exist?("#{$srcdir}/extconf.rb")
|
||||
load "#{$srcdir}/extconf.rb"
|
||||
else
|
||||
create_makefile(target)
|
||||
end
|
||||
Config::CONFIG["srcdir"] = $top_srcdir
|
||||
end
|
||||
end
|
||||
if File.exist?("./Makefile")
|
||||
if $static
|
||||
$extlist.push [$static, $target, File.basename($target)]
|
||||
$extlist.push [$static, $target, File.basename($target)]
|
||||
end
|
||||
if $install
|
||||
if /bccwin32/ =~ RUBY_PLATFORM
|
||||
system "#{$make} -DDESTDIR=#{$destdir} install"
|
||||
else
|
||||
system "#{$make} install DESTDIR=#{$destdir}"
|
||||
end
|
||||
elsif $clean
|
||||
system "#{$make} #{$clean}"
|
||||
else
|
||||
unless system "#{$make} all"
|
||||
if ENV["MAKEFLAGS"] != "k" and ENV["MFLAGS"] != "-k"
|
||||
exit
|
||||
end
|
||||
end
|
||||
unless system *ARGV
|
||||
$ignore or $continue or exit(1)
|
||||
end
|
||||
else
|
||||
open("./Makefile", "w") {|f|
|
||||
f.print configuration($srcdir), makerules(nil)
|
||||
}
|
||||
end
|
||||
if $static
|
||||
$extflags ||= ""
|
||||
$extlibs ||= ""
|
||||
$extlibs += " " + $DLDFLAGS if $DLDFLAGS
|
||||
$extlibs += " " + $LDFLAGS unless $LDFLAGS == ""
|
||||
$extflags += " " + $DLDFLAGS if $DLDFLAGS
|
||||
$extflags += " " + $LDFLAGS unless $LDFLAGS == ""
|
||||
$extlibs += " " + $libs unless $libs == ""
|
||||
$extlibs += " " + $LOCAL_LIBS unless $LOCAL_LIBS == ""
|
||||
end
|
||||
rescue SystemExit
|
||||
# ignore
|
||||
ensure
|
||||
rm_f "conftest*"
|
||||
Dir.chdir dir
|
||||
end
|
||||
end
|
||||
|
||||
$make = ENV["MAKE"]
|
||||
$make ||= with_config("make-prog", "make")
|
||||
if ARGV[0] == "static"
|
||||
ARGV.shift
|
||||
$force_static = true
|
||||
end
|
||||
|
||||
File::makedirs('ext')
|
||||
Dir::chdir('ext')
|
||||
$make = ARGV[0] if ARGV[0]
|
||||
ARGV << $make if ARGV.empty? and $make
|
||||
if mflags = ENV["MAKEFLAGS"]
|
||||
mflags, = mflags.split(nil, 2)
|
||||
else
|
||||
mflags = ENV["MFLAGS"] || ""
|
||||
end
|
||||
$continue = mflags.include?(?k)
|
||||
$dryrun = mflags.include?(?n)
|
||||
|
||||
unless $message
|
||||
if ARGV.size > 1 and /^[a-z]+$/ =~ ($message = ARGV[-1])
|
||||
$message = $message.sub(/^(?:dist|real)(?=(?:clean)?$)/, '\1')
|
||||
case $message
|
||||
when "clean"
|
||||
$ignore ||= true
|
||||
when "install"
|
||||
$ignore ||= true
|
||||
ARGV[1, 0] = ["INSTALL_PROG=install -m 0755", "INSTALL_DATA=install -m 0644"] if $dryrun
|
||||
end
|
||||
$message.sub!(/e?$/, "ing")
|
||||
else
|
||||
$message = "compiling"
|
||||
end
|
||||
end
|
||||
|
||||
EXEEXT = CONFIG['EXEEXT']
|
||||
if defined? CROSS_COMPILING
|
||||
$ruby = CONFIG['MINIRUBY']
|
||||
elsif $nmake
|
||||
$ruby = '$(topdir:/=\\)\\miniruby' + EXEEXT
|
||||
else
|
||||
$ruby = '$(topdir)/miniruby' + EXEEXT
|
||||
end
|
||||
$ruby << " -I$(topdir) -I$(hdrdir)/lib"
|
||||
$config_h = '$(topdir)/config.h'
|
||||
|
||||
MTIMES = [File.mtime(__FILE__)]
|
||||
|
||||
# get static-link modules
|
||||
$static_ext = {}
|
||||
for setup in [CONFIG['setup'], File::join($top_srcdir, "ext", CONFIG['setup'])]
|
||||
for dir in ["ext", File::join($top_srcdir, "ext")]
|
||||
setup = File::join(dir, CONFIG['setup'])
|
||||
if File.file? setup
|
||||
f = open(setup)
|
||||
while line = f.gets()
|
||||
line.chomp!
|
||||
line.sub!(/#.*$/, '')
|
||||
next if /^\s*$/ =~ line
|
||||
if /^option +nodynamic/ =~ line
|
||||
$nodynamic = true
|
||||
target, opt = line.split(nil, 3)
|
||||
if target == 'option'
|
||||
case opt
|
||||
when 'nodynamic'
|
||||
$nodynamic = true
|
||||
end
|
||||
next
|
||||
end
|
||||
target = line.split[0]
|
||||
target = target.downcase if /mswin32|bccwin32/ =~ RUBY_PLATFORM
|
||||
$static_ext[target] = true
|
||||
end
|
||||
MTIMES << f.mtime
|
||||
$setup = setup
|
||||
f.close
|
||||
break
|
||||
end
|
||||
end
|
||||
|
||||
File::makedirs('ext')
|
||||
Dir::chdir('ext')
|
||||
|
||||
ext_prefix = "#{$top_srcdir}/ext"
|
||||
for d in Dir["#{ext_prefix}/**/*"]
|
||||
File.directory?(d) || next
|
||||
File.file?(d + "/MANIFEST") || next
|
||||
|
||||
Dir.glob("#{ext_prefix}/**/MANIFEST") do |d|
|
||||
d = File.dirname(d)
|
||||
d.slice!(0, ext_prefix.length + 1)
|
||||
if $install
|
||||
print "installing ", d, "\n"
|
||||
elsif $clean
|
||||
print "cleaning ", d, "\n"
|
||||
else
|
||||
print "compiling ", d, "\n"
|
||||
if RUBY_PLATFORM =~ /-aix/ and older("../ruby.imp", "../miniruby")
|
||||
load "#{$top_srcdir}/ext/aix_mksym.rb"
|
||||
end
|
||||
end
|
||||
$stdout.flush
|
||||
extmake(d)
|
||||
end
|
||||
|
||||
if $install or $clean
|
||||
if $ignore
|
||||
Dir.chdir ".."
|
||||
exit
|
||||
end
|
||||
$extinit = "" unless $extinit
|
||||
|
||||
ruby = CONFIG["RUBY_INSTALL_NAME"] + CONFIG["EXEEXT"]
|
||||
miniruby = "miniruby" + CONFIG["EXEEXT"]
|
||||
|
||||
$extobjs = "" unless $extobjs
|
||||
if $extlist.size > 0
|
||||
$extinit ||= ""
|
||||
$extobjs ||= ""
|
||||
for s,t,i in $extlist
|
||||
f = format("%s/%s.%s", s, i, $LIBEXT)
|
||||
if File.exist?(f)
|
||||
$extinit += format("\
|
||||
\tInit_%s();\n\
|
||||
\trb_provide(\"%s.so\");\n\
|
||||
", i, t)
|
||||
$extobjs += "ext/"
|
||||
$extobjs += f
|
||||
$extobjs += " "
|
||||
else
|
||||
false
|
||||
$extinit += "\tInit_#{i}();\n\trb_provide(\"#{t}.so\");\n"
|
||||
$extobjs += "ext/#{f} "
|
||||
end
|
||||
end
|
||||
|
||||
if older("extinit.c", $setup) || older("extinit.c", "#{$top_srcdir}/ext/extmk.rb")
|
||||
f = open("extinit.c", "w")
|
||||
f.printf "void Init_ext() {\n"
|
||||
f.printf $extinit
|
||||
f.printf "}\n"
|
||||
f.close
|
||||
end
|
||||
if older("extinit.#{$OBJEXT}", "extinit.c")
|
||||
cmd = CONFIG["CC"] + " " + CFLAGS + " -c extinit.c"
|
||||
print cmd, "\n"
|
||||
system cmd or exit 1
|
||||
end
|
||||
|
||||
Dir.chdir ".."
|
||||
|
||||
if older(ruby, $setup) or older(ruby, miniruby)
|
||||
rm_f ruby
|
||||
src = "void Init_ext() {\n#$extinit}\n"
|
||||
if older("extinit.c", *MTIMES) || IO.read("extinit.c") != src
|
||||
open("extinit.c", "w") {|f| f.print src}
|
||||
end
|
||||
|
||||
$extobjs = "ext/extinit.#{$OBJEXT} " + $extobjs
|
||||
if RUBY_PLATFORM =~ /m68k-human|beos/
|
||||
$extlibs.gsub!("-L/usr/local/lib", "") if $extlibs
|
||||
end
|
||||
system format(%[#{$make} #{ruby} EXTOBJS='%s' EXTLIBS='%s'], $extobjs, $extlibs)
|
||||
else
|
||||
Dir.chdir ".."
|
||||
if older(ruby, miniruby)
|
||||
rm_f ruby
|
||||
system("#{$make} #{ruby}")
|
||||
end
|
||||
conf = ['SETUP='+$setup, 'EXTOBJS='+$extobjs.strip]
|
||||
conf << 'EXTLIBS='+$extlibs.strip if $extlibs
|
||||
conf << 'EXTLDFLAGS='+$extflags.strip if $extflags
|
||||
puts conf
|
||||
ARGV.concat(conf)
|
||||
end
|
||||
rubies = []
|
||||
%w[RUBY RUBYW].each {|r|
|
||||
r = CONFIG[r+"_INSTALL_NAME"] and !r.empty? and rubies << r+EXEEXT
|
||||
}
|
||||
|
||||
Dir.chdir ".."
|
||||
puts "making #{rubies.join(', ')}"
|
||||
ARGV.concat(rubies)
|
||||
host = (defined?(CROSS_COMPILING) ? CROSS_COMPILING : RUBY_PLATFORM)
|
||||
/mswin|bccwin|mingw|djgpp|human|os2|macos/ =~ host or exec(*ARGV)
|
||||
system(*ARGV.quote) or exit($?.exitstatus)
|
||||
|
||||
#Local variables:
|
||||
# mode: ruby
|
||||
|
914
lib/mkmf.rb
914
lib/mkmf.rb
File diff suppressed because it is too large
Load Diff
@ -25,11 +25,14 @@ iconinc=-I$(icondirs: = -I)
|
||||
###############
|
||||
|
||||
VPATH = $(srcdir):$(srcdir)/missing
|
||||
.SUFFIXES: .y
|
||||
.SUFFIXES: .y .def .lib
|
||||
|
||||
!if !defined(CC)
|
||||
CC = cl
|
||||
!endif
|
||||
!if !defined(CPP)
|
||||
CPP = $(CC) -E
|
||||
!endif
|
||||
!if !defined(YACC)
|
||||
YACC = byacc
|
||||
!endif
|
||||
@ -75,14 +78,11 @@ prefix = /usr
|
||||
DESTDIR = $(prefix)
|
||||
!endif
|
||||
!if !defined(CFLAGS)
|
||||
CFLAGS = -nologo -MD -DNT=1 $(DEBUGFLAGS) $(OPTFLAGS) $(PROCESSOR_FLAG)
|
||||
CFLAGS = -MD -DNT=1 $(DEBUGFLAGS) $(OPTFLAGS) $(PROCESSOR_FLAG)
|
||||
!endif
|
||||
!if !defined(CPPFLAGS)
|
||||
CPPFLAGS = -I. -I$(srcdir) -I$(srcdir)/missing -DLIBRUBY_SO=\"$(LIBRUBY_SO)\"
|
||||
!endif
|
||||
!if !defined(LDFLAGS)
|
||||
LDFLAGS = $(CFLAGS) -Fm
|
||||
!endif
|
||||
!if !defined(XLDFLAGS)
|
||||
XLDFLAGS =
|
||||
!endif
|
||||
@ -94,15 +94,25 @@ EXTLIBS =
|
||||
!endif
|
||||
LIBS = user32.lib advapi32.lib wsock32.lib $(EXTLIBS)
|
||||
MISSING = acosh.obj crypt.obj win32.obj isinf.obj isnan.obj
|
||||
LDSHARED = $(CC) -LD
|
||||
DLDFLAGS =
|
||||
|
||||
ARFLAGS = -machine:$(MACHINE) -out:
|
||||
CC = $(CC) -nologo
|
||||
LD = $(CC)
|
||||
LDSHARED = $(LD) -LD
|
||||
XCFLAGS =
|
||||
LDFLAGS = -link -incremental:no -pdb:none
|
||||
DLDFLAGS = $(LDFLAGS) -dll
|
||||
XLDFLAGS = -stack:$(STACK)
|
||||
SOLIBS =
|
||||
|
||||
LIBRUBY_LDSHARED = $(LDSHARED)
|
||||
LIBRUBY_DLDFLAGS = $(EXTLDFLAGS) -def:$(RUBYDEF)
|
||||
|
||||
EXEEXT = .exe
|
||||
PROGRAM=$(RUBY_INSTALL_NAME)$(EXEEXT)
|
||||
WPROGRAM=$(RUBYW_INSTALL_NAME)$(EXEEXT)
|
||||
RUBYDEF = $(RUBY_SO_NAME).def
|
||||
MINIRUBY=miniruby$(EXEEXT)
|
||||
MINIRUBY = .\miniruby$(EXEEXT)
|
||||
|
||||
!if !defined(STACK)
|
||||
STACK = 0x2000000
|
||||
@ -116,7 +126,7 @@ LIBRUBY_SO = $(RUBY_SO_NAME).dll
|
||||
LIBRUBY = $(RUBY_SO_NAME).lib
|
||||
LIBRUBYARG = $(LIBRUBY)
|
||||
|
||||
EXTOBJS = dmyext.obj
|
||||
EXTOBJS =
|
||||
|
||||
MAINOBJ = main.obj
|
||||
WINMAINOBJ = winmain.obj
|
||||
@ -161,7 +171,7 @@ OBJS = array.obj \
|
||||
|
||||
all: ext miniruby$(EXEEXT) rbconfig.rb \
|
||||
$(LIBRUBY) $(MISCLIBS)
|
||||
@.\miniruby$(EXEEXT) $(srcdir)/ext/extmk.rb
|
||||
@$(MINIRUBY) $(srcdir)/ext/extmk.rb $(EXTSTATIC) $(MAKE) -$(MFLAGS)$(MAKEFLAGS)
|
||||
|
||||
ext:
|
||||
@mkdir $@
|
||||
@ -264,17 +274,16 @@ config.h: Makefile $(srcdir)/win32/Makefile.sub
|
||||
#define RUBY_SITE_ARCHLIB "/lib/ruby/site_ruby/1.7/$(ARCH)-$(RT)"
|
||||
<<KEEP
|
||||
|
||||
config.status: Makefile $(srcdir)/win32/Makefile.sub $(MINIRUBY)
|
||||
@echo Creating config.status
|
||||
@$(MINIRUBY) -pe "~/@CFLAGS@/||$$_.sub!(/#{Regexp.quote('$(CFLAGS)')}/o, '$$(CFLAGS)')" << > $@
|
||||
config.status: Makefile $(srcdir)/win32/Makefile.sub
|
||||
@echo Creating <<$@
|
||||
# Generated automatically by Makefile.sub.
|
||||
s,@SHELL@,$$(COMSPEC),;t t
|
||||
s,@CFLAGS@,$(CFLAGS),;t t
|
||||
s,@CPPFLAGS@,$(CPPFLAGS),;t t
|
||||
s,@CXXFLAGS@,$(CXXFLAGS),;t t
|
||||
s,@FFLAGS@,$(FFLAGS),;t t
|
||||
s,@LDFLAGS@,$(LDFLAGS),;t t
|
||||
s,@LIBS@,user32.lib advapi32.lib wsock32.lib,;t t
|
||||
s,@LDFLAGS@,,;t t
|
||||
s,@LIBS@,$(LIBS),;t t
|
||||
s,@exec_prefix@,$${prefix},;t t
|
||||
s,@prefix@,,;t t
|
||||
s,@program_transform_name@,s,,,,;t t
|
||||
@ -306,10 +315,11 @@ s,@target_cpu@,$(ARCH),;t t
|
||||
s,@target_vendor@,pc,;t t
|
||||
s,@target_os@,$(OS),;t t
|
||||
s,@CC@,$(CC),;t t
|
||||
s,@CPP@,$$(CC) -E,;t t
|
||||
s,@CPP@,$(CPP),;t t
|
||||
s,@YACC@,$(YACC),;t t
|
||||
s,@RANLIB@,rem,;t t
|
||||
s,@AR@,$(AR),;t t
|
||||
s,@ARFLAGS@,$(ARFLAGS):,;t t
|
||||
s,@LN_S@,$(LN_S),;t t
|
||||
s,@SET_MAKE@,$(SET_MAKE),;t t
|
||||
s,@LIBOBJS@, acosh.obj crypt.obj win32.obj isinf.obj isnan.obj,;t t
|
||||
@ -318,12 +328,13 @@ s,@DEFAULT_KCODE@,$(DEFAULT_KCODE),;t t
|
||||
s,@EXEEXT@,.exe,;t t
|
||||
s,@OBJEXT@,obj,;t t
|
||||
s,@XLDFLAGS@,$(XLDFLAGS),;t t
|
||||
s,@DLDFLAGS@,$$(CFLAGS),;t t
|
||||
s,@DLDFLAGS@,$(DLDFLAGS) $$(LIBPATH) -def:$$(DEFFILE),;t t
|
||||
s,@STATIC@,$(STATIC),;t t
|
||||
s,@CCDLFLAGS@,-DIMPORT,;t t
|
||||
s,@LDSHARED@,$$(CC) -LD,;t t
|
||||
s,@LDSHARED@,$(LDSHARED),;t t
|
||||
s,@DLEXT@,so,;t t
|
||||
s,@DLEXT2@,dll,;t t
|
||||
s,@LIBEXT@,lib,;t t
|
||||
s,@STRIP@,$(STRIP),;t t
|
||||
s,@EXTSTATIC@,$(EXTSTATIC),;t t
|
||||
s,@setup@,Setup,;t t
|
||||
@ -331,6 +342,8 @@ s,@MINIRUBY@,$(MINIRUBY),;t t
|
||||
s,@LIBRUBY_LDSHARED@,$(LIBRUBY_LDSHARED),;t t
|
||||
s,@LIBRUBY_DLDFLAGS@,$(LIBRUBY_DLDFLAGS),;t t
|
||||
s,@RUBY_INSTALL_NAME@,$(RUBY_INSTALL_NAME),;t t
|
||||
s,@rubyw_install_name@,$(RUBYW_INSTALL_NAME),;t t
|
||||
s,@RUBYW_INSTALL_NAME@,$(RUBYW_INSTALL_NAME),;t t
|
||||
s,@RUBY_SO_NAME@,$(RUBY_SO_NAME),;t t
|
||||
s,@LIBRUBY_A@,lib$$(RUBY_INSTALL_NAME).lib,;t t
|
||||
s,@LIBRUBY_SO@,$$(RUBY_SO_NAME).dll,;t t
|
||||
@ -342,6 +355,17 @@ s,@DLDLIBS@,$(DLDLIBS),;t t
|
||||
s,@ENABLE_SHARED@,yes,;t t
|
||||
s,@OUTFLAG@,-Fe,;t t
|
||||
s,@CPPOUTFILE@,-P,;t t
|
||||
s,@LIBPATHFLAG@, -libpath:%s,;t t
|
||||
s,@LIBARG@,%s.lib,;t t
|
||||
s,@LINK_SO@,$$(LDSHARED) -Fe$$(@) $$(OBJS) $$(LIBS) $$(LOCAL_LIBS) $$(DLDFLAGS),;t t
|
||||
s,@COMPILE_C@,$$(CC) $$(CFLAGS) $$(CPPFLAGS) -c -Tc$$(<:\=/),;t t
|
||||
s,@COMPILE_CXX@,$$(CXX) $$(CXXFLAGS) $$(CPPFLAGS) -c -Tp$$(<:\=/),;t t
|
||||
s,@COMPILE_RULES@,{$$(srcdir)}.%s{}.%s: .%s.%s:,;t t
|
||||
s,@TRY_LINK@,$$(CC) -Feconftest $$(INCFLAGS) -I$$(hdrdir) $$(CPPFLAGS) $$(CFLAGS) $$(src) $$(LOCAL_LIBS) $$(LIBS) $$(LDFLAGS) $$(XLDFLAGS),;t t
|
||||
s,@COMMON_LIBS@,m,;t t
|
||||
s,@COMMON_MACROS@,WIN32_LEAN_AND_MEAN;t t
|
||||
s,@COMMON_HEADERS@,winsock2.h windows.h,;t t
|
||||
s,@EXPORT_PREFIX@, ,;t t
|
||||
s,@arch@,$(ARCH)-$(OS),;t t
|
||||
s,@sitearch@,$(ARCH)-$(RT),;t t
|
||||
s,@sitedir@,$${prefix}/lib/ruby/site_ruby,;t t
|
||||
@ -349,36 +373,40 @@ s,@configure_args@,--with-make-prog=nmake --enable-shared $(configure_args),;t t
|
||||
s,@configure_input@,$$configure_input,;t t
|
||||
s,@srcdir@,$(srcdir),;t t
|
||||
s,@top_srcdir@,$(srcdir),;t t
|
||||
<<
|
||||
<<KEEP
|
||||
|
||||
miniruby$(EXEEXT): $(OBJS) $(MAINOBJ) dmyext.obj
|
||||
@echo $(EXTOBJS)
|
||||
@echo $(LIBS)
|
||||
$(PURIFY) $(CC) $(LDFLAGS) $(MAINOBJ) dmyext.obj $(OBJS) $(LIBS) -Fe$@
|
||||
@echo. $(LIBS)
|
||||
$(PURIFY) $(CC) $(MAINOBJ) dmyext.obj $(OBJS) $(LIBS) -Fe$@ $(LDFLAGS)
|
||||
|
||||
$(PROGRAM): $(MAINOBJ) $(LIBRUBY_SO) $*.res
|
||||
$(PURIFY) $(CC) $(LDFLAGS) $(XLDFLAGS) $(MAINOBJ) $*.res \
|
||||
-Fe$@ $(LIBRUBYARG) -link -stack:$(STACK) -incremental:no
|
||||
$(PURIFY) $(CC) $(MAINOBJ) $*.res \
|
||||
-Fe$@ $(LIBRUBYARG) $(LDFLAGS) $(XLDFLAGS)
|
||||
|
||||
$(WPROGRAM): $(MAINOBJ) $(WINMAINOBJ) $(LIBRUBY_SO) $*.res
|
||||
$(PURIFY) $(CC) $(LDFLAGS) $(MAINOBJ) $(WINMAINOBJ) $*.res \
|
||||
-Fe$@ $(LIBRUBYARG) -link -stack:$(STACK) -subsystem:Windows -incremental:no
|
||||
$(PURIFY) $(CC) $(MAINOBJ) $(WINMAINOBJ) $*.res \
|
||||
-Fe$@ $(LIBRUBYARG) $(LDFLAGS) $(XLDFLAGS) -subsystem:Windows
|
||||
|
||||
$(LIBRUBY_A): $(OBJS) dmyext.obj
|
||||
$(AR) -out:$@ -machine:$(MACHINE) $(OBJS) dmyext.obj
|
||||
$(AR) $(ARFLAGS)$@ $(OBJS) dmyext.obj
|
||||
|
||||
$(LIBRUBY): $(RUBYDEF)
|
||||
$(AR) -out:$@ -def:$(RUBYDEF) -machine:$(MACHINE)
|
||||
$(AR) $(ARFLAGS)$@ -def:$(RUBYDEF)
|
||||
|
||||
$(LIBRUBY_SO): $(LIBRUBY_A) $(EXTOBJS) $(RUBYDEF) $*.res
|
||||
$(CC) $(LDFLAGS) $(MAINOBJ) $(EXTOBJS) $(LIBRUBY_A) $*.res $(LIBS) \
|
||||
-Fe$@ -link -dll -def:$(RUBYDEF)
|
||||
@echo. $(EXTOBJS)
|
||||
$(LIBRUBY_LDSHARED) $(MAINOBJ) $(EXTOBJS) $(LIBRUBY_A) $*.res $(LIBS) \
|
||||
-Fe$@ $(LDFLAGS) $(LIBRUBY_DLDFLAGS)
|
||||
|
||||
$(RUBYDEF): $(LIBRUBY_A) miniruby$(EXEEXT)
|
||||
.\miniruby$(EXEEXT) $(srcdir)/win32/mkexports.rb -output=$@ $(LIBRUBY_A)
|
||||
$(MINIRUBY) $(srcdir)/win32/mkexports.rb -output=$@ $(LIBRUBY_A)
|
||||
|
||||
{$(srcdir)/win32}.def.lib:
|
||||
$(AR) $(ARFLAGS)$@ -def:$<
|
||||
|
||||
install: rbconfig.rb
|
||||
.\miniruby.exe $(srcdir)/instruby.rb $(DESTDIR)
|
||||
$(MINIRUBY) $(srcdir)/instruby.rb $(DESTDIR)
|
||||
$(MINIRUBY) $(srcdir)/ext/extmk.rb $(MAKE) -$(MFLAGS)$(MAKEFLAGS) DESTDIR=$(DESTDIR) install
|
||||
|
||||
clean: clean-ext clean-local
|
||||
|
||||
@ -393,7 +421,7 @@ clean-local:
|
||||
@if exist *.res del *.res
|
||||
|
||||
clean-ext:
|
||||
@-.\miniruby$(EXEEXT) $(srcdir)/ext/extmk.rb clean
|
||||
@-$(MINIRUBY) $(srcdir)/ext/extmk.rb $(MAKE) -$(MFLAGS)$(MAKEFLAGS) clean
|
||||
|
||||
distclean: distclean-ext distclean-local
|
||||
|
||||
@ -427,35 +455,35 @@ distclean-local: clean-local
|
||||
@if exist miniruby$(EXEEXT) del miniruby$(EXEEXT)
|
||||
|
||||
distclean-ext:
|
||||
@-.\miniruby$(EXEEXT) $(srcdir)/ext/extmk.rb distclean
|
||||
@-$(MINIRUBY) $(srcdir)/ext/extmk.rb $(MAKE) -$(MFLAGS)$(MAKEFLAGS) distclean
|
||||
|
||||
realclean: distclean
|
||||
@if exist parse.c del parse.c
|
||||
@if exist lex.c del lex.c
|
||||
|
||||
test: miniruby$(EXEEXT)
|
||||
@.\miniruby$(EXEEXT) $(srcdir)/rubytest.rb
|
||||
@miniruby$(EXEEXT) $(srcdir)/rubytest.rb
|
||||
|
||||
rbconfig.rb: miniruby$(EXEEXT) config.status
|
||||
@.\miniruby$(EXEEXT) $(srcdir)/mkconfig.rb -srcdir=$(srcdir) \
|
||||
@$(MINIRUBY) $(srcdir)/mkconfig.rb -srcdir=$(srcdir) \
|
||||
-install_name=$(RUBY_INSTALL_NAME) \
|
||||
-so_name=$(RUBY_SO_NAME) rbconfig.rb
|
||||
|
||||
$(RUBY_INSTALL_NAME).rc $(RUBYW_INSTALL_NAME).rc $(RUBY_SO_NAME).rc: rbconfig.rb
|
||||
@.\miniruby$(EXEEXT) $(srcdir)/win32/resource.rb \
|
||||
@$(MINIRUBY) $(srcdir)/win32/resource.rb \
|
||||
-ruby_name=$(RUBY_INSTALL_NAME) \
|
||||
-rubyw_name=$(RUBYW_INSTALL_NAME) \
|
||||
-so_name=$(RUBY_SO_NAME) \
|
||||
. $(icondirs) $(srcdir)/win32
|
||||
|
||||
{$(srcdir)/missing}.c.obj:
|
||||
$(CC) $(CFLAGS) -I. -I$(<D) $(CPPFLAGS) -c -Tc$(<:\=/)
|
||||
$(CC) $(CFLAGS) $(XCFLAGS) -I. -I$(<D) $(CPPFLAGS) -c -Tc$(<:\=/)
|
||||
{$(srcdir)/win32}.c.obj:
|
||||
$(CC) $(CFLAGS) -I. -I$(<D) $(CPPFLAGS) -c -Tc$(<:\=/)
|
||||
$(CC) $(CFLAGS) $(XCFLAGS) -I. -I$(<D) $(CPPFLAGS) -c -Tc$(<:\=/)
|
||||
{$(srcdir)}.c.obj:
|
||||
$(CC) $(CFLAGS) -I. -I$(<D) $(CPPFLAGS) -c -Tc$(<:\=/)
|
||||
$(CC) $(CFLAGS) $(XCFLAGS) -I. -I$(<D) $(CPPFLAGS) -c -Tc$(<:\=/)
|
||||
.c.obj:
|
||||
$(CC) $(CFLAGS) -I. $(CPPFLAGS) -c -Tc$(<:\=/)
|
||||
$(CC) $(CFLAGS) $(XCFLAGS) -I. $(CPPFLAGS) -c -Tc$(<:\=/)
|
||||
|
||||
.rc.res:
|
||||
$(RC) -I. -I$(<D) $(iconinc) -I$(srcdir)/win32 $(RFLAGS) -fo$@ $(<:\=/)
|
||||
@ -467,6 +495,9 @@ $(RUBY_INSTALL_NAME).rc $(RUBYW_INSTALL_NAME).rc $(RUBY_SO_NAME).rc: rbconfig.rb
|
||||
|
||||
{$(srcdir)}parse.c: parse.y
|
||||
|
||||
ext/extinit.obj: ext/extinit.c $(SETUP)
|
||||
$(CC) $(CFLAGS) $(XCFLAGS) $(CPPFLAGS) -Fo$@ -c ext/extinit.c
|
||||
|
||||
acosh.obj: {$(srcdir)}missing/acosh.c
|
||||
alloca.obj: {$(srcdir)}missing/alloca.c
|
||||
crypt.obj: {$(srcdir)}missing/crypt.c
|
||||
|
110
win32/setup.mak
110
win32/setup.mak
@ -1,58 +1,82 @@
|
||||
# -*- makefile -*-
|
||||
|
||||
!IF "$(WIN32DIR)" == "win32"
|
||||
!if "$(srcdir)" != ""
|
||||
WIN32DIR = $(srcdir)/win32
|
||||
!elseif "$(WIN32DIR)" == "win32"
|
||||
srcdir = .
|
||||
!ELSEIF "$(WIN32DIR)" == "$(WIN32DIR:/win32=)/win32"
|
||||
!elseif "$(WIN32DIR)" == "$(WIN32DIR:/win32=)/win32"
|
||||
srcdir = $(WIN32DIR:/win32=)
|
||||
!ELSE
|
||||
!else
|
||||
srcdir = $(WIN32DIR)/..
|
||||
!ENDIF
|
||||
!endif
|
||||
OS = mswin32
|
||||
RT = msvcrt
|
||||
INCLUDE = !include
|
||||
MAKEFILE = $(WIN32DIR)/setup.mak
|
||||
|
||||
!if "$(target)" == ""
|
||||
all: Makefile
|
||||
@echo type `$(MAKE)' to make ruby for $(OS).
|
||||
APPEND = echo>>$(MAKEFILE)
|
||||
!ifdef MAKEFILE
|
||||
MAKE = $(MAKE) -f $(MAKEFILE)
|
||||
!else
|
||||
all: $(target)
|
||||
MAKEFILE = Makefile
|
||||
!endif
|
||||
ARCH = PROCESSOR_ARCHITECTURE
|
||||
CPU = PROCESSOR_LEVEL
|
||||
|
||||
i386-$(OS):
|
||||
@$(MAKE) -$(MAKEFLAGS) -f $(MAKEFILE) target= \
|
||||
PROCESSOR_ARCHITECTURE=x86 PROCESSOR_LEVEL=3
|
||||
i486-$(OS):
|
||||
@$(MAKE) -$(MAKEFLAGS) -f $(MAKEFILE) target= \
|
||||
PROCESSOR_ARCHITECTURE=x86 PROCESSOR_LEVEL=4
|
||||
i586-$(OS):
|
||||
@$(MAKE) -$(MAKEFLAGS) -f $(MAKEFILE) target= \
|
||||
PROCESSOR_ARCHITECTURE=x86 PROCESSOR_LEVEL=5
|
||||
i686-$(OS):
|
||||
@$(MAKE) -$(MAKEFLAGS) -f $(MAKEFILE) target= \
|
||||
PROCESSOR_ARCHITECTURE=x86 PROCESSOR_LEVEL=6
|
||||
alpha-$(OS):
|
||||
@$(MAKE) -$(MAKEFLAGS) -f $(MAKEFILE) target= \
|
||||
PROCESSOR_ARCHITECTURE=alpha PROCESSOR_LEVEL=
|
||||
all: -prologue- -generic- -epilogue-
|
||||
i386-$(OS): -prologue- -i386- -epilogue-
|
||||
i486-$(OS): -prologue- -i486- -epilogue-
|
||||
i586-$(OS): -prologue- -i586- -epilogue-
|
||||
i686-$(OS): -prologue- -i686- -epilogue-
|
||||
alpha-$(OS): -prologue- -alpha- -epilogue-
|
||||
|
||||
Makefile:
|
||||
@echo Creating <<$@
|
||||
-prologue-: nul
|
||||
@echo Creating <<$(MAKEFILE)
|
||||
### Makefile for ruby $(OS) ###
|
||||
srcdir = $(srcdir:\=/)
|
||||
!if defined(PROCESSOR_ARCHITECTURE)
|
||||
PROCESSOR_ARCHITECTURE = $(PROCESSOR_ARCHITECTURE)
|
||||
!endif
|
||||
!if defined(PROCESSOR_LEVEL)
|
||||
PROCESSOR_LEVEL = $(PROCESSOR_LEVEL)
|
||||
!endif
|
||||
RUBY_INSTALL_NAME = ruby
|
||||
RUBY_SO_NAME = $(RT)-$$(RUBY_INSTALL_NAME)17
|
||||
prefix = /usr
|
||||
CFLAGS = -nologo -MD -DNT=1 $$(DEBUGFLAGS) $$(OPTFLAGS) $$(PROCESSOR_FLAG)
|
||||
CPPFLAGS = -I. -I$$(srcdir) -I$$(srcdir)/missing -DLIBRUBY_SO=\"$$(LIBRUBY_SO)\"
|
||||
LDFLAGS = $$(CFLAGS) -Fm
|
||||
XLDFLAGS =
|
||||
RFLAGS = -r
|
||||
EXTLIBS =
|
||||
$(INCLUDE) $$(srcdir)/win32/Makefile.sub
|
||||
|
||||
<<KEEP
|
||||
|
||||
-generic-: nul
|
||||
!if defined($(ARCH)) || defined($(CPU))
|
||||
@type << >>$(MAKEFILE)
|
||||
!if defined($(ARCH))
|
||||
$(ARCH) = $(PROCESSOR_ARCHITECTURE)
|
||||
!endif
|
||||
!if defined($(CPU))
|
||||
$(CPU) = $(PROCESSOR_LEVEL)
|
||||
!endif
|
||||
|
||||
<<
|
||||
!endif
|
||||
|
||||
-alpha-: nul
|
||||
@$(APPEND) $(ARCH) = alpha
|
||||
-ix86-: nul
|
||||
@$(APPEND) $(ARCH) = x86
|
||||
|
||||
-i386-: -ix86-
|
||||
@$(APPEND) $(CPU) = 3
|
||||
-i486-: -ix86-
|
||||
@$(APPEND) $(CPU) = 4
|
||||
-i586-: -ix86-
|
||||
@$(APPEND) $(CPU) = 5
|
||||
-i686-: -ix86-
|
||||
@$(APPEND) $(CPU) = 6
|
||||
|
||||
-epilogue-: nul
|
||||
@type << >>$(MAKEFILE)
|
||||
# OS = $(OS)
|
||||
# RT = $(RT)
|
||||
# RUBY_INSTALL_NAME = ruby
|
||||
# RUBY_SO_NAME = $$(RT)-$$(RUBY_INSTALL_NAME)17
|
||||
# prefix = /usr
|
||||
# CFLAGS = -nologo -MD $$(DEBUGFLAGS) $$(OPTFLAGS) $$(PROCESSOR_FLAG)
|
||||
# CPPFLAGS = -I. -I$$(srcdir) -I$$(srcdir)/missing -DLIBRUBY_SO=\"$$(LIBRUBY_SO)\"
|
||||
# STACK = 0x2000000
|
||||
# LDFLAGS = $$(CFLAGS) -Fm
|
||||
# XLDFLAGS =
|
||||
# RFLAGS = -r
|
||||
# EXTLIBS =
|
||||
|
||||
$(INCLUDE) $$(srcdir)/win32/Makefile.sub
|
||||
<<
|
||||
@echo type `$(MAKE)' to make ruby for $(OS).
|
||||
|
Loading…
x
Reference in New Issue
Block a user