Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

* marshal.c (w_symbol, w_object): get rid of warnings.

* re.c (rb_memsearch): ditto.

* time.c (time_dump): ditto.

* ext/extmk.rb (extmake): not continue making when extconf.rb
  failed.

* ext/openssl/extconf.rb: check __VA_ARGS__ macro more precisely.

* ext/openssl/ossl.h: remove version.h dependency.

* ext/openssl/ruby_missing.h: ditto.

* lib/mkmf.rb (pkg_config): use --libs output except with
  only-L for other options.  [ruby-list:38099]

* lib/mkmf.rb (create_makefile): separate rule for static
  library from shared object.

* win32/Makefile.sub, bcc32/Makefile.sub, wince/Makefile.sub:
  define exec_prefix and libdir.


git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@4396 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
  • Loading branch information...
commit 0e11cb0e912e845f0143287c1203ae8b09635204 1 parent e988253
@nobu nobu authored
View
26 ChangeLog
@@ -1,3 +1,29 @@
+Sat Aug 16 23:58:18 2003 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * marshal.c (w_symbol, w_object): get rid of warnings.
+
+ * re.c (rb_memsearch): ditto.
+
+ * time.c (time_dump): ditto.
+
+ * ext/extmk.rb (extmake): not continue making when extconf.rb
+ failed.
+
+ * ext/openssl/extconf.rb: check __VA_ARGS__ macro more precisely.
+
+ * ext/openssl/ossl.h: remove version.h dependency.
+
+ * ext/openssl/ruby_missing.h: ditto.
+
+ * lib/mkmf.rb (pkg_config): use --libs output except with
+ only-L for other options. [ruby-list:38099]
+
+ * lib/mkmf.rb (create_makefile): separate rule for static
+ library from shared object.
+
+ * win32/Makefile.sub, bcc32/Makefile.sub, wince/Makefile.sub:
+ define exec_prefix and libdir.
+
Fri Aug 15 23:15:00 2003 Shigeo Kobayashi <shigek@ruby-lang.org>
* ext/bigdecimal/bigdecimal.c .h: Bug in combination of limit & div
View
6 Makefile.in
@@ -196,12 +196,12 @@ Makefile: $(srcdir)/Makefile.in
@MAKEFILES@: config.status
MAKE=$(MAKE) $(SHELL) ./config.status
- @{ : $(MAKE); \
+ @{ \
echo "all:; -@rm -f conftest.mk"; \
echo "conftest.mk: .force; @echo AUTO_REMAKE"; \
echo ".force:"; \
- } > conftest.mk
- @$(MAKE) -f conftest.mk | grep '^AUTO_REMAKE$$' >/dev/null 2>&1 || \
+ } > conftest.mk || exit 1; \
+ $(MAKE) -f conftest.mk | grep '^AUTO_REMAKE$$' >/dev/null 2>&1 || \
{ echo "Makefile updated, restart."; exit 1; }
config.status: $(srcdir)/configure
View
8 bcc32/Makefile.sub
@@ -1,3 +1,5 @@
+# -*- makefile -*-
+
SHELL = $(COMSPEC)
#### Start of system configuration section. ####
@@ -83,6 +85,12 @@ OPTFLAGS = -O
!ifndef prefix
prefix = /usr
!endif
+!ifndef exec_prefix
+exec_prefix = $(prefix)
+!endif
+!ifndef libdir
+libdir = $(exec_prefix)/lib
+!endif
!ifndef DESTDIR
DESTDIR = $(prefix)
!endif
View
28 ext/extmk.rb
@@ -61,15 +61,17 @@ def extmake(target)
$mdir = target
$srcdir = File.join($top_srcdir, "ext", $mdir)
$preload = nil
+ makefile = "./Makefile"
unless $ignore
if $static ||
- !(t = modified?("./Makefile", MTIMES)) ||
+ !(t = modified?(makefile, MTIMES)) ||
%W<#{$srcdir}/makefile.rb #{$srcdir}/extconf.rb
#{$srcdir}/depend #{$srcdir}/MANIFEST>.any? {|f| modified?(f, [t])}
then
$defs = []
Logging::logfile 'mkmf.log'
Config::CONFIG["srcdir"] = $srcdir
+ rm_f makefile
begin
if File.exist?($0 = "#{$srcdir}/makefile.rb")
load $0
@@ -78,6 +80,7 @@ def extmake(target)
else
create_makefile(target)
end
+ File.exist?(makefile)
rescue SystemExit
# ignore
ensure
@@ -85,19 +88,20 @@ def extmake(target)
$0 = $PROGRAM_NAME
Config::CONFIG["srcdir"] = $top_srcdir
end
+ else
+ true
end
+ end or open(makefile, "w") do |f|
+ f.print dummy_makefile($srcdir)
+ return true
end
- if File.exist?("./Makefile")
- if $static
- $extlist.push [$static, $target, File.basename($target), $preload]
- end
- unless system($make, *sysquote($mflags))
- $ignore or $continue or return false
- end
- else
- open("./Makefile", "w") {|f|
- f.print dummy_makefile($srcdir)
- }
+ args = sysquote($mflags)
+ if $static
+ args += ["static"]
+ $extlist.push [$static, $target, File.basename($target), $preload]
+ end
+ unless system($make, *args)
+ $ignore or $continue or return false
end
if $static
$extflags ||= ""
View
5 ext/openssl/extconf.rb
@@ -79,15 +79,12 @@
have_func("BN_rand_range")
have_func("BN_pseudo_rand_range")
have_func("CONF_get1_default_config_file")
-if try_cpp("#define FOO(a, ...) foo(a, ##__VA_ARGS__)\n int x(){FOO(1,2);}\n")
+if try_cpp("#define FOO(a, ...) foo(a, ##__VA_ARGS__)\n int x(){FOO(1);FOO(1,2);FOO(1,2,3);}\n")
$defs.push("-DHAVE_VA_ARGS_MACRO")
end
have_header("openssl/ocsp.h")
have_struct_member("EVP_CIPHER_CTX", "flags", "openssl/evp.h")
-message "=== Checking for Ruby features... ===\n"
-have_func("rb_obj_init_copy", "ruby.h")
-
message "=== Checking done. ===\n"
$distcleanfiles << "GNUmakefile" << "dep"
create_makefile("openssl")
View
8 ext/openssl/ossl.h
@@ -16,15 +16,13 @@ extern "C" {
#endif
/*
- * Check the Ruby version and OpenSSL
+ * Check the OpenSSL version
* The only supported are:
- * Ruby >= 1.7.2
* OpenSSL >= 0.9.7
*/
-#include <version.h>
#include <openssl/opensslv.h>
-#if defined(NT) || defined(_WIN32)
+#if defined(_WIN32)
# define OpenFile WINAPI_OpenFile
#endif
#include <errno.h>
@@ -40,7 +38,7 @@ extern "C" {
# define OSSL_OCSP_ENABLED
# include <openssl/ocsp.h>
#endif
-#if defined(NT) || defined(_WIN32)
+#if defined(_WIN32)
# undef OpenFile
#endif
View
54 ext/openssl/ruby_missing.h
@@ -11,60 +11,10 @@
#if !defined(_OSSL_RUBY_MISSING_H_)
#define _OSS_RUBY_MISSING_H_
-#if !defined(StringValue)
-# define StringValue(v) \
- if (TYPE(v) != T_STRING) v = rb_str_to_str(v)
-#endif
+#define DEFINE_ALLOC_WRAPPER(func)
-#if !defined(StringValuePtr)
-# define StringValuePtr(v) \
- RSTRING((TYPE(v) == T_STRING) ? (v) : rb_str_to_str(v))->ptr
-#endif
-
-#if !defined(SafeStringValue)
-# define SafeStringValue(v) do {\
- StringValue(v);\
- rb_check_safe_str(v);\
-} while (0)
-#endif
-
-#if RUBY_VERSION_CODE < 180
-# define rb_cstr_to_inum(a,b,c) \
- rb_cstr2inum(a,b)
-# define rb_check_frozen(obj) \
- if (OBJ_FROZEN(obj)) rb_error_frozen(rb_obj_classname(obj))
-# define rb_obj_classname(obj) \
- rb_class2name(CLASS_OF(obj))
-#endif
-
-#if HAVE_RB_DEFINE_ALLOC_FUNC
-# define DEFINE_ALLOC_WRAPPER(func)
-#else
-# define DEFINE_ALLOC_WRAPPER(func) \
- static VALUE \
- func##_wrapper(int argc, VALUE *argv, VALUE klass) \
- { \
- VALUE obj; \
- \
- obj = func(klass); \
- \
- rb_obj_call_init(obj, argc, argv); \
- \
- return obj; \
- }
-# define rb_define_alloc_func(klass, func) \
- rb_define_singleton_method(klass, "new", func##_wrapper, -1)
-#endif
-
-#if RUBY_VERSION_CODE >= 180
-# if !defined(HAVE_RB_OBJ_INIT_COPY)
-# define rb_define_copy_func(klass, func) \
- rb_define_method(klass, "copy_object", func, 1)
-# else
-# define rb_define_copy_func(klass, func) \
+#define rb_define_copy_func(klass, func) \
rb_define_method(klass, "initialize_copy", func, 1)
-# endif
-#endif
#endif /* _OSS_RUBY_MISSING_H_ */
View
20 lib/mkmf.rb
@@ -650,8 +650,9 @@ def pkg_config(pkg)
end
if $PKGCONFIG and system("#{$PKGCONFIG} --exists #{pkg}")
cflags = `#{$PKGCONFIG} --cflags #{pkg}`.chomp
- ldflags = `#{$PKGCONFIG} --libs-only-L #{pkg}`.chomp
+ ldflags = `#{$PKGCONFIG} --libs #{pkg}`.chomp
libs = `#{$PKGCONFIG} --libs-only-l #{pkg}`.chomp
+ ldflags = (Shellwords.shellwords(ldflags) - Shellwords.shellwords(libs)).quote.join(" ")
$CFLAGS += " " << cflags
$LDFLAGS += " " << ldflags
$libs += " " << libs
@@ -805,7 +806,8 @@ def create_makefile(target, srcprefix = nil)
libpath = libpathflag(libpath)
- dllib = target ? "$(TARGET).#{$static ? $LIBEXT : CONFIG['DLEXT']}" : ""
+ dllib = target ? "$(TARGET).#{CONFIG['DLEXT']}" : ""
+ staticlib = target ? "$(TARGET).#$LIBEXT" : ""
mfile = open("Makefile", "wb")
mfile.print configuration(srcdir)
mfile.print %{
@@ -821,6 +823,7 @@ def create_makefile(target, srcprefix = nil)
OBJS = #{$objs}
TARGET = #{target}
DLLIB = #{dllib}
+STATIC_LIB = #{staticlib}
}
if $extmk
mfile.print %{
@@ -840,6 +843,7 @@ def create_makefile(target, srcprefix = nil)
CLEANOBJS = "*.{#{$OBJEXT},#{$LIBEXT},s[ol],pdb,bak}"
all: #{target ? "$(DLLIB)" : "Makefile"}
+static: $(STATIC_LIB)
}
mfile.print CLEANINGS
dirs = []
@@ -894,13 +898,11 @@ def create_makefile(target, srcprefix = nil)
mfile.print "$(DLLIB): $(OBJS)\n\t"
mfile.print "@-$(RM) $@\n\t"
mfile.print "@-$(RM) $(TARGET).lib\n\t" if $mswin
- if $static
- mfile.print "$(AR) #{config_string('ARFLAGS') || 'cru '}$(DLLIB) $(OBJS)"
- if ranlib = config_string('RANLIB')
- mfile.print "\n\t@-#{ranlib} $(DLLIB) 2> /dev/null || true"
- end
- else
- mfile.print LINK_SO
+ mfile.print LINK_SO, "\n\n"
+ mfile.print "$(STATIC_LIB): $(OBJS)\n\t"
+ mfile.print "$(AR) #{config_string('ARFLAGS') || 'cru '}$@ $(OBJS)"
+ if ranlib = config_string('RANLIB')
+ mfile.print "\n\t@-#{ranlib} $(DLLIB) 2> /dev/null || true"
end
mfile.print "\n\n"
View
8 marshal.c
@@ -308,11 +308,11 @@ w_symbol(id, arg)
struct dump_arg *arg;
{
char *sym = rb_id2name(id);
- long num;
+ st_data_t num;
if (st_lookup(arg->symbols, id, &num)) {
w_byte(TYPE_SYMLINK, arg);
- w_long(num, arg);
+ w_long((long)num, arg);
}
else {
w_byte(TYPE_SYMBOL, arg);
@@ -468,11 +468,11 @@ w_object(obj, arg, limit)
w_symbol(SYM2ID(obj), arg);
}
else {
- long num;
+ st_data_t num;
if (st_lookup(arg->data, obj, &num)) {
w_byte(TYPE_LINK, arg);
- w_long(num, arg);
+ w_long((long)num, arg);
return;
}
View
4 re.c
@@ -69,8 +69,6 @@ static const char casetable[] = {
# error >>> "You lose. You will need a translation table for your character set." <<<
#endif
-#define MIN(a,b) (((a)>(b))?(b):(a))
-
int
rb_memcicmp(p1, p2, len)
char *p1, *p2;
@@ -101,7 +99,7 @@ rb_memsearch(x0, m, y0, n)
char *x0, *y0;
long m, n;
{
- unsigned char *x = x0, *y = y0;
+ unsigned char *x = (unsigned char *)x0, *y = (unsigned char *)y0;
unsigned char *s, *e;
long i;
int d;
View
2  time.c
@@ -1302,7 +1302,7 @@ time_dump(argc, argv, time)
struct time_object *tobj;
struct tm *tm;
unsigned long p, s;
- unsigned char buf[8];
+ char buf[8];
time_t t;
int i;
View
8 win32/Makefile.sub
@@ -1,3 +1,5 @@
+# -*- makefile -*-
+
SHELL = $(COMSPEC)
#### Start of system configuration section. ####
@@ -74,6 +76,12 @@ RUBY_SO_NAME = $(RT)-$(RUBY_INSTALL_NAME)$(MAJOR)$(MINOR)
!if !defined(prefix)
prefix = /usr
!endif
+!if !defined(exec_prefix)
+exec_prefix = $(prefix)
+!endif
+!if !defined(libdir)
+libdir = $(exec_prefix)/lib
+!endif
!if !defined(DESTDIR)
DESTDIR = $(prefix)
!endif
View
8 wince/Makefile.sub
@@ -1,3 +1,5 @@
+# -*- makefile -*-
+
SHELL = $(COMSPEC)
#### Start of system configuration section. ####
@@ -78,6 +80,12 @@ RUBY_SO_NAME = $(RT)-$(RUBY_INSTALL_NAME)$(MAJOR)$(MINOR)
!if !defined(prefix)
prefix = /usr
!endif
+!if !defined(exec_prefix)
+exec_prefix = $(prefix)
+!endif
+!if !defined(libdir)
+libdir = $(exec_prefix)/lib
+!endif
!if !defined(DESTDIR)
DESTDIR = $(prefix)
!endif
Please sign in to comment.
Something went wrong with that request. Please try again.