summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authoreban <eban@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2001-05-28 16:07:34 +0000
committereban <eban@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2001-05-28 16:07:34 +0000
commit032825472be96143de44bc0ee9795735d03dfbf4 (patch)
tree8ca6c1e3f6d094a06934c12532267cc0ec66edd8
parente83171c4c4f71093a64abc2c4bb9bdb6a1445e02 (diff)
* 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
-rw-r--r--ChangeLog24
-rw-r--r--configure.in7
-rw-r--r--cygwin/GNUmakefile.in4
-rw-r--r--defines.h2
-rw-r--r--ext/sdbm/_sdbm.c2
-rw-r--r--ext/tcltklib/extconf.rb1
-rw-r--r--ext/tcltklib/stubs.c2
-rw-r--r--ruby.c21
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 <eban@ruby-lang.org>
+
+ * 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 <nobu.nakada@nifty.ne.jp>
* 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 <matz@ruby-lang.org>
Thu Apr 26 22:36:11 2001 WATANABE Hirofumi <eban@ruby-lang.org>
- * 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 <matz@ruby-lang.org>
Wed Jan 31 22:27:29 2001 WATANABE Hirofumi <eban@ruby-lang.org>
- * 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 <matz@ruby-lang.org>
Tue Oct 10 16:11:54 2000 WATANABE Hirofumi <eban@ruby-lang.org>
- * 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 <matz@ruby-lang.org>
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 $(<D) --include-dir $(srcdir)/win32 $< $@
+ @WINDRES@ --include-dir . --include-dir $(<D) --include-dir $(srcdir)/win32 $< $@
$(RUBY_INSTALL_NAME).rc $(RUBYW_INSTALL_NAME).rc $(LIBRUBY_SO).rc: rbconfig.rb
@@MINIRUBY@ $(srcdir)/win32/resource.rb \
diff --git a/defines.h b/defines.h
index 1e3280a305..3ca631ef12 100644
--- a/defines.h
+++ b/defines.h
@@ -83,7 +83,7 @@
#undef HAVE_SETITIMER
#endif
-#if defined(DJGPP) || defined(__BOW__) || defined __CYGWIN__
+#if defined(DJGPP) || defined(__BOW__)
#undef HAVE_SETITIMER
#endif
diff --git a/ext/sdbm/_sdbm.c b/ext/sdbm/_sdbm.c
index 92c96f26d0..d8bfae80b2 100644
--- a/ext/sdbm/_sdbm.c
+++ b/ext/sdbm/_sdbm.c
@@ -103,7 +103,7 @@ static int duppair proto((char *, datum));
/*
* externals
*/
-#if !defined(sun) && !defined(MSDOS) && !defined(_WIN32)
+#if !defined sun && !defined MSDOS && !defined _WIN32 && !defined __CYGWIN__
extern int errno;
#endif
diff --git a/ext/tcltklib/extconf.rb b/ext/tcltklib/extconf.rb
index c9082e0a7f..f732c165dc 100644
--- a/ext/tcltklib/extconf.rb
+++ b/ext/tcltklib/extconf.rb
@@ -67,5 +67,6 @@ if have_header("tcl.h") && have_header("tk.h") &&
find_tcl(tcllib, stubs) &&
find_tk(tklib, stubs)
$CPPFLAGS += ' -DUSE_TCL_STUBS -DUSE_TK_STUBS' if stubs
+ $CPPFLAGS += ' -D_WIN32' if /cygwin/ =~ RUBY_PLATFORM
create_makefile("tcltklib")
end
diff --git a/ext/tcltklib/stubs.c b/ext/tcltklib/stubs.c
index 537ca74d37..faf5b4bb4b 100644
--- a/ext/tcltklib/stubs.c
+++ b/ext/tcltklib/stubs.c
@@ -3,7 +3,7 @@
#include <tk.h>
#include "ruby.h"
-#if defined _WIN32
+#if defined _WIN32 || defined __CYGWIN__
# include <windows.h>
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 <windows.h>
#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);