Mercurial > pub > dyncall > bindings
view ruby/rbdc/extconf.rb @ 49:d6670bd553dd
- comment cleanup
author | Tassilo Philipp |
---|---|
date | Fri, 13 Nov 2020 20:44:00 +0100 |
parents | 02a455de2b40 |
children |
line wrap: on
line source
#////////////////////////////////////////////////////////////////////// # # extconf.rb # Copyright (c) 2007-2018 Daniel Adler <dadler@uni-goettingen.de>, # Tassilo Philipp <tphilipp@potion-studios.com> # # Permission to use, copy, modify, and distribute this software for any # purpose with or without fee is hereby granted, provided that the above # copyright notice and this permission notice appear in all copies. # # THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES # WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF # MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR # ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES # WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN # ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF # OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. # # Configuration file for dyncall/ruby extension. This script creates # a makefile that can be used to compile the C-extension. It is # configured such that every .c file in this directory will be used # for compilation. # #/////////////////////////////////////////////////////////////////////// require 'mkmf' dir_config 'rbdc' base_dir = 'dyncall/' $CFLAGS << ' -Idyncall/dyncall ' # Build dyncall libs. puts 'Building dyncall libraries:' Dir.chdir(base_dir) do cmd = case when RUBY_PLATFORM =~ /mswin/ then 'configure.bat && nmake /f Nmakefile' else './configure && make' end puts cmd raise "'#{cmd}' failed" unless system(cmd) end # Search for dyncall libs. puts 'Using the following dyncall libraries to build native ruby extension:' Dir[base_dir+'**/*'].each { |d| if d =~ /(lib)?dyn(call(back)?|load)_s\./ $LOCAL_LIBS << '"'+d+'" ' puts d end } if($LOCAL_LIBS.size > 0) then # Write out a makefile for our dyncall extension. create_makefile 'rbdc' else puts "Couldn't find dyncall and dynload libraries - dyncall build seems to have failed!" end