From d34f9699fc3adf72e40e4eb3f837eaf8ee60137f Mon Sep 17 00:00:00 2001 From: nobu Date: Wed, 4 Mar 2009 14:29:58 +0000 Subject: * configure.in, win32/configure.bat (--enable-win95): new option to enable/disable win95 support. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@22766 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- ChangeLog | 5 +++++ configure.in | 16 ++++++++++++++-- win32/Makefile.sub | 4 ++-- win32/configure.bat | 15 +++++++++++++++ win32/setup.mak | 6 +++++- 5 files changed, 41 insertions(+), 5 deletions(-) diff --git a/ChangeLog b/ChangeLog index 8a94a92408..5acaf3501a 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +Wed Mar 4 23:29:56 2009 Nobuyoshi Nakada + + * configure.in, win32/configure.bat (--enable-win95): new option + to enable/disable win95 support. + Wed Mar 4 21:21:51 2009 Yusuke Endoh * lib/thread.rb (SizedQueue#push): fix limit condition. diff --git a/configure.in b/configure.in index 1946ffcead..81020f8de7 100644 --- a/configure.in +++ b/configure.in @@ -551,6 +551,12 @@ dnl Check whether we need to define sys_nerr locally AC_CHECK_DECLS([sys_nerr], [], [], [$ac_includes_default #include ]) +AC_ARG_ENABLE(win95, [ --enable-win95 enable Windows 95 series support] + [case "$enableval" in + when(yes|no) enable_win95=$enableval;; + when(*) unset enable_win95;; + esac]) + case "$target_os" in when(freebsd*) AC_CACHE_CHECK([whether pthread should be enabled by default], @@ -709,8 +715,7 @@ when(mingw*) LIBS="-lshell32 -lws2_32 $LIBS" ac_cv_func_fcntl=yes ac_cv_func_flock=yes AC_LIBOBJ([langinfo]) - AC_HAVE_LIBRARY(unicows, [LIBS="-lunicows $LIBS" - AC_DEFINE(WIN95)]) + : ${enable_win95=maybe} ;; when(os2-emx*) LIBS="-lm $LIBS" ac_cv_lib_dir_opendir=no;; @@ -742,6 +747,13 @@ AC_CHECK_LIB(dl, dlopen) # Dynamic linking for SunOS/Solaris and SYSV AC_CHECK_LIB(dld, shl_load) # Dynamic linking for HP-UX AC_CHECK_LIB(socket, socketpair) # SunOS/Solaris AC_CHECK_LIB(rt, clock_gettime) # GNU/Linux +if test "${enable_win95}" = maybe; then + AC_HAVE_LIBRARY(unicows, [enable_win95=yes], [enable_win95=no]) +fi +if test "${enable_win95}" = yes; then + AC_DEFINE(WIN95) + LIBS="-lunicows $LIBS" +fi case "$target_cpu" in when(alpha*) case "$target_os"::"$GCC" in diff --git a/win32/Makefile.sub b/win32/Makefile.sub index 2f264eeb92..4dc1ec6de0 100644 --- a/win32/Makefile.sub +++ b/win32/Makefile.sub @@ -178,7 +178,7 @@ EXTLIBS = !if !defined(LIBS) LIBS = oldnames.lib user32.lib advapi32.lib shell32.lib ws2_32.lib $(EXTLIBS) !endif -!if defined(HAVE_UNICOWS) +!if "$(ENABLE_WIN95)" == "yes" LIBS = unicows.lib $(LIBS) !endif !if !defined(MISSING) @@ -335,7 +335,7 @@ $(CONFIG_H): $(MKFILES) $(srcdir)/win32/Makefile.sub $(win_srcdir)/Makefile.sub #if _MSC_VER != $(MSC_VER) #error MSC version unmatch: _MSC_VER: $(MSC_VER) is expected. #endif -!if defined(HAVE_UNICOWS) && "$(MACHINE)" == "x86" +!if "$(ENABLE_WIN95)" == "yes" && "$(MACHINE)" == "x86" #define WIN95 1 !endif #define STDC_HEADERS 1 diff --git a/win32/configure.bat b/win32/configure.bat index f9d287b21c..8c157927e4 100755 --- a/win32/configure.bat +++ b/win32/configure.bat @@ -25,6 +25,8 @@ if "%1" == "--install-name" goto :installname if "%1" == "--so-name" goto :soname if "%1" == "--enable-install-doc" goto :enable-rdoc if "%1" == "--disable-install-doc" goto :disable-rdoc +if "%1" == "--enable-win95" goto :enable-win95 +if "%1" == "--disable-win95" goto :disable-win95 if "%1" == "--extout" goto :extout if "%1" == "--path" goto :path if "%1" == "--with-baseruby" goto :baseruby @@ -95,6 +97,16 @@ goto :loop echo>>confargs.tmp %1 \ shift goto :loop +:enable-win95 + echo>> ~tmp~.mak "ENABLE_WIN95=yes" \ + echo>>confargs.tmp %1 \ + shift +goto :loop +:disable-win95 + echo>> ~tmp~.mak "ENABLE_WIN95=no" \ + echo>>confargs.tmp %1 \ + shift +goto :loop :extout echo>> ~tmp~.mak "EXTOUT=%2" \ echo>>confargs.tmp %1=%2 \ @@ -125,6 +137,7 @@ goto :loop echo --with-baseruby=RUBY use RUBY as baseruby [ruby] echo --with-static-linked-ext link external modules statically echo --disable-install-doc do not install rdoc indexes during install + echo --enable-win95 enable win95 support del *.tmp del ~tmp~.mak goto :exit @@ -132,8 +145,10 @@ goto :exit echo>> ~tmp~.mak WIN32DIR=$(@D) echo.>>confargs.tmp echo>confargs.c #define $ $$ +echo>>confargs.c !ifndef CONFIGURE_ARGS type>>confargs.c confargs.tmp echo>>confargs.c configure_args = CONFIGURE_ARGS +echo>>confargs.c !endif echo>>confargs.c #undef $ if exist pathlist.tmp echo>>confargs.c #define PATH_LIST \ if exist pathlist.tmp type>>confargs.c pathlist.tmp diff --git a/win32/setup.mak b/win32/setup.mak index 0ddf401bff..1f14a08f1a 100644 --- a/win32/setup.mak +++ b/win32/setup.mak @@ -142,8 +142,9 @@ int main(int argc, char **argv) @del rtname.* -unicows-: nul +!if "$(ENABLE_WIN95)" == "" @echo Checking unicows.lib - @$(CC) -MD < nul && echo>>$(MAKEFILE) HAVE_UNICOWS = 1 || rem + @$(CC) -MD < nul && echo>>$(MAKEFILE) ENABLE_WIN95 = yes || rem #include int main() { @@ -151,6 +152,9 @@ int main() } << @del conftest.* +!else if "$(ENABLE_WIN95)" == "yes" + @echo>>$(MAKEFILE) ENABLE_WIN95 = yes +!endif -version-: nul @$(APPEND) -- cgit v1.2.3