summaryrefslogtreecommitdiff
path: root/ext/dl/extconf.rb
diff options
context:
space:
mode:
Diffstat (limited to 'ext/dl/extconf.rb')
-rw-r--r--ext/dl/extconf.rb39
1 files changed, 15 insertions, 24 deletions
diff --git a/ext/dl/extconf.rb b/ext/dl/extconf.rb
index 46b3c6c87dc..dd9c3844e49 100644
--- a/ext/dl/extconf.rb
+++ b/ext/dl/extconf.rb
@@ -33,19 +33,25 @@ else
end
$with_dlstack = ! $with_asm
-$with_type_int = try_run(<<EOF)
-int main(){ return sizeof(int) == sizeof(long); }
+$with_type_int = try_cpp(<<EOF)
+#include "config.h"
+#if SIZEOF_INT == SIZEOF_LONG
+#error int not needed
+#endif
EOF
-$with_type_float = try_run(<<EOF)
-int main(){ return sizeof(float) == sizeof(double); }
+$with_type_float = try_cpp(<<EOF)
+#include "config.h"
+#if SIZEOF_FLOAT == SIZEOF_DOUBLE
+#error float not needed
+#endif
EOF
-$with_type_voidp = try_run(<<EOF)
-int main(){
- return (sizeof(void *) == sizeof(long))
- || (sizeof(void *) == sizeof(int));
-}
+$with_type_voidp = try_cpp(<<EOF)
+#include "config.h"
+#if SIZEOF_VOIDP == SIZEOF_INT || SIZEOF_VOIDP == SIZEOF_LONG
+#error void* not needed
+#endif
EOF
$with_type_char = DLTYPE[CHAR][:sym]
@@ -176,21 +182,6 @@ $INSTALLFILES = [
["dl.h", "$(archdir)$(target_prefix)", ""],
]
-if /bccwin32/ =~ RUBY_PLATFORM
- srcdir = $top_srcdir + "/ext/dl/"
- if !FileTest.exist?( srcdir+"dl.def.org" )
- File.copy( srcdir+"dl.def", srcdir+"dl.def.org" )
- open( srcdir+"dl.def.org" ){ |f|
- open( "dl.def", "w" ) { |g|
- g.print f.gets
- while line = f.gets
- g.print "_", line
- end
- }
- }
- end
-end
-
create_makefile('dl')
rescue SystemExit
# do nothing