From f76f6155e11f1d9bae9a9a1f61bb8a5646b6ec2e Mon Sep 17 00:00:00 2001 From: nobu Date: Fri, 14 Oct 2005 14:10:08 +0000 Subject: [PATCH] * win32/Makefile.sub (MKFILES): update MKFILES if configure files get changed. * win32/configure.bat, win32/setup.mak (configure_args): store arguments to configure files. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@9391 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- ChangeLog | 8 ++++++++ win32/Makefile.sub | 13 +++++++++++++ win32/configure.bat | 41 +++++++++++++++++++++++++++++++++++++++-- win32/setup.mak | 6 +++++- 4 files changed, 65 insertions(+), 3 deletions(-) diff --git a/ChangeLog b/ChangeLog index 94bdaa0605..e5a36bdf7d 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,11 @@ +Fri Oct 14 23:09:31 2005 Nobuyoshi Nakada + + * win32/Makefile.sub (MKFILES): update MKFILES if configure files get + changed. + + * win32/configure.bat, win32/setup.mak (configure_args): store + arguments to configure files. + Fri Oct 14 22:05:45 2005 NAKAMURA Usaku * win32/win32.c (ioctl): should set errno. diff --git a/win32/Makefile.sub b/win32/Makefile.sub index c5c7b49ab5..1b0279ce23 100644 --- a/win32/Makefile.sub +++ b/win32/Makefile.sub @@ -6,6 +6,12 @@ NULL = nul #### Start of system configuration section. #### +!if defined(pathlist) +PATH = $(pathlist:;=/bin;)$(PATH) +INCLUDE = $(pathlist:;=/include;) +LIB = $(pathlist:;=/lib;) +!endif + ## variables may be overridden by $(compile_dir)/Makefile !ifndef srcdir srcdir = .. @@ -179,6 +185,10 @@ rubyw: $(WPROGRAM) !include $(srcdir)/common.mk +$(MKFILES): $(srcdir)/win32/Makefile.sub $(srcdir)/win32/configure.bat $(srcdir)/win32/setup.mak + $(srcdir:/=\)\win32\configure.bat $(configure_args) + @echo $(MKFILES) should be updated, re-run $(MAKE). + CONFIG_H = ./.config.h.time config: config.status @@ -187,6 +197,9 @@ config.status: $(CONFIG_H) $(CONFIG_H): $(MKFILES) $(srcdir)/win32/Makefile.sub @echo Creating config.h +!if exist(config.h) + @copy config.h config.h.old > nul +!endif @$(srcdir:/=\)\win32\ifchange.bat config.h << #define STDC_HEADERS 1 #define HAVE_SYS_TYPES_H 1 diff --git a/win32/configure.bat b/win32/configure.bat index 00c9347214..b6d5aed93b 100755 --- a/win32/configure.bat +++ b/win32/configure.bat @@ -6,8 +6,10 @@ echo> ~tmp~.mak #### echo>> ~tmp~.mak conf = %0 echo>> ~tmp~.mak $(conf:\=/): nul -echo>> ~tmp~.mak @del ~tmp~.mak +echo>> ~tmp~.mak @del ~setup~.mak echo>> ~tmp~.mak @-$(MAKE) -l$(MAKEFLAGS) -f $(@D)/setup.mak \ +if exist pathlist.tmp del pathlist.tmp +echo>confargs.tmp #define CONFIGURE_ARGS \ :loop if "%1" == "" goto :end if "%1" == "--prefix" goto :prefix @@ -21,55 +23,73 @@ if "%1" == "--program-name" goto :progname if "%1" == "--enable-install-doc" goto :enable-rdoc if "%1" == "--disable-install-doc" goto :disable-rdoc if "%1" == "--extout" goto :extout +if "%1" == "--path" goto :path if "%1" == "-h" goto :help if "%1" == "--help" goto :help echo>> ~tmp~.mak "%1" \ + echo>>confargs.tmp %1 \ shift goto :loop :srcdir echo>> ~tmp~.mak "srcdir=%2" \ + echo>>confargs.tmp %1=%2 \ shift shift goto :loop :prefix echo>> ~tmp~.mak "prefix=%2" \ + echo>>confargs.tmp %1=%2 \ shift shift goto :loop :suffix echo>> ~tmp~.mak "RUBY_SUFFIX=%2" \ + echo>>confargs.tmp %1=%2 \ shift shift goto :loop :installname echo>> ~tmp~.mak "RUBY_INSTALL_NAME=%2" \ + echo>>confargs.tmp %1=%2 \ shift shift goto :loop :soname echo>> ~tmp~.mak "RUBY_SO_NAME=%2" \ + echo>>confargs.tmp %1=%2 \ shift shift goto :loop :target echo>> ~tmp~.mak "%2" \ + echo>>confargs.tmp %1=%2 \ shift shift goto :loop :extstatic echo>> ~tmp~.mak "EXTSTATIC=static" \ + echo>>confargs.tmp %1 \ shift goto :loop :enable-rdoc echo>> ~tmp~.mak "RDOCTARGET=install-doc" \ + echo>>confargs.tmp %1 \ shift goto :loop :disable-rdoc echo>> ~tmp~.mak "RDOCTARGET=install-nodoc" \ + echo>>confargs.tmp %1 \ shift goto :loop :extout echo>> ~tmp~.mak "EXTOUT=%2" \ + echo>>confargs.tmp %1=%2 \ + shift + shift +goto :loop +:path + echo>>pathlist.tmp %2;\ + echo>>confargs.tmp %1=%2 \ shift shift goto :loop @@ -84,9 +104,26 @@ goto :loop echo Optional Package: echo --with-static-linked-ext link external modules statically echo --disable-install-doc do not install rdoc indexes during install + del *.tmp del ~tmp~.mak goto :exit :end echo>> ~tmp~.mak WIN32DIR=$(@D) -nmake -alf ~tmp~.mak +echo.>>confargs.tmp +echo>confargs.c #define $ $$ +type>>confargs.c confargs.tmp +echo>>confargs.c configure_args = CONFIGURE_ARGS +echo>>confargs.c #undef $ +if exist pathlist.tmp echo>>confargs.c #define PATH_LIST \ +if exist pathlist.tmp type>>confargs.c pathlist.tmp +if exist pathlist.tmp echo.>>confargs.c +if exist pathlist.tmp echo>>confargs.c pathlist = PATH_LIST +cl -EP confargs.c > ~setup~.mak 2>nul +if exist pathlist.tmp echo>>~setup~.mak PATH = $(pathlist:;=/bin;)$(PATH) +if exist pathlist.tmp echo>>~setup~.mak INCLUDE = $(pathlist:;=/include;) +if exist pathlist.tmp echo>>~setup~.mak LIB = $(pathlist:;=/lib;) +type>>~setup~.mak ~tmp~.mak +del *.tmp > nul +del ~tmp~.mak > nul +nmake -alf ~setup~.mak :exit diff --git a/win32/setup.mak b/win32/setup.mak index 3919bfafd6..358ba61dd1 100644 --- a/win32/setup.mak +++ b/win32/setup.mak @@ -139,7 +139,12 @@ $(CPU) = $(PROCESSOR_LEVEL) @$(APPEND) $(CPU) = 6 -epilogue-: nul +!if exist(confargs.c) + @$(CPP) confargs.c | findstr /v /r ^^$$ >> $(MAKEFILE) + @del confargs.c +!endif @type << >>$(MAKEFILE) + # OS = $(OS) # RUBY_INSTALL_NAME = ruby # RUBY_SO_NAME = $$(RT)-$$(RUBY_INSTALL_NAME)$$(MAJOR)$$(MINOR) @@ -153,5 +158,4 @@ $(CPU) = $(PROCESSOR_LEVEL) $(BANG)include $$(srcdir)/win32/Makefile.sub << - @$(srcdir:/=\)\win32\rm.bat config.h config.status @echo type `$(MAKE)' to make ruby for $(OS).