From 032825472be96143de44bc0ee9795735d03dfbf4 Mon Sep 17 00:00:00 2001 From: eban Date: Mon, 28 May 2001 16:07:34 +0000 Subject: * configure.in: remove unnecessary AC_CANONICAL_BUILD * defins.h: #define HAVE_SETITIMER on Cygwin(bug fixed). * ruby.c: use relative path from LIBRUBY_SO. * ruby.c: don't use -mwin32 option on Cygwin. * cygwin/GNUmakefile.in: ditto. * ext/sdbm/_sdbm: ditto. * ext/tcltklib/extconf.rb: ditto. * ext/tcltklib/stubs.c: ditto. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@1472 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- ChangeLog | 24 +++++++++++++++++++++--- configure.in | 7 ------- cygwin/GNUmakefile.in | 4 +++- defines.h | 2 +- ext/sdbm/_sdbm.c | 2 +- ext/tcltklib/extconf.rb | 1 + ext/tcltklib/stubs.c | 2 +- ruby.c | 21 +++++++++++++++------ 8 files changed, 43 insertions(+), 20 deletions(-) diff --git a/ChangeLog b/ChangeLog index 93709294c9..7113ccbda4 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,21 @@ +Mon May 28 23:20:43 2001 WATANABE Hirofumi + + * configure.in: remove unnecessary AC_CANONICAL_BUILD + + * defins.h: #define HAVE_SETITIMER on Cygwin(bug fixed). + + * ruby.c: use relative path from LIBRUBY_SO. + + * ruby.c: don't use -mwin32 option on Cygwin. + + * cygwin/GNUmakefile.in: ditto. + + * ext/sdbm/_sdbm: ditto. + + * ext/tcltklib/extconf.rb: ditto. + + * ext/tcltklib/stubs.c: ditto. + Mon May 28 22:12:01 2001 Nobuyoshi Nakada * ext/extconf.rb.in: make the priority of the make rule of .c @@ -366,7 +384,7 @@ Fri Apr 27 09:27:10 2001 Yukihiro Matsumoto Thu Apr 26 22:36:11 2001 WATANABE Hirofumi - * configure.in: don't use tzname on cygwin 1.3.1+. + * configure.in: don't use tzname on Cygwin 1.3.1+. * configure.in: add -mieee/-ieee to CFLAGS on OSF1/Alpha to disable "DIVISION BY ZERO" exception. @@ -1433,7 +1451,7 @@ Fri Feb 2 16:14:51 2001 Yukihiro Matsumoto Wed Jan 31 22:27:29 2001 WATANABE Hirofumi - * configure.in: gcc-2.95.2-7(cygwin) support. + * configure.in: gcc-2.95.2-7(Cygwin) support. add -mwin32 if available. * cygwin/GNUmakefile: ditto. @@ -2453,7 +2471,7 @@ Wed Oct 11 11:13:03 2000 Yukihiro Matsumoto Tue Oct 10 16:11:54 2000 WATANABE Hirofumi - * dln.c (dln_load): remove unused code for cygwin. + * dln.c (dln_load): remove unused code for Cygwin. Tue Oct 10 09:49:23 2000 Yukihiro Matsumoto diff --git a/configure.in b/configure.in index c758a8d0dc..620e28bd62 100644 --- a/configure.in +++ b/configure.in @@ -27,7 +27,6 @@ fi AC_CANONICAL_HOST AC_CANONICAL_TARGET -AC_CANONICAL_BUILD dnl checks for fat-binary fat_binary=no @@ -107,14 +106,8 @@ cygwin*|mingw*) AC_CHECK_TOOL(AS, as) AC_CHECK_TOOL(DLLTOOL, dlltool) AC_CHECK_TOOL(WINDRES, windres) - echo 'main(){}' > conftest.c - if $CC -mwin32 -c conftest.c 2> /dev/null; then - MWIN32=-mwin32 - CFLAGS="$CFLAGS $MWIN32" - fi ;; esac -AC_SUBST(MWIN32) AC_PROG_LN_S AC_PROG_MAKE_SET diff --git a/cygwin/GNUmakefile.in b/cygwin/GNUmakefile.in index 0e89d15dec..4fc628f4da 100644 --- a/cygwin/GNUmakefile.in +++ b/cygwin/GNUmakefile.in @@ -5,6 +5,8 @@ ENABLE_SHARED=@ENABLE_SHARED@ ifneq (,$(findstring no, $(ENABLE_SHARED))) EXTOBJS = $(RUBY_INSTALL_NAME).exp LIBRUBYARG = $(LIBRUBY_A) +else + CPPFLAGS += -DLIBRUBY_SO=\"$(LIBRUBY_SO)\" endif ifneq (,$(findstring ruby, $(RUBY_INSTALL_NAME))) @@ -21,7 +23,7 @@ $(LIBRUBY_SO): $(RUBYDEF) $(LIBRUBY_SO).res.@OBJEXT@ $(LIBRUBY): $(LIBRUBY_SO) %.res.@OBJEXT@: %.rc - @WINDRES@ --preprocessor '$(CC) -E -xc-header -DRC_INVOKE @MWIN32@' --include-dir . --include-dir $( #include "ruby.h" -#if defined _WIN32 +#if defined _WIN32 || defined __CYGWIN__ # include typedef HINSTANCE DL_HANDLE; # define DL_OPEN LoadLibrary diff --git a/ruby.c b/ruby.c index 5fa1954cad..2c3102ed59 100644 --- a/ruby.c +++ b/ruby.c @@ -12,7 +12,7 @@ **********************************************************************/ -#ifdef _WIN32 +#if defined _WIN32 || defined __CYGWIN__ #include #endif #include "ruby.h" @@ -106,7 +106,7 @@ extern VALUE rb_load_path; #define STATIC_FILE_LENGTH 255 -#if defined(_WIN32) || defined(DJGPP) +#if defined _WIN32 || defined __CYGWIN__ || defined __DJGPP__ static char * rubylib_mangle(s, l) char *s; @@ -173,7 +173,7 @@ ruby_incpush(path) const char sep = PATH_SEP_CHAR; if (path == 0) return; -#if defined(__CYGWIN32__) +#if defined(__CYGWIN__) { char rubylib[FILENAME_MAX]; conv_to_posix_path(path, rubylib, FILENAME_MAX); @@ -203,15 +203,24 @@ ruby_incpush(path) } } +#if defined _WIN32 || defined __CYGWIN__ || defined __DJGPP__ || defined __EMX__ +#define LOAD_RELATIVE 1 +#endif + void ruby_init_loadpath() { -#if defined(_WIN32) || defined(DJGPP) || defined(__EMX__) +#if defined LOAD_RELATIVE char libpath[FILENAME_MAX+1]; char *p; int rest; -#if defined(_WIN32) - GetModuleFileName(NULL, libpath, sizeof libpath); +#if defined _WIN32 || defined __CYGWIN__ +# if defined LIBRUBY_SO + HMODULE libruby = GetModuleHandle(LIBRUBY_SO); +# else + HMODULE libruby = NULL; +# endif + GetModuleFileName(libruby, libpath, sizeof libpath); #elif defined(DJGPP) extern char *__dos_argv0; strncpy(libpath, __dos_argv0, FILENAME_MAX); -- cgit v1.2.3