From 21410f4dfeee36f9dbadc611492516ebf2a427fa Mon Sep 17 00:00:00 2001 From: nobu Date: Fri, 12 Mar 2004 11:19:22 +0000 Subject: * configure.in (rb_cv_noreturn): default for platforms not support prototypes. * ruby.c (ruby_init_loadpath): buffer for path name should have MAXPATHLEN. * lib/mkmf.rb (configuration): include topdir and hdrdir in VPATH. * lib/mkmf.rb (create_makefile): default dependency rule. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@5942 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- ChangeLog | 16 ++++++++++++++-- configure.in | 2 +- lib/mkmf.rb | 9 ++++++++- ruby.c | 18 ++++++++++++------ 4 files changed, 35 insertions(+), 10 deletions(-) diff --git a/ChangeLog b/ChangeLog index 54ffea8ea2..04b36b162c 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,9 +1,21 @@ +Fri Mar 12 20:19:16 2004 Nobuyoshi Nakada + + * configure.in (rb_cv_noreturn): default for platforms not support + prototypes. + + * ruby.c (ruby_init_loadpath): buffer for path name should have + MAXPATHLEN. + + * lib/mkmf.rb (configuration): include topdir and hdrdir in VPATH. + + * lib/mkmf.rb (create_makefile): default dependency rule. + Fri Mar 12 07:35:36 2004 GOTOU Yuuzou * lib/webrick/config.rb (WEBrick::Config::General): add :DoNotReverseLookup. - * lib/webrick/server.rb (WEBrick::GenericServer#accept): call + * lib/webrick/server.rb (WEBrick::GenericServer#accept): call do_not_reverse_lookup for each socket if :DoNotReverseLookup is set. [ruby-code:02357] @@ -95,7 +107,7 @@ Mon Mar 8 01:05:55 2004 GOTOU Yuuzou * lib/webrick/httpserver.rb (WEBrick::HTTPServer#run): should print error message for WEBrick::HTTPSataus::Error. - * lib/webrick/httpserver.rb (WEBrick::HTTPServer#lookup_server): + * lib/webrick/httpserver.rb (WEBrick::HTTPServer#lookup_server): lookup for hostname from :ServerAlias if the req.host is not match to :ServerName. diff --git a/configure.in b/configure.in index 90ce4dc57c..16d6eaaad9 100644 --- a/configure.in +++ b/configure.in @@ -246,7 +246,7 @@ if test "$rb_cv_stdarg" = yes; then fi AC_CACHE_CHECK([for noreturn], rb_cv_noreturn, -[rb_cv_noreturn=no +[rb_cv_noreturn=x for mac in "x __attribute__ ((noreturn))" "__declspec(noreturn) x" x; do AC_TRY_COMPILE( [#define NORETURN(x) $mac diff --git a/lib/mkmf.rb b/lib/mkmf.rb index c6180282ec..39da5dfeb4 100644 --- a/lib/mkmf.rb +++ b/lib/mkmf.rb @@ -727,6 +727,10 @@ end def configuration(srcdir) mk = [] + vpath = %w[$(srcdir) $(topdir) $(hdrdir)] + if $mingw && CONFIG['build_os'] == 'cygwin' + vpath.each {|p| p.sub!(/.*/, '$(shell cygpath -u \&)')} + end mk << %{ SHELL = /bin/sh @@ -735,7 +739,7 @@ SHELL = /bin/sh srcdir = #{srcdir} topdir = #{$topdir} hdrdir = #{$hdrdir} -VPATH = #{$mingw && CONFIG['build_os'] == 'cygwin' ? '$(shell cygpath -u $(srcdir))' : '$(srcdir)'} +VPATH = #{vpath.join(File::PATH_SEPARATOR)} } drive = File::PATH_SEPARATOR == ';' ? /\A\w:/ : /\A/ if destdir = CONFIG["prefix"].scan(drive)[0] and !destdir.empty? @@ -982,6 +986,9 @@ site-install-rb: install-rb mfile.print line end end + else + vpath = ($nmake ? "{$(hdrdir)}" : "") + mfile.print "$(OBJS): #{vpath}ruby.h #{vpath}defines.h #{$config_h}\n" end ensure mfile.close if mfile diff --git a/ruby.c b/ruby.c index b9c29fe821..fc727d188e 100644 --- a/ruby.c +++ b/ruby.c @@ -33,6 +33,12 @@ #ifdef HAVE_UNISTD_H #include #endif +#ifdef HAVE_SYS_PARAM_H +# include +#endif +#ifndef MAXPATHLEN +# define MAXPATHLEN 1024 +#endif #ifndef HAVE_STRING_H char *strchr _((const char*,const char)); @@ -236,7 +242,7 @@ void ruby_init_loadpath() { #if defined LOAD_RELATIVE - char libpath[FILENAME_MAX+1]; + char libpath[MAXPATHLEN+1]; char *p; int rest; #if defined _WIN32 || defined __CYGWIN__ @@ -251,15 +257,15 @@ ruby_init_loadpath() GetModuleFileName(libruby, libpath, sizeof libpath); #elif defined(DJGPP) extern char *__dos_argv0; - strncpy(libpath, __dos_argv0, FILENAME_MAX); + strncpy(libpath, __dos_argv0, sizeof(libpath) - 1); #elif defined(__human68k__) extern char **_argv; - strncpy(libpath, _argv[0], FILENAME_MAX); + strncpy(libpath, _argv[0], sizeof(libpath) - 1); #elif defined(__EMX__) - _execname(libpath, FILENAME_MAX); + _execname(libpath, sizeof(libpath) - 1); #endif - libpath[FILENAME_MAX] = '\0'; + libpath[sizeof(libpath) - 1] = '\0'; #if defined DOSISH || defined __CYGWIN__ translate_char(libpath, '\\', '/'); #endif @@ -276,7 +282,7 @@ ruby_init_loadpath() p = libpath + 1; } - rest = FILENAME_MAX - (p - libpath); + rest = sizeof(libpath) - 1 - (p - libpath); #define RUBY_RELATIVE(path) (strncpy(p, (path), rest), libpath) #else -- cgit v1.2.3